LavaPack.loadBundle([[4331,{"../../../../shared/constants/metametrics":3408,"../../../components/component-library":3840,"../../../components/ui/toggle-button":4028,"../../../components/ui/typography/typography":4040,"../../../helpers/constants/design-system":4070,"../../../helpers/utils/settings-search":4104,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=p(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=d(e("prop-types")),s=d(e("../../../components/ui/toggle-button")),o=e("../../../helpers/utils/settings-search"),i=e("../../../../shared/constants/metametrics"),l=d(e("../../../components/ui/typography/typography")),c=e("../../../components/component-library"),u=e("../../../helpers/constants/design-system");function d(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(p=function(e){return e?a:t})(e)}function f(e,t,a){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(a!==undefined){var n=a.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class m extends n.PureComponent{constructor(...e){super(...e),f(this,"settingsRefs",Array((0,o.getNumberOfSettingsInSection)(this.context.t,this.context.t("experimental"))).fill(undefined).map((()=>n.default.createRef())))}componentDidUpdate(){const{t:e}=this.context;(0,o.handleSettingsRefs)(e,e("experimental"),this.settingsRefs)}componentDidMount(){const{t:e}=this.context;(0,o.handleSettingsRefs)(e,e("experimental"),this.settingsRefs)}renderOpenSeaEnabledToggle(){const{t:e}=this.context,{openSeaEnabled:t,setOpenSeaEnabled:a,useNftDetection:r,setUseNftDetection:o}=this.props;return n.default.createElement(n.default.Fragment,null,n.default.createElement("div",{ref:this.settingsRefs[0],className:"settings-page__content-row"},n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("span",null,e("enableOpenSeaAPI")),n.default.createElement("div",{className:"settings-page__content-description"},e("enableOpenSeaAPIDescription"))),n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("div",{className:"settings-page__content-item-col"},n.default.createElement(s.default,{value:t,onToggle:e=>{this.context.trackEvent({category:i.MetaMetricsEventCategory.Settings,event:"Enabled/Disable OpenSea",properties:{action:"Enabled/Disable OpenSea",legacy_event:!0}}),e&&r&&o(!1),a(!e)},offLabel:e("off"),onLabel:e("on")})))),n.default.createElement("div",{ref:this.settingsRefs[1],className:"settings-page__content-row"},n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("span",null,e("useNftDetection")),n.default.createElement("div",{className:"settings-page__content-description"},n.default.createElement(c.Text,{color:u.TextColor.textAlternative},e("useNftDetectionDescription")),n.default.createElement("ul",{className:"settings-page__content-unordered-list"},n.default.createElement("li",null,e("useNftDetectionDescriptionLine2")),n.default.createElement("li",null,e("useNftDetectionDescriptionLine3")),n.default.createElement("li",null,e("useNftDetectionDescriptionLine4"))),n.default.createElement(c.Text,{color:u.TextColor.textAlternative,paddingTop:4},e("useNftDetectionDescriptionLine5")))),n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("div",{className:"settings-page__content-item-col"},n.default.createElement(s.default,{value:r,onToggle:e=>{this.context.trackEvent({category:i.MetaMetricsEventCategory.Settings,event:"NFT Detected",properties:{action:"NFT Detected",legacy_event:!0}}),e||t||a(!e),o(!e)},offLabel:e("off"),onLabel:e("on")})))))}renderTransactionSecurityCheckToggle(){const{t:e}=this.context,{transactionSecurityCheckEnabled:t,setTransactionSecurityCheckEnabled:a}=this.props;return n.default.createElement(n.default.Fragment,null,n.default.createElement(l.default,{variant:u.TypographyVariant.H4,color:u.TextColor.textAlternative,marginBottom:2,fontWeight:u.FONT_WEIGHT.BOLD},e("privacy")),n.default.createElement("div",{ref:this.settingsRefs[1],className:"settings-page__content-row settings-page__content-row-experimental"},n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("span",null,e("transactionSecurityCheck")),n.default.createElement("div",{className:"settings-page__content-description"},n.default.createElement(l.default,{variant:u.TypographyVariant.H6,color:u.TextColor.textAlternative},e("transactionSecurityCheckDescription")),n.default.createElement(l.default,{marginTop:3,marginBottom:1,variant:u.TypographyVariant.H6,color:u.TextColor.textAlternative},e("selectProvider")),n.default.createElement("div",{className:"settings-page__content-item-col settings-page__content-item-col-open-sea"},n.default.createElement(l.default,{variant:u.TypographyVariant.H5,color:u.TextColor.textDefault,fontWeight:u.FONT_WEIGHT.MEDIUM,marginBottom:0},e("openSea")),n.default.createElement(s.default,{value:t,onToggle:e=>{this.context.trackEvent({category:i.MetaMetricsEventCategory.Settings,event:"Enabled/Disable TransactionSecurityCheck",properties:{action:"Enabled/Disable TransactionSecurityCheck",legacy_event:!0}}),a(!e)}})),n.default.createElement(l.default,{variant:u.TypographyVariant.H6,color:u.TextColor.textAlternative,marginTop:0},e("thisServiceIsExperimental",[n.default.createElement("a",{href:"http://opensea.io/securityproviderterms",key:"termsOfUse",rel:"noopener noreferrer",target:"_blank"},e("termsOfUse"))])),n.default.createElement(l.default,{variant:u.TypographyVariant.H5,color:u.TextColor.textMuted,fontWeight:u.FONT_WEIGHT.MEDIUM,marginTop:2},e("moreComingSoon"))))))}render(){return n.default.createElement("div",{className:"settings-page__body"},this.renderTransactionSecurityCheckToggle(),this.renderOpenSeaEnabledToggle())}}a.default=m,f(m,"contextTypes",{t:r.default.func,trackEvent:r.default.func}),f(m,"propTypes",{useNftDetection:r.default.bool,setUseNftDetection:r.default.func,setOpenSeaEnabled:r.default.func,openSeaEnabled:r.default.bool,transactionSecurityCheckEnabled:r.default.bool,setTransactionSecurityCheckEnabled:r.default.func})}}},{package:"$root$",file:"ui/pages/settings/experimental-tab/experimental-tab.component.js"}],[4332,{"../../../selectors":4436,"../../../store/actions":4443,"./experimental-tab.component":4331,"react-redux":3130,"react-router-dom":3150,redux:3194},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n,r=e("redux"),s=e("react-redux"),o=e("react-router-dom"),i=e("../../../store/actions"),l=e("../../../selectors"),c=(n=e("./experimental-tab.component"))&&n.__esModule?n:{default:n};var u=(0,r.compose)(o.withRouter,(0,s.connect)((e=>({useNftDetection:(0,l.getUseNftDetection)(e),openSeaEnabled:(0,l.getOpenSeaEnabled)(e),transactionSecurityCheckEnabled:(0,l.getIsTransactionSecurityCheckEnabled)(e)})),(e=>({setUseNftDetection:t=>e((0,i.setUseNftDetection)(t)),setOpenSeaEnabled:t=>e((0,i.setOpenSeaEnabled)(t)),setTransactionSecurityCheckEnabled:t=>e((0,i.setTransactionSecurityCheckEnabled)(t))}))))(c.default);a.default=u}}},{package:"$root$",file:"ui/pages/settings/experimental-tab/experimental-tab.container.js"}],[4333,{"./experimental-tab.container":4332},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./experimental-tab.container"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/settings/experimental-tab/index.js"}],[4334,{"./settings.container":4363},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./settings.container"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/settings/index.js"}],[4335,{"./info-tab.component":4336},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./info-tab.component"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/settings/info-tab/index.js"}],[4336,{"../../../../shared/constants/metametrics":3408,"../../../../shared/lib/ui-utils":3426,"../../../components/component-library":3840,"../../../components/ui/button":3904,"../../../helpers/constants/common":4068,"../../../helpers/utils/build-types":4088,"../../../helpers/utils/settings-search":4104,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=f(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=p(e("prop-types")),s=p(e("../../../components/ui/button")),o=e("../../../components/component-library"),i=e("../../../helpers/constants/common"),l=e("../../../helpers/utils/build-types"),c=e("../../../helpers/utils/settings-search"),u=e("../../../../shared/constants/metametrics"),d=e("../../../../shared/lib/ui-utils");function p(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(f=function(e){return e?a:t})(e)}function m(e,t,a){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(a!==undefined){var n=a.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class g extends n.PureComponent{constructor(...e){super(...e),m(this,"state",{version:global.platform.getVersion()}),m(this,"settingsRefs",Array((0,c.getNumberOfSettingsInSection)(this.context.t,this.context.t("about"))).fill(undefined).map((()=>n.default.createRef())))}componentDidUpdate(){const{t:e}=this.context;(0,c.handleSettingsRefs)(e,e("about"),this.settingsRefs)}componentDidMount(){const{t:e}=this.context;(0,c.handleSettingsRefs)(e,e("about"),this.settingsRefs)}renderInfoLinks(){const{t:e}=this.context;let t,a;return t="https://metamask.io/privacy.html",a="https://metamask.io/",n.default.createElement("div",{className:"settings-page__content-item settings-page__content-item--without-height"},n.default.createElement("div",{ref:this.settingsRefs[1],className:"info-tab__link-header"},e("links")),n.default.createElement("div",{ref:this.settingsRefs[2],className:"info-tab__link-item"},n.default.createElement(s.default,{type:"link",href:"https://metamask.io/privacy.html",target:"_blank",rel:"noopener noreferrer",className:"info-tab__link-text"},e("privacyMsg"))),n.default.createElement("div",{ref:this.settingsRefs[3],className:"info-tab__link-item"},n.default.createElement(s.default,{type:"link",href:"https://metamask.io/terms.html",target:"_blank",rel:"noopener noreferrer",className:"info-tab__link-text"},e("terms"))),(0,l.isBeta)()?n.default.createElement("div",{ref:this.settingsRefs[8],className:"info-tab__link-item"},n.default.createElement(s.default,{type:"link",href:"https://metamask.io/beta-terms.html",target:"_blank",rel:"noopener noreferrer",className:"info-tab__link-text"},e("betaTerms"),n.default.createElement(o.Tag,{label:e("new"),className:"info-tab__tag"}))):null,n.default.createElement("div",{ref:this.settingsRefs[4],className:"info-tab__link-item"},n.default.createElement(s.default,{type:"link",href:"https://metamask.io/attributions.html",target:"_blank",rel:"noopener noreferrer",className:"info-tab__link-text"},e("attributions"))),n.default.createElement("hr",{className:"info-tab__separator"}),n.default.createElement("div",{ref:this.settingsRefs[5],className:"info-tab__link-item"},n.default.createElement(s.default,{type:"link",href:d.SUPPORT_LINK,target:"_blank",rel:"noopener noreferrer",className:"info-tab__link-text",onClick:()=>{this.context.trackEvent({category:u.MetaMetricsEventCategory.Settings,event:u.MetaMetricsEventName.SupportLinkClicked,properties:{url:d.SUPPORT_LINK}},{contextPropsIntoEventProperties:[u.MetaMetricsContextProp.PageTitle]})}},e("supportCenter"))),n.default.createElement("div",{ref:this.settingsRefs[6],className:"info-tab__link-item"},n.default.createElement(s.default,{type:"link",href:"https://metamask.io/",target:"_blank",rel:"noopener noreferrer",className:"info-tab__link-text"},e("visitWebSite"))),n.default.createElement("div",{ref:this.settingsRefs[7],className:"info-tab__link-item"},n.default.createElement(s.default,{type:"link",href:i.SUPPORT_REQUEST_LINK,target:"_blank",rel:"noopener noreferrer",className:"info-tab__link-text",onClick:()=>{this.context.trackEvent({category:u.MetaMetricsEventCategory.Settings,event:u.MetaMetricsEventName.SupportLinkClicked,properties:{url:i.SUPPORT_REQUEST_LINK}},{contextPropsIntoEventProperties:[u.MetaMetricsContextProp.PageTitle]})}},e("contactUs"))))}render(){const{t:e}=this.context;return n.default.createElement("div",{className:"settings-page__body"},n.default.createElement("div",{className:"settings-page__content-row"},n.default.createElement("div",{className:"settings-page__content-item settings-page__content-item--without-height"},n.default.createElement("div",{className:"info-tab__item"},n.default.createElement("div",{ref:this.settingsRefs[0],className:"info-tab__version-header"},(0,l.isBeta)()?e("betaMetamaskVersion"):e("metamaskVersion")),n.default.createElement("div",{className:"info-tab__version-number"},this.state.version)),n.default.createElement("div",{className:"info-tab__item"},n.default.createElement("div",{className:"info-tab__about"},e("builtAroundTheWorld")))),this.renderInfoLinks()),n.default.createElement("div",{className:"info-tab__logo-wrapper"},n.default.createElement("img",{src:"./images/logo/metamask-fox.svg",className:"info-tab__logo",alt:"MetaMask Logo"})))}}a.default=g,m(g,"contextTypes",{t:r.default.func,trackEvent:r.default.func})}}},{package:"$root$",file:"ui/pages/settings/info-tab/info-tab.component.js"}],[4337,{"../../../../components/component-library/icon/deprecated":3836,"../../../../components/ui/icon/search-icon":3953,"../../../../components/ui/text-field":4025,"../../../../contexts/i18n":4047,"@material-ui/core/InputAdornment":680,"fuse.js":2497,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=f;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=p(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=d(e("prop-types")),s=d(e("fuse.js")),o=d(e("@material-ui/core/InputAdornment")),i=d(e("../../../../components/ui/text-field")),l=e("../../../../contexts/i18n"),c=d(e("../../../../components/ui/icon/search-icon")),u=e("../../../../components/component-library/icon/deprecated");function d(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(p=function(e){return e?a:t})(e)}function f({onSearch:e,error:t,networksList:a,searchQueryInput:r}){const d=(0,n.useContext)(l.I18nContext),[p,f]=(0,n.useState)("var(--color-icon-muted)"),m=Object.values(a),g=new s.default(m,{shouldSort:!0,threshold:.2,location:0,distance:100,maxPatternLength:32,minMatchCharLength:1,keys:["label","labelKey"]}),h=async t=>{f(""===t?"var(--color-icon-muted)":"var(--color-icon-alternative)");const a=g.search(t),n=t?[...a]:m;await e({searchQuery:t,results:n})};return n.default.createElement(i.default,{id:"search-networks","data-testid":"search-networks",placeholder:d("customContentSearch"),type:"text",value:r,onChange:e=>h(e.target.value),error:t,fullWidth:!0,autoFocus:!0,autoComplete:"off",classes:{inputRoot:"networks-tab__networks-list__custom-search-network"},startAdornment:n.default.createElement(o.default,{position:"start"},n.default.createElement(c.default,{color:p})),endAdornment:n.default.createElement(n.default.Fragment,null,r&&n.default.createElement(o.default,{className:"imageclosectn",position:"end",onClick:()=>h("")},n.default.createElement(u.Icon,{name:u.ICON_NAMES.CLOSE,className:"networks-tab__imageclose"})))})}f.propTypes={onSearch:r.default.func,error:r.default.string,networksList:r.default.array,searchQueryInput:r.default.string}}}},{package:"$root$",file:"ui/pages/settings/networks-tab/custom-content-search/custom-content-search.js"}],[4338,{"./custom-content-search":4337},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./custom-content-search"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/settings/networks-tab/custom-content-search/index.js"}],[4339,{"./networks-tab":4351},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./networks-tab"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/settings/networks-tab/index.js"}],[434,{"./crowdsale":433,"./inspect":435,"./keystore":436},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.decryptJsonWalletSync=a.decryptJsonWallet=a.getJsonWalletAddress=a.isKeystoreWallet=a.isCrowdsaleWallet=a.encryptKeystore=a.decryptKeystoreSync=a.decryptKeystore=a.decryptCrowdsale=void 0;var n=e("./crowdsale");Object.defineProperty(a,"decryptCrowdsale",{enumerable:!0,get:function(){return n.decrypt}});var r=e("./inspect");Object.defineProperty(a,"getJsonWalletAddress",{enumerable:!0,get:function(){return r.getJsonWalletAddress}}),Object.defineProperty(a,"isCrowdsaleWallet",{enumerable:!0,get:function(){return r.isCrowdsaleWallet}}),Object.defineProperty(a,"isKeystoreWallet",{enumerable:!0,get:function(){return r.isKeystoreWallet}});var s=e("./keystore");Object.defineProperty(a,"decryptKeystore",{enumerable:!0,get:function(){return s.decrypt}}),Object.defineProperty(a,"decryptKeystoreSync",{enumerable:!0,get:function(){return s.decryptSync}}),Object.defineProperty(a,"encryptKeystore",{enumerable:!0,get:function(){return s.encrypt}}),a.decryptJsonWallet=function(e,t,a){if((0,r.isCrowdsaleWallet)(e)){a&&a(0);var o=(0,n.decrypt)(e,t);return a&&a(1),Promise.resolve(o)}return(0,r.isKeystoreWallet)(e)?(0,s.decrypt)(e,t,a):Promise.reject(new Error("invalid JSON wallet"))},a.decryptJsonWalletSync=function(e,t){if((0,r.isCrowdsaleWallet)(e))return(0,n.decrypt)(e,t);if((0,r.isKeystoreWallet)(e))return(0,s.decryptSync)(e,t);throw new Error("invalid JSON wallet")}}}},{package:"@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>ethers>@ethersproject/json-wallets",file:"node_modules/@ethersproject/json-wallets/lib/index.js"}],[4340,{"./networks-form":4341},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./networks-form"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/settings/networks-tab/networks-form/index.js"}],[4341,{"../../../../../shared/constants/metametrics":3408,"../../../../../shared/constants/network":3409,"../../../../../shared/lib/fetch-with-cache":3419,"../../../../../shared/modules/conversion.utils":3431,"../../../../../shared/modules/network.utils":3437,"../../../../../shared/modules/rpc.utils":3440,"../../../../components/ui/actionable-message":3897,"../../../../components/ui/button":3904,"../../../../components/ui/form-field":3936,"../../../../hooks/useI18nContext":4129,"../../../../hooks/usePrevious":4133,"../../../../store/actions":4443,classnames:1980,lodash:2932,loglevel:2944,"prop-types":3032,react:3177,"react-redux":3130,"valid-url":3366},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=T(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=e("react-redux"),s=b(e("prop-types")),o=b(e("valid-url")),i=b(e("loglevel")),l=b(e("classnames")),c=e("lodash"),u=e("../../../../hooks/useI18nContext"),d=e("../../../../../shared/modules/network.utils"),p=e("../../../../../shared/modules/rpc.utils"),f=b(e("../../../../components/ui/actionable-message")),m=b(e("../../../../components/ui/button")),g=b(e("../../../../components/ui/form-field")),h=e("../../../../store/actions"),_=b(e("../../../../../shared/lib/fetch-with-cache")),y=e("../../../../hooks/usePrevious"),v=e("../../../../../shared/constants/metametrics"),E=e("../../../../../shared/constants/network"),w=e("../../../../../shared/modules/conversion.utils");function b(e){return e&&e.__esModule?e:{default:e}}function T(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(T=function(e){return e?a:t})(e)}const k=e=>e&&"string"==typeof e&&e.startsWith("0x")?parseInt(e,16).toString(10):e,C=e=>{const t=`http://${e}`;return o.default.isWebUri(t)&&!e.match(/^https?:\/\/$/u)},S=({addNewNetwork:e,restrictHeight:t,isCurrentRpcTarget:a,networksToRender:s,selectedNetwork:b,cancelCallback:T,submitCallback:S})=>{var N,O,x,I,P,M;const A=(0,u.useI18nContext)(),R=(0,r.useDispatch)(),{label:D,labelKey:j,viewOnly:L,rpcPrefs:F}=b,U=D||j&&A(j),[W,q]=(0,n.useState)(U||""),[B,H]=(0,n.useState)((null==b?void 0:b.rpcUrl)||""),[G,$]=(0,n.useState)((null==b?void 0:b.chainId)||""),[K,V]=(0,n.useState)((null==b?void 0:b.ticker)||""),[Q,Y]=(0,n.useState)((null==b?void 0:b.blockExplorerUrl)||""),[Z,z]=(0,n.useState)({}),[X,J]=(0,n.useState)({}),[ee,te]=(0,n.useState)(!1),ae=E.FEATURED_RPCS.some((e=>Number(e.chainId)===Number(G))),[ne,re]=(0,n.useState)(Boolean(e)),[se,oe]=(0,n.useState)(b),ie=(0,n.useCallback)((()=>{q(U||""),H(b.rpcUrl),$(k(b.chainId)),V(null==b?void 0:b.ticker),Y(null==b?void 0:b.blockExplorerUrl),z({}),J({}),te(!1),re(!1),oe(b)}),[b,U]),le=(0,n.useRef)(),ce=(0,n.useRef)(),ue=(0,n.useRef)(),de=(0,n.useRef)(),pe=(0,n.useRef)(),fe=(0,n.useRef)();(0,n.useEffect)((()=>{!le.current&&e?(q(""),H(""),$(""),V(""),Y(""),z({}),te(!1)):ce.current===U&&de.current===b.rpcUrl&&ue.current===b.chainId&&pe.current===b.ticker&&fe.current===b.blockExplorerUrl||ne&&(0,c.isEqual)(b,se)||ie(b)}),[b,U,e,se,ie,ne]),(0,n.useEffect)((()=>()=>{q(""),H(""),$(""),V(""),Y(""),z({}),R((0,h.setSelectedNetworkConfigurationId)(""))}),[q,H,$,V,Y,z,R]);const me=(0,n.useCallback)((e=>{if(!o.default.isWebUri(e)&&""!==e){let t,a;return C(e)?(t="urlErrorMsg",a=A("urlErrorMsg")):(t="invalidBlockExplorerURL",a=A("invalidBlockExplorerURL")),{key:t,msg:a}}return null}),[A]),ge=(0,n.useCallback)((async(e="")=>{const t=e.trim();let a="",n="",r="",o="",l=10,c=t;if(!c.startsWith("0x"))try{c=`0x${(0,w.decimalToHex)(c)}`}catch(e){return{error:{key:"invalidHexNumber",msg:A("invalidHexNumber")}}}const[u]=s.filter((e=>e.chainId===c&&e.rpcUrl!==B));if(""===t)return null;let f,m;u?(r="chainIdExistsErrorMsg",o=A("chainIdExistsErrorMsg",[u.label??u.labelKey])):t.startsWith("0x")?(l=16,/^0x[0-9a-f]+$/iu.test(t)?(0,d.isPrefixedFormattedHexString)(t)||(n=A("invalidHexNumberLeadingZeros")):(a="invalidHexNumber",n=A("invalidHexNumber"))):/^[0-9]+$/u.test(t)?t.startsWith("0")?(a="invalidNumberLeadingZeros",n=A("invalidNumberLeadingZeros")):(0,d.isSafeChainId)(parseInt(t,l))||(a="invalidChainIdTooBig",n=A("invalidChainIdTooBig")):(a="invalidNumber",n=A("invalidNumber"));try{f=await(0,p.jsonRpcRequest)(B,"eth_chainId")}catch(e){i.default.warn("Failed to fetch the chainId from the endpoint.",e),m=e}if(B&&t)if(m||"string"!=typeof f)a="failedToFetchChainId",n=A("failedToFetchChainId");else if(c!==f){if(!t.startsWith("0x"))try{f=parseInt(f,16).toString(10)}catch(e){i.default.warn("Failed to convert endpoint chain ID to decimal",f)}a="endpointReturnedDifferentChainId",n=A("endpointReturnedDifferentChainId",[f.length<=12?f:`${f.slice(0,9)}...`])}return a?{error:{key:a,msg:n}}:r?{warning:{key:r,msg:o}}:null}),[B,s,A]),he=(0,n.useCallback)((async(e,t)=>{let a,n,r,s;if(!e||!t)return null;try{r=await(0,_.default)("https://chainid.network/chains.json")||[]}catch(e){i.default.warn("Failed to fetch the chainList from chainid.network",e),s=e}if(s)a="failedToFetchTickerSymbolData",n=A("failedToFetchTickerSymbolData");else{var o;const s=null===(o=r)||void 0===o?void 0:o.find((t=>t.chainId.toString()===e));if(s===undefined)a="failedToFetchTickerSymbolData",n=A("failedToFetchTickerSymbolData");else{var l;const r=null===(l=s.nativeCurrency)||void 0===l?void 0:l.symbol;r!==t&&(a="chainListReturnedDifferentTickerSymbol",n=A("chainListReturnedDifferentTickerSymbol",[e,r]))}}return a?{key:a,msg:n}:null}),[A]),_e=(0,n.useCallback)((e=>{const t=o.default.isWebUri(e),[{rpcUrl:a=null,label:n,labelKey:r}={}]=s.filter((t=>t.rpcUrl===e)),{rpcUrl:i}=b;if(!t&&""!==e){let t,a;return C(e)?(t="urlErrorMsg",a=A("urlErrorMsg")):(t="invalidRPC",a=A("invalidRPC")),{key:t,msg:a}}return a&&a!==i?{key:"urlExistsErrorMsg",msg:A("urlExistsErrorMsg",[n??r])}:null}),[b,s,A]),ye=(0,y.usePrevious)(B),ve=(0,y.usePrevious)(G),Ee=(0,y.usePrevious)(K),we=(0,y.usePrevious)(Q);(0,n.useEffect)((()=>{L||ye===B&&ve===G&&Ee===K&&we===Q||async function(){const{error:e,warning:t}=await ge(G)||{},a=await he(G,K),n=me(Q),r=_e(B);z({...Z,blockExplorerUrl:n,rpcUrl:r,chainId:e}),J({...X,chainId:t,ticker:a})}()}),[Z,X,B,G,K,Q,L,D,ye,ve,Ee,we,me,ge,he,_e]);const be=!a&&!L&&!e,Te=(()=>{const e="string"==typeof b.chainId&&b.chainId.toLowerCase().startsWith("0x")&&G===k(b.chainId);return B===b.rpcUrl&&e&&K===b.ticker&&W===U&&Q===b.blockExplorerUrl})(),ke=(null==b?void 0:b.rpcUrl)&&Z.chainId&&ae,Ce=Object.keys(Z).some((e=>{const t=Z[e];return("chainId"!==e||"chainIdExistsErrorMsg"!==(null==t?void 0:t.key))&&(null==t?void 0:t.key)&&(null==t?void 0:t.msg)}))||ee||Te||ke||!B||!G||!K;return n.default.createElement("div",{className:(0,l.default)({"networks-tab__network-form":!e,"networks-tab__add-network-form":e,"networks-tab__restrict-height":t})},e?n.default.createElement(f.default,{type:"warning",message:A("onlyAddTrustedNetworks"),iconFillColor:"var(--color-warning-default)",useIcon:!0,withRightButton:!0,className:"networks-tab__add-network-form__alert"}):null,n.default.createElement("div",{className:(0,l.default)({"networks-tab__network-form-body":!e,"networks-tab__network-form-body__view-only":L,"networks-tab__add-network-form-body":e})},n.default.createElement(g.default,{autoFocus:!0,error:(null===(N=Z.networkName)||void 0===N?void 0:N.msg)||"",onChange:e=>{re(!0),q(e)},titleText:A("networkName"),value:W,disabled:L}),n.default.createElement(g.default,{error:(null===(O=Z.rpcUrl)||void 0===O?void 0:O.msg)||"",onChange:e=>{re(!0),H(e)},titleText:A("rpcUrl"),value:null!=B&&B.includes(`/v3/${E.infuraProjectId}`)?B.replace(`/v3/${E.infuraProjectId}`,""):B,disabled:L}),n.default.createElement(g.default,{warning:(null===(x=X.chainId)||void 0===x?void 0:x.msg)||"",error:(null===(I=Z.chainId)||void 0===I?void 0:I.msg)||"",onChange:e=>{re(!0),$(e)},titleText:A("chainId"),value:G,disabled:L,tooltipText:L?null:A("networkSettingsChainIdDescription")}),n.default.createElement(g.default,{warning:(null===(P=X.ticker)||void 0===P?void 0:P.msg)||"",onChange:e=>{re(!0),V(e)},titleText:A("currencySymbol"),value:K,disabled:L}),n.default.createElement(g.default,{error:(null===(M=Z.blockExplorerUrl)||void 0===M?void 0:M.msg)||"",onChange:e=>{re(!0),Y(e)},titleText:A("blockExplorerUrl"),titleUnit:A("optionalWithParanthesis"),value:Q,disabled:L,autoFocus:"blockExplorerUrl"===window.location.hash.split("#")[2]})),n.default.createElement("div",{className:(0,l.default)({"networks-tab__network-form-footer":!e,"networks-tab__add-network-form-footer":e})},!L&&n.default.createElement(n.default.Fragment,null,be&&n.default.createElement(m.default,{type:"danger",onClick:()=>{R((0,h.showModal)({name:"CONFIRM_DELETE_NETWORK",target:b.networkConfigurationId,onConfirm:()=>{ie(),R((0,h.setSelectedNetworkConfigurationId)(""))}}))}},A("delete")),n.default.createElement(m.default,{type:"secondary",onClick:()=>{e?(R((0,h.setSelectedNetworkConfigurationId)("")),null==T||T()):ie()},disabled:Te},A("cancel")),n.default.createElement(m.default,{type:"primary",disabled:Ce,onClick:async()=>{te(!0);try{const t=(e=>{let t=e;return e.startsWith("0x")||(t=`0x${parseInt(e,10).toString(16)}`),t})(G.trim().toLowerCase());let a;b.rpcUrl&&B!==b.rpcUrl?await R((0,h.editAndSetNetworkConfiguration)({rpcUrl:B,ticker:K,networkConfigurationId:b.networkConfigurationId,chainId:t,nickname:W,rpcPrefs:{...F,blockExplorerUrl:Q||(null==F?void 0:F.blockExplorerUrl)}},{source:v.MetaMetricsNetworkEventSource.CustomNetworkForm})):a=await R((0,h.upsertNetworkConfiguration)({rpcUrl:B,ticker:K,chainId:t,nickname:W,rpcPrefs:{...F,blockExplorerUrl:Q||(null==F?void 0:F.blockExplorerUrl)}},{setActive:!0,source:v.MetaMetricsNetworkEventSource.CustomNetworkForm})),e&&(R((0,h.setNewNetworkAdded)({nickname:W,networkConfigurationId:a})),null==S||S())}catch(e){throw te(!1),e}}},A("save")))))};S.propTypes={addNewNetwork:s.default.bool,isCurrentRpcTarget:s.default.bool,networksToRender:s.default.array.isRequired,selectedNetwork:s.default.object,cancelCallback:s.default.func,submitCallback:s.default.func,restrictHeight:s.default.bool},S.defaultProps={selectedNetwork:{}};var N=S;a.default=N}}},{package:"$root$",file:"ui/pages/settings/networks-tab/networks-form/networks-form.js"}],[4342,{"./networks-list-item":4343},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./networks-list-item"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/settings/networks-tab/networks-list-item/index.js"}],[4343,{"../../../../../app/scripts/lib/util":82,"../../../../../shared/constants/app":3401,"../../../../../shared/constants/network":3409,"../../../../components/component-library/icon/deprecated":3836,"../../../../components/ui/identicon":3962,"../../../../components/ui/url-icon":4044,"../../../../helpers/constants/design-system":4070,"../../../../helpers/constants/routes":4074,"../../../../helpers/utils/settings-search":4104,"../../../../hooks/useI18nContext":4129,"../../../../selectors":4436,"../../../../store/actions":4443,classnames:1980,"prop-types":3032,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=E(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=v(e("prop-types")),s=v(e("classnames")),o=e("react-redux"),i=e("../../../../hooks/useI18nContext"),l=e("../../../../../shared/constants/network"),c=e("../../../../helpers/constants/routes"),u=e("../../../../store/actions"),d=e("../../../../../app/scripts/lib/util"),p=e("../../../../../shared/constants/app"),f=e("../../../../selectors"),m=v(e("../../../../components/ui/identicon")),g=v(e("../../../../components/ui/url-icon")),h=e("../../../../helpers/utils/settings-search"),_=e("../../../../components/component-library/icon/deprecated"),y=e("../../../../helpers/constants/design-system");function v(e){return e&&e.__esModule?e:{default:e}}function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(E=function(e){return e?a:t})(e)}const w=({network:e,networkIsSelected:t,selectedNetworkConfigurationId:a,setSearchQuery:r,setSearchedNetworks:v})=>{const E=(0,i.useI18nContext)(),w=(0,o.useDispatch)(),b=(0,d.getEnvironmentType)()===p.ENVIRONMENT_TYPE_FULLSCREEN,T=(0,o.useSelector)(f.getProvider),{label:k,labelKey:C,networkConfigurationId:S,rpcUrl:N,providerType:O}=e,x=a&&a===S,I=N===T.rpcUrl,P=T.type!==l.NETWORK_TYPES.RPC&&O===T.type,M=x||!t&&(I||P),A=I||P,R=(0,n.useRef)();return(0,n.useEffect)((()=>{(0,h.handleSettingsRefs)(E,E("networks"),R)}),[R,E]),n.default.createElement("div",{ref:R,key:`settings-network-list-item:${S}`,className:"networks-tab__networks-list-item",onClick:()=>{r(""),v([]),w((0,u.setSelectedNetworkConfigurationId)(S)),b||global.platform.openExtensionInBrowser(c.NETWORKS_ROUTE)}},A?n.default.createElement(_.Icon,{name:_.ICON_NAMES.CHECK,color:y.IconColor.successDefault}):n.default.createElement(_.Icon,{name:_.ICON_NAMES.CHECK,color:y.IconColor.transparent}),e.chainId in l.CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP?n.default.createElement(m.default,{className:"networks-tab__content__custom-image",diameter:24,image:l.CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP[e.chainId],imageBorder:!0}):!e.isATestNetwork&&n.default.createElement(g.default,{className:"networks-tab__content__icon-with-fallback",fallbackClassName:"networks-tab__content__icon-with-fallback",name:k}),e.isATestNetwork&&n.default.createElement(g.default,{name:k||C,fallbackClassName:(0,s.default)("networks-tab__content__icon-with-fallback",{[`networks-tab__content__icon-with-fallback--color-${C}`]:!0})}),n.default.createElement("div",{className:(0,s.default)("networks-tab__networks-list-name",{"networks-tab__networks-list-name--selected":M,"networks-tab__networks-list-name--disabled":O!==l.NETWORK_TYPES.RPC&&!M})},k||E(C),O!==l.NETWORK_TYPES.RPC&&n.default.createElement(_.Icon,{name:_.ICON_NAMES.LOCK,color:y.IconColor.iconMuted,size:_.ICON_SIZES.AUTO,marginInlineStart:2})))};w.propTypes={network:r.default.object.isRequired,networkIsSelected:r.default.bool,selectedNetworkConfigurationId:r.default.string,setSearchQuery:r.default.func,setSearchedNetworks:r.default.func};var b=w;a.default=b}}},{package:"$root$",file:"ui/pages/settings/networks-tab/networks-list-item/networks-list-item.js"}],[4344,{"./networks-list":4345},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./networks-list"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/settings/networks-tab/networks-list/index.js"}],[4345,{"../../../../components/ui/typography":4039,"../../../../helpers/constants/design-system":4070,"../../../../hooks/useI18nContext":4129,"../custom-content-search":4338,"../networks-list-item":4342,classnames:1980,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=p(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=d(e("prop-types")),s=d(e("classnames")),o=e("../../../../hooks/useI18nContext"),i=d(e("../custom-content-search")),l=d(e("../../../../components/ui/typography")),c=e("../../../../helpers/constants/design-system"),u=d(e("../networks-list-item"));function d(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(p=function(e){return e?a:t})(e)}const f=({networkIsSelected:e,networksToRender:t,networkDefaultedToProvider:a,selectedNetworkConfigurationId:r})=>{const d=(0,o.useI18nContext)(),[p,f]=(0,n.useState)([]),[m,g]=(0,n.useState)(""),h=0===p.length&&""===m?t:p,_=h.filter((e=>!e.isATestNetwork)),y=h.filter((e=>e.isATestNetwork));return n.default.createElement("div",{className:(0,s.default)("networks-tab__networks-list",{"networks-tab__networks-list--selection":e&&!a})},n.default.createElement(i.default,{onSearch:({searchQuery:e="",results:t=[]})=>{f(t),g(e)},error:0===h.length?d("settingsSearchMatchingNotFound"):null,networksList:t,searchQueryInput:m}),_.map(((t,a)=>n.default.createElement(u.default,{key:`settings-network-list:${t.rpcUrl}`,network:t,networkIsSelected:e,selectedNetworkConfigurationId:r,setSearchQuery:g,setSearchedNetworks:f}))),""===m&&n.default.createElement(l.default,{variant:c.TypographyVariant.H6,marginTop:4,color:c.Color.textAlternative,className:"networks-tab__networks-list__label"},d("testNetworks")),y.map(((t,a)=>n.default.createElement(u.default,{key:`settings-network-list:${t.rpcUrl}`,network:t,networkIsSelected:e,selectedNetworkConfigurationId:r,setSearchQuery:g,setSearchedNetworks:f}))))};f.propTypes={networkDefaultedToProvider:r.default.bool,networkIsSelected:r.default.bool,networksToRender:r.default.arrayOf(r.default.object).isRequired,selectedNetworkConfigurationId:r.default.string};var m=f;a.default=m}}},{package:"$root$",file:"ui/pages/settings/networks-tab/networks-list/networks-list.js"}],[4346,{"./networks-tab-content":4347},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./networks-tab-content"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/settings/networks-tab/networks-tab-content/index.js"}],[4347,{"../../../../helpers/constants/routes":4074,"../../../../selectors":4436,"../networks-form":4340,"../networks-list":4344,"prop-types":3032,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=d(e("react")),r=d(e("prop-types")),s=e("react-redux"),o=e("react-router-dom"),i=d(e("../networks-form")),l=d(e("../networks-list")),c=e("../../../../selectors"),u=e("../../../../helpers/constants/routes");function d(e){return e&&e.__esModule?e:{default:e}}const p=({networkDefaultedToProvider:e,networkIsSelected:t,networksToRender:a,selectedNetwork:r,shouldRenderNetworkForm:d})=>{const p=(0,s.useSelector)(c.getProvider),f=(0,o.useHistory)();return n.default.createElement(n.default.Fragment,null,n.default.createElement(l.default,{networkDefaultedToProvider:e,networkIsSelected:t,networksToRender:a,selectedNetworkConfigurationId:r.networkConfigurationId}),d?n.default.createElement(i.default,{isCurrentRpcTarget:p.rpcUrl===r.rpcUrl,networksToRender:a,selectedNetwork:r,submitCallback:()=>f.push(u.DEFAULT_ROUTE),cancelCallback:()=>f.push(u.NETWORKS_ROUTE)}):null)};p.propTypes={networkDefaultedToProvider:r.default.bool,networkIsSelected:r.default.bool,networksToRender:r.default.arrayOf(r.default.object).isRequired,selectedNetwork:r.default.object,shouldRenderNetworkForm:r.default.bool.isRequired};var f=p;a.default=f}}},{package:"$root$",file:"ui/pages/settings/networks-tab/networks-tab-content/networks-tab-content.js"}],[4348,{"./networks-tab-subheader":4349},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./networks-tab-subheader"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/settings/networks-tab/networks-tab-subheader/index.js"}],[4349,{"../../../../components/ui/button":3904,"../../../../helpers/constants/routes":4074,"../../../../hooks/useI18nContext":4129,"prop-types":3032,react:3177,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=c(e("react")),r=c(e("prop-types")),s=e("react-router-dom"),o=e("../../../../hooks/useI18nContext"),i=e("../../../../helpers/constants/routes"),l=c(e("../../../../components/ui/button"));function c(e){return e&&e.__esModule?e:{default:e}}const u=({addNewNetwork:e})=>{const t=(0,o.useI18nContext)(),a=(0,s.useHistory)();return e?n.default.createElement("div",{className:"networks-tab__subheader"},n.default.createElement("span",{className:"networks-tab__sub-header-text"},t("networks")),n.default.createElement("span",{className:"networks-tab__sub-header-text"},"  >  "),n.default.createElement("div",{className:"networks-tab__sub-header-text"},t("addANetwork")),n.default.createElement("span",null,"  >  "),n.default.createElement("div",{className:"networks-tab__subheader--break"},t("addANetworkManually"))):n.default.createElement("div",{className:"settings-page__sub-header"},n.default.createElement("span",{className:"settings-page__sub-header-text"},t("networks")),n.default.createElement("div",{className:"networks-tab__add-network-header-button-wrapper"},n.default.createElement(l.default,{type:"primary",onClick:e=>{e.preventDefault(),a.push(i.ADD_POPULAR_CUSTOM_NETWORK)}},t("addANetwork"))))};u.propTypes={addNewNetwork:r.default.bool.isRequired};var d=u;a.default=d}}},{package:"$root$",file:"ui/pages/settings/networks-tab/networks-tab-subheader/networks-tab-subheader.js"}],[435,{"@ethersproject/address":403},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.getJsonWalletAddress=a.isKeystoreWallet=a.isCrowdsaleWallet=void 0;var n=e("@ethersproject/address");function r(e){var t=null;try{t=JSON.parse(e)}catch(e){return!1}return t.encseed&&t.ethaddr}function s(e){var t=null;try{t=JSON.parse(e)}catch(e){return!1}return!(!t.version||parseInt(t.version)!==t.version||3!==parseInt(t.version))}a.isCrowdsaleWallet=r,a.isKeystoreWallet=s,a.getJsonWalletAddress=function(e){if(r(e))try{return(0,n.getAddress)(JSON.parse(e).ethaddr)}catch(e){return null}if(s(e))try{return(0,n.getAddress)(JSON.parse(e).address)}catch(e){return null}return null}}}},{package:"@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>ethers>@ethersproject/json-wallets",file:"node_modules/@ethersproject/json-wallets/lib/inspect.js"}],[4350,{"../../../../shared/constants/network":3409},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.defaultNetworksData=void 0;var n=e("../../../../shared/constants/network");const r=[{labelKey:n.NETWORK_TYPES.MAINNET,iconColor:"#29B6AF",providerType:n.NETWORK_TYPES.MAINNET,rpcUrl:(0,n.getRpcUrl)({network:n.NETWORK_TYPES.MAINNET,excludeProjectId:!0}),chainId:n.CHAIN_IDS.MAINNET,ticker:n.CURRENCY_SYMBOLS.ETH,blockExplorerUrl:"https://etherscan.io"},{labelKey:n.NETWORK_TYPES.GOERLI,iconColor:"#3099f2",providerType:n.NETWORK_TYPES.GOERLI,rpcUrl:(0,n.getRpcUrl)({network:n.NETWORK_TYPES.GOERLI,excludeProjectId:!0}),chainId:n.CHAIN_IDS.GOERLI,ticker:n.TEST_NETWORK_TICKER_MAP[n.NETWORK_TYPES.GOERLI],blockExplorerUrl:"https://goerli.etherscan.io"},{labelKey:n.NETWORK_TYPES.SEPOLIA,iconColor:"#CFB5F0",providerType:n.NETWORK_TYPES.SEPOLIA,rpcUrl:(0,n.getRpcUrl)({network:n.NETWORK_TYPES.SEPOLIA,excludeProjectId:!0}),chainId:n.CHAIN_IDS.SEPOLIA,ticker:n.TEST_NETWORK_TICKER_MAP[n.NETWORK_TYPES.SEPOLIA],blockExplorerUrl:"https://sepolia.etherscan.io"},{labelKey:n.NETWORK_TYPES.LINEA_TESTNET,iconColor:"#234FD5",providerType:n.NETWORK_TYPES.LINEA_TESTNET,rpcUrl:n.LINEA_TESTNET_RPC_URL,chainId:n.CHAIN_IDS.LINEA_TESTNET,ticker:n.TEST_NETWORK_TICKER_MAP[n.NETWORK_TYPES.LINEA_TESTNET],blockExplorerUrl:"https://explorer.goerli.linea.build"}];a.defaultNetworksData=r}}},{package:"$root$",file:"ui/pages/settings/networks-tab/networks-tab.constants.js"}],[4351,{"../../../../app/scripts/lib/util":82,"../../../../shared/constants/app":3401,"../../../../shared/constants/network":3409,"../../../components/ui/button":3904,"../../../helpers/constants/routes":4074,"../../../hooks/useI18nContext":4129,"../../../selectors":4436,"../../../store/actions":4443,"./networks-form":4340,"./networks-tab-content":4346,"./networks-tab-subheader":4348,"./networks-tab.constants":4350,classnames:1980,"prop-types":3032,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=w(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=E(e("prop-types")),s=E(e("classnames")),o=e("react-router-dom"),i=e("react-redux"),l=e("../../../hooks/useI18nContext"),c=e("../../../helpers/constants/routes"),u=e("../../../store/actions"),d=E(e("../../../components/ui/button")),p=e("../../../../app/scripts/lib/util"),f=e("../../../../shared/constants/app"),m=e("../../../selectors"),g=e("../../../../shared/constants/network"),h=e("./networks-tab.constants"),_=E(e("./networks-tab-content")),y=E(e("./networks-form")),v=E(e("./networks-tab-subheader"));function E(e){return e&&e.__esModule?e:{default:e}}function w(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(w=function(e){return e?a:t})(e)}const b=h.defaultNetworksData.map((e=>({...e,viewOnly:!0,isATestNetwork:g.TEST_CHAINS.includes(e.chainId)}))).filter((e=>e.chainId!==g.CHAIN_IDS.LINEA_TESTNET)),T=({addNewNetwork:e})=>{const t=(0,l.useI18nContext)(),a=(0,i.useDispatch)(),{pathname:r}=(0,o.useLocation)(),h=(0,o.useHistory)(),E=(0,p.getEnvironmentType)()===f.ENVIRONMENT_TYPE_FULLSCREEN,w=E||Boolean(r.match(c.NETWORKS_FORM_ROUTE))||"blockExplorerUrl"===window.location.hash.split("#")[2],T=(0,i.useSelector)(m.getNetworkConfigurations),k=(0,i.useSelector)(m.getProvider),C=(0,i.useSelector)(m.getNetworksTabSelectedNetworkConfigurationId),S=Object.entries(T).map((([e,t])=>{var a;return{label:t.nickname,iconColor:"var(--color-icon-alternative)",providerType:g.NETWORK_TYPES.RPC,rpcUrl:t.rpcUrl,chainId:t.chainId,ticker:t.ticker,blockExplorerUrl:(null===(a=t.rpcPrefs)||void 0===a?void 0:a.blockExplorerUrl)||"",isATestNetwork:g.TEST_CHAINS.includes(t.chainId),networkConfigurationId:e}}));let N=[...b,...S];g.SHOULD_SHOW_LINEA_TESTNET_NETWORK||(N=N.filter((e=>e.chainId!==g.CHAIN_IDS.LINEA_TESTNET)));let O=N.find((e=>e.networkConfigurationId===C))||{};const x=Boolean(O.rpcUrl);let I=!1;return x||(O=N.find((e=>e.rpcUrl===k.rpcUrl||e.providerType!==g.NETWORK_TYPES.RPC&&e.providerType===k.type))||{},I=!0),(0,n.useEffect)((()=>()=>{a((0,u.setSelectedNetworkConfigurationId)(""))}),[a]),n.default.createElement("div",{className:"networks-tab__body"},E?n.default.createElement(v.default,{addNewNetwork:e}):null,n.default.createElement("div",{className:(0,s.default)("networks-tab__content",{"networks-tab__content--with-networks-list-popup-footer":!E&&!w})},e?n.default.createElement(y.default,{networksToRender:N,addNewNetwork:e,submitCallback:()=>h.push(c.DEFAULT_ROUTE),cancelCallback:()=>h.push(c.NETWORKS_ROUTE)}):n.default.createElement(n.default.Fragment,null,n.default.createElement(_.default,{networkDefaultedToProvider:I,networkIsSelected:x,networksToRender:N,providerUrl:k.rpcUrl,selectedNetwork:O,shouldRenderNetworkForm:w}),E||w?null:n.default.createElement("div",{className:"networks-tab__networks-list-popup-footer"},n.default.createElement(d.default,{type:"primary",onClick:()=>{E?h.push(c.ADD_POPULAR_CUSTOM_NETWORK):global.platform.openExtensionInBrowser(c.ADD_POPULAR_CUSTOM_NETWORK)}},t("addNetwork"))))))};T.propTypes={addNewNetwork:r.default.bool};var k=T;a.default=k}}},{package:"$root$",file:"ui/pages/settings/networks-tab/networks-tab.js"}],[4352,{"./security-tab.container":4354},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./security-tab.container"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/settings/security-tab/index.js"}],[4353,{"../../../../app/scripts/lib/util":82,"../../../../shared/constants/app":3401,"../../../../shared/constants/metametrics":3408,"../../../../shared/lib/ui-utils":3426,"../../../components/ui/button":3904,"../../../components/ui/text-field":4025,"../../../components/ui/toggle-button":4028,"../../../helpers/constants/routes":4074,"../../../helpers/utils/settings-search":4104,lodash:2932,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=h(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=g(e("prop-types")),s=e("lodash"),o=g(e("../../../components/ui/toggle-button")),i=g(e("../../../components/ui/text-field")),l=e("../../../helpers/constants/routes"),c=g(e("../../../components/ui/button")),u=e("../../../helpers/utils/settings-search"),d=e("../../../../shared/constants/metametrics"),p=e("../../../../shared/lib/ui-utils"),f=e("../../../../shared/constants/app"),m=e("../../../../app/scripts/lib/util");function g(e){return e&&e.__esModule?e:{default:e}}function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(h=function(e){return e?a:t})(e)}function _(e,t,a){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(a!==undefined){var n=a.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class y extends n.PureComponent{constructor(...e){super(...e),_(this,"state",{ipfsGateway:this.props.ipfsGateway,ipfsGatewayError:""}),_(this,"settingsRefCounter",0),_(this,"settingsRefs",Array((0,u.getNumberOfSettingsInSection)(this.context.t,this.context.t("securityAndPrivacy"))).fill(undefined).map((()=>n.default.createRef())))}componentDidUpdate(){const{t:e}=this.context;(0,u.handleSettingsRefs)(e,e("securityAndPrivacy"),this.settingsRefs)}componentDidMount(){const{t:e}=this.context;(0,u.handleSettingsRefs)(e,e("securityAndPrivacy"),this.settingsRefs)}toggleSetting(e,t,a,n){this.context.trackEvent({category:d.MetaMetricsEventCategory.Settings,event:t,properties:{action:a,legacy_event:!0}}),n(!e)}renderSeedWords(){const{t:e}=this.context,{history:t}=this.props;return n.default.createElement("div",{ref:this.settingsRefs[0],className:"settings-page__content-row"},n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("span",null,e("revealSeedWords"))),n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("div",{className:"settings-page__content-item-col"},n.default.createElement(c.default,{"data-testid":"reveal-seed-words",type:"danger",large:!0,onClick:e=>{e.preventDefault(),this.context.trackEvent({category:d.MetaMetricsEventCategory.Settings,event:d.MetaMetricsEventName.KeyExportSelected,properties:{key_type:d.MetaMetricsEventKeyType.Srp,location:"Settings"}}),t.push(l.REVEAL_SEED_ROUTE)}},e("revealSeedWords")))))}renderIncomingTransactionsOptIn(){const{t:e}=this.context,{showIncomingTransactions:t,setShowIncomingTransactionsFeatureFlag:a}=this.props;return n.default.createElement("div",{ref:this.settingsRefs[1],className:"settings-page__content-row"},n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("span",null,e("showIncomingTransactions")),n.default.createElement("div",{className:"settings-page__content-description"},e("showIncomingTransactionsDescription",[n.default.createElement("a",{href:p.ETHERSCAN_PRIVACY_LINK,target:"_blank",rel:"noopener noreferrer",key:"etherscan-privacy-link"},e("etherscan")),n.default.createElement("a",{href:p.CONSENSYS_PRIVACY_LINK,target:"_blank",rel:"noopener noreferrer",key:"ic-consensys-privacy-link"},e("privacyMsg"))]))),n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("div",{className:"settings-page__content-item-col"},n.default.createElement(o.default,{value:t,onToggle:e=>a(!e),offLabel:e("off"),onLabel:e("on")}))))}renderPhishingDetectionToggle(){const{t:e}=this.context,{usePhishDetect:t,setUsePhishDetect:a}=this.props;return n.default.createElement("div",{ref:this.settingsRefs[2],className:"settings-page__content-row"},n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("span",null,e("usePhishingDetection")),n.default.createElement("div",{className:"settings-page__content-description"},e("usePhishingDetectionDescription"))),n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("div",{className:"settings-page__content-item-col"},n.default.createElement(o.default,{value:t,onToggle:e=>a(!e),offLabel:e("off"),onLabel:e("on")}))))}renderMetaMetricsOptIn(){const{t:e}=this.context,{participateInMetaMetrics:t,setParticipateInMetaMetrics:a}=this.props;return n.default.createElement("div",{ref:this.settingsRefs[3],className:"settings-page__content-row"},n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("span",null,e("participateInMetaMetrics")),n.default.createElement("div",{className:"settings-page__content-description"},n.default.createElement("span",null,e("participateInMetaMetricsDescription")))),n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("div",{className:"settings-page__content-item-col"},n.default.createElement(o.default,{value:t,onToggle:e=>a(!e),offLabel:e("off"),onLabel:e("on")}))))}renderChooseYourNetworkButton(){const{t:e}=this.context;return n.default.createElement("div",{ref:this.settingsRefs[5],className:"settings-page__content-row","data-testid":"advanced-setting-choose-your-network"},n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("span",null,e("chooseYourNetwork")),n.default.createElement("div",{className:"settings-page__content-description"},e("chooseYourNetworkDescription",[n.default.createElement("a",{href:p.CONSENSYS_PRIVACY_LINK,target:"_blank",rel:"noopener noreferrer",key:"cyn-consensys-privacy-link"},e("privacyMsg"))]))),n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("div",{className:"settings-page__content-item-col"},n.default.createElement(c.default,{type:"secondary",className:"settings-page__button",onClick:()=>{(0,m.getEnvironmentType)()===f.ENVIRONMENT_TYPE_POPUP?global.platform.openExtensionInBrowser(l.ADD_POPULAR_CUSTOM_NETWORK):this.props.history.push(l.ADD_POPULAR_CUSTOM_NETWORK)}},e("addCustomNetwork")))))}renderIpfsGatewayControl(){const{t:e}=this.context,{ipfsGatewayError:t}=this.state,a=e=>{const t=new URL((0,m.addUrlProtocolPrefix)(e)),{host:a}=t;this.props.setIpfsGateway(a)},r=t=>{this.setState((()=>{let n="";try{const e=new URL((0,m.addUrlProtocolPrefix)(t));if(!e.host)throw new Error;if("gateway.ipfs.io"===e.host)throw new Error("Forbidden gateway")}catch(t){n="Forbidden gateway"===t.message?e("forbiddenIpfsGateway"):e("invalidIpfsGateway")}return a(t),{ipfsGateway:t,ipfsGatewayError:n}}))};return n.default.createElement("div",{ref:this.settingsRefs[6],className:"settings-page__content-row","data-testid":"setting-ipfs-gateway"},n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("span",null,e("addCustomIPFSGateway")),n.default.createElement("div",{className:"settings-page__content-description"},e("addCustomIPFSGatewayDescription"))),n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("div",{className:"settings-page__content-item-col"},n.default.createElement(i.default,{type:"text",value:this.state.ipfsGateway,onChange:e=>r(e.target.value),error:t,fullWidth:!0,margin:"dense"}))))}renderAutoDectectTokensToggle(){const{t:e}=this.context,{useTokenDetection:t,setUseTokenDetection:a}=this.props;return n.default.createElement("div",{ref:this.settingsRefs[4],className:"settings-page__content-row","data-testid":"advanced-setting-gas-fee-estimation"},n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("span",null,e("autoDetectTokens")),n.default.createElement("div",{className:"settings-page__content-description"},e("autoDetectTokensDescription",[n.default.createElement("a",{href:p.AUTO_DETECT_TOKEN_LEARN_MORE_LINK,target:"_blank",rel:"noopener noreferrer",key:"cyn-consensys-privacy-link"},(0,s.startCase)(e("learnMore")))]))),n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("div",{className:"settings-page__content-item-col"},n.default.createElement(o.default,{value:t,onToggle:e=>{this.toggleSetting(e,d.MetaMetricsEventName.KeyAutoDetectTokens,d.MetaMetricsEventName.KeyAutoDetectTokens,a)},offLabel:e("off"),onLabel:e("on")}))))}renderBatchAccountBalanceRequestsToggle(){const{t:e}=this.context,{useMultiAccountBalanceChecker:t,setUseMultiAccountBalanceChecker:a}=this.props;return n.default.createElement("div",{ref:this.settingsRefs[8],className:"settings-page__content-row"},n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("span",null,e("useMultiAccountBalanceChecker")),n.default.createElement("div",{className:"settings-page__content-description"},e("useMultiAccountBalanceCheckerDescription"))),n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("div",{className:"settings-page__content-item-col"},n.default.createElement(o.default,{value:t,onToggle:e=>{this.toggleSetting(e,d.MetaMetricsEventName.KeyBatchAccountBalanceRequests,d.MetaMetricsEventName.KeyBatchAccountBalanceRequests,a)},offLabel:e("off"),onLabel:e("on")}))))}renderCurrencyRateCheckToggle(){const{t:e}=this.context,{useCurrencyRateCheck:t,setUseCurrencyRateCheck:a}=this.props;return n.default.createElement("div",{ref:this.settingsRefs[9],className:"settings-page__content-row"},n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("span",null,e("currencyRateCheckToggle")),n.default.createElement("div",{className:"settings-page__content-description"},e("currencyRateCheckToggleDescription",[n.default.createElement("a",{key:"coingecko_link",href:p.COINGECKO_LINK,rel:"noreferrer",target:"_blank"},e("coingecko")),n.default.createElement("a",{key:"cryptocompare_link",href:p.CRYPTOCOMPARE_LINK,rel:"noreferrer",target:"_blank"},e("cryptoCompare")),n.default.createElement("a",{key:"privacy_policy_link",href:p.PRIVACY_POLICY_LINK,rel:"noreferrer",target:"_blank"},e("privacyMsg"))]))),n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("div",{className:"settings-page__content-item-col"},n.default.createElement(o.default,{value:t,onToggle:e=>a(!e),offLabel:e("off"),onLabel:e("on")}))))}render(){const{warning:e}=this.props;return n.default.createElement("div",{className:"settings-page__body"},e?n.default.createElement("div",{className:"settings-tab__error"},e):null,n.default.createElement("span",{className:"settings-page__security-tab-sub-header__bold"},this.context.t("security")),n.default.createElement("div",{className:"settings-page__content-padded"},this.renderSeedWords()),n.default.createElement("span",{className:"settings-page__security-tab-sub-header__bold"},this.context.t("privacy")),n.default.createElement("div",null,n.default.createElement("span",{className:"settings-page__security-tab-sub-header"},"Alerts")),n.default.createElement("div",{className:"settings-page__content-padded"},this.renderPhishingDetectionToggle()),n.default.createElement("span",{className:"settings-page__security-tab-sub-header"},this.context.t("transactions")),n.default.createElement("div",{className:"settings-page__content-padded"},this.renderCurrencyRateCheckToggle(),this.renderIncomingTransactionsOptIn()),n.default.createElement("span",{className:"settings-page__security-tab-sub-header"},this.context.t("networkProvider")),n.default.createElement("div",{className:"settings-page__content-padded"},this.renderChooseYourNetworkButton(),this.renderIpfsGatewayControl()),n.default.createElement("span",{className:"settings-page__security-tab-sub-header"},this.context.t("tokenAutoDetection")),n.default.createElement("div",{className:"settings-page__content-padded"},this.renderAutoDectectTokensToggle(),this.renderBatchAccountBalanceRequestsToggle()),n.default.createElement("span",{className:"settings-page__security-tab-sub-header"},this.context.t("metrics")),n.default.createElement("div",{className:"settings-page__content-padded"},this.renderMetaMetricsOptIn()))}}a.default=y,_(y,"contextTypes",{t:r.default.func,trackEvent:r.default.func}),_(y,"propTypes",{warning:r.default.string,history:r.default.object,participateInMetaMetrics:r.default.bool.isRequired,setParticipateInMetaMetrics:r.default.func.isRequired,showIncomingTransactions:r.default.bool.isRequired,setShowIncomingTransactionsFeatureFlag:r.default.func.isRequired,setUsePhishDetect:r.default.func.isRequired,usePhishDetect:r.default.bool.isRequired,useTokenDetection:r.default.bool.isRequired,setUseTokenDetection:r.default.func.isRequired,setIpfsGateway:r.default.func.isRequired,ipfsGateway:r.default.string.isRequired,useMultiAccountBalanceChecker:r.default.bool.isRequired,setUseMultiAccountBalanceChecker:r.default.func.isRequired,useCurrencyRateCheck:r.default.bool.isRequired,setUseCurrencyRateCheck:r.default.func.isRequired})}}},{package:"$root$",file:"ui/pages/settings/security-tab/security-tab.component.js"}],[4354,{"../../../store/actions":4443,"./security-tab.component":4353,"react-redux":3130,"react-router-dom":3150,redux:3194},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n,r=e("redux"),s=e("react-redux"),o=e("react-router-dom"),i=e("../../../store/actions"),l=(n=e("./security-tab.component"))&&n.__esModule?n:{default:n};var c=(0,r.compose)(o.withRouter,(0,s.connect)((e=>{const{appState:{warning:t},metamask:a}=e,{featureFlags:{showIncomingTransactions:n}={},participateInMetaMetrics:r,usePhishDetect:s,useTokenDetection:o,ipfsGateway:i,useMultiAccountBalanceChecker:l,useCurrencyRateCheck:c}=a;return{warning:t,showIncomingTransactions:n,participateInMetaMetrics:r,usePhishDetect:s,useTokenDetection:o,ipfsGateway:i,useMultiAccountBalanceChecker:l,useCurrencyRateCheck:c}}),(e=>({setParticipateInMetaMetrics:t=>e((0,i.setParticipateInMetaMetrics)(t)),setShowIncomingTransactionsFeatureFlag:t=>e((0,i.setFeatureFlag)("showIncomingTransactions",t)),setUsePhishDetect:t=>e((0,i.setUsePhishDetect)(t)),setUseCurrencyRateCheck:t=>e((0,i.setUseCurrencyRateCheck)(t)),setUseTokenDetection:t=>e((0,i.setUseTokenDetection)(t)),setIpfsGateway:t=>e((0,i.setIpfsGateway)(t)),setUseMultiAccountBalanceChecker:t=>e((0,i.setUseMultiAccountBalanceChecker)(t))}))))(l.default);a.default=c}}},{package:"$root$",file:"ui/pages/settings/security-tab/security-tab.container.js"}],[4355,{"./settings-search-list":4356},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){var n;Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var r=((n=e("./settings-search-list"))&&n.__esModule?n:{default:n}).default;a.default=r}}},{package:"$root$",file:"ui/pages/settings/settings-search-list/index.js"}],[4356,{"../../../components/component-library/icon/deprecated":3836,"../../../contexts/i18n":4047,"../../../helpers/constants/design-system":4070,"../../../helpers/utils/settings-search":4104,classnames:1980,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=p;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=d(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=u(e("prop-types")),s=u(e("classnames")),o=e("../../../helpers/utils/settings-search"),i=e("../../../contexts/i18n"),l=e("../../../components/component-library/icon/deprecated"),c=e("../../../helpers/constants/design-system");function u(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(d=function(e){return e?a:t})(e)}function p({results:e,onClickSetting:t}){const a=(0,n.useContext)(i.I18nContext);return(0,n.useEffect)(o.highlightSearchedText,[e]),n.default.createElement("div",{className:"settings-page__header__search__list"},e.slice(0,5).map((e=>{const{icon:r,iconName:o,tabMessage:i,sectionMessage:u,route:d}=e;return Boolean(r||i||u)&&n.default.createElement("div",{key:`settings_${d}`},n.default.createElement("div",{className:"settings-page__header__search__list__item",onClick:()=>t(e)},o?n.default.createElement(l.Icon,{name:o}):n.default.createElement("i",{className:(0,s.default)("settings-page__header__search__list__item__icon",r)}),n.default.createElement("span",{id:`menu-tab_${d}`,className:(0,s.default)("settings-page__header__search__list__item__tab",{"settings-page__header__search__list__item__tab-multiple-lines":i(a)===a("securityAndPrivacy")})},i(a)),n.default.createElement(l.Icon,{name:l.ICON_NAMES.ARROW_RIGHT,size:c.Size.SM,className:"settings-page__header__search__list__item__caret"}),n.default.createElement("span",{id:`menu-section_${d}`,className:(0,s.default)("settings-page__header__search__list__item__section",{"settings-page__header__search__list__item__section-multiple-lines":i(a)===a("securityAndPrivacy")||i(a)===a("alerts")})},u(a))))})),0===e.length&&n.default.createElement("div",{className:"settings-page__header__search__list__item",style:{cursor:"auto",display:"flex"}},n.default.createElement("span",{className:"settings-page__header__search__list__item__no-matching"},a("settingsSearchMatchingNotFound"))),n.default.createElement("div",{className:"settings-page__header__search__list__item",style:{cursor:"auto",display:"flex"}},n.default.createElement("span",{className:"settings-page__header__search__list__item__request"},a("missingSetting")),n.default.createElement("a",{href:"https://community.metamask.io/c/feature-requests-ideas/13",target:"_blank",rel:"noopener noreferrer",key:"need-help-link",className:"settings-page__header__search__list__item__link"},a("missingSettingRequest"))))}p.propTypes={results:r.default.array,onClickSetting:r.default.func}}}},{package:"$root$",file:"ui/pages/settings/settings-search-list/settings-search-list.js"}],[4357,{"./settings-search":4358},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){var n;Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var r=((n=e("./settings-search"))&&n.__esModule?n:{default:n}).default;a.default=r}}},{package:"$root$",file:"ui/pages/settings/settings-search/index.js"}],[4358,{"../../../../shared/modules/string-utils":3442,"../../../components/component-library/icon/deprecated":3836,"../../../components/ui/icon/search-icon":3953,"../../../components/ui/text-field":4025,"../../../contexts/i18n":4047,"../../../helpers/constants/design-system":4070,"@material-ui/core/InputAdornment":680,"fuse.js":2497,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=g;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=m(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=f(e("prop-types")),s=f(e("fuse.js")),o=f(e("@material-ui/core/InputAdornment")),i=f(e("../../../components/ui/text-field")),l=e("../../../contexts/i18n"),c=f(e("../../../components/ui/icon/search-icon")),u=e("../../../../shared/modules/string-utils"),d=e("../../../components/component-library/icon/deprecated"),p=e("../../../helpers/constants/design-system");function f(e){return e&&e.__esModule?e:{default:e}}function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(m=function(e){return e?a:t})(e)}function g({onSearch:e,error:t,settingsRoutesList:a}){const r=(0,n.useContext)(l.I18nContext),[f,m]=(0,n.useState)(""),[g,h]=(0,n.useState)("var(--color-icon-muted)"),_=Object.values(a),y=new s.default(_,{shouldSort:!0,threshold:.3,location:0,distance:100,maxPatternLength:32,minMatchCharLength:1,keys:["tabMessage","sectionMessage","descriptionMessage"],getFn:(e,t)=>e[t](r)}),v=t=>{const a=t.replace(/[^A-Za-z0-9\s&_]/gu,"").trimStart();m(a),h(""===a?"var(--color-icon-muted)":"var(--color-icon-default)");const n=y.search(a),r=[..._.filter((e=>e.tabMessage&&a&&(0,u.isEqualCaseInsensitive)(e.tab,a))),...n];e({searchQuery:a,results:r})};return n.default.createElement(i.default,{id:"search-settings",placeholder:r("searchSettings"),type:"text",value:f,onChange:e=>v(e.target.value),error:t,fullWidth:!0,autoFocus:!0,autoComplete:"off",startAdornment:n.default.createElement(o.default,{position:"start",style:{marginRight:"12px"}},n.default.createElement(c.default,{color:g})),endAdornment:n.default.createElement(n.default.Fragment,null,f&&n.default.createElement(o.default,{className:"imageclosectn",position:"end",onClick:()=>v(""),style:{cursor:"pointer"}},n.default.createElement(d.Icon,{name:d.ICON_NAMES.CLOSE,color:p.IconColor.iconDefault})))})}g.propTypes={onSearch:r.default.func,error:r.default.string,settingsRoutesList:r.default.array}}}},{package:"$root$",file:"ui/pages/settings/settings-search/settings-search.js"}],[4359,{"./settings-tab.container":4361},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./settings-tab.container"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/settings/settings-tab/index.js"}],[436,{"./_version":432,"./utils":437,"@ethersproject/address":403,"@ethersproject/bytes":413,"@ethersproject/hdnode":431,"@ethersproject/keccak256":439,"@ethersproject/logger":442,"@ethersproject/pbkdf2":446,"@ethersproject/properties":448,"@ethersproject/random":470,"@ethersproject/transactions":489,"aes-js":438,"scrypt-js":3217},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function a(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}),s=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(r,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function i(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(o,i)}l((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var a,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function i(s){return function(i){return function(s){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],n=0}finally{a=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,i])}}},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.encrypt=a.decrypt=a.decryptSync=a.KeystoreAccount=void 0;var l=i(e("aes-js")),c=i(e("scrypt-js")),u=e("@ethersproject/address"),d=e("@ethersproject/bytes"),p=e("@ethersproject/hdnode"),f=e("@ethersproject/keccak256"),m=e("@ethersproject/pbkdf2"),g=e("@ethersproject/random"),h=e("@ethersproject/properties"),_=e("@ethersproject/transactions"),y=e("./utils"),v=e("@ethersproject/logger"),E=e("./_version"),w=new v.Logger(E.version);function b(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}var T=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.isKeystoreAccount=function(e){return!(!e||!e._isKeystoreAccount)},t}(h.Description);function k(e,t){var a=(0,y.looseArrayify)((0,y.searchPath)(e,"crypto/ciphertext"));if((0,d.hexlify)((0,f.keccak256)((0,d.concat)([t.slice(16,32),a]))).substring(2)!==(0,y.searchPath)(e,"crypto/mac").toLowerCase())throw new Error("invalid password");var n=function(e,t,a){if("aes-128-ctr"===(0,y.searchPath)(e,"crypto/cipher")){var n=(0,y.looseArrayify)((0,y.searchPath)(e,"crypto/cipherparams/iv")),r=new l.default.Counter(n),s=new l.default.ModeOfOperation.ctr(t,r);return(0,d.arrayify)(s.decrypt(a))}return null}(e,t.slice(0,16),a);n||w.throwError("unsupported cipher",v.Logger.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});var r=t.slice(32,64),s=(0,_.computeAddress)(n);if(e.address){var o=e.address.toLowerCase();if("0x"!==o.substring(0,2)&&(o="0x"+o),(0,u.getAddress)(o)!==s)throw new Error("address mismatch")}var i={_isKeystoreAccount:!0,address:s,privateKey:(0,d.hexlify)(n)};if("0.1"===(0,y.searchPath)(e,"x-ethers/version")){var c=(0,y.looseArrayify)((0,y.searchPath)(e,"x-ethers/mnemonicCiphertext")),m=(0,y.looseArrayify)((0,y.searchPath)(e,"x-ethers/mnemonicCounter")),g=new l.default.Counter(m),h=new l.default.ModeOfOperation.ctr(r,g),E=(0,y.searchPath)(e,"x-ethers/path")||p.defaultPath,b=(0,y.searchPath)(e,"x-ethers/locale")||"en",k=(0,d.arrayify)(h.decrypt(c));try{var C=(0,p.entropyToMnemonic)(k,b),S=p.HDNode.fromMnemonic(C,null,b).derivePath(E);if(S.privateKey!=i.privateKey)throw new Error("mnemonic mismatch");i.mnemonic=S.mnemonic}catch(e){if(e.code!==v.Logger.errors.INVALID_ARGUMENT||"wordlist"!==e.argument)throw e}}return new T(i)}function C(e,t,a,n,r){return(0,d.arrayify)((0,m.pbkdf2)(e,t,a,n,r))}function S(e,t,a,n,r){return Promise.resolve(C(e,t,a,n,r))}function N(e,t,a,n,r){var s=(0,y.getPassword)(t),o=(0,y.searchPath)(e,"crypto/kdf");if(o&&"string"==typeof o){var i=function(e,t){return w.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===o.toLowerCase()){var l=(0,y.looseArrayify)((0,y.searchPath)(e,"crypto/kdfparams/salt")),c=parseInt((0,y.searchPath)(e,"crypto/kdfparams/n")),u=parseInt((0,y.searchPath)(e,"crypto/kdfparams/r")),d=parseInt((0,y.searchPath)(e,"crypto/kdfparams/p"));return c&&u&&d||i("kdf",o),0!=(c&c-1)&&i("N",c),32!==(m=parseInt((0,y.searchPath)(e,"crypto/kdfparams/dklen")))&&i("dklen",m),n(s,l,c,u,d,64,r)}if("pbkdf2"===o.toLowerCase()){l=(0,y.looseArrayify)((0,y.searchPath)(e,"crypto/kdfparams/salt"));var p=null,f=(0,y.searchPath)(e,"crypto/kdfparams/prf");"hmac-sha256"===f?p="sha256":"hmac-sha512"===f?p="sha512":i("prf",f);var m,g=parseInt((0,y.searchPath)(e,"crypto/kdfparams/c"));return 32!==(m=parseInt((0,y.searchPath)(e,"crypto/kdfparams/dklen")))&&i("dklen",m),a(s,l,g,m,p)}}return w.throwArgumentError("unsupported key-derivation function","kdf",o)}a.KeystoreAccount=T,a.decryptSync=function(e,t){var a=JSON.parse(e);return k(a,N(a,t,C,c.default.syncScrypt))},a.decrypt=function(e,t,a){return s(this,void 0,void 0,(function(){var n,r;return o(this,(function(s){switch(s.label){case 0:return[4,N(n=JSON.parse(e),t,S,c.default.scrypt,a)];case 1:return r=s.sent(),[2,k(n,r)]}}))}))},a.encrypt=function(e,t,a,n){try{if((0,u.getAddress)(e.address)!==(0,_.computeAddress)(e.privateKey))throw new Error("address/privateKey mismatch");if(b(e)){var r=e.mnemonic;if(p.HDNode.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path||p.defaultPath).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(e){return Promise.reject(e)}"function"!=typeof a||n||(n=a,a={}),a||(a={});var s=(0,d.arrayify)(e.privateKey),o=(0,y.getPassword)(t),i=null,m=null,h=null;if(b(e)){var v=e.mnemonic;i=(0,d.arrayify)((0,p.mnemonicToEntropy)(v.phrase,v.locale||"en")),m=v.path||p.defaultPath,h=v.locale||"en"}var E=a.client;E||(E="ethers.js");var w=null;w=a.salt?(0,d.arrayify)(a.salt):(0,g.randomBytes)(32);var T=null;if(a.iv){if(16!==(T=(0,d.arrayify)(a.iv)).length)throw new Error("invalid iv")}else T=(0,g.randomBytes)(16);var k=null;if(a.uuid){if(16!==(k=(0,d.arrayify)(a.uuid)).length)throw new Error("invalid uuid")}else k=(0,g.randomBytes)(16);var C=1<<17,S=8,N=1;return a.scrypt&&(a.scrypt.N&&(C=a.scrypt.N),a.scrypt.r&&(S=a.scrypt.r),a.scrypt.p&&(N=a.scrypt.p)),c.default.scrypt(o,w,C,S,N,64,n).then((function(t){var a=(t=(0,d.arrayify)(t)).slice(0,16),n=t.slice(16,32),r=t.slice(32,64),o=new l.default.Counter(T),c=new l.default.ModeOfOperation.ctr(a,o),u=(0,d.arrayify)(c.encrypt(s)),p=(0,f.keccak256)((0,d.concat)([n,u])),_={address:e.address.substring(2).toLowerCase(),id:(0,y.uuidV4)(k),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,d.hexlify)(T).substring(2)},ciphertext:(0,d.hexlify)(u).substring(2),kdf:"scrypt",kdfparams:{salt:(0,d.hexlify)(w).substring(2),n:C,dklen:32,p:N,r:S},mac:p.substring(2)}};if(i){var v=(0,g.randomBytes)(16),b=new l.default.Counter(v),O=new l.default.ModeOfOperation.ctr(r,b),x=(0,d.arrayify)(O.encrypt(i)),I=new Date,P=I.getUTCFullYear()+"-"+(0,y.zpad)(I.getUTCMonth()+1,2)+"-"+(0,y.zpad)(I.getUTCDate(),2)+"T"+(0,y.zpad)(I.getUTCHours(),2)+"-"+(0,y.zpad)(I.getUTCMinutes(),2)+"-"+(0,y.zpad)(I.getUTCSeconds(),2)+".0Z";_["x-ethers"]={client:E,gethFilename:"UTC--"+P+"--"+_.address,mnemonicCounter:(0,d.hexlify)(v).substring(2),mnemonicCiphertext:(0,d.hexlify)(x).substring(2),path:m,locale:h,version:"0.1"}}return JSON.stringify(_)}))}}}},{package:"@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>ethers>@ethersproject/json-wallets",file:"node_modules/@ethersproject/json-wallets/lib/keystore.js"}],[4360,{"../../../../app/_locales/index.json":2,"../../../../shared/constants/metametrics":3408,"../../../../shared/constants/preferences":3411,"../../../components/ui/dropdown":3928,"../../../components/ui/identicon/blockieIdenticon":3959,"../../../components/ui/jazzicon":3966,"../../../components/ui/toggle-button":4028,"../../../components/ui/typography":4039,"../../../helpers/constants/available-conversions.json":4067,"../../../helpers/constants/design-system":4070,"../../../helpers/utils/settings-search":4104,classnames:1980,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=y(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=_(e("prop-types")),s=_(e("classnames")),o=_(e("../../../helpers/constants/available-conversions.json")),i=e("../../../helpers/constants/design-system"),l=_(e("../../../components/ui/dropdown")),c=_(e("../../../components/ui/toggle-button")),u=_(e("../../../../app/_locales/index.json")),d=_(e("../../../components/ui/jazzicon")),p=_(e("../../../components/ui/identicon/blockieIdenticon")),f=_(e("../../../components/ui/typography")),m=e("../../../../shared/constants/metametrics"),g=e("../../../helpers/utils/settings-search"),h=e("../../../../shared/constants/preferences");function _(e){return e&&e.__esModule?e:{default:e}}function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(y=function(e){return e?a:t})(e)}function v(e,t,a){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(a!==undefined){var n=a.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const E=o.default.sort(((e,t)=>e.name.toLocaleLowerCase().localeCompare(t.name.toLocaleLowerCase()))).map((({code:e,name:t})=>({name:`${e.toUpperCase()} - ${t}`,value:e}))),w=u.default.map((e=>({name:`${e.name}`,value:e.code})));class b extends n.PureComponent{constructor(...e){super(...e),v(this,"settingsRefs",Array((0,g.getNumberOfSettingsInSection)(this.context.t,this.context.t("general"))).fill(undefined).map((()=>n.default.createRef())))}componentDidUpdate(){const{t:e}=this.context;(0,g.handleSettingsRefs)(e,e("general"),this.settingsRefs)}componentDidMount(){const{t:e}=this.context;(0,g.handleSettingsRefs)(e,e("general"),this.settingsRefs)}renderCurrentConversion(){const{t:e}=this.context,{currentCurrency:t,setCurrentCurrency:a,lastFetchedConversionDate:r}=this.props;return n.default.createElement("div",{ref:this.settingsRefs[0],className:"settings-page__content-row"},n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("span",null,e("currencyConversion")),n.default.createElement("span",{className:"settings-page__content-description"},r?e("updatedWithDate",[new Date(1e3*r).toString()]):e("noConversionDateAvailable"))),n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("div",{className:"settings-page__content-item-col"},n.default.createElement(l.default,{"data-testid":"currency-select",id:"select-currency",options:E,selectedOption:t,onChange:e=>a(e)}))))}renderCurrentLocale(){const{t:e}=this.context,{updateCurrentLocale:t,currentLocale:a}=this.props,r=u.default.find((e=>e.code===a)),s=r?r.name:"";return n.default.createElement("div",{ref:this.settingsRefs[2],className:"settings-page__content-row"},n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("span",{className:"settings-page__content-label"},e("currentLanguage")),n.default.createElement("span",{className:"settings-page__content-description"},s)),n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("div",{className:"settings-page__content-item-col"},n.default.createElement(l.default,{"data-testid":"locale-select",id:"select-locale",options:w,selectedOption:a,onChange:async e=>t(e)}))))}renderHideZeroBalanceTokensOptIn(){const{t:e}=this.context,{hideZeroBalanceTokens:t,setHideZeroBalanceTokens:a}=this.props;return n.default.createElement("div",{ref:this.settingsRefs[5],"data-testid":"hide-zero-balance-tokens",className:"settings-page__content-row",id:"toggle-zero-balance"},n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("span",null,e("hideZeroBalanceTokens"))),n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("div",{className:"settings-page__content-item-col"},n.default.createElement(c.default,{value:t,onToggle:e=>a(!e),offLabel:e("off"),onLabel:e("on")}))))}renderBlockieOptIn(){const{t:e}=this.context,{useBlockie:t,setUseBlockie:a,selectedAddress:r,tokenList:o}=this.props;return n.default.createElement("div",{ref:this.settingsRefs[4],className:"settings-page__content-row",id:"blockie-optin"},n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement(f.default,{variant:i.TypographyVariant.H5,color:i.TextColor.textDefault},e("accountIdenticon")),n.default.createElement("span",{className:"settings-page__content-item__description"},e("jazzAndBlockies")),n.default.createElement("div",{className:"settings-page__content-item__identicon"},n.default.createElement("button",{"data-testid":"jazz_icon",onClick:()=>a(!1),className:"settings-page__content-item__identicon__item"},n.default.createElement("div",{className:(0,s.default)("settings-page__content-item__identicon__item__icon",{"settings-page__content-item__identicon__item__icon--active":!t})},n.default.createElement(d.default,{id:"jazzicon",address:r,diameter:32,tokenList:o,style:{display:"block",borderRadius:"16px",width:"32px",height:"32px"}})),n.default.createElement(f.default,{color:i.TextColor.textDefault,variant:i.TypographyVariant.H7,marginTop:0,marginRight:12,marginBottom:0,marginLeft:3},e("jazzicons"))),n.default.createElement("button",{"data-testid":"blockie_icon",onClick:()=>a(!0),className:"settings-page__content-item__identicon__item"},n.default.createElement("div",{className:(0,s.default)("settings-page__content-item__identicon__item__icon",{"settings-page__content-item__identicon__item__icon--active":t})},n.default.createElement(p.default,{id:"blockies",address:r,diameter:32,borderRadius:"50%"})),n.default.createElement(f.default,{color:i.TextColor.textDefault,variant:i.TypographyVariant.H7,marginTop:3,marginRight:0,marginBottom:3,marginLeft:3},e("blockies"))))))}renderUsePrimaryCurrencyOptions(){const{t:e}=this.context,{nativeCurrency:t,setUseNativeCurrencyAsPrimaryCurrencyPreference:a,useNativeCurrencyAsPrimaryCurrency:r}=this.props;return n.default.createElement("div",{ref:this.settingsRefs[1],className:"settings-page__content-row"},n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("span",null,e("primaryCurrencySetting")),n.default.createElement("div",{className:"settings-page__content-description"},e("primaryCurrencySettingDescription"))),n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("div",{className:"settings-page__content-item-col"},n.default.createElement("div",{className:"settings-tab__radio-buttons"},n.default.createElement("div",{className:"settings-tab__radio-button"},n.default.createElement("input",{type:"radio","data-testid":"toggle-native-currency",id:"native-primary-currency",onChange:()=>a(!0),checked:Boolean(r)}),n.default.createElement("label",{htmlFor:"native-primary-currency",className:"settings-tab__radio-label"},t)),n.default.createElement("div",{className:"settings-tab__radio-button"},n.default.createElement("input",{type:"radio","data-testid":"toggle-fiat-currency",id:"fiat-primary-currency",onChange:()=>a(!1),checked:!r}),n.default.createElement("label",{htmlFor:"fiat-primary-currency",className:"settings-tab__radio-label"},e("fiat")))))))}renderTheme(){const{t:e}=this.context,{theme:t,setTheme:a}=this.props,r=[{name:e("lightTheme"),value:h.ThemeType.light},{name:e("darkTheme"),value:h.ThemeType.dark},{name:e("osTheme"),value:h.ThemeType.os}];return n.default.createElement("div",{ref:this.settingsRefs[3],className:"settings-page__content-row"},n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("span",null,this.context.t("theme")),n.default.createElement("div",{className:"settings-page__content-description"},this.context.t("themeDescription"))),n.default.createElement("div",{className:"settings-page__content-item"},n.default.createElement("div",{className:"settings-page__content-item-col"},n.default.createElement(l.default,{id:"select-theme",options:r,selectedOption:t,onChange:e=>{this.context.trackEvent({category:m.MetaMetricsEventCategory.Settings,event:"Theme Changed",properties:{theme_selected:e}}),a(e)}}))))}render(){const{warning:e}=this.props;return n.default.createElement("div",{className:"settings-page__body"},e?n.default.createElement("div",{className:"settings-tab__error"},e):null,this.renderCurrentConversion(),this.renderUsePrimaryCurrencyOptions(),this.renderCurrentLocale(),this.renderTheme(),this.renderBlockieOptIn(),this.renderHideZeroBalanceTokensOptIn())}}a.default=b,v(b,"contextTypes",{t:r.default.func,metricsEvent:r.default.func,trackEvent:r.default.func}),v(b,"propTypes",{setUseBlockie:r.default.func,setCurrentCurrency:r.default.func,warning:r.default.string,updateCurrentLocale:r.default.func,currentLocale:r.default.string,useBlockie:r.default.bool,currentCurrency:r.default.string,nativeCurrency:r.default.string,useNativeCurrencyAsPrimaryCurrency:r.default.bool,setUseNativeCurrencyAsPrimaryCurrencyPreference:r.default.func,hideZeroBalanceTokens:r.default.bool,setHideZeroBalanceTokens:r.default.func,lastFetchedConversionDate:r.default.number,selectedAddress:r.default.string,tokenList:r.default.object,theme:r.default.string,setTheme:r.default.func})}}},{package:"$root$",file:"ui/pages/settings/settings-tab/settings-tab.component.js"}],[4361,{"../../../selectors":4436,"../../../store/actions":4443,"./settings-tab.component":4360,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n,r=e("react-redux"),s=e("../../../store/actions"),o=e("../../../selectors"),i=(n=e("./settings-tab.component"))&&n.__esModule?n:{default:n};var l=(0,r.connect)(((e,t)=>{const{appState:{warning:a},metamask:n}=e,{currentCurrency:r,nativeCurrency:s,useBlockie:i,currentLocale:l,selectedAddress:c}=n,{useNativeCurrencyAsPrimaryCurrency:u,hideZeroBalanceTokens:d}=(0,o.getPreferences)(e),{lastFetchedConversionDate:p}=t;return{warning:a,currentLocale:l,currentCurrency:r,nativeCurrency:s,useBlockie:i,useNativeCurrencyAsPrimaryCurrency:u,hideZeroBalanceTokens:d,lastFetchedConversionDate:p,selectedAddress:c,tokenList:(0,o.getTokenList)(e),theme:(0,o.getTheme)(e)}}),(e=>({setCurrentCurrency:t=>e((0,s.setCurrentCurrency)(t)),setUseBlockie:t=>e((0,s.setUseBlockie)(t)),updateCurrentLocale:t=>e((0,s.updateCurrentLocale)(t)),setUseNativeCurrencyAsPrimaryCurrencyPreference:t=>e((0,s.setUseNativeCurrencyAsPrimaryCurrencyPreference)(t)),setParticipateInMetaMetrics:t=>e((0,s.setParticipateInMetaMetrics)(t)),setHideZeroBalanceTokens:t=>e((0,s.setHideZeroBalanceTokens)(t)),setTheme:t=>e((0,s.setTheme)(t))})))(i.default);a.default=l}}},{package:"$root$",file:"ui/pages/settings/settings-tab/settings-tab.container.js"}],[4362,{"../../components/app/add-network/add-network":3452,"../../components/app/tab-bar":3720,"../../components/component-library":3840,"../../components/component-library/icon/deprecated":3836,"../../helpers/constants/design-system":4070,"../../helpers/constants/routes":4074,"../../helpers/utils/settings-search":4104,"./advanced-tab":4316,"./alerts-tab":4318,"./contact-list-tab":4327,"./experimental-tab":4333,"./info-tab":4335,"./networks-tab":4339,"./security-tab":4352,"./settings-search":4357,"./settings-search-list":4355,"./settings-tab":4359,classnames:1980,"prop-types":3032,react:3177,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=C(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=k(e("prop-types")),s=e("react-router-dom"),o=k(e("classnames")),i=k(e("../../components/app/tab-bar")),l=e("../../helpers/constants/routes"),c=e("../../helpers/utils/settings-search"),u=k(e("../../components/app/add-network/add-network")),d=e("../../components/component-library"),p=e("../../components/component-library/icon/deprecated"),f=e("../../helpers/constants/design-system"),m=k(e("./settings-tab")),g=k(e("./alerts-tab")),h=k(e("./networks-tab")),_=k(e("./advanced-tab")),y=k(e("./info-tab")),v=k(e("./security-tab")),E=k(e("./contact-list-tab")),w=k(e("./experimental-tab")),b=k(e("./settings-search")),T=k(e("./settings-search-list"));function k(e){return e&&e.__esModule?e:{default:e}}function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(C=function(e){return e?a:t})(e)}function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},S.apply(this,arguments)}function N(e,t,a){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(a!==undefined){var n=a.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class O extends n.PureComponent{constructor(...e){super(...e),N(this,"state",{isSearchList:!1,lastFetchedConversionDate:null,searchResults:[],searchText:""})}componentDidMount(){this.handleConversionDate()}componentDidUpdate(){this.handleConversionDate()}handleConversionDate(){const{conversionDate:e}=this.props;null!==e&&this.setState({lastFetchedConversionDate:e})}handleClickSetting(e){const{history:t}=this.props;t.push(e.route),this.setState({isSearchList:"",searchResults:""})}render(){const{history:e,backRoute:t,currentPath:a,mostRecentOverviewPage:r,addNewNetwork:s,isSnapViewPage:i}=this.props,{searchResults:u,isSearchList:m,searchText:g}=this.state,{t:h}=this.context;return n.default.createElement("div",{className:(0,o.default)("main-container settings-page",{"settings-page--selected":a!==l.SETTINGS_ROUTE})},n.default.createElement("div",{className:"settings-page__header"},n.default.createElement("div",{className:"settings-page__header__title-container"},a!==l.SETTINGS_ROUTE&&n.default.createElement(d.ButtonIcon,{ariaLabel:h("back"),iconName:p.ICON_NAMES.ARROW_LEFT,className:"settings-page__back-button",color:f.Color.iconDefault,onClick:()=>e.push(t),display:[f.DISPLAY.FLEX,f.DISPLAY.NONE]}),this.renderTitle(),n.default.createElement("div",{className:"settings-page__header__title-container__close-button",onClick:()=>{s?e.push(l.NETWORKS_ROUTE):e.push(r)}})),n.default.createElement("div",{className:"settings-page__header__search"},n.default.createElement(b.default,{onSearch:({searchQuery:e="",results:t=[]})=>{this.setState({isSearchList:""!==e,searchResults:t,searchText:e})},settingsRoutesList:(0,c.getSettingsRoutes)()}),m&&g.length>=3&&n.default.createElement(T.default,{results:u,onClickSetting:e=>this.handleClickSetting(e)}))),n.default.createElement("div",{className:"settings-page__content"},n.default.createElement("div",{className:"settings-page__content__tabs"},this.renderTabs()),n.default.createElement("div",{className:"settings-page__content__modules"},i?null:this.renderSubHeader(),this.renderContent())))}renderTitle(){const{t:e}=this.context,{isPopup:t,pathnameI18nKey:a,addressName:r,isSnapViewPage:s}=this.props;let o;return o=e(s?"snaps":t&&r?"details":a&&t?a:"settings"),n.default.createElement("div",{className:"settings-page__header__title-container__title"},o)}renderSubHeader(){const{t:e}=this.context,{currentPath:t,isPopup:a,isAddressEntryPage:r,pathnameI18nKey:s,addressName:i,initialBreadCrumbRoute:c,breadCrumbTextKey:u,history:d,initialBreadCrumbKey:p}=this.props;let f;return f=e(a&&r?"settings":r?"contacts":p||(s||"general")),!t.startsWith(l.NETWORKS_ROUTE)&&n.default.createElement("div",{className:"settings-page__subheader"},n.default.createElement("div",{className:(0,o.default)({"settings-page__subheader--link":c}),onClick:()=>c&&d.push(c)},f),u&&n.default.createElement("div",{className:"settings-page__subheader--break"},n.default.createElement("span",null," > "),e(u)),r&&n.default.createElement("div",{className:"settings-page__subheader--break"},n.default.createElement("span",null," > "),i))}renderTabs(){const{history:e,currentPath:t}=this.props,{t:a}=this.context,r=[{content:a("general"),icon:n.default.createElement(p.Icon,{name:p.ICON_NAMES.SETTING}),key:l.GENERAL_ROUTE},{content:a("advanced"),icon:n.default.createElement("i",{className:"fas fa-sliders-h"}),key:l.ADVANCED_ROUTE},{content:a("contacts"),icon:n.default.createElement(p.Icon,{name:p.ICON_NAMES.BOOK}),key:l.CONTACT_LIST_ROUTE},{content:a("securityAndPrivacy"),icon:n.default.createElement("i",{className:"fa fa-lock"}),key:l.SECURITY_ROUTE},{content:a("alerts"),icon:n.default.createElement(p.Icon,{name:p.ICON_NAMES.NOTIFICATION}),key:l.ALERTS_ROUTE},{content:a("networks"),icon:n.default.createElement("i",{className:"fa fa-plug"}),key:l.NETWORKS_ROUTE},{content:a("experimental"),icon:n.default.createElement("i",{className:"fa fa-flask"}),key:l.EXPERIMENTAL_ROUTE},{content:a("about"),icon:n.default.createElement("i",{className:"fa fa-info-circle"}),key:l.ABOUT_US_ROUTE}];return n.default.createElement(i.default,{tabs:r,isActive:e=>e===l.GENERAL_ROUTE&&t===l.SETTINGS_ROUTE||(0,s.matchPath)(t,{exact:!0,path:e}),onSelect:t=>e.push(t)})}renderContent(){return n.default.createElement(s.Switch,null,n.default.createElement(s.Route,{exact:!0,path:l.GENERAL_ROUTE,render:e=>n.default.createElement(m.default,S({},e,{lastFetchedConversionDate:this.state.lastFetchedConversionDate}))}),n.default.createElement(s.Route,{exact:!0,path:l.ABOUT_US_ROUTE,component:y.default}),n.default.createElement(s.Route,{exact:!0,path:l.ADVANCED_ROUTE,component:_.default}),n.default.createElement(s.Route,{exact:!0,path:l.ALERTS_ROUTE,component:g.default}),n.default.createElement(s.Route,{exact:!0,path:l.ADD_NETWORK_ROUTE,render:()=>n.default.createElement(h.default,{addNewNetwork:!0})}),n.default.createElement(s.Route,{exact:!0,path:l.NETWORKS_ROUTE,render:()=>n.default.createElement(h.default,{addNewNetwork:!1})}),n.default.createElement(s.Route,{exact:!0,path:l.ADD_POPULAR_CUSTOM_NETWORK,render:()=>n.default.createElement(u.default,null)}),n.default.createElement(s.Route,{exact:!0,path:l.SECURITY_ROUTE,component:v.default}),n.default.createElement(s.Route,{exact:!0,path:l.EXPERIMENTAL_ROUTE,component:w.default}),n.default.createElement(s.Route,{exact:!0,path:l.CONTACT_LIST_ROUTE,component:E.default}),n.default.createElement(s.Route,{exact:!0,path:l.CONTACT_ADD_ROUTE,component:E.default}),n.default.createElement(s.Route,{exact:!0,path:`${l.CONTACT_EDIT_ROUTE}/:id`,component:E.default}),n.default.createElement(s.Route,{exact:!0,path:`${l.CONTACT_VIEW_ROUTE}/:id`,component:E.default}),n.default.createElement(s.Route,{render:e=>n.default.createElement(m.default,S({},e,{lastFetchedConversionDate:this.state.lastFetchedConversionDate}))}))}}N(O,"propTypes",{addNewNetwork:r.default.bool,addressName:r.default.string,backRoute:r.default.string,breadCrumbTextKey:r.default.string,conversionDate:r.default.number,currentPath:r.default.string,history:r.default.object,initialBreadCrumbKey:r.default.string,initialBreadCrumbRoute:r.default.string,isAddressEntryPage:r.default.bool,isPopup:r.default.bool,isSnapViewPage:r.default.bool,mostRecentOverviewPage:r.default.string.isRequired,pathnameI18nKey:r.default.string}),N(O,"contextTypes",{t:r.default.func});var x=O;a.default=x}}},{package:"$root$",file:"ui/pages/settings/settings.component.js"}],[4363,{"../../../app/scripts/lib/util":82,"../../../shared/constants/app":3401,"../../../shared/modules/hexstring-utils":3435,"../../ducks/history/history":4059,"../../helpers/constants/routes":4074,"../../selectors":4436,"./settings.component":4362,"react-redux":3130,"react-router-dom":3150,redux:3194},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n,r=e("redux"),s=e("react-redux"),o=e("react-router-dom"),i=e("../../selectors"),l=e("../../../shared/constants/app"),c=e("../../../app/scripts/lib/util"),u=e("../../ducks/history/history"),d=e("../../../shared/modules/hexstring-utils"),p=e("../../helpers/constants/routes"),f=(n=e("./settings.component"))&&n.__esModule?n:{default:n};const m={[p.ABOUT_US_ROUTE]:"about",[p.ADD_NETWORK_ROUTE]:"networks",[p.ADD_POPULAR_CUSTOM_NETWORK]:"addNetwork",[p.ADVANCED_ROUTE]:"advanced",[p.ALERTS_ROUTE]:"alerts",[p.CONTACT_ADD_ROUTE]:"newContact",[p.CONTACT_EDIT_ROUTE]:"editContact",[p.CONTACT_LIST_ROUTE]:"contacts",[p.CONTACT_VIEW_ROUTE]:"viewContact",[p.EXPERIMENTAL_ROUTE]:"experimental",[p.GENERAL_ROUTE]:"general",[p.NETWORKS_FORM_ROUTE]:"networks",[p.NETWORKS_ROUTE]:"networks",[p.SECURITY_ROUTE]:"securityAndPrivacy",[p.SNAPS_LIST_ROUTE]:"snaps",[p.SNAPS_VIEW_ROUTE]:"snaps"};var g=(0,r.compose)(o.withRouter,(0,s.connect)(((e,t)=>{const{location:a}=t,{pathname:n}=a,{metamask:{conversionDate:r}}=e,s=n.match(/[^/]+$/u)[0],o=s.includes("0x"),f=Boolean(n.match(p.SNAPS_VIEW_ROUTE)),g=Boolean(n.match(p.CONTACT_ADD_ROUTE)),h=Boolean(n.match(p.CONTACT_EDIT_ROUTE)),_=Boolean(n.match(p.NETWORKS_FORM_ROUTE))||Boolean(n.match(p.ADD_NETWORK_ROUTE)),y=Boolean(n.match(p.ADD_NETWORK_ROUTE)),v=Boolean(n.match(p.ADD_POPULAR_CUSTOM_NETWORK)),E=(0,c.getEnvironmentType)()===l.ENVIRONMENT_TYPE_POPUP,w=m[n];let b=p.SETTINGS_ROUTE;h?b=`${p.CONTACT_VIEW_ROUTE}/${s}`:o||g?b=p.CONTACT_LIST_ROUTE:_?b=p.NETWORKS_ROUTE:f?b=p.SNAPS_LIST_ROUTE:v&&(b=p.NETWORKS_ROUTE);return{addNewNetwork:y,addressName:(0,i.getAddressBookEntryOrAccountName)(e,!(0,d.isBurnAddress)(s)&&(0,d.isValidHexAddress)(s,{mixedCaseUseChecksum:!0})?s:""),backRoute:b,conversionDate:r,currentPath:n,initialBreadCrumbKey:undefined,initialBreadCrumbRoute:undefined,isAddressEntryPage:o,isPopup:E,isSnapViewPage:f,mostRecentOverviewPage:(0,u.getMostRecentOverviewPage)(e),pathnameI18nKey:w}})))(f.default);a.default=g}}},{package:"$root$",file:"ui/pages/settings/settings.container.js"}],[4364,{"../../../../shared/constants/metametrics":3408,"../../../components/ui/box":3900,"../../../components/ui/pulse-loader":4001,"../../../components/ui/typography":4039,"../../../contexts/i18n":4047,"../../../contexts/metametrics":4048,"../../../ducks/swaps/swaps":4066,"../../../helpers/constants/design-system":4070,"../../../helpers/constants/routes":4074,"../../../selectors/selectors":4439,"../swaps-footer":4418,"./swap-step-icon":4366,"lodash/isEqual":2918,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(){const e=(0,n.useContext)(i.I18nContext),t=(0,s.useHistory)(),a=(0,r.useDispatch)(),v=(0,r.useSelector)(l.getFetchParams,o.default),{destinationTokenInfo:E,sourceTokenInfo:w}=(null==v?void 0:v.metaData)||{},b=(0,r.useSelector)(l.getApproveTxParams,r.shallowEqual),T=(0,r.useSelector)(c.isHardwareWallet),k=(0,r.useSelector)(c.getHardwareWalletType),C=(0,r.useSelector)(l.getSmartTransactionsOptInStatus),S=(0,r.useSelector)(l.getSmartTransactionsEnabled),N=(0,r.useSelector)(l.getCurrentSmartTransactionsEnabled),O=Boolean(b),x=(0,n.useContext)(h.MetaMetricsContext);(0,n.useEffect)((()=>{x({event:"Awaiting Signature(s) on a HW wallet",category:_.MetaMetricsEventCategory.Swaps,sensitiveProperties:{needs_two_confirmations:O,token_from:null==w?void 0:w.symbol,token_from_amount:null==v?void 0:v.value,token_to:null==E?void 0:E.symbol,request_type:null!=v&&v.balanceError?"Quote":"Order",slippage:null==v?void 0:v.slippage,custom_slippage:2===(null==v?void 0:v.slippage),is_hardware_wallet:T,hardware_wallet_type:k,stx_enabled:S,current_stx_enabled:N,stx_user_opt_in:C}})}),[]);const I=e(O?"swapTwoTransactions":"swapConfirmWithHwWallet");return n.default.createElement("div",{className:"awaiting-signatures"},n.default.createElement(f.default,{paddingLeft:8,paddingRight:8,height:m.BLOCK_SIZES.FULL,justifyContent:m.JustifyContent.center,display:m.DISPLAY.FLEX,className:"awaiting-signatures__content"},n.default.createElement(f.default,{marginTop:3,marginBottom:4},n.default.createElement(d.default,null)),n.default.createElement(p.default,{color:m.TextColor.textDefault,variant:m.TypographyVariant.H3},I),O&&n.default.createElement(n.default.Fragment,null,n.default.createElement(p.default,{variant:m.TypographyVariant.paragraph,boxProps:{marginTop:2},fontWeight:m.FONT_WEIGHT.BOLD},e("swapToConfirmWithHwWallet")),n.default.createElement("ul",{className:"awaiting-signatures__steps"},n.default.createElement("li",null,n.default.createElement(y.default,{stepNumber:1}),e("swapAllowSwappingOf",[n.default.createElement(p.default,{as:"span",fontWeight:m.FONT_WEIGHT.BOLD,key:"allowToken"},null==E?void 0:E.symbol)])),n.default.createElement("li",null,n.default.createElement(y.default,{stepNumber:2}),e("swapFromTo",[n.default.createElement(p.default,{as:"span",fontWeight:m.FONT_WEIGHT.BOLD,key:"tokenFrom"},null==w?void 0:w.symbol),n.default.createElement(p.default,{as:"span",fontWeight:m.FONT_WEIGHT.BOLD,key:"tokenTo"},null==E?void 0:E.symbol)]))),n.default.createElement(p.default,{variant:m.TypographyVariant.paragraph},e("swapGasFeesSplit")))),n.default.createElement(g.default,{onSubmit:async()=>{await a((0,l.prepareToLeaveSwaps)()),t.push(u.DEFAULT_ROUTE),t.push(u.BUILD_QUOTE_ROUTE)},submitText:e("cancel"),hideCancel:!0}))};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=E(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=e("react-redux"),s=e("react-router-dom"),o=v(e("lodash/isEqual")),i=e("../../../contexts/i18n"),l=e("../../../ducks/swaps/swaps"),c=e("../../../selectors/selectors"),u=e("../../../helpers/constants/routes"),d=v(e("../../../components/ui/pulse-loader")),p=v(e("../../../components/ui/typography")),f=v(e("../../../components/ui/box")),m=e("../../../helpers/constants/design-system"),g=v(e("../swaps-footer")),h=e("../../../contexts/metametrics"),_=e("../../../../shared/constants/metametrics"),y=v(e("./swap-step-icon"));function v(e){return e&&e.__esModule?e:{default:e}}function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(E=function(e){return e?a:t})(e)}}}},{package:"$root$",file:"ui/pages/swaps/awaiting-signatures/awaiting-signatures.js"}],[4365,{"./awaiting-signatures":4364},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./awaiting-signatures"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/awaiting-signatures/index.js"}],[4366,{"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=o;var n=s(e("react")),r=s(e("prop-types"));function s(e){return e&&e.__esModule?e:{default:e}}function o({stepNumber:e=1}){switch(e){case 1:return n.default.createElement("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.default.createElement("circle",{cx:"7",cy:"7",r:"6.25",stroke:"var(--color-primary-default)",strokeWidth:"1.5"}),n.default.createElement("path",{d:"M6.50983 5.192H5.27783L6.14183 4H7.71783V9.68H6.50983V5.192Z",fill:"var(--color-primary-default)"}));case 2:return n.default.createElement("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.default.createElement("circle",{cx:"7",cy:"7",r:"6.25",stroke:"var(--color-primary-default)",strokeWidth:"1.5"}),n.default.createElement("path",{d:"M8.92 9.776H5V9.368C5 9.048 5.056 8.77067 5.168 8.536C5.28 8.296 5.42133 8.08533 5.592 7.904C5.768 7.71733 5.96267 7.54933 6.176 7.4C6.39467 7.25067 6.608 7.10133 6.816 6.952C6.928 6.872 7.03467 6.78933 7.136 6.704C7.24267 6.61867 7.33333 6.53067 7.408 6.44C7.488 6.34933 7.552 6.256 7.6 6.16C7.648 6.064 7.672 5.96533 7.672 5.864C7.672 5.67733 7.616 5.52 7.504 5.392C7.39733 5.25867 7.22933 5.192 7 5.192C6.88267 5.192 6.776 5.21333 6.68 5.256C6.584 5.29333 6.50133 5.344 6.432 5.408C6.368 5.472 6.31733 5.54667 6.28 5.632C6.248 5.71733 6.232 5.808 6.232 5.904H5.024C5.024 5.62667 5.07467 5.37067 5.176 5.136C5.27733 4.90133 5.41867 4.70133 5.6 4.536C5.78133 4.36533 5.99467 4.23467 6.24 4.144C6.48533 4.048 6.752 4 7.04 4C7.28 4 7.50933 4.03733 7.728 4.112C7.952 4.18667 8.14933 4.29867 8.32 4.448C8.49067 4.59733 8.62667 4.784 8.728 5.008C8.82933 5.22667 8.88 5.48267 8.88 5.776C8.88 6.032 8.85067 6.25867 8.792 6.456C8.73333 6.648 8.65067 6.824 8.544 6.984C8.44267 7.13867 8.32 7.28 8.176 7.408C8.032 7.536 7.87733 7.66133 7.712 7.784C7.64267 7.832 7.55733 7.888 7.456 7.952C7.36 8.016 7.26133 8.08267 7.16 8.152C7.064 8.22133 6.97333 8.29333 6.888 8.368C6.80267 8.44267 6.74133 8.51467 6.704 8.584H8.92V9.776Z",fill:"var(--color-primary-default)"}));default:return undefined}}o.propTypes={stepNumber:r.default.number}}}},{package:"$root$",file:"ui/pages/swaps/awaiting-signatures/swap-step-icon.js"}],[4367,{"../../../../shared/constants/metametrics":3408,"../../../../shared/constants/swaps":3413,"../../../../shared/lib/ui-utils":3426,"../../../../shared/modules/swaps.utils":3443,"../../../components/ui/mascot":3979,"../../../components/ui/pulse-loader":4001,"../../../contexts/i18n":4047,"../../../contexts/metametrics":4048,"../../../ducks/swaps/swaps":4066,"../../../helpers/constants/routes":4074,"../../../selectors":4436,"../../../store/actions":4443,"../create-new-swap":4378,"../swaps-footer":4418,"../swaps.util":4420,"../view-on-block-explorer":4421,"./quotes-timeout-icon":4369,"./swap-failure-icon":4370,"./swap-success-icon":4371,"@metamask/etherscan-link":1221,events:1944,"lodash/isEqual":2918,"prop-types":3032,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=P;var n=I(e("events")),r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=x(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),s=e("react-redux"),o=I(e("prop-types")),i=e("react-router-dom"),l=I(e("lodash/isEqual")),c=e("@metamask/etherscan-link"),u=e("../../../contexts/i18n"),d=e("../../../contexts/metametrics"),p=e("../../../../shared/constants/metametrics"),f=e("../../../selectors"),m=e("../../../ducks/swaps/swaps"),g=I(e("../../../components/ui/mascot")),h=e("../../../../shared/constants/swaps"),_=e("../../../../shared/modules/swaps.utils"),y=I(e("../../../components/ui/pulse-loader")),v=e("../../../helpers/constants/routes"),E=e("../../../store/actions"),w=e("../swaps.util"),b=I(e("../swaps-footer")),T=I(e("../create-new-swap")),k=I(e("../view-on-block-explorer")),C=e("../../../../shared/lib/ui-utils"),S=I(e("./swap-failure-icon")),N=I(e("./swap-success-icon")),O=I(e("./quotes-timeout-icon"));function x(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(x=function(e){return e?a:t})(e)}function I(e){return e&&e.__esModule?e:{default:e}}function P({swapComplete:e,errorKey:t,txHash:a,tokensReceived:o,submittingSwap:x,txId:I}){const P=(0,r.useContext)(u.I18nContext),M=(0,r.useContext)(d.MetaMetricsContext),A=(0,i.useHistory)(),R=(0,s.useDispatch)(),D=(0,r.useRef)(new n.default),{swapMetaData:j}=(0,s.useSelector)((e=>(0,f.getFullTxData)(e,I)))||{},L=(0,s.useSelector)(m.getFetchParams,l.default),F=(0,s.useSelector)(m.getFromTokenInputValue),U=(0,s.useSelector)(m.getMaxSlippage),W=(0,s.useSelector)(m.getUsedQuote,l.default),q=(0,s.useSelector)(m.getApproveTxParams,s.shallowEqual),B=(0,s.useSelector)(m.getUsedSwapsGasPrice),H=(0,s.useSelector)(f.getCurrentCurrency),G=(0,s.useSelector)(f.getUSDConversionRate),$=(0,s.useSelector)(f.getCurrentChainId),K=(0,s.useSelector)(f.getRpcPrefsForCurrentProvider,s.shallowEqual),[V,Q]=(0,r.useState)(!1);let Y;if(W&&B){var Z;Y=(0,w.getRenderableNetworkFeesForQuote)({tradeGas:W.gasEstimateWithRefund||W.averageGas,approveGas:(null==q?void 0:q.gas)||"0x0",gasPrice:B,currentCurrency:H,conversionRate:G,tradeValue:null==W||null===(Z=W.trade)||void 0===Z?void 0:Z.value,sourceSymbol:null==j?void 0:j.token_from,sourceAmount:W.sourceAmount,chainId:$}).rawNetworkFees}const z=(0,s.useSelector)(f.isHardwareWallet),X=(0,s.useSelector)(f.getHardwareWalletType),J=(0,s.useSelector)(m.getSmartTransactionsOptInStatus),ee=(0,s.useSelector)(m.getSmartTransactionsEnabled),te=(0,s.useSelector)(m.getCurrentSmartTransactionsEnabled),ae={token_from:null==j?void 0:j.token_from,token_from_amount:null==j?void 0:j.token_from_amount,token_to:null==j?void 0:j.token_to,request_type:null!=L&&L.balanceError?"Quote":"Order",slippage:null==j?void 0:j.slippage,custom_slippage:2===(null==j?void 0:j.slippage),gas_fees:Y,is_hardware_wallet:z,hardware_wallet_type:X,stx_enabled:ee,current_stx_enabled:te,stx_user_opt_in:J},ne=K.blockExplorerUrl??h.SWAPS_CHAINID_DEFAULT_BLOCK_EXPLORER_URL_MAP[$]??null,re=(0,c.getBlockExplorerLink)({hash:a,chainId:$},{blockExplorerUrl:ne});let se,oe,ie,le,ce;return t===h.OFFLINE_FOR_MAINTENANCE?(se=P("offlineForMaintenance"),ie=P("metamaskSwapsOfflineDescription"),le=P("close"),oe=r.default.createElement(S.default,null)):t===h.SWAP_FAILED_ERROR?(se=P("swapFailedErrorTitle"),ie=P("swapFailedErrorDescriptionWithSupportLink",[r.default.createElement("a",{className:"awaiting-swap__support-link",key:"awaiting-swap-support-link",href:C.SUPPORT_LINK,target:"_blank",rel:"noopener noreferrer",onClick:()=>{M({category:p.MetaMetricsEventCategory.Swaps,event:p.MetaMetricsEventName.SupportLinkClicked,properties:{url:C.SUPPORT_LINK}},{contextPropsIntoEventProperties:[p.MetaMetricsContextProp.PageTitle]})}},new URL(C.SUPPORT_LINK).hostname)]),le=P("tryAgain"),oe=r.default.createElement(S.default,null),ce=re&&r.default.createElement(k.default,{blockExplorerUrl:re,sensitiveTrackingProperties:ae})):t===h.QUOTES_EXPIRED_ERROR?(se=P("swapQuotesExpiredErrorTitle"),ie=P("swapQuotesExpiredErrorDescription"),le=P("tryAgain"),oe=r.default.createElement(O.default,null),V||(Q(!0),M({event:"Quotes Timed Out",category:p.MetaMetricsEventCategory.Swaps,sensitiveProperties:ae}))):t===h.ERROR_FETCHING_QUOTES?(se=P("swapFetchingQuotesErrorTitle"),ie=P("swapFetchingQuotesErrorDescription"),le=P("back"),oe=r.default.createElement(S.default,null)):t===h.QUOTES_NOT_AVAILABLE_ERROR?(se=P("swapQuotesNotAvailableErrorTitle"),ie=P("swapQuotesNotAvailableErrorDescription"),le=P("tryAgain"),oe=r.default.createElement(S.default,null)):t===h.CONTRACT_DATA_DISABLED_ERROR?(se=P("swapContractDataDisabledErrorTitle"),ie=P("swapContractDataDisabledErrorDescription"),le=P("tryAgain"),oe=r.default.createElement(S.default,null)):t||e?!t&&e&&(se=P("swapTransactionComplete"),oe=r.default.createElement(N.default,null),le=P("close"),ie=P("swapTokenAvailable",[r.default.createElement("span",{key:"swapTokenAvailable-2",className:"awaiting-swap__amount-and-symbol"},`${o||""} ${null==j?void 0:j.token_to}`)]),ce=re&&r.default.createElement(k.default,{blockExplorerUrl:re,sensitiveTrackingProperties:ae})):(se=P("swapProcessing"),oe=r.default.createElement(y.default,null),le=P("swapsViewInActivity"),ie=P("swapOnceTransactionHasProcess",[r.default.createElement("span",{key:"swapOnceTransactionHasProcess-1",className:"awaiting-swap__amount-and-symbol"},null==j?void 0:j.token_to)]),ce=re&&r.default.createElement(k.default,{blockExplorerUrl:re,sensitiveTrackingProperties:ae})),(0,r.useEffect)((()=>{t&&R((0,E.stopPollingForQuotes)())}),[R,t]),r.default.createElement("div",{className:"awaiting-swap"},r.default.createElement("div",{className:"awaiting-swap__content"},!(e||t)&&r.default.createElement(g.default,{animationEventEmitter:D.current,width:"90",height:"90"}),r.default.createElement("div",{className:"awaiting-swap__status-image"},oe),r.default.createElement("div",{className:"awaiting-swap__header"},se),r.default.createElement("div",{className:"awaiting-swap__main-description"},ie),ce),!t&&e?r.default.createElement(T.default,{sensitiveTrackingProperties:ae}):null,r.default.createElement(b.default,{onSubmit:async()=>{t===h.OFFLINE_FOR_MAINTENANCE?(await R((0,m.prepareToLeaveSwaps)()),A.push(v.DEFAULT_ROUTE)):t===h.QUOTES_EXPIRED_ERROR?(R((0,m.prepareForRetryGetQuotes)()),await R((0,m.fetchQuotesAndSetQuoteState)(A,F,U,M))):t?await R((0,m.navigateBackToBuildQuote)(A)):((0,_.isSwapsDefaultTokenSymbol)(null==j?void 0:j.token_to,$)||e||await R((0,E.setDefaultHomeActiveTabName)("activity")),A.push(v.DEFAULT_ROUTE))},onCancel:async()=>await R((0,m.navigateBackToBuildQuote)(A)),submitText:le,disabled:x,hideCancel:t!==h.QUOTES_EXPIRED_ERROR}))}P.propTypes={swapComplete:o.default.bool,txHash:o.default.string,tokensReceived:o.default.string,errorKey:o.default.oneOf([h.QUOTES_EXPIRED_ERROR,h.SWAP_FAILED_ERROR,h.ERROR_FETCHING_QUOTES,h.QUOTES_NOT_AVAILABLE_ERROR,h.OFFLINE_FOR_MAINTENANCE,h.CONTRACT_DATA_DISABLED_ERROR]),submittingSwap:o.default.bool,txId:o.default.number}}}},{package:"$root$",file:"ui/pages/swaps/awaiting-swap/awaiting-swap.js"}],[4368,{"./awaiting-swap":4367},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./awaiting-swap"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/awaiting-swap/index.js"}],[4369,{react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(){return r.default.createElement("svg",{width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.default.createElement("path",{d:"M22 0C9.96768 0 0.178406 9.78928 0.178406 21.8216C0.178406 33.8539 9.96768 43.6432 22 43.6432C34.0323 43.6432 43.8216 33.8539 43.8216 21.8216C43.8216 9.78929 34.0323 0 22 0ZM22 3.27324C32.2633 3.27324 40.5484 11.5583 40.5484 21.8216C40.5484 32.0849 32.2633 40.3699 22 40.3699C11.7367 40.3699 3.45164 32.0849 3.45164 21.8216C3.45164 11.5583 11.7367 3.27324 22 3.27324ZM22 6.00094C21.0961 6.00094 20.3634 6.73371 20.3634 7.63756V21.8216C20.3634 22.4269 20.6932 22.9534 21.1817 23.2366L32.5187 29.783C33.3014 30.235 34.3001 29.9692 34.752 29.1864C35.2039 28.4036 34.938 27.405 34.1553 26.953L23.6366 20.8839V7.63756C23.6366 6.73371 22.9039 6.00094 22 6.00094Z",fill:"var(--color-primary-default)"}))};var n,r=(n=e("react"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/awaiting-swap/quotes-timeout-icon.js"}],[437,{"@ethersproject/bytes":413,"@ethersproject/strings":486},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.uuidV4=a.searchPath=a.getPassword=a.zpad=a.looseArrayify=void 0;var n=e("@ethersproject/bytes"),r=e("@ethersproject/strings");a.looseArrayify=function(e){return"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),(0,n.arrayify)(e)},a.zpad=function(e,t){for(e=String(e);e.length<t;)e="0"+e;return e},a.getPassword=function(e){return"string"==typeof e?(0,r.toUtf8Bytes)(e,r.UnicodeNormalizationForm.NFKC):(0,n.arrayify)(e)},a.searchPath=function(e,t){for(var a=e,n=t.toLowerCase().split("/"),r=0;r<n.length;r++){var s=null;for(var o in a)if(o.toLowerCase()===n[r]){s=a[o];break}if(null===s)return null;a=s}return a},a.uuidV4=function(e){var t=(0,n.arrayify)(e);t[6]=15&t[6]|64,t[8]=63&t[8]|128;var a=(0,n.hexlify)(t);return[a.substring(2,10),a.substring(10,14),a.substring(14,18),a.substring(18,22),a.substring(22,34)].join("-")}}}},{package:"@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>ethers>@ethersproject/json-wallets",file:"node_modules/@ethersproject/json-wallets/lib/utils.js"}],[4370,{react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(){return r.default.createElement("svg",{width:"45",height:"39",viewBox:"0 0 45 39",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.default.createElement("path",{d:"M22.203 0.424438L0.285706 38.2816H44.1203L22.203 0.424438ZM22.203 8.39436L37.2064 34.2966H7.19961L22.203 8.39436ZM20.2105 16.3643V24.3342H24.1955V16.3643H20.2105ZM20.2105 28.3192V32.3041H24.1955V28.3192",fill:"var(--color-error-default)"}))};var n,r=(n=e("react"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/awaiting-swap/swap-failure-icon.js"}],[4371,{react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(){return r.default.createElement("svg",{width:"38",height:"38",viewBox:"0 0 38 38",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.default.createElement("path",{d:"M34.1429 19C34.1429 23.0161 32.5474 26.8678 29.7076 29.7076C26.8678 32.5474 23.0161 34.1428 19 34.1428C14.9839 34.1428 11.1322 32.5474 8.29238 29.7076C5.45254 26.8678 3.85714 23.0161 3.85714 19C3.85714 14.9838 5.45254 11.1322 8.29238 8.29237C11.1322 5.45253 14.9839 3.85713 19 3.85713C20.4386 3.85713 21.8393 4.06534 23.1643 4.44391L26.1361 1.47213C23.9404 0.563554 21.5364 0.0714111 19 0.0714111C16.5143 0.0714111 14.0529 0.561013 11.7563 1.51226C9.45983 2.46351 7.37316 3.85778 5.61548 5.61546C2.06568 9.16526 0.0714264 13.9798 0.0714264 19C0.0714264 24.0201 2.06568 28.8347 5.61548 32.3845C7.37316 34.1422 9.45983 35.5364 11.7563 36.4877C14.0529 37.4389 16.5143 37.9286 19 37.9286C24.0202 37.9286 28.8347 35.9343 32.3845 32.3845C35.9343 28.8347 37.9286 24.0201 37.9286 19H34.1429ZM11.2582 15.3657L8.58928 18.0536L17.1071 26.5714L36.0357 7.64284L33.3668 4.95498L17.1071 21.2146L11.2582 15.3657Z",fill:"var(--color-success-default)"}))};var n,r=(n=e("react"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/awaiting-swap/swap-success-icon.js"}],[4372,{"../../../../shared/constants/metametrics":3408,"../../../../shared/constants/swaps":3413,"../../../../shared/lib/swaps-utils":3422,"../../../../shared/lib/token-util.ts":3424,"../../../../shared/lib/transactions-controller-utils":3425,"../../../../shared/modules/conversion.utils":3431,"../../../../shared/modules/string-utils":3442,"../../../../shared/modules/swaps.utils":3443,"../../../components/ui/actionable-message/actionable-message":3896,"../../../components/ui/box":3900,"../../../components/ui/button":3904,"../../../components/ui/info-tooltip":3963,"../../../components/ui/popover":3999,"../../../components/ui/typography":4039,"../../../contexts/i18n":4047,"../../../contexts/metametrics":4048,"../../../ducks/metamask/metamask":4062,"../../../ducks/swaps/swaps":4066,"../../../helpers/constants/design-system":4070,"../../../helpers/constants/routes":4074,"../../../helpers/utils/util":4108,"../../../hooks/useEqualityCheck":4126,"../../../hooks/useEthFiatAmount":4127,"../../../hooks/usePrevious":4133,"../../../hooks/useTokenFiatAmount":4144,"../../../hooks/useTokenTracker":4145,"../../../hooks/useTokensToSearch":4146,"../../../selectors":4436,"../../../store/actions":4443,"../dropdown-input-pair":4380,"../dropdown-search-list":4382,"../slippage-buttons":4408,"../swaps-footer":4418,"../swaps.util":4420,"@metamask/etherscan-link":1221,"bignumber.js":1853,classnames:1980,lodash:2932,"prop-types":3032,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=Y;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=K(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=$(e("bignumber.js")),s=$(e("prop-types")),o=e("react-redux"),i=$(e("classnames")),l=e("lodash"),c=e("react-router-dom"),u=e("@metamask/etherscan-link"),d=e("../../../contexts/metametrics"),p=e("../../../hooks/useTokensToSearch"),f=e("../../../hooks/useEqualityCheck"),m=e("../../../contexts/i18n"),g=$(e("../dropdown-input-pair")),h=$(e("../dropdown-search-list")),_=$(e("../slippage-buttons")),y=e("../../../ducks/metamask/metamask"),v=$(e("../../../components/ui/info-tooltip")),E=$(e("../../../components/ui/popover")),w=$(e("../../../components/ui/button")),b=$(e("../../../components/ui/actionable-message/actionable-message")),T=$(e("../../../components/ui/box")),k=$(e("../../../components/ui/typography")),C=e("../../../helpers/constants/design-system"),S=e("../../../helpers/constants/routes"),N=e("../../../ducks/swaps/swaps"),O=e("../../../selectors"),x=e("../../../helpers/utils/util"),I=e("../../../hooks/usePrevious"),P=e("../../../hooks/useTokenTracker"),M=e("../../../hooks/useTokenFiatAmount"),A=e("../../../hooks/useEthFiatAmount"),R=e("../../../../shared/modules/swaps.utils"),D=e("../../../../shared/constants/metametrics"),j=e("../../../../shared/constants/swaps"),L=e("../../../store/actions"),F=e("../swaps.util"),U=$(e("../swaps-footer")),W=e("../../../../shared/modules/string-utils"),q=e("../../../../shared/lib/transactions-controller-utils"),B=e("../../../../shared/lib/token-util.ts"),H=e("../../../../shared/lib/swaps-utils"),G=e("../../../../shared/modules/conversion.utils");function $(e){return e&&e.__esModule?e:{default:e}}function K(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(K=function(e){return e?a:t})(e)}const V=[{name:"name",weight:.499},{name:"symbol",weight:.499},{name:"address",weight:.002}];let Q;function Y({ethBalance:e,selectedAccountAddress:t,shuffledTokensList:a}){var s;const $=(0,n.useContext)(m.I18nContext),K=(0,o.useDispatch)(),Y=(0,c.useHistory)(),Z=(0,n.useContext)(d.MetaMetricsContext),[z,X]=(0,n.useState)(undefined),[J,ee]=(0,n.useState)(!1),te=(0,o.useSelector)(N.getIsFeatureFlagLoaded),ae=(0,o.useSelector)(N.getBalanceError),ne=(0,o.useSelector)(N.getFetchParams,l.isEqual),{sourceTokenInfo:re={},destinationTokenInfo:se={}}=(null==ne?void 0:ne.metaData)||{},oe=(0,o.useSelector)(y.getTokens,l.isEqual),ie=(0,o.useSelector)(N.getTopAssets,l.isEqual),le=(0,o.useSelector)(N.getFromToken,l.isEqual),ce=(0,o.useSelector)(N.getFromTokenInputValue),ue=(0,o.useSelector)(N.getFromTokenError),de=(0,o.useSelector)(N.getMaxSlippage),pe=(0,o.useSelector)(N.getToToken,l.isEqual)||se,fe=(0,o.useSelector)(O.getSwapsDefaultToken,l.isEqual),me=(0,o.useSelector)(O.getCurrentChainId),ge=(0,o.useSelector)(O.getRpcPrefsForCurrentProvider,o.shallowEqual),he=(0,o.useSelector)(O.getTokenList,l.isEqual),_e=(0,o.useSelector)(N.getQuotes,l.isEqual),ye=Object.keys(_e).length>0,ve=(0,o.useSelector)(O.getTokenExchangeRates,l.isEqual),Ee=(0,o.useSelector)(y.getConversionRate),we=(0,o.useSelector)(O.getUseCurrencyRateCheck),be=(0,o.useSelector)(O.isHardwareWallet),Te=(0,o.useSelector)(O.getHardwareWalletType),ke=(0,o.useSelector)(N.getSmartTransactionsOptInStatus),Ce=(0,o.useSelector)(N.getSmartTransactionsEnabled),Se=(0,o.useSelector)(N.getCurrentSmartTransactionsEnabled),Ne=(0,o.useSelector)(N.getSmartTransactionFees),Oe=ke!==undefined,xe=(0,o.useSelector)(N.getCurrentSmartTransactionsError),Ie=(0,o.useSelector)(O.getCurrentCurrency),Pe=Ce&&!Oe,Me=(0,R.isSwapsDefaultTokenSymbol)(null==re?void 0:re.symbol,me)?fe:re,{loading:Ae,tokensWithBalances:Re}=(0,P.useTokenTracker)(oe),De=!(0,R.isSwapsDefaultTokenSymbol)(null==le?void 0:le.symbol,me)&&null!=le&&le.balance?[le]:[],je=(0,l.uniqBy)([...Re,...oe,...De],"address"),Le=(0,f.useEqualityCheck)(je),Fe=(0,p.getRenderableTokenData)(le||Me,ve,Ee,Ie,me,he),Ue=(0,p.useTokensToSearch)({usersTokens:Le,topTokens:ie,shuffledTokensList:a,tokenBucketPriority:j.TokenBucketPriority.owned}),We=(0,p.useTokensToSearch)({usersTokens:Le,topTokens:ie,shuffledTokensList:a,tokenBucketPriority:j.TokenBucketPriority.top}),qe=Ue.find((({address:e})=>(0,W.isEqualCaseInsensitive)(e,null==pe?void 0:pe.address)))||pe,Be=(null==qe?void 0:qe.address)&&!(0,R.isSwapsDefaultTokenAddress)(null==qe?void 0:qe.address,me),He=Number((null==qe?void 0:qe.occurances)||(null==qe?void 0:qe.occurrences)||0),{address:Ge,symbol:$e,string:Ke,decimals:Ve,balance:Qe}=Fe||{},{address:Ye}=qe||{},Ze=Qe&&(0,q.calcTokenAmount)(Qe,Ve).toString(10),ze=(0,I.usePrevious)(Ze),Xe=(0,M.useTokenFiatAmount)(Ge,ce||0,$e,{showFiat:we},!0),Je=(0,A.useEthFiatAmount)(ce||0,{showFiat:we},!0),et=(0,R.isSwapsDefaultTokenSymbol)($e,me)?Je:Xe,tt=(0,n.useCallback)(((e,t)=>{K((0,N.setFromTokenInputValue)(e));const a=new r.default(e||0).gt(t||0);ae!==a&&K((0,N.setBalanceError)(a)),K((0,N.setFromTokenError)(le&&(0,F.countDecimals)(e)>le.decimals?"tooManyDecimals":null))}),[K,le,ae]),at=e=>{null!=e&&e.address&&!et&&null!==z?(0,F.fetchTokenPrice)(e.address).then((e=>{null!==e&&e!==undefined&&X(e)})):X(null),null!=e&&e.address&&!Le.find((t=>(0,W.isEqualCaseInsensitive)(t.address,e.address)))&&(0,B.fetchTokenBalance)(e.address,t,global.ethereumProvider).then((t=>{if(null!=t&&t.balance){const a=t.balance.toString(10),n=(0,q.calcTokenAmount)(a,e.decimals);K((0,N.setSwapsFromToken)({...e,string:n.toString(10),balance:a}))}})),K((0,N.setSwapsFromToken)(e)),tt(null!=e&&e.address?ce:"",e.string,e.decimals)},nt=(0,u.getTokenTrackerLink)(qe.address,me,null,null,{blockExplorerUrl:j.SWAPS_CHAINID_DEFAULT_BLOCK_EXPLORER_URL_MAP[me]??null}),rt=ge.blockExplorerUrl?(0,x.getURLHostName)(nt):$("etherscan"),{destinationTokenAddedForSwap:st}=ne||{},{address:ot}=pe||{},it=(0,n.useCallback)((e=>{st&&e.address!==ot&&K((0,L.ignoreTokens)({tokensToIgnore:ot,dontShowLoadingIndicator:!0})),K((0,N.setSwapToToken)(e)),ee(!1)}),[K,st,ot]),lt=(0,n.useCallback)((e=>(0,W.isEqualCaseInsensitive)(e.address,Ge)),[Ge]),ct=Re.find((e=>(0,W.isEqualCaseInsensitive)(e.address,null==le?void 0:le.address))),ut=(0,I.usePrevious)(ct);(0,n.useEffect)((()=>{const e=!(0,R.isSwapsDefaultTokenAddress)(null==ct?void 0:ct.address,me),t=(0,W.isEqualCaseInsensitive)(null==ct?void 0:ct.address,null==ut?void 0:ut.address),a=(null==ct?void 0:ct.balance)!==(null==ut?void 0:ut.balance);e&&t&&a&&K((0,N.setSwapsFromToken)({...le,balance:null==ct?void 0:ct.balance,string:null==ct?void 0:ct.string}))}),[K,ct,ut,le,me]),(0,n.useEffect)((()=>{(0,R.isSwapsDefaultTokenAddress)(null==le?void 0:le.address,me)&&(null==le?void 0:le.balance)!==(0,G.hexToDecimal)(e)&&K((0,N.setSwapsFromToken)({...le,balance:(0,G.hexToDecimal)(e),string:(0,G.getValueFromWeiHex)({value:e,numberOfDecimals:4,toDenomination:"ETH"})}))}),[K,le,e,me]),(0,n.useEffect)((()=>{ze!==Ze&&tt(ce,Ze)}),[tt,ze,ce,Ze]);const dt=(0,n.useCallback)((()=>{Z({event:"Build Quote Page Loaded",category:D.MetaMetricsEventCategory.Swaps,sensitiveProperties:{is_hardware_wallet:be,hardware_wallet_type:Te,stx_enabled:Ce,current_stx_enabled:Se,stx_user_opt_in:ke}})}),[Z,be,Te,Ce,Se,ke]);(0,n.useEffect)((()=>{K((0,L.resetSwapsPostFetchState)()),K((0,N.setReviewSwapClickedTimestamp)()),dt()}),[K,dt]),(0,n.useEffect)((()=>{Ce&&null!=Ne&&Ne.tradeTxFees&&(0,L.clearSmartTransactionFees)()}),[Ce,Ne]);const pt=()=>n.default.createElement("a",{className:"build-quote__token-etherscan-link build-quote__underline",key:"build-quote-etherscan-link",onClick:()=>{Z({event:D.MetaMetricsEventName.ExternalLinkClicked,category:D.MetaMetricsEventCategory.Swaps,properties:{link_type:D.MetaMetricsEventLinkType.TokenTracker,location:"Swaps Confirmation",url_domain:(0,x.getURLHostName)(nt)}}),global.platform.openTab({url:nt})},target:"_blank",rel:"noopener noreferrer"},rt);let ft="";nt&&(1===He?ft=$("verifyThisTokenOn",[n.default.createElement(pt,{key:"block-explorer-link"})]):0===He&&(ft=$("verifyThisUnconfirmedTokenOn",[n.default.createElement(pt,{key:"block-explorer-link"})])));const mt=$("swapYourTokenBalance",[Ke||"0",$e||(null===(s=j.SWAPS_CHAINID_DEFAULT_TOKEN_MAP[me])||void 0===s?void 0:s.symbol)||""]),gt=(0,H.shouldEnableDirectWrapping)(me,Ge,qe.address),ht=ue||!te||!Number(ce)||!(null!=qe&&qe.address)||!Ge||Number(de)<0||Number(de)>15||Be&&He<2&&!J;return(0,n.useEffect)((()=>{K((0,L.clearSwapsQuotes)()),K((0,L.stopPollingForQuotes)());return Q=setTimeout((()=>{Q=null,ht||(async()=>{await K((0,N.fetchQuotesAndSetQuoteState)(Y,ce,de,Z,!0))})()}),1e3),()=>clearTimeout(Q)}),[K,Y,de,Z,ht,ce,Ge,Ye,ke]),n.default.createElement("div",{className:"build-quote"},n.default.createElement("div",{className:"build-quote__content"},Pe&&n.default.createElement(E.default,{title:$("stxAreHere"),footer:n.default.createElement(n.default.Fragment,null,n.default.createElement(w.default,{type:"primary",onClick:()=>(0,L.setSmartTransactionsOptInStatus)(!0,ke)},$("enableSmartTransactions")),n.default.createElement(T.default,{marginTop:1},n.default.createElement(k.default,{variant:C.TypographyVariant.H6},n.default.createElement(w.default,{type:"link",onClick:e=>{null==e||e.preventDefault(),(0,L.setSmartTransactionsOptInStatus)(!1,ke)},className:"smart-transactions-popover__no-thanks-link"},$("noThanksVariant2"))))),footerClassName:"smart-transactions-popover__footer",className:"smart-transactions-popover"},n.default.createElement(T.default,{paddingRight:6,paddingLeft:6,paddingTop:0,paddingBottom:0,display:C.DISPLAY.FLEX,className:"smart-transactions-popover__content"},n.default.createElement(T.default,{marginTop:0,marginBottom:4,display:C.DISPLAY.FLEX,flexDirection:C.FLEX_DIRECTION.COLUMN},n.default.createElement("img",{src:"./images/logo/smart-transactions-header.png",alt:$("swapSwapSwitch")})),n.default.createElement(k.default,{variant:C.TypographyVariant.H7,marginTop:0},$("stxDescription")),n.default.createElement(k.default,{as:"ul",variant:C.TypographyVariant.H7,fontWeight:C.FONT_WEIGHT.BOLD,marginTop:3},n.default.createElement("li",null,$("stxBenefit1")),n.default.createElement("li",null,$("stxBenefit2")),n.default.createElement("li",null,$("stxBenefit3")),n.default.createElement("li",null,$("stxBenefit4"),n.default.createElement(k.default,{as:"span",fontWeight:C.FONT_WEIGHT.NORMAL,variant:C.TypographyVariant.H7}," *"))),n.default.createElement(k.default,{variant:C.TypographyVariant.H8,color:C.TextColor.textAlternative,boxProps:{marginTop:3}},$("stxSubDescription")," ",n.default.createElement(k.default,{as:"span",fontWeight:C.FONT_WEIGHT.BOLD,variant:C.TypographyVariant.H8,color:C.TextColor.textAlternative},$("stxYouCanOptOut")," ")))),n.default.createElement("div",{className:"build-quote__dropdown-input-pair-header"},n.default.createElement("div",{className:"build-quote__input-label"},$("swapSwapFrom")),!(0,R.isSwapsDefaultTokenSymbol)($e,me)&&n.default.createElement("div",{className:"build-quote__max-button","data-testid":"build-quote__max-button",onClick:()=>tt(Ze||"0",Ze)},$("max"))),n.default.createElement(g.default,{onSelect:at,itemsToSearch:Ue,onInputChange:e=>{tt(e,Ze)},inputValue:ce,leftValue:ce&&et,selectedItem:Fe,maxListItems:30,loading:Ae&&(!(null!=Ue&&Ue.length)||!ie||!Object.keys(ie).length),selectPlaceHolderText:$("swapSelect"),hideItemIf:e=>(0,W.isEqualCaseInsensitive)(e.address,null==qe?void 0:qe.address),listContainerClassName:"build-quote__open-dropdown",autoFocus:!0}),n.default.createElement("div",{className:(0,i.default)("build-quote__balance-message",{"build-quote__balance-message--error":ae||ue})},!ue&&!ae&&$e&&mt,!ue&&ae&&$e&&n.default.createElement("div",{className:"build-quite__insufficient-funds"},n.default.createElement("div",{className:"build-quite__insufficient-funds-first"},$("swapsNotEnoughForTx",[$e])),n.default.createElement("div",{className:"build-quite__insufficient-funds-second"},mt)),ue&&n.default.createElement(n.default.Fragment,null,n.default.createElement("div",{className:"build-quote__form-error"},$("swapTooManyDecimalsError",[$e,Ve])),n.default.createElement("div",null,mt))),n.default.createElement("div",{className:"build-quote__swap-arrows-row"},n.default.createElement("button",{className:"build-quote__swap-arrows","data-testid":"build-quote__swap-arrows",onClick:()=>{it(Fe),at(qe)}},n.default.createElement("i",{className:"fa fa-arrow-up",title:$("swapSwapSwitch")}),n.default.createElement("i",{className:"fa fa-arrow-down",title:$("swapSwapSwitch")}))),n.default.createElement("div",{className:"build-quote__dropdown-swap-to-header"},n.default.createElement("div",{className:"build-quote__input-label"},$("swapSwapTo"))),n.default.createElement("div",{className:"dropdown-input-pair dropdown-input-pair__to"},n.default.createElement(h.default,{startingItem:qe,itemsToSearch:We,fuseSearchKeys:V,selectPlaceHolderText:$("swapSelectAToken"),maxListItems:30,onSelect:it,loading:Ae&&(!(null!=We&&We.length)||!ie||!Object.keys(ie).length),externallySelectedItem:qe,hideItemIf:lt,listContainerClassName:"build-quote__open-to-dropdown",hideRightLabels:!0,defaultToAll:!0,shouldSearchForImports:!0})),Be&&(He<2?n.default.createElement(b.default,{type:1===He?"warning":"danger",message:n.default.createElement("div",{className:"build-quote__token-verification-warning-message"},n.default.createElement("div",{className:"build-quote__bold"},$(1===He?"swapTokenVerificationOnlyOneSource":"swapTokenVerificationAddedManually")),n.default.createElement("div",null,ft)),primaryAction:J?null:{label:$("continue"),onClick:()=>ee(!0)},withRightButton:!0,infoTooltipText:nt&&$("swapVerifyTokenExplanation",[rt])}):n.default.createElement("div",{className:"build-quote__token-message"},n.default.createElement("span",{className:"build-quote__bold",key:"token-verification-bold-text"},$("swapTokenVerificationSources",[He])),nt&&n.default.createElement(n.default.Fragment,null,$("swapTokenVerificationMessage",[n.default.createElement("a",{className:"build-quote__token-etherscan-link",key:"build-quote-etherscan-link",onClick:()=>{Z({event:"Clicked Block Explorer Link",category:D.MetaMetricsEventCategory.Swaps,properties:{link_type:"Token Tracker",action:"Swaps Confirmation",block_explorer_domain:(0,x.getURLHostName)(nt)}}),global.platform.openTab({url:nt})},target:"_blank",rel:"noopener noreferrer"},rt)]),n.default.createElement(v.default,{position:"top",contentText:$("swapVerifyTokenExplanation",[rt]),containerClassName:"build-quote__token-tooltip-container",key:"token-verification-info-tooltip"})))),(Ce||!Ce&&!gt)&&n.default.createElement("div",{className:"build-quote__slippage-buttons-container"},n.default.createElement(_.default,{onSelect:e=>{K((0,N.setMaxSlippage)(e))},maxAllowedSlippage:15,currentSlippage:de,smartTransactionsEnabled:Ce,smartTransactionsOptInStatus:ke,setSmartTransactionsOptInStatus:L.setSmartTransactionsOptInStatus,currentSmartTransactionsError:xe,isDirectWrappingEnabled:gt}))),n.default.createElement(U.default,{onSubmit:async()=>{K((0,N.setReviewSwapClickedTimestamp)(Date.now())),Q?(clearTimeout(Q),K((0,N.fetchQuotesAndSetQuoteState)(Y,ce,de,Z))):ye?Y.push(S.VIEW_QUOTE_ROUTE):(await K((0,L.setBackgroundSwapRouteState)("loading")),Y.push(S.LOADING_QUOTES_ROUTE))},submitText:$("swapReviewSwap"),disabled:ht,hideCancel:!0,showTermsOfService:!0}))}Y.propTypes={ethBalance:s.default.string,selectedAccountAddress:s.default.string,shuffledTokensList:s.default.array}}}},{package:"$root$",file:"ui/pages/swaps/build-quote/build-quote.js"}],[4373,{"./build-quote":4372},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./build-quote"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/build-quote/index.js"}],[4374,{"../../../../shared/constants/time":3415,"../../../components/ui/info-tooltip":3963,"../../../contexts/i18n":4047,"../../../ducks/swaps/swaps":4066,"./timer-icon":4376,classnames:1980,luxon:2947,"prop-types":3032,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=y;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=m(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=e("react-redux"),s=f(e("prop-types")),o=f(e("classnames")),i=e("luxon"),l=e("../../../contexts/i18n"),c=f(e("../../../components/ui/info-tooltip")),u=e("../../../ducks/swaps/swaps"),d=e("../../../../shared/constants/time"),p=f(e("./timer-icon"));function f(e){return e&&e.__esModule?e:{default:e}}function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(m=function(e){return e?a:t})(e)}function g(e,t,a){return a-(e-t)}function h(e){return Math.max(e-d.SECOND,0)}function _(e,t){const[a,n]=t.split(":");return e<=(60*Number(a)+Number(n))*d.SECOND}function y({timeStarted:e,timeOnly:t,timerBase:a,warningTime:s,labelKey:f,infoTooltipLabelKey:m}){const y=(0,n.useContext)(l.I18nContext),v=(0,n.useRef)(),E=(0,n.useRef)(),w=(0,r.useSelector)(u.getSwapsQuoteRefreshTime),b=(0,r.useSelector)(u.getSwapsQuotePrefetchingRefreshTime),T=E.current?w:b,k=Number(a)||T,[C,S]=(0,n.useState)((()=>Date.now())),[N,O]=(0,n.useState)((()=>g(C,e,k)));(0,n.useEffect)((()=>(v.current===undefined&&(v.current=setInterval((()=>{O(h)}),d.SECOND)),function(){clearInterval(v.current)})),[]),(0,n.useEffect)((()=>{if(E.current||(E.current=e||Date.now()),0===N&&e!==E.current){E.current=e;const t=Date.now();S(t),O(g(t,e,k)),clearInterval(v.current),v.current=setInterval((()=>{O(h)}),d.SECOND)}}),[e,N,k]);const x=i.Duration.fromMillis(N).toFormat("m:ss");let I;return t?I=n.default.createElement("div",{className:"countdown-timer__time"},x):f&&(I=y(f,[n.default.createElement("div",{key:"countdown-time-1",className:"countdown-timer__time"},x)])),n.default.createElement("div",{className:"countdown-timer"},n.default.createElement("div",{"data-testid":"countdown-timer__timer-container",className:(0,o.default)("countdown-timer__timer-container",{"countdown-timer__timer-container--warning":s&&_(N,s)})},n.default.createElement(p.default,null),I),!t&&m?n.default.createElement(c.default,{position:"bottom",contentText:y(m)}):null)}y.propTypes={timeStarted:s.default.number,timeOnly:s.default.bool,timerBase:s.default.number,warningTime:s.default.string,labelKey:s.default.string,infoTooltipLabelKey:s.default.string}}}},{package:"$root$",file:"ui/pages/swaps/countdown-timer/countdown-timer.js"}],[4375,{"./countdown-timer":4374},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./countdown-timer"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/countdown-timer/index.js"}],[4376,{react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(){return r.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.default.createElement("path",{d:"M7.49835 0.510498C3.75226 0.510498 0.717102 3.54565 0.717102 7.29175C0.717102 11.0378 3.75226 14.073 7.49835 14.073C11.2444 14.073 14.2796 11.0378 14.2796 7.29175C14.2796 3.54565 11.2444 0.510498 7.49835 0.510498ZM7.49835 12.7605C4.4632 12.7605 2.0296 10.3269 2.0296 7.29175C2.0296 4.28394 4.4632 1.823 7.49835 1.823C10.5062 1.823 12.9671 4.28394 12.9671 7.29175C12.9671 10.3269 10.5062 12.7605 7.49835 12.7605ZM9.16632 9.91675C9.33038 10.0261 9.52179 9.99878 9.63116 9.83472L10.1507 9.15112C10.2601 8.98706 10.2327 8.79565 10.0687 8.68628L8.26398 7.34644V3.46362C8.26398 3.29956 8.09991 3.1355 7.93585 3.1355H7.06085C6.86945 3.1355 6.73273 3.29956 6.73273 3.46362V7.97534C6.73273 8.05737 6.76007 8.16675 6.8421 8.22144L9.16632 9.91675Z",fill:"var(--color-primary-default)"}))};var n,r=(n=e("react"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/countdown-timer/timer-icon.js"}],[4377,{"../../../../shared/constants/metametrics":3408,"../../../components/ui/box":3900,"../../../contexts/i18n":4047,"../../../contexts/metametrics":4048,"../../../ducks/swaps/swaps":4066,"../../../helpers/constants/routes":4074,"../../../selectors":4436,"lodash/isEqual":2918,"prop-types":3032,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=_;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=h(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=e("react-redux"),s=g(e("prop-types")),o=e("react-router-dom"),i=g(e("lodash/isEqual")),l=g(e("../../../components/ui/box")),c=e("../../../contexts/i18n"),u=e("../../../contexts/metametrics"),d=e("../../../../shared/constants/metametrics"),p=e("../../../ducks/swaps/swaps"),f=e("../../../helpers/constants/routes"),m=e("../../../selectors");function g(e){return e&&e.__esModule?e:{default:e}}function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(h=function(e){return e?a:t})(e)}function _({sensitiveTrackingProperties:e}){const t=(0,n.useContext)(c.I18nContext),a=(0,n.useContext)(u.MetaMetricsContext),s=(0,r.useDispatch)(),g=(0,o.useHistory)(),h=(0,r.useSelector)(m.getSwapsDefaultToken,i.default);return n.default.createElement(l.default,{marginBottom:3,className:"create-new-swap"},n.default.createElement("button",{onClick:async()=>{a({event:"Make Another Swap",category:d.MetaMetricsEventCategory.Swaps,sensitiveProperties:e}),g.push(f.DEFAULT_ROUTE),await s((0,p.navigateBackToBuildQuote)(g)),s((0,p.setSwapsFromToken)(h))}},t("makeAnotherSwap")))}_.propTypes={sensitiveTrackingProperties:s.default.object.isRequired}}}},{package:"$root$",file:"ui/pages/swaps/create-new-swap/create-new-swap.js"}],[4378,{"./create-new-swap":4377},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./create-new-swap"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/create-new-swap/index.js"}],[4379,{"../../../components/ui/text-field":4025,"../dropdown-search-list":4382,classnames:1980,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=d;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=c(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=l(e("prop-types")),s=l(e("classnames")),o=l(e("../dropdown-search-list")),i=l(e("../../../components/ui/text-field"));function l(e){return e&&e.__esModule?e:{default:e}}function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(c=function(e){return e?a:t})(e)}const u={1:5.86,2:10.05,3:10.45,4:11.1,5:10,6:10.06,7:9.17,8:10.28,9:10.06,0:11.22,".":4.55};function d({itemsToSearch:e=[],onInputChange:t,inputValue:a="",onSelect:r,leftValue:l,selectedItem:c,SearchListPlaceholder:d,maxListItems:p,selectPlaceHolderText:f,loading:m,hideItemIf:g,listContainerClassName:h,autoFocus:_}){const[y,v]=(0,n.useState)(!1),E=(0,n.useRef)(),[w,b]=(0,n.useState)(null);return(0,n.useEffect)((()=>{var e,t;b(((null==E||null===(e=E.current)||void 0===e||null===(t=e.getBoundingClientRect())||void 0===t?void 0:t.width)||0)+String(a||"").split("").reduce(((e,t)=>e+u[t]),12)>137)}),[a,E]),n.default.createElement("div",{className:"dropdown-input-pair"},n.default.createElement(o.default,{itemsToSearch:e,SearchListPlaceholder:d,fuseSearchKeys:[{name:"name",weight:.499},{name:"symbol",weight:.499},{name:"address",weight:.002}],maxListItems:p,onOpen:()=>v(!0),onClose:()=>v(!1),onSelect:r,className:y?"dropdown-input-pair__list--full-width":"",externallySelectedItem:c,selectPlaceHolderText:f,selectorClosedClassName:"dropdown-input-pair__selector--closed",listContainerClassName:h,loading:m,hideItemIf:g,defaultToAll:!0}),!y&&n.default.createElement(i.default,{className:(0,s.default)("dropdown-input-pair__input",{"dropdown-input-pair__two-line-input":w}),type:"text",placeholder:"0",onChange:e=>{e.stopPropagation();const n="."===e.target.value?"0.":e.target.value;""===n||/^(\.\d+|\d+(\.\d+)?|\d+\.)$/u.test(n)?t(n):t(a||"")},fullWidth:!0,margin:"dense",value:a,autoFocus:_}),!y&&l&&n.default.createElement("div",{className:(0,s.default)("dropdown-input-pair__left-value",{"dropdown-input-pair__left-value--two-lines":w}),ref:E},"≈ ",l))}d.propTypes={itemsToSearch:r.default.array,onInputChange:r.default.func,inputValue:r.default.oneOfType([r.default.number,r.default.string]),onSelect:r.default.func,leftValue:r.default.string,selectedItem:r.default.object,SearchListPlaceholder:r.default.func,maxListItems:r.default.number,selectPlaceHolderText:r.default.string,loading:r.default.bool,hideItemIf:r.default.func,listContainerClassName:r.default.string,autoFocus:r.default.bool}}}},{package:"$root$",file:"ui/pages/swaps/dropdown-input-pair/dropdown-input-pair.js"}],[438,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){!function(e){function n(e){return parseInt(e)===e}function r(e){if(!n(e.length))return!1;for(var t=0;t<e.length;t++)if(!n(e[t])||e[t]<0||e[t]>255)return!1;return!0}function s(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!r(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(n(e.length)&&r(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function o(e){return new Uint8Array(e)}function i(e,t,a,n,r){null==n&&null==r||(e=e.slice?e.slice(n,r):Array.prototype.slice.call(e,n,r)),t.set(e,a)}var l,c={toBytes:function(e){var t=[],a=0;for(e=encodeURI(e);a<e.length;){var n=e.charCodeAt(a++);37===n?(t.push(parseInt(e.substr(a,2),16)),a+=2):t.push(n)}return s(t)},fromBytes:function(e){for(var t=[],a=0;a<e.length;){var n=e[a];n<128?(t.push(String.fromCharCode(n)),a++):n>191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[a+1])),a+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[a+1])<<6|63&e[a+2])),a+=3)}return t.join("")}},u=(l="0123456789abcdef",{toBytes:function(e){for(var t=[],a=0;a<e.length;a+=2)t.push(parseInt(e.substr(a,2),16));return t},fromBytes:function(e){for(var t=[],a=0;a<e.length;a++){var n=e[a];t.push(l[(240&n)>>4]+l[15&n])}return t.join("")}}),d={16:10,24:12,32:14},p=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],f=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],m=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],g=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],h=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],_=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],y=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],v=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],E=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],w=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],b=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],T=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],k=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],C=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],S=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function N(e){for(var t=[],a=0;a<e.length;a+=4)t.push(e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3]);return t}var O=function(e){if(!(this instanceof O))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:s(e,!0)}),this._prepare()};O.prototype._prepare=function(){var e=d[this.key.length];if(null==e)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var a,n=4*(e+1),r=this.key.length/4,s=N(this.key);for(t=0;t<r;t++)a=t>>2,this._Ke[a][t%4]=s[t],this._Kd[e-a][t%4]=s[t];for(var o,i=0,l=r;l<n;){if(o=s[r-1],s[0]^=f[o>>16&255]<<24^f[o>>8&255]<<16^f[255&o]<<8^f[o>>24&255]^p[i]<<24,i+=1,8!=r)for(t=1;t<r;t++)s[t]^=s[t-1];else{for(t=1;t<r/2;t++)s[t]^=s[t-1];o=s[r/2-1],s[r/2]^=f[255&o]^f[o>>8&255]<<8^f[o>>16&255]<<16^f[o>>24&255]<<24;for(t=r/2+1;t<r;t++)s[t]^=s[t-1]}for(t=0;t<r&&l<n;)c=l>>2,u=l%4,this._Ke[c][u]=s[t],this._Kd[e-c][u]=s[t++],l++}for(var c=1;c<e;c++)for(var u=0;u<4;u++)o=this._Kd[c][u],this._Kd[c][u]=T[o>>24&255]^k[o>>16&255]^C[o>>8&255]^S[255&o]},O.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,a=[0,0,0,0],n=N(e),r=0;r<4;r++)n[r]^=this._Ke[0][r];for(var s=1;s<t;s++){for(r=0;r<4;r++)a[r]=g[n[r]>>24&255]^h[n[(r+1)%4]>>16&255]^_[n[(r+2)%4]>>8&255]^y[255&n[(r+3)%4]]^this._Ke[s][r];n=a.slice()}var i,l=o(16);for(r=0;r<4;r++)i=this._Ke[t][r],l[4*r]=255&(f[n[r]>>24&255]^i>>24),l[4*r+1]=255&(f[n[(r+1)%4]>>16&255]^i>>16),l[4*r+2]=255&(f[n[(r+2)%4]>>8&255]^i>>8),l[4*r+3]=255&(f[255&n[(r+3)%4]]^i);return l},O.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,a=[0,0,0,0],n=N(e),r=0;r<4;r++)n[r]^=this._Kd[0][r];for(var s=1;s<t;s++){for(r=0;r<4;r++)a[r]=v[n[r]>>24&255]^E[n[(r+3)%4]>>16&255]^w[n[(r+2)%4]>>8&255]^b[255&n[(r+1)%4]]^this._Kd[s][r];n=a.slice()}var i,l=o(16);for(r=0;r<4;r++)i=this._Kd[t][r],l[4*r]=255&(m[n[r]>>24&255]^i>>24),l[4*r+1]=255&(m[n[(r+3)%4]>>16&255]^i>>16),l[4*r+2]=255&(m[n[(r+2)%4]>>8&255]^i>>8),l[4*r+3]=255&(m[255&n[(r+1)%4]]^i);return l};var x=function(e){if(!(this instanceof x))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new O(e)};x.prototype.encrypt=function(e){if((e=s(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),a=o(16),n=0;n<e.length;n+=16)i(e,a,0,n,n+16),i(a=this._aes.encrypt(a),t,n);return t},x.prototype.decrypt=function(e){if((e=s(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=o(e.length),a=o(16),n=0;n<e.length;n+=16)i(e,a,0,n,n+16),i(a=this._aes.decrypt(a),t,n);return t};var I=function(e,t){if(!(this instanceof I))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=o(16);this._lastCipherblock=s(t,!0),this._aes=new O(e)};I.prototype.encrypt=function(e){if((e=s(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),a=o(16),n=0;n<e.length;n+=16){i(e,a,0,n,n+16);for(var r=0;r<16;r++)a[r]^=this._lastCipherblock[r];this._lastCipherblock=this._aes.encrypt(a),i(this._lastCipherblock,t,n)}return t},I.prototype.decrypt=function(e){if((e=s(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=o(e.length),a=o(16),n=0;n<e.length;n+=16){i(e,a,0,n,n+16),a=this._aes.decrypt(a);for(var r=0;r<16;r++)t[n+r]=a[r]^this._lastCipherblock[r];i(e,this._lastCipherblock,0,n,n+16)}return t};var P=function(e,t,a){if(!(this instanceof P))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 size)")}else t=o(16);a||(a=1),this.segmentSize=a,this._shiftRegister=s(t,!0),this._aes=new O(e)};P.prototype.encrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var t,a=s(e,!0),n=0;n<a.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var r=0;r<this.segmentSize;r++)a[n+r]^=t[r];i(this._shiftRegister,this._shiftRegister,0,this.segmentSize),i(a,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return a},P.prototype.decrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var t,a=s(e,!0),n=0;n<a.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var r=0;r<this.segmentSize;r++)a[n+r]^=t[r];i(this._shiftRegister,this._shiftRegister,0,this.segmentSize),i(e,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return a};var M=function(e,t){if(!(this instanceof M))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=o(16);this._lastPrecipher=s(t,!0),this._lastPrecipherIndex=16,this._aes=new O(e)};M.prototype.encrypt=function(e){for(var t=s(e,!0),a=0;a<t.length;a++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),t[a]^=this._lastPrecipher[this._lastPrecipherIndex++];return t},M.prototype.decrypt=M.prototype.encrypt;var A=function(e){if(!(this instanceof A))throw Error("Counter must be instanitated with `new`");0===e||e||(e=1),"number"==typeof e?(this._counter=o(16),this.setValue(e)):this.setBytes(e)};A.prototype.setValue=function(e){if("number"!=typeof e||parseInt(e)!=e)throw new Error("invalid counter value (must be an integer)");for(var t=15;t>=0;--t)this._counter[t]=e%256,e>>=8},A.prototype.setBytes=function(e){if(16!=(e=s(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},A.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var R=function(e,t){if(!(this instanceof R))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof A||(t=new A(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new O(e)};R.prototype.encrypt=function(e){for(var t=s(e,!0),a=0;a<t.length;a++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),t[a]^=this._remainingCounter[this._remainingCounterIndex++];return t},R.prototype.decrypt=R.prototype.encrypt;var D={AES:O,Counter:A,ModeOfOperation:{ecb:x,cbc:I,cfb:P,ofb:M,ctr:R},utils:{hex:u,utf8:c},padding:{pkcs7:{pad:function(e){var t=16-(e=s(e,!0)).length%16,a=o(e.length+t);i(e,a);for(var n=e.length;n<a.length;n++)a[n]=t;return a},strip:function(e){if((e=s(e,!0)).length<16)throw new Error("PKCS#7 invalid length");var t=e[e.length-1];if(t>16)throw new Error("PKCS#7 padding byte out of range");for(var a=e.length-t,n=0;n<t;n++)if(e[a+n]!==t)throw new Error("PKCS#7 invalid padding byte");var r=o(a);return i(e,r,0,0,a),r}}},_arrayTest:{coerceArray:s,createArray:o,copyArray:i}};void 0!==a?t.exports=D:"function"==typeof define&&define.amd?define(D):(e.aesjs&&(D._aesjs=e.aesjs),e.aesjs=D)}(this)}}},{package:"@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>ethers>@ethersproject/json-wallets>aes-js",file:"node_modules/@ethersproject/json-wallets/node_modules/aes-js/index.js"}],[4380,{"./dropdown-input-pair":4379},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./dropdown-input-pair"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/dropdown-input-pair/index.js"}],[4381,{"../../../../shared/constants/metametrics":3408,"../../../../shared/constants/swaps":3413,"../../../components/ui/actionable-message/actionable-message":3896,"../../../components/ui/pulse-loader":4001,"../../../components/ui/url-icon":4044,"../../../contexts/i18n":4047,"../../../contexts/metametrics":4048,"../../../ducks/swaps/swaps":4066,"../../../helpers/utils/util":4108,"../../../selectors/selectors":4439,"../import-token":4388,"../searchable-item-list":4395,classnames:1980,lodash:2932,"prop-types":3032,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=b;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=w(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=e("react-redux"),s=E(e("prop-types")),o=E(e("classnames")),i=e("lodash"),l=e("../../../contexts/i18n"),c=E(e("../searchable-item-list")),u=E(e("../../../components/ui/pulse-loader")),d=E(e("../../../components/ui/url-icon")),p=E(e("../../../components/ui/actionable-message/actionable-message")),f=E(e("../import-token")),m=e("../../../selectors/selectors"),g=e("../../../../shared/constants/swaps"),h=e("../../../helpers/utils/util"),_=e("../../../ducks/swaps/swaps"),y=e("../../../contexts/metametrics"),v=e("../../../../shared/constants/metametrics");function E(e){return e&&e.__esModule?e:{default:e}}function w(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(w=function(e){return e?a:t})(e)}function b({searchListClassName:e,itemsToSearch:t,selectPlaceHolderText:a,fuseSearchKeys:s,defaultToAll:E,maxListItems:w,onSelect:b,startingItem:T,onOpen:k,onClose:C,className:S="",externallySelectedItem:N,selectorClosedClassName:O,loading:x,hideRightLabels:I,hideItemIf:P,listContainerClassName:M,shouldSearchForImports:A}){const R=(0,n.useContext)(l.I18nContext),[D,j]=(0,n.useState)(!1),[L,F]=(0,n.useState)(!1),[U,W]=(0,n.useState)(T),[q,B]=(0,n.useState)(null),[H,G]=(0,n.useState)(""),$=(0,r.useSelector)(m.isHardwareWallet),K=(0,r.useSelector)(m.getHardwareWalletType),V=(0,r.useSelector)(m.getCurrentChainId),Q=(0,r.useSelector)(m.getRpcPrefsForCurrentProvider),Y=(0,r.useSelector)(_.getSmartTransactionsOptInStatus),Z=(0,r.useSelector)(_.getSmartTransactionsEnabled),z=(0,r.useSelector)(_.getCurrentSmartTransactionsEnabled),X=(0,n.useContext)(y.MetaMetricsContext),J=(0,n.useCallback)((()=>{j(!1),null==C||C()}),[C]),ee=(0,n.useCallback)((e=>{null==b||b(e),W(e),J()}),[b,J]),te=(0,n.useCallback)((()=>{D||(j(!0),null==k||k())}),[D,k]),ae=(0,n.useRef)();(0,n.useEffect)((()=>{ae.current=N}));const ne=ae.current;(0,n.useEffect)((()=>{N&&!(0,i.isEqual)(N,U)?W(N):ne&&!N&&W(null)}),[N,U,ne]);const re=Q.blockExplorerUrl??g.SWAPS_CHAINID_DEFAULT_BLOCK_EXPLORER_URL_MAP[V]??null,se=(0,h.getURLHostName)(re),oe={onImportTokenCloseClick:()=>{F(!1),J()},onImportTokenClick:()=>{X({event:"Token Imported",category:v.MetaMetricsEventCategory.Swaps,sensitiveProperties:{symbol:null==q?void 0:q.symbol,address:null==q?void 0:q.address,chain_id:V,is_hardware_wallet:$,hardware_wallet_type:K,stx_enabled:Z,current_stx_enabled:z,stx_user_opt_in:Y}}),null==b||b(q),W(q),B(null),J()},setIsImportTokenModalOpen:F,tokenForImport:q};return n.default.createElement("div",{className:(0,o.default)("dropdown-search-list",S),"data-testid":"dropdown-search-list",onClick:te,onKeyUp:e=>{"Escape"===e.key?J():"Enter"===e.key&&te(e)},tabIndex:"0"},q&&L&&n.default.createElement(f.default,oe),!D&&n.default.createElement("div",{className:(0,o.default)("dropdown-search-list__selector-closed-container",O)},n.default.createElement("div",{className:"dropdown-search-list__selector-closed"},(null==U?void 0:U.iconUrl)&&n.default.createElement(d.default,{url:U.iconUrl,className:"dropdown-search-list__selector-closed-icon",name:null==U?void 0:U.symbol}),!(null!=U&&U.iconUrl)&&n.default.createElement("div",{className:"dropdown-search-list__default-dropdown-icon"}),n.default.createElement("div",{className:"dropdown-search-list__labels"},n.default.createElement("div",{className:"dropdown-search-list__item-labels"},n.default.createElement("span",{className:(0,o.default)("dropdown-search-list__closed-primary-label",{"dropdown-search-list__select-default":!(null!=U&&U.symbol)})},(null==U?void 0:U.symbol)||a)))),n.default.createElement("i",{className:"fa fa-caret-down fa-lg dropdown-search-list__caret"})),D&&n.default.createElement(n.default.Fragment,null,n.default.createElement(c.default,{itemsToSearch:x?[]:t,Placeholder:()=>x?n.default.createElement("div",{className:"dropdown-search-list__loading-item"},n.default.createElement(u.default,null),n.default.createElement("div",{className:"dropdown-search-list__loading-item-text-container"},n.default.createElement("span",{className:"dropdown-search-list__loading-item-text"},R("swapFetchingTokens")))):n.default.createElement("div",{className:"dropdown-search-list__placeholder"},R("swapBuildQuotePlaceHolderText",[H]),re&&n.default.createElement("div",{tabIndex:"0",className:"searchable-item-list__item searchable-item-list__item--add-token",key:"searchable-item-list-item-last"},n.default.createElement(p.default,{message:R("addCustomTokenByContractAddress",[n.default.createElement("a",{key:"dropdown-search-list__etherscan-link",onClick:()=>{X({event:"Clicked Block Explorer Link",category:v.MetaMetricsEventCategory.Swaps,properties:{link_type:"Token Tracker",action:"Verify Contract Address",block_explorer_domain:se}}),global.platform.openTab({url:re})},target:"_blank",rel:"noopener noreferrer"},se)])}))),searchPlaceholderText:R("swapSearchNameOrAddress"),fuseSearchKeys:s,defaultToAll:E,onClickItem:ee,onOpenImportTokenModalClick:e=>{B(e),F(!0)},maxListItems:w,className:(0,o.default)("dropdown-search-list__token-container",e,{"dropdown-search-list--open":D}),hideRightLabels:I,hideItemIf:P,listContainerClassName:M,shouldSearchForImports:A,searchQuery:H,setSearchQuery:G}),n.default.createElement("div",{className:"dropdown-search-list__close-area","data-testid":"dropdown-search-list__close-area",onClick:e=>{e.stopPropagation(),j(!1),null==C||C()}})))}b.propTypes={itemsToSearch:s.default.array,onSelect:s.default.func,searchListClassName:s.default.string,fuseSearchKeys:s.default.arrayOf(s.default.shape({name:s.default.string,weight:s.default.number})),defaultToAll:s.default.bool,maxListItems:s.default.number,startingItem:s.default.object,onOpen:s.default.func,onClose:s.default.func,className:s.default.string,externallySelectedItem:s.default.object,loading:s.default.bool,selectPlaceHolderText:s.default.string,selectorClosedClassName:s.default.string,hideRightLabels:s.default.bool,hideItemIf:s.default.func,listContainerClassName:s.default.string,shouldSearchForImports:s.default.bool}}}},{package:"$root$",file:"ui/pages/swaps/dropdown-search-list/dropdown-search-list.js"}],[4382,{"./dropdown-search-list":4381},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./dropdown-search-list"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/dropdown-search-list/index.js"}],[4383,{"../../../../shared/lib/transactions-controller-utils":3425,"../swaps.util":4420,"bignumber.js":1853,classnames:1980,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=d;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=u(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=c(e("prop-types")),s=c(e("bignumber.js")),o=c(e("classnames")),i=e("../swaps.util"),l=e("../../../../shared/lib/transactions-controller-utils");function c(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(u=function(e){return e?a:t})(e)}function d({primaryTokenValue:e,primaryTokenDecimals:t=18,primaryTokenSymbol:a,secondaryTokenValue:r,secondaryTokenDecimals:c=18,secondaryTokenSymbol:u,arrowColor:d="var(--color-primary-default)",boldSymbols:p=!0,className:f}){const[m,g]=(0,n.useState)(!0),[h,_]=(0,n.useState)(!1),y=(0,l.calcTokenAmount)(e,t),v=(0,l.calcTokenAmount)(r,c),E=new s.default(v).div(y).round(9).toString(10),w=new s.default(y).div(v).round(9).toString(10),b=m?a:u,T=m?u:a,k=m?E:w;let C,S="=";return new s.default(k,10).lt("0.00000001",10)?(C="0.000000001",S="<"):C=new s.default(k,10).lt("0.000001",10)?k:(0,i.formatSwapsValueForDisplay)(k),n.default.createElement("div",{className:(0,o.default)("exchange-rate-display",f)},n.default.createElement("span",null,"1"),n.default.createElement("span",{className:(0,o.default)({"exchange-rate-display__bold":p}),"data-testid":"exchange-rate-display__base-symbol"},b),n.default.createElement("span",null,S),n.default.createElement("span",null,C),n.default.createElement("span",{className:(0,o.default)({"exchange-rate-display__bold":p})},T),n.default.createElement("div",{className:(0,o.default)("exchange-rate-display__switch-arrows",{"exchange-rate-display__switch-arrows-rotate":h}),"data-testid":"exchange-rate-display__switch-arrows",onClick:()=>{g(!m),_(!0)},onAnimationEnd:()=>_(!1)},n.default.createElement("svg",{width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.default.createElement("path",{d:"M4.15294 4.38514H9.99223L8.50853 5.86884C8.30421 6.07297 8.30421 6.40418 8.50853 6.60869C8.61069 6.71085 8.74443 6.76203 8.87836 6.76203C9.01229 6.76203 9.14603 6.71085 9.24819 6.60869L11.6249 4.23219C11.649 4.20803 11.6707 4.1814 11.6899 4.15305C11.6947 4.14563 11.6981 4.13726 11.7025 4.12965C11.7154 4.10815 11.7282 4.08646 11.7381 4.06325C11.7426 4.05222 11.7447 4.04043 11.7487 4.0292C11.7558 4.00827 11.7636 3.98754 11.7681 3.96547C11.775 3.93161 11.7786 3.89717 11.7786 3.86198C11.7786 3.82678 11.775 3.79235 11.7681 3.75849C11.7638 3.73642 11.756 3.71568 11.7487 3.69476C11.7447 3.68353 11.7428 3.67174 11.7381 3.6607C11.7282 3.63749 11.7156 3.616 11.7025 3.59431C11.6981 3.5867 11.6947 3.57833 11.6899 3.57091C11.6707 3.54256 11.649 3.51593 11.6249 3.49177L9.24876 1.11564C9.04444 0.911322 8.71342 0.911322 8.50891 1.11564C8.30459 1.31977 8.30459 1.65098 8.50891 1.85549L9.99223 3.339H4.15294C2.22978 3.339 0.665039 4.90374 0.665039 6.8269C0.665039 7.11588 0.899227 7.35007 1.1882 7.35007C1.47718 7.35007 1.71137 7.11588 1.71137 6.8269C1.71137 5.48037 2.80659 4.38514 4.15294 4.38514ZM12.2066 6.57445C11.9177 6.57445 11.6835 6.80864 11.6835 7.09762C11.6835 8.44396 10.5883 9.53919 9.24191 9.53919H3.40262L4.88632 8.05549C5.09064 7.85136 5.09064 7.52014 4.88632 7.31563C4.682 7.11112 4.35098 7.11131 4.14647 7.31563L1.76977 9.69233C1.74561 9.71649 1.72393 9.74312 1.70471 9.77147C1.70015 9.7787 1.69691 9.78669 1.69273 9.79392C1.6796 9.81561 1.66647 9.83748 1.65677 9.86126C1.6524 9.87211 1.6503 9.88371 1.64631 9.89475C1.63927 9.91586 1.63128 9.93679 1.62671 9.95905C1.61986 9.99291 1.61625 10.0273 1.61625 10.0625C1.61625 10.0977 1.61986 10.1322 1.62671 10.166C1.63109 10.1883 1.63908 10.2092 1.64631 10.2303C1.6503 10.2414 1.65221 10.253 1.65677 10.2638C1.66666 10.2874 1.6796 10.3093 1.69273 10.3312C1.69691 10.3384 1.70015 10.3464 1.70471 10.3536C1.72393 10.382 1.74561 10.4086 1.76977 10.4328L4.14609 12.8091C4.24825 12.9112 4.38199 12.9624 4.51592 12.9624C4.64985 12.9624 4.78359 12.9112 4.88575 12.8091C5.09007 12.6049 5.09007 12.2737 4.88575 12.0692L3.40243 10.5857H9.24172C11.1649 10.5857 12.7296 9.02097 12.7296 7.09781C12.7298 6.80864 12.4956 6.57445 12.2066 6.57445Z",fill:d}))))}d.propTypes={primaryTokenValue:r.default.oneOfType([r.default.string,r.default.instanceOf(s.default)]).isRequired,primaryTokenDecimals:r.default.oneOfType([r.default.string,r.default.number]),primaryTokenSymbol:r.default.string.isRequired,secondaryTokenValue:r.default.oneOfType([r.default.string,r.default.instanceOf(s.default)]).isRequired,secondaryTokenDecimals:r.default.oneOfType([r.default.string,r.default.number]),secondaryTokenSymbol:r.default.string.isRequired,className:r.default.string,arrowColor:r.default.string,boldSymbols:r.default.bool}}}},{package:"$root$",file:"ui/pages/swaps/exchange-rate-display/exchange-rate-display.js"}],[4384,{"./exchange-rate-display":4383},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./exchange-rate-display"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/exchange-rate-display/index.js"}],[4385,{"../../../../shared/constants/metametrics":3408,"../../../../shared/constants/network":3409,"../../../components/app/transaction-detail-item/transaction-detail-item.component":3753,"../../../components/app/transaction-detail/transaction-detail.component":3755,"../../../components/ui/info-tooltip":3963,"../../../components/ui/typography":4039,"../../../contexts/i18n":4047,"../../../contexts/metametrics":4048,"../../../helpers/constants/design-system":4070,"../../../selectors":4436,"prop-types":3032,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=y;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=_(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=e("react-redux"),s=h(e("prop-types")),o=e("../../../contexts/i18n"),i=h(e("../../../components/ui/info-tooltip")),l=e("../../../../shared/constants/network"),c=h(e("../../../components/app/transaction-detail/transaction-detail.component")),u=h(e("../../../components/app/transaction-detail-item/transaction-detail-item.component")),d=h(e("../../../components/ui/typography")),p=e("../../../helpers/constants/design-system"),f=e("../../../contexts/metametrics"),m=e("../../../../shared/constants/metametrics"),g=e("../../../selectors");function h(e){return e&&e.__esModule?e:{default:e}}function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(_=function(e){return e?a:t})(e)}function y({primaryFee:e,secondaryFee:t,hideTokenApprovalRow:a,tokenApprovalSourceTokenSymbol:s,onTokenApprovalClick:h,metaMaskFee:_,numberOfQuotes:y,onQuotesClick:v,chainId:E,isBestQuote:w}){const b=(0,n.useContext)(o.I18nContext),T=(0,r.useSelector)(g.getUseCurrencyRateCheck),k=(0,n.useContext)(f.MetaMetricsContext),C=n.default.createElement("span",{key:"fee-card-approve-symbol",className:"fee-card__bold"},b("enableToken",[s]));return n.default.createElement("div",{className:"fee-card"},n.default.createElement("div",{className:"fee-card__main"},n.default.createElement(c.default,{disableEditGasFeeButton:!0,rows:[n.default.createElement(u.default,{key:"gas-item",detailTitle:n.default.createElement(n.default.Fragment,null,b("transactionDetailGasHeading"),n.default.createElement(i.default,{position:"top",contentText:n.default.createElement(n.default.Fragment,null,n.default.createElement("p",{className:"fee-card__info-tooltip-paragraph"},b("swapGasFeesSummary",[(()=>{switch(E){case l.CHAIN_IDS.MAINNET:return b("networkNameEthereum");case l.CHAIN_IDS.BSC:return b("networkNameBSC");case l.CHAIN_IDS.POLYGON:return b("networkNamePolygon");case l.CHAIN_IDS.LOCALHOST:return b("networkNameTestnet");case l.CHAIN_IDS.GOERLI:return b("networkNameGoerli");case l.CHAIN_IDS.AVALANCHE:return b("networkNameAvalanche");case l.CHAIN_IDS.OPTIMISM:return b("networkNameOptimism");case l.CHAIN_IDS.ARBITRUM:return b("networkNameArbitrum");default:throw new Error("This network is not supported for token swaps")}})()])),n.default.createElement("p",{className:"fee-card__info-tooltip-paragraph"},b("swapGasFeesDetails")),n.default.createElement("p",{className:"fee-card__info-tooltip-paragraph"},n.default.createElement("a",{className:"fee-card__link",onClick:()=>{k({event:'Clicked "Gas Fees: Learn More" Link',category:m.MetaMetricsEventCategory.Swaps}),global.platform.openTab({url:"https://community.metamask.io/t/what-is-gas-why-do-transactions-take-so-long/3172"})},target:"_blank",rel:"noopener noreferrer"},b("swapGasFeesLearnMore")))),containerClassName:"fee-card__info-tooltip-content-container",wrapperClassName:"fee-card__row-label fee-card__info-tooltip-container"})),detailText:e.fee,detailTotal:T&&t.fee,subText:((null==t?void 0:t.maxFee)!==undefined||(null==e?void 0:e.maxFee)!==undefined)&&n.default.createElement(n.default.Fragment,null,n.default.createElement(d.default,{as:"span",fontWeight:p.FONT_WEIGHT.BOLD,color:p.TextColor.textAlternative,variant:p.TypographyVariant.H7},b("maxFee")),T?`: ${t.maxFee}`:`: ${e.maxFee}`)})]}),!a&&n.default.createElement("div",{className:"fee-card__row-header"},n.default.createElement("div",{className:"fee-card__row-label"},n.default.createElement("div",{className:"fee-card__row-header-text"},b("swapEnableTokenForSwapping",[C]),n.default.createElement(i.default,{position:"top",contentText:b("swapEnableDescription",[s]),containerClassName:"fee-card__info-tooltip-container"}))),n.default.createElement("div",{className:"fee-card__link",onClick:()=>h()},b("swapEditLimit"))),n.default.createElement("div",{className:"fee-card__row-header"},n.default.createElement("div",{className:"fee-card__row-label"},n.default.createElement("div",{className:"fee-card__row-header-text"},y>1&&n.default.createElement("span",{onClick:v,className:"fee-card__quote-link-text"},b(w?"swapBestOfNQuotes":"swapNQuotesWithDot",[y])),b("swapIncludesMMFee",[_]),n.default.createElement(i.default,{position:"top",contentText:b("swapMetaMaskFeeDescription",[_]),wrapperClassName:"fee-card__info-tooltip-container"}))))))}y.propTypes={primaryFee:s.default.shape({fee:s.default.string.isRequired,maxFee:s.default.string.isRequired}).isRequired,secondaryFee:s.default.shape({fee:s.default.string.isRequired,maxFee:s.default.string.isRequired}),hideTokenApprovalRow:s.default.bool.isRequired,tokenApprovalSourceTokenSymbol:s.default.string,onTokenApprovalClick:s.default.func,metaMaskFee:s.default.string.isRequired,onQuotesClick:s.default.func.isRequired,numberOfQuotes:s.default.number.isRequired,chainId:s.default.string.isRequired,isBestQuote:s.default.bool}}}},{package:"$root$",file:"ui/pages/swaps/fee-card/fee-card.js"}],[4386,{"./fee-card":4385},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./fee-card"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/fee-card/index.js"}],[4387,{"../../../components/ui/actionable-message/actionable-message":3896,"../../../components/ui/box":3900,"../../../components/ui/button":3904,"../../../components/ui/popover":3999,"../../../components/ui/typography":4039,"../../../components/ui/url-icon":4044,"../../../contexts/i18n":4047,"../../../helpers/constants/design-system":4070,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=g;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=m(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=f(e("prop-types")),s=e("../../../contexts/i18n"),o=f(e("../../../components/ui/url-icon")),i=f(e("../../../components/ui/popover")),l=f(e("../../../components/ui/button")),c=f(e("../../../components/ui/box")),u=f(e("../../../components/ui/typography")),d=f(e("../../../components/ui/actionable-message/actionable-message")),p=e("../../../helpers/constants/design-system");function f(e){return e&&e.__esModule?e:{default:e}}function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(m=function(e){return e?a:t})(e)}function g({onImportTokenCloseClick:e,onImportTokenClick:t,setIsImportTokenModalOpen:a,tokenForImport:r}){const f=(0,n.useContext)(s.I18nContext),m=n.default.createElement(n.default.Fragment,null,n.default.createElement(l.default,{type:"secondary",className:"page-container__footer-button",onClick:e},f("cancel")),n.default.createElement(l.default,{type:"primary",className:"page-container__footer-button",onClick:t,"data-testid":"page-container__import-button"},f("import")));return n.default.createElement(i.default,{title:f("importTokenQuestion"),onClose:()=>a(!1),footer:m},n.default.createElement(c.default,{paddingRight:6,paddingBottom:4,paddingLeft:4,alignItems:p.AlignItems.center,display:p.DISPLAY.FLEX,className:"import-token"},n.default.createElement(d.default,{type:"danger",message:f("importTokenWarning")}),n.default.createElement(o.default,{url:r.iconUrl,className:"import-token__token-icon",fallbackClassName:"import-token__token-icon",name:r.symbol}),n.default.createElement(u.default,{ariant:p.TypographyVariant.H4,fontWeight:p.FONT_WEIGHT.BOLD,boxProps:{marginTop:2,marginBottom:3}},r.name||""),n.default.createElement(u.default,{variant:p.TypographyVariant.H6},f("contract"),":"),n.default.createElement(u.default,{className:"import-token__contract-address",variant:p.TypographyVariant.H7,boxProps:{marginBottom:6}},r.address||"")))}g.propTypes={onImportTokenCloseClick:r.default.func,onImportTokenClick:r.default.func,setIsImportTokenModalOpen:r.default.func,tokenForImport:r.default.object}}}},{package:"$root$",file:"ui/pages/swaps/import-token/import-token.js"}],[4388,{"./import-token":4387},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./import-token"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/import-token/index.js"}],[4389,{"../../../shared/constants/metametrics":3408,"../../../shared/constants/swaps":3413,"../../../shared/constants/transaction":3417,"../../../shared/lib/transactions-controller-utils":3425,"../../contexts/i18n":4047,"../../contexts/metametrics":4048,"../../ducks/swaps/swaps":4066,"../../helpers/constants/routes":4074,"../../helpers/higher-order-components/feature-toggled-route":4081,"../../hooks/useGasFeeEstimates":4128,"../../selectors":4436,"../../selectors/selectors":4439,"../../store/actions":4443,"./awaiting-signatures":4365,"./awaiting-swap":4368,"./build-quote":4373,"./loading-swaps-quotes":4391,"./smart-transaction-status":4412,"./swaps.util":4420,"./view-quote":4423,lodash:2932,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(){var e,t,a,N;const O=(0,n.useContext)(i.I18nContext),x=(0,s.useHistory)(),I=(0,r.useDispatch)(),P=(0,n.useContext)(y.MetaMetricsContext),{pathname:M}=(0,s.useLocation)(),A=M===d.AWAITING_SWAP_ROUTE,R=M===d.AWAITING_SIGNATURES_ROUTE,D=M===d.SWAPS_ERROR_ROUTE,j=M===d.LOADING_QUOTES_ROUTE,L=M===d.SMART_TRANSACTION_STATUS_ROUTE,F=M===d.VIEW_QUOTE_ROUTE,[U,W]=(0,n.useState)(!1),q=(0,r.useSelector)(c.getFetchParams,o.isEqual),{destinationTokenInfo:B={}}=(null==q?void 0:q.metaData)||{},H=(0,r.useSelector)(c.getBackgroundSwapRouteState),G=(0,r.useSelector)(l.getSelectedAccount,r.shallowEqual),$=(0,r.useSelector)(c.getQuotes,o.isEqual),K=(0,r.useSelector)(u.currentNetworkTxListSelector,r.shallowEqual),V=(0,r.useSelector)(c.getTradeTxId),Q=(0,r.useSelector)(c.getApproveTxId),Y=(0,r.useSelector)(c.getAggregatorMetadata,r.shallowEqual),Z=(0,r.useSelector)(c.getFetchingQuotes);let z=(0,r.useSelector)(c.getSwapsErrorKey);const X=(0,r.useSelector)(c.getSwapsFeatureIsLive),J=(0,r.useSelector)(l.getCurrentChainId),ee=(0,r.useSelector)(l.getIsSwapsChain),te=(0,r.useSelector)(u.checkNetworkAndAccountSupports1559),ae=(0,r.useSelector)(l.getTokenList,o.isEqual),ne=(0,o.shuffle)(Object.values(ae)),re=(0,r.useSelector)(c.getReviewSwapClickedTimestamp),se=(0,r.useSelector)(c.getPendingSmartTransactions),oe=Boolean(re),ie=(0,r.useSelector)(c.getSmartTransactionsOptInStatus),le=(0,r.useSelector)(c.getSmartTransactionsEnabled),ce=(0,r.useSelector)(c.getCurrentSmartTransactionsEnabled),ue=(0,r.useSelector)(c.getCurrentSmartTransactionsError);(0,n.useEffect)((()=>{ee||(async()=>{await I((0,c.prepareToLeaveSwaps)()),x.push(d.DEFAULT_ROUTE)})()}),[ee,I,x]),(0,m.useGasFeeEstimates)();const{balance:de,address:pe}=G,{destinationTokenAddedForSwap:fe}=q||{},me=Q&&K.find((({id:e})=>Q===e)),ge=V&&K.find((({id:e})=>V===e)),he=(null==ge?void 0:ge.txReceipt)&&(0,v.getSwapsTokensReceivedFromTxMeta)(null==B?void 0:B.symbol,ge,null==B?void 0:B.address,pe,null==B?void 0:B.decimals,me,J),_e=(null==ge?void 0:ge.status)===_.TransactionStatus.confirmed,ye=(null==me?void 0:me.status)===_.TransactionStatus.failed||"0x0"===(null==me||null===(e=me.txReceipt)||void 0===e?void 0:e.status),ve=(null==ge?void 0:ge.status)===_.TransactionStatus.failed||"0x0"===(null==ge||null===(t=ge.txReceipt)||void 0===t?void 0:t.status),Ee=ye||ve;Ee&&z!==p.CONTRACT_DATA_DISABLED_ERROR&&(z=p.SWAP_FAILED_ERROR);const we=(0,n.useRef)();(0,n.useEffect)((()=>{we.current=()=>{!fe||A&&!Ee||I((0,f.ignoreTokens)({tokensToIgnore:null==B?void 0:B.address,dontShowLoadingIndicator:!0}))}}),[Ee,I,fe,B,q,A]),(0,n.useEffect)((()=>()=>{we.current()}),[]),(0,n.useEffect)((()=>ee?((0,E.fetchTokens)(J).then((e=>{I((0,f.setSwapsTokens)(e))})).catch((e=>console.error(e))),(0,E.fetchTopAssets)(J).then((e=>{I((0,c.setTopAssets)(e))})),(0,E.fetchAggregatorMetadata)(J).then((e=>{I((0,c.setAggregatorMetadata)(e))})),te||I((0,c.fetchAndSetSwapsGasPriceInfo)(J)),()=>{I((0,c.prepareToLeaveSwaps)())}):undefined),[I,J,te,ee]);const be=(0,r.useSelector)(l.isHardwareWallet),Te=(0,r.useSelector)(l.getHardwareWalletType),ke=(0,n.useRef)();(0,n.useEffect)((()=>{ke.current=()=>{var e,t;P({event:"Exited Swaps",category:h.MetaMetricsEventCategory.Swaps,sensitiveProperties:{token_from:null==q||null===(e=q.sourceTokenInfo)||void 0===e?void 0:e.symbol,token_from_amount:null==q?void 0:q.value,request_type:null==q?void 0:q.balanceError,token_to:null==q||null===(t=q.destinationTokenInfo)||void 0===t?void 0:t.symbol,slippage:null==q?void 0:q.slippage,custom_slippage:2!==(null==q?void 0:q.slippage),current_screen:M.match(/\/swaps\/(.+)/u)[1],is_hardware_wallet:be,hardware_wallet_type:Te,stx_enabled:le,current_stx_enabled:ce,stx_user_opt_in:ie}})}})),(0,n.useEffect)((()=>((async()=>{await I((0,c.fetchSwapsLivenessAndFeatureFlags)())})(),()=>{ke.current()})),[I]),(0,n.useEffect)((()=>{z&&!D&&oe&&x.push(d.SWAPS_ERROR_ROUTE)}),[x,z,D,oe]);const Ce=(0,n.useRef)();(0,n.useEffect)((()=>{const e=()=>(we.current(),j&&I((0,c.prepareToLeaveSwaps)()),null);return j&&!Ce.current&&(Ce.current=!0,window.addEventListener("beforeunload",e)),()=>window.removeEventListener("beforeunload",e)}),[I,j]);const Se=(0,n.useCallback)((()=>{var e,t;P({event:"Error Smart Transactions",category:h.MetaMetricsEventCategory.Swaps,sensitiveProperties:{token_from:null==q||null===(e=q.sourceTokenInfo)||void 0===e?void 0:e.symbol,token_from_amount:null==q?void 0:q.value,request_type:null==q?void 0:q.balanceError,token_to:null==q||null===(t=q.destinationTokenInfo)||void 0===t?void 0:t.symbol,slippage:null==q?void 0:q.slippage,custom_slippage:2!==(null==q?void 0:q.slippage),current_screen:M.match(/\/swaps\/(.+)/u)[1],is_hardware_wallet:be,hardware_wallet_type:Te,stx_enabled:le,current_stx_enabled:ce,stx_user_opt_in:ie,stx_error:ue}})}),[ue,ce,P,null==q?void 0:q.balanceError,null==q||null===(a=q.destinationTokenInfo)||void 0===a?void 0:a.symbol,null==q?void 0:q.slippage,null==q||null===(N=q.sourceTokenInfo)||void 0===N?void 0:N.symbol,null==q?void 0:q.value,Te,be,M,le,ie]);if((0,n.useEffect)((()=>{ue&&!U&&(W(!0),Se())}),[ue,Se,U]),!ee)return n.default.createElement(n.default.Fragment,null);return n.default.createElement("div",{className:"swaps"},n.default.createElement("div",{className:"swaps__container"},n.default.createElement("div",{className:"swaps__header"},n.default.createElement("div",{className:"swaps__header-edit",onClick:async()=>{await I((0,c.navigateBackToBuildQuote)(x))}},F&&O("edit")),n.default.createElement("div",{className:"swaps__title"},O("swap")),n.default.createElement("div",{className:"swaps__header-cancel",onClick:async()=>{we.current(),I((0,c.clearSwapsState)()),await I((0,f.resetBackgroundSwapsState)()),x.push(d.DEFAULT_ROUTE)}},!A&&!R&&!L&&O("cancel"))),n.default.createElement("div",{className:"swaps__content"},n.default.createElement(s.Switch,null,n.default.createElement(g.default,{redirectRoute:d.SWAPS_MAINTENANCE_ROUTE,flag:X,path:d.BUILD_QUOTE_ROUTE,exact:!0,render:()=>ge&&!Ee?n.default.createElement(s.Redirect,{to:{pathname:d.AWAITING_SWAP_ROUTE}}):ge&&H?n.default.createElement(s.Redirect,{to:{pathname:d.SWAPS_ERROR_ROUTE}}):"loading"===H&&Y?n.default.createElement(s.Redirect,{to:{pathname:d.LOADING_QUOTES_ROUTE}}):n.default.createElement(C.default,{ethBalance:de,selectedAccountAddress:pe,shuffledTokensList:ne})}),n.default.createElement(g.default,{redirectRoute:d.SWAPS_MAINTENANCE_ROUTE,flag:X,path:d.VIEW_QUOTE_ROUTE,exact:!0,render:()=>se.length>0&&"smartTransactionStatus"===H?n.default.createElement(s.Redirect,{to:{pathname:d.SMART_TRANSACTION_STATUS_ROUTE}}):Object.values($).length?n.default.createElement(S.default,{numberOfQuotes:Object.values($).length}):q?n.default.createElement(s.Redirect,{to:{pathname:d.SWAPS_ERROR_ROUTE}}):n.default.createElement(s.Redirect,{to:{pathname:d.BUILD_QUOTE_ROUTE}})}),n.default.createElement(s.Route,{path:d.SWAPS_ERROR_ROUTE,exact:!0,render:()=>z?n.default.createElement(T.default,{swapComplete:!1,errorKey:z,txHash:null==ge?void 0:ge.hash,txId:null==ge?void 0:ge.id,submittedTime:null==ge?void 0:ge.submittedTime}):n.default.createElement(s.Redirect,{to:{pathname:d.BUILD_QUOTE_ROUTE}})}),n.default.createElement(g.default,{redirectRoute:d.SWAPS_MAINTENANCE_ROUTE,flag:X,path:d.LOADING_QUOTES_ROUTE,exact:!0,render:()=>Y?n.default.createElement(k.default,{loadingComplete:!Z&&Boolean(Object.values($).length),onDone:async()=>{await I((0,f.setBackgroundSwapRouteState)("")),z===p.ERROR_FETCHING_QUOTES||z===p.QUOTES_NOT_AVAILABLE_ERROR?(I((0,f.setSwapsErrorKey)(p.QUOTES_NOT_AVAILABLE_ERROR)),x.push(d.SWAPS_ERROR_ROUTE)):x.push(d.VIEW_QUOTE_ROUTE)},aggregatorMetadata:Y}):n.default.createElement(s.Redirect,{to:{pathname:d.BUILD_QUOTE_ROUTE}})}),n.default.createElement(s.Route,{path:d.SWAPS_MAINTENANCE_ROUTE,exact:!0,render:()=>!1===X?n.default.createElement(T.default,{errorKey:p.OFFLINE_FOR_MAINTENANCE}):n.default.createElement(s.Redirect,{to:{pathname:d.BUILD_QUOTE_ROUTE}})}),n.default.createElement(s.Route,{path:d.AWAITING_SIGNATURES_ROUTE,exact:!0,render:()=>n.default.createElement(w.default,null)}),n.default.createElement(s.Route,{path:d.SMART_TRANSACTION_STATUS_ROUTE,exact:!0,render:()=>n.default.createElement(b.default,{txId:null==ge?void 0:ge.id})}),n.default.createElement(s.Route,{path:d.AWAITING_SWAP_ROUTE,exact:!0,render:()=>"awaiting"===H||ge?n.default.createElement(T.default,{swapComplete:_e,txHash:null==ge?void 0:ge.hash,tokensReceived:he,txId:null==ge?void 0:ge.id,submittingSwap:"awaiting"===H&&!(Q||V)}):n.default.createElement(s.Redirect,{to:{pathname:d.DEFAULT_ROUTE}})})))))};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=O(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=e("react-redux"),s=e("react-router-dom"),o=e("lodash"),i=e("../../contexts/i18n"),l=e("../../selectors/selectors"),c=e("../../ducks/swaps/swaps"),u=e("../../selectors"),d=e("../../helpers/constants/routes"),p=e("../../../shared/constants/swaps"),f=e("../../store/actions"),m=e("../../hooks/useGasFeeEstimates"),g=N(e("../../helpers/higher-order-components/feature-toggled-route")),h=e("../../../shared/constants/metametrics"),_=e("../../../shared/constants/transaction"),y=e("../../contexts/metametrics"),v=e("../../../shared/lib/transactions-controller-utils"),E=e("./swaps.util"),w=N(e("./awaiting-signatures")),b=N(e("./smart-transaction-status")),T=N(e("./awaiting-swap")),k=N(e("./loading-swaps-quotes")),C=N(e("./build-quote")),S=N(e("./view-quote"));function N(e){return e&&e.__esModule?e:{default:e}}function O(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(O=function(e){return e?a:t})(e)}}}},{package:"$root$",file:"ui/pages/swaps/index.js"}],[4390,{react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(){return r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:"loading-swaps-quotes__background-1"},r.default.createElement("svg",{width:"193",height:"190",viewBox:"0 0 193 190",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.default.createElement("path",{d:"M153.753 53.876C153.595 53.9493 153.419 54.0161 153.25 54.0651C151.081 54.7451 148.777 53.538 148.086 51.3768C147.763 50.3298 147.851 49.2109 148.361 48.2363C148.87 47.2618 149.732 46.5374 150.78 46.2144C151.828 45.8913 152.948 45.9781 153.923 46.4865C154.898 46.9949 155.622 47.8557 155.944 48.9027C156.567 50.918 155.592 53.0243 153.753 53.876ZM150.817 47.5708C150.245 47.8359 149.782 48.2721 149.495 48.8334C149.144 49.5127 149.073 50.2843 149.303 51.0047C149.774 52.4998 151.375 53.3384 152.877 52.8787C154.374 52.4069 155.215 50.8063 154.756 49.3056C154.526 48.5852 154.027 47.9888 153.36 47.6334C152.68 47.2836 151.908 47.213 151.187 47.4437C151.049 47.4636 150.927 47.52 150.817 47.5708Z",fill:"#86E29B"}),r.default.createElement("path",{d:"M18.3624 73.9241C18.3015 73.9523 18.2407 73.9805 18.1798 74.0087C17.0495 74.4733 15.8073 74.4728 14.6751 74.0078C12.3517 73.0461 11.2387 70.3567 12.2031 68.0341C13.1676 65.7115 15.8598 64.5971 18.1833 65.5589C19.3155 66.0239 20.1951 66.9013 20.6591 68.0304C21.123 69.1595 21.1215 70.4008 20.6552 71.5326C20.2207 72.6053 19.4093 73.4391 18.3624 73.9241ZM15.0433 66.7921C14.3129 67.1305 13.713 67.7186 13.3766 68.5243C12.6776 70.207 13.4834 72.1377 15.1666 72.8348C15.9849 73.1647 16.8786 73.1789 17.6933 72.831C18.5136 72.4952 19.1388 71.8659 19.4818 71.0424C19.8126 70.2245 19.8276 69.3313 19.4801 68.5175C19.1448 67.6981 18.5155 67.0739 17.6917 66.7319C16.8144 66.3703 15.8589 66.4142 15.0433 66.7921Z",fill:"#FFB0EB"}),r.default.createElement("path",{d:"M116.617 37.3839C117.397 37.0226 117.736 36.0982 117.375 35.3192C117.015 34.5402 116.09 34.2016 115.31 34.5629C114.53 34.9243 114.19 35.8487 114.551 36.6277C114.912 37.4067 115.837 37.7453 116.617 37.3839Z",fill:"url(#paint0_linear)"}),r.default.createElement("path",{d:"M55.1317 91.7213C55.9116 91.36 56.2512 90.4356 55.8903 89.6566C55.5294 88.8776 54.6046 88.539 53.8247 88.9003C53.0448 89.2617 52.7052 90.1861 53.0661 90.9651C53.427 91.7441 54.3518 92.0827 55.1317 91.7213Z",fill:"url(#paint1_linear)"}),r.default.createElement("path",{d:"M31.9932 126.235C32.7731 125.874 33.1127 124.95 32.7518 124.171C32.3909 123.392 31.4661 123.053 30.6863 123.414C29.9064 123.776 29.5667 124.7 29.9277 125.479C30.2886 126.258 31.2134 126.597 31.9932 126.235Z",fill:"url(#paint2_linear)"}),r.default.createElement("path",{d:"M119.43 132.589C120.21 132.228 120.55 131.304 120.189 130.525C119.828 129.746 118.903 129.407 118.123 129.768C117.344 130.13 117.004 131.054 117.365 131.833C117.726 132.612 118.651 132.951 119.43 132.589Z",fill:"url(#paint3_linear)"}),r.default.createElement("path",{d:"M44.7469 47.3835C46.0108 46.7979 46.5612 45.2997 45.9763 44.0372C45.3914 42.7747 43.8926 42.2259 42.6286 42.8115C41.3647 43.3971 40.8143 44.8953 41.3992 46.1578C41.9841 47.4203 43.4829 47.9691 44.7469 47.3835Z",fill:"url(#paint4_linear)"}),r.default.createElement("path",{d:"M105.107 90.7857C106.371 90.2001 106.922 88.702 106.337 87.4394C105.752 86.1769 104.253 85.6282 102.989 86.2137C101.725 86.7993 101.175 88.2975 101.76 89.56C102.344 90.8226 103.843 91.3713 105.107 90.7857Z",fill:"url(#paint5_linear)"}),r.default.createElement("path",{d:"M95.5179 172.376C96.7818 171.791 97.3322 170.293 96.7473 169.03C96.1624 167.767 94.6636 167.219 93.3996 167.804C92.1357 168.39 91.5853 169.888 92.1702 171.151C92.7551 172.413 94.2539 172.962 95.5179 172.376Z",fill:"url(#paint6_linear)"}),r.default.createElement("path",{d:"M165.098 102.367C166.362 101.781 166.912 100.283 166.327 99.0205C165.742 97.758 164.244 97.2092 162.98 97.7948C161.716 98.3804 161.165 99.8786 161.75 101.141C162.335 102.404 163.834 102.952 165.098 102.367Z",fill:"url(#paint7_linear)"}),r.default.createElement("defs",null,r.default.createElement("linearGradient",{id:"paint0_linear",x1:"114.554",y1:"36.6326",x2:"117.379",y2:"35.3237",gradientUnits:"userSpaceOnUse"},r.default.createElement("stop",{stopColor:"#75C3FC"}),r.default.createElement("stop",{offset:"1",stopColor:"#75C3FC"})),r.default.createElement("linearGradient",{id:"paint1_linear",x1:"53.0688",y1:"90.97",x2:"55.8937",y2:"89.6611",gradientUnits:"userSpaceOnUse"},r.default.createElement("stop",{stopColor:"#75C3FC"}),r.default.createElement("stop",{offset:"1",stopColor:"#75C3FC"})),r.default.createElement("linearGradient",{id:"paint2_linear",x1:"29.9283",y1:"125.483",x2:"32.7532",y2:"124.174",gradientUnits:"userSpaceOnUse"},r.default.createElement("stop",{stopColor:"#75C3FC"}),r.default.createElement("stop",{offset:"1",stopColor:"#75C3FC"})),r.default.createElement("linearGradient",{id:"paint3_linear",x1:"117.365",y1:"131.837",x2:"120.19",y2:"130.528",gradientUnits:"userSpaceOnUse"},r.default.createElement("stop",{stopColor:"#75C3FC"}),r.default.createElement("stop",{offset:"1",stopColor:"#75C3FC"})),r.default.createElement("linearGradient",{id:"paint4_linear",x1:"41.4394",y1:"46.2402",x2:"45.947",y2:"43.9537",gradientUnits:"userSpaceOnUse"},r.default.createElement("stop",{stopColor:"#75C3FC"}),r.default.createElement("stop",{offset:"1",stopColor:"#75C3FC"})),r.default.createElement("linearGradient",{id:"paint5_linear",x1:"101.8",y1:"89.6425",x2:"106.307",y2:"87.356",gradientUnits:"userSpaceOnUse"},r.default.createElement("stop",{stopColor:"#75C3FC"}),r.default.createElement("stop",{offset:"1",stopColor:"#75C3FC"})),r.default.createElement("linearGradient",{id:"paint6_linear",x1:"92.2104",y1:"171.233",x2:"96.718",y2:"168.947",gradientUnits:"userSpaceOnUse"},r.default.createElement("stop",{stopColor:"#75C3FC"}),r.default.createElement("stop",{offset:"1",stopColor:"#75C3FC"})),r.default.createElement("linearGradient",{id:"paint7_linear",x1:"161.79",y1:"101.224",x2:"166.298",y2:"98.937",gradientUnits:"userSpaceOnUse"},r.default.createElement("stop",{stopColor:"#75C3FC"}),r.default.createElement("stop",{offset:"1",stopColor:"#75C3FC"}))))),r.default.createElement("div",{className:"loading-swaps-quotes__background-2"},r.default.createElement("svg",{width:"195",height:"205",viewBox:"0 0 195 205",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.default.createElement("path",{d:"M29.84 121.982C30.0408 121.969 30.245 122.01 30.4258 122.106L46.4233 130.275C46.8125 130.478 47.0536 130.893 47.0402 131.324C47.0143 131.768 46.7423 132.148 46.3356 132.308L24.5484 140.937C24.1417 141.097 23.6789 141.005 23.3642 140.702C23.0495 140.4 22.9398 139.937 23.0753 139.525L28.8651 122.727C28.9671 122.426 29.2065 122.169 29.5086 122.056C29.614 122.023 29.7194 121.989 29.84 121.982ZM43.1981 131.148L30.5607 124.689L25.9884 137.96L43.1981 131.148Z",fill:"#75C4FD"}),r.default.createElement("path",{d:"M168.214 54.3381C168.442 54.3238 168.674 54.3764 168.869 54.485C169.217 54.6781 169.44 55.0266 169.465 55.4145L170.59 68.4358C170.631 68.8763 170.416 69.3061 170.041 69.5444C169.666 69.7827 169.182 69.7862 168.805 69.5681L156.14 62.2246C155.763 62.0065 155.535 61.5911 155.548 61.1472C155.56 60.7033 155.818 60.3112 156.209 60.1122L167.75 54.4343C167.908 54.3841 168.067 54.3473 168.214 54.3381ZM168.027 66.3674L167.248 57.3661L159.267 61.2902L168.027 66.3674Z",fill:"#FFB0EB"}),r.default.createElement("path",{d:"M88.6283 16.6885C88.8694 16.6734 89.1154 16.7385 89.3255 16.873L100.21 24.1133C100.561 24.3464 100.762 24.7635 100.708 25.1832C100.653 25.6028 100.381 25.969 99.9864 26.1146L86.3391 31.4276C85.9449 31.5731 85.5106 31.5064 85.1842 31.2314C84.8712 30.9556 84.7239 30.5352 84.8192 30.1264L87.5815 17.5731C87.666 17.2053 87.9162 16.9076 88.2702 16.7646C88.3882 16.7169 88.5078 16.696 88.6283 16.6885ZM97.1342 24.7894L89.4471 19.6718L87.5021 28.5349L97.1342 24.7894Z",fill:"url(#paint0_linear)"}),r.default.createElement("path",{d:"M117.145 183.156C116.944 183.289 116.698 183.356 116.449 183.344L103.402 182.517C102.982 182.49 102.6 182.229 102.437 181.839C102.274 181.448 102.327 180.995 102.596 180.671L111.758 169.247C112.027 168.923 112.436 168.764 112.856 168.839C113.265 168.921 113.603 169.212 113.725 169.614L117.609 181.866C117.72 182.227 117.652 182.61 117.417 182.911C117.339 183.011 117.246 183.089 117.145 183.156ZM105.728 180.393L114.944 180.981L112.197 172.333L105.728 180.393Z",fill:"url(#paint1_linear)"}),r.default.createElement("path",{d:"M38.0816 74.0208C38.1217 74.0183 38.1485 74.0166 38.1887 74.0141C42.3831 73.805 45.9744 77.0577 46.1831 81.2474C46.3919 85.4371 43.1484 89.0241 38.9407 89.234C34.7463 89.4431 31.1549 86.1904 30.9462 82.0007C30.7391 77.8377 33.9307 74.2809 38.0816 74.0208ZM38.9104 87.2486C41.9767 87.0565 44.3523 84.4236 44.1997 81.3448C44.0455 78.2393 41.3949 75.8407 38.2859 75.9952C35.1761 76.1364 32.7753 78.7977 32.9296 81.9033C33.0838 85.0088 35.7344 87.4073 38.8434 87.2528C38.8568 87.252 38.8836 87.2503 38.9104 87.2486Z",fill:"#86E29B"}),r.default.createElement("path",{d:"M162.178 97.8401C162.218 97.8376 162.245 97.8359 162.285 97.8334C166.48 97.6243 170.071 100.877 170.28 105.067C170.489 109.256 167.245 112.843 163.037 113.053C158.843 113.262 155.252 110.01 155.043 105.82C154.836 101.657 158.027 98.1002 162.178 97.8401ZM163.007 111.068C166.073 110.876 168.449 108.243 168.296 105.164C168.142 102.059 165.492 99.6601 162.383 99.8146C159.273 99.9557 156.872 102.617 157.026 105.723C157.181 108.828 159.831 111.227 162.94 111.072C162.953 111.071 162.98 111.07 163.007 111.068Z",fill:"#86E29B"}),r.default.createElement("defs",null,r.default.createElement("linearGradient",{id:"paint0_linear",x1:"100.609",y1:"23.2611",x2:"84.4152",y2:"24.2757",gradientUnits:"userSpaceOnUse"},r.default.createElement("stop",{stopColor:"#FFE466"}),r.default.createElement("stop",{offset:"1",stopColor:"#FFAFEA"})),r.default.createElement("linearGradient",{id:"paint1_linear",x1:"103.812",y1:"183.939",x2:"116.959",y2:"174.66",gradientUnits:"userSpaceOnUse"},r.default.createElement("stop",{stopColor:"#75C3FC"}),r.default.createElement("stop",{offset:"0.0928503",stopColor:"#81C2F6"}),r.default.createElement("stop",{offset:"1",stopColor:"#F0B8BD"}))))))};var n,r=(n=e("react"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/loading-swaps-quotes/background-animation.js"}],[4391,{"./loading-swaps-quotes":4392},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./loading-swaps-quotes"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/loading-swaps-quotes/index.js"}],[4392,{"../../../../shared/constants/metametrics":3408,"../../../components/ui/mascot":3979,"../../../contexts/i18n":4047,"../../../contexts/metametrics":4048,"../../../ducks/swaps/swaps":4066,"../../../selectors/selectors":4439,"../swaps-footer":4418,"./background-animation":4390,events:1944,lodash:2932,"lodash/isEqual":2918,"prop-types":3032,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=E;var n=v(e("events")),r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=y(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),s=e("react-redux"),o=v(e("prop-types")),i=e("lodash"),l=e("react-router-dom"),c=v(e("lodash/isEqual")),u=e("../../../ducks/swaps/swaps"),d=e("../../../selectors/selectors"),p=e("../../../contexts/i18n"),f=e("../../../contexts/metametrics"),m=v(e("../../../components/ui/mascot")),g=e("../../../../shared/constants/metametrics"),h=v(e("../swaps-footer")),_=v(e("./background-animation"));function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(y=function(e){return e?a:t})(e)}function v(e){return e&&e.__esModule?e:{default:e}}function E({aggregatorMetadata:e,loadingComplete:t,onDone:a}){var o,y;const v=(0,r.useContext)(p.I18nContext),E=(0,r.useContext)(f.MetaMetricsContext),w=(0,s.useDispatch)(),b=(0,l.useHistory)(),T=(0,r.useRef)(new n.default),k=(0,s.useSelector)(u.getFetchParams,c.default),C=(0,s.useSelector)(u.getQuotesFetchStartTime),S=(0,s.useSelector)(d.isHardwareWallet),N=(0,s.useSelector)(d.getHardwareWalletType),O=(0,s.useSelector)(u.getSmartTransactionsOptInStatus),x=(0,s.useSelector)(u.getSmartTransactionsEnabled),I=(0,s.useSelector)(u.getCurrentSmartTransactionsEnabled),P={event:"Quotes Request Cancelled",category:g.MetaMetricsEventCategory.Swaps,sensitiveProperties:{token_from:null==k||null===(o=k.sourceTokenInfo)||void 0===o?void 0:o.symbol,token_from_amount:null==k?void 0:k.value,request_type:null==k?void 0:k.balanceError,token_to:null==k||null===(y=k.destinationTokenInfo)||void 0===y?void 0:y.symbol,slippage:null==k?void 0:k.slippage,custom_slippage:2!==(null==k?void 0:k.slippage),response_time:Date.now()-C,is_hardware_wallet:S,hardware_wallet_type:N,stx_enabled:x,current_stx_enabled:I,stx_user_opt_in:O}},[M]=(0,r.useState)((()=>(0,i.shuffle)(Object.keys(e)))),A=M.length,R=(0,r.useRef)(),D=R.current,[j,L]=(0,r.useState)(0),[F,U]=(0,r.useState)(null);return(0,r.useEffect)((()=>{let e;e=t?20:500+Math.floor(1500*Math.random());const n=setTimeout((()=>{j<A?L(j+1):j===A&&t&&a()}),e);return function(){clearTimeout(n)}}),[j,t,a,A]),(0,r.useEffect)((()=>{if(D){const{top:e,left:t,width:a,height:n}=D.getBoundingClientRect();U({x:t+a/2,y:e+n/2})}}),[D]),r.default.createElement("div",{className:"loading-swaps-quotes"},r.default.createElement("div",{className:"loading-swaps-quotes__content"},r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:"loading-swaps-quotes__quote-counter"},r.default.createElement("span",null,v("swapFetchingQuoteNofN",[Math.min(j+1,A),A]))),r.default.createElement("div",{className:"loading-swaps-quotes__quote-name-check"},r.default.createElement("span",null,v("swapFetchingQuotes"))),r.default.createElement("div",{className:"loading-swaps-quotes__loading-bar-container"},r.default.createElement("div",{className:"loading-swaps-quotes__loading-bar",style:{width:100/A*j+"%"}}))),r.default.createElement("div",{className:"loading-swaps-quotes__animation"},r.default.createElement(_.default,null),r.default.createElement("div",{className:"loading-swaps-quotes__mascot-container",ref:R},r.default.createElement(m.default,{animationEventEmitter:T.current,width:"90",height:"90",lookAtTarget:F})))),r.default.createElement(h.default,{submitText:v("back"),onSubmit:async()=>{E(P),await w((0,u.navigateBackToBuildQuote)(b))},hideCancel:!0}))}E.propTypes={loadingComplete:o.default.bool.isRequired,onDone:o.default.func.isRequired,aggregatorMetadata:o.default.objectOf(o.default.shape({title:o.default.string,color:o.default.string,icon:o.default.string}))}}}},{package:"$root$",file:"ui/pages/swaps/loading-swaps-quotes/loading-swaps-quotes.js"}],[4393,{"./main-quote-summary":4394},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./main-quote-summary"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/main-quote-summary/index.js"}],[4394,{"../../../../shared/lib/transactions-controller-utils":3425,"../../../components/ui/tooltip":4035,"../../../components/ui/url-icon":4044,"../exchange-rate-display":4384,"../swaps.util":4420,"bignumber.js":1853,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=p;var n=d(e("react")),r=d(e("prop-types")),s=d(e("bignumber.js")),o=d(e("../../../components/ui/tooltip")),i=d(e("../../../components/ui/url-icon")),l=d(e("../exchange-rate-display")),c=e("../swaps.util"),u=e("../../../../shared/lib/transactions-controller-utils");function d(e){return e&&e.__esModule?e:{default:e}}function p({sourceValue:e,sourceSymbol:t,sourceDecimals:a,sourceIconUrl:r,destinationValue:s,destinationSymbol:d,destinationDecimals:p,destinationIconUrl:f}){const m=(0,u.toPrecisionWithoutTrailingZeros)((0,u.calcTokenAmount)(e,a).toString(10),12),g=(0,u.calcTokenAmount)(s,p),h=(0,c.formatSwapsValueForDisplay)(g),_=h.match(/\d+/gu).join("").length,[y,v]=(E=_)<=9?[50,48]:E<=13?[40,32]:[26,15];var E;let w=h;return _>20&&(w=`${h.slice(0,20)}...`),n.default.createElement("div",{className:"main-quote-summary"},n.default.createElement("div",{className:"main-quote-summary__details"},n.default.createElement("div",{className:"main-quote-summary__quote-details-top"},n.default.createElement("div",{className:"main-quote-summary__source-row","data-testid":"main-quote-summary__source-row"},n.default.createElement("span",{className:"main-quote-summary__source-row-value",title:(0,c.formatSwapsValueForDisplay)(m)},(0,c.formatSwapsValueForDisplay)(m)),n.default.createElement(i.default,{url:r,className:"main-quote-summary__icon",name:t,fallbackClassName:"main-quote-summary__icon-fallback"}),n.default.createElement("span",{className:"main-quote-summary__source-row-symbol",title:t},t)),n.default.createElement("i",{className:"fa fa-arrow-down main-quote-summary__down-arrow"}),n.default.createElement("div",{className:"main-quote-summary__destination-row"},n.default.createElement(i.default,{url:f,className:"main-quote-summary__icon",name:d,fallbackClassName:"main-quote-summary__icon-fallback"}),n.default.createElement("span",{className:"main-quote-summary__destination-row-symbol"},d)),n.default.createElement("div",{className:"main-quote-summary__quote-large"},n.default.createElement(o.default,{interactive:!0,position:"bottom",html:h,disabled:w===h},n.default.createElement("span",{className:"main-quote-summary__quote-large-number",style:{fontSize:y,lineHeight:`${v}px`}},`${w}`)))),n.default.createElement("div",{className:"main-quote-summary__exchange-rate-container","data-testid":"main-quote-summary__exchange-rate-container"},n.default.createElement(l.default,{primaryTokenValue:e,primaryTokenDecimals:a,primaryTokenSymbol:t,secondaryTokenValue:s,secondaryTokenDecimals:p,secondaryTokenSymbol:d,arrowColor:"var(--color-primary-default)",boldSymbols:!1,className:"main-quote-summary__exchange-rate-display"}))))}p.propTypes={sourceValue:r.default.oneOfType([r.default.string,r.default.instanceOf(s.default)]).isRequired,sourceDecimals:r.default.oneOfType([r.default.string,r.default.number]),sourceSymbol:r.default.string.isRequired,destinationValue:r.default.oneOfType([r.default.string,r.default.instanceOf(s.default)]).isRequired,destinationDecimals:r.default.oneOfType([r.default.string,r.default.number]),destinationSymbol:r.default.string.isRequired,sourceIconUrl:r.default.string,destinationIconUrl:r.default.string}}}},{package:"$root$",file:"ui/pages/swaps/main-quote-summary/main-quote-summary.js"}],[4395,{"./searchable-item-list":4400},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./searchable-item-list"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/searchable-item-list/index.js"}],[4396,{"./item-list.component":4397},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./item-list.component"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/searchable-item-list/item-list/index.js"}],[4397,{"../../../../../shared/constants/metametrics":3408,"../../../../../shared/constants/swaps":3413,"../../../../components/ui/actionable-message/actionable-message":3896,"../../../../components/ui/button":3904,"../../../../components/ui/identicon":3962,"../../../../components/ui/url-icon":4044,"../../../../contexts/i18n":4047,"../../../../contexts/metametrics":4048,"../../../../helpers/utils/util":4108,"../../../../selectors":4436,classnames:1980,"prop-types":3032,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=v;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=y(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=e("react-redux"),s=_(e("prop-types")),o=_(e("classnames")),i=_(e("../../../../components/ui/identicon")),l=_(e("../../../../components/ui/url-icon")),c=_(e("../../../../components/ui/button")),u=_(e("../../../../components/ui/actionable-message/actionable-message")),d=e("../../../../contexts/i18n"),p=e("../../../../selectors"),f=e("../../../../../shared/constants/metametrics"),m=e("../../../../../shared/constants/swaps"),g=e("../../../../helpers/utils/util"),h=e("../../../../contexts/metametrics");function _(e){return e&&e.__esModule?e:{default:e}}function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(y=function(e){return e?a:t})(e)}function v({results:e=[],onClickItem:t,onOpenImportTokenModalClick:a,Placeholder:s,listTitle:_,maxListItems:y=6,searchQuery:v="",containerRef:E,hideRightLabels:w,hideItemIf:b,listContainerClassName:T}){const k=(0,n.useContext)(d.I18nContext),C=(0,r.useSelector)(p.getCurrentChainId),S=(0,r.useSelector)(p.getRpcPrefsForCurrentProvider).blockExplorerUrl??m.SWAPS_CHAINID_DEFAULT_BLOCK_EXPLORER_URL_MAP[C]??null,N=(0,r.useSelector)(p.getUseCurrencyRateCheck),O=(0,g.getURLHostName)(S),x=(0,n.useContext)(h.MetaMetricsContext),I=1===e.length&&e[0].notImported,P=s?n.default.createElement(s,{searchQuery:v}):null;return 0===e.length?P:n.default.createElement("div",{className:"searchable-item-list"},_?n.default.createElement("div",{className:"searchable-item-list__title"},_):null,n.default.createElement("div",{className:(0,o.default)("searchable-item-list__list-container",T),ref:E},e.slice(0,y).map(((e,r)=>{if(null!=b&&b(e))return null;const s=()=>{e.notImported?a(e):null==t||t(e)},{iconUrl:u,identiconAddress:d,selected:p,disabled:f,primaryLabel:m,secondaryLabel:g,rightPrimaryLabel:h,rightSecondaryLabel:_,IconComponent:y}=e;return n.default.createElement("div",{tabIndex:"0",className:(0,o.default)("searchable-item-list__item",{"searchable-item-list__item--selected":p,"searchable-item-list__item--disabled":f}),"data-testid":"searchable-item-list__item",onClick:s,onKeyUp:e=>"Enter"===e.key&&s(),key:`searchable-item-list-item-${r}`},u||m?n.default.createElement(l.default,{url:u,name:m}):null,u||m||!d?null:n.default.createElement("div",{className:"searchable-item-list__identicon"},n.default.createElement(i.default,{address:d,diameter:24})),y?n.default.createElement(y,null):null,n.default.createElement("div",{className:"searchable-item-list__labels"},n.default.createElement("div",{className:"searchable-item-list__item-labels"},m?n.default.createElement("span",{className:"searchable-item-list__primary-label"},m):null,g?n.default.createElement("span",{className:"searchable-item-list__secondary-label"},g):null),w||!h&&!_?null:n.default.createElement("div",{className:"searchable-item-list__right-labels"},h?n.default.createElement("span",{className:"searchable-item-list__right-primary-label"},h):null,_&&N?n.default.createElement("span",{className:"searchable-item-list__right-secondary-label"},_):null)),e.notImported&&n.default.createElement(c.default,{type:"primary",onClick:s},k("import")))})),!I&&S&&n.default.createElement("div",{tabIndex:"0",className:"searchable-item-list__item searchable-item-list__item--add-token",key:"searchable-item-list-item-last"},n.default.createElement(u.default,{message:k("addCustomTokenByContractAddress",[n.default.createElement("a",{key:"searchable-item-list__etherscan-link",onClick:()=>{x({event:"Clicked Block Explorer Link",category:f.MetaMetricsEventCategory.Swaps,properties:{link_type:"Token Tracker",action:"Verify Contract Address",block_explorer_domain:O}}),global.platform.openTab({url:S})},target:"_blank",rel:"noopener noreferrer"},O)])}))))}v.propTypes={results:s.default.arrayOf(s.default.shape({iconUrl:s.default.string,selected:s.default.bool,disabled:s.default.bool,primaryLabel:s.default.string,secondaryLabel:s.default.string,rightPrimaryLabel:s.default.string,rightSecondaryLabel:s.default.string})),onClickItem:s.default.func,onOpenImportTokenModalClick:s.default.func,Placeholder:s.default.func,listTitle:s.default.string,maxListItems:s.default.number,searchQuery:s.default.string,containerRef:s.default.shape({current:s.default.instanceOf(window.Element)}),hideRightLabels:s.default.bool,hideItemIf:s.default.func,listContainerClassName:s.default.string}}}},{package:"$root$",file:"ui/pages/swaps/searchable-item-list/item-list/item-list.component.js"}],[4398,{"./list-item-search.component":4399},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./list-item-search.component"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/searchable-item-list/list-item-search/index.js"}],[4399,{"../../../../../shared/modules/hexstring-utils":3435,"../../../../components/ui/icon/search-icon":3953,"../../../../components/ui/text-field":4025,"../../../../hooks/usePrevious":4133,"../../../../selectors/selectors":4439,"../../swaps.util":4420,"@material-ui/core/InputAdornment":680,"fuse.js":2497,loglevel:2944,"prop-types":3032,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=y;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=h(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=e("react-redux"),s=g(e("prop-types")),o=g(e("fuse.js")),i=g(e("loglevel")),l=g(e("@material-ui/core/InputAdornment")),c=g(e("../../../../components/ui/text-field")),u=e("../../../../hooks/usePrevious"),d=e("../../../../../shared/modules/hexstring-utils"),p=e("../../swaps.util"),f=e("../../../../selectors/selectors"),m=g(e("../../../../components/ui/icon/search-icon"));function g(e){return e&&e.__esModule?e:{default:e}}function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(h=function(e){return e?a:t})(e)}let _;function y({onSearch:e,error:t,listToSearch:a=[],fuseSearchKeys:s,searchPlaceholderText:g,defaultToAll:h,shouldSearchForImports:y,searchQuery:v,setSearchQuery:E}){const w=(0,n.useRef)(),b=(0,r.useSelector)(f.getCurrentChainId),T=async t=>{E(t),_&&clearTimeout(_),_=setTimeout((async()=>{_=null;const n=t.trim(),r=(0,d.isValidHexAddress)(n),s=w.current.search(t),o=h&&""===t?a:s;y&&0===o.length&&r?await(async t=>{try{const a=await(0,p.fetchToken)(t,b);if(a)return a.primaryLabel=a.symbol,a.secondaryLabel=a.name,a.notImported=!0,void e({searchQuery:t,results:[a]})}catch(e){i.default.error("Token not found, show 0 results.",e)}e({searchQuery:t,results:[]})})(n):e({searchQuery:t,results:o})}),350)};(0,n.useEffect)((()=>()=>clearTimeout(_)),[]),(0,n.useEffect)((()=>{w.current||(w.current=new o.default(a,{shouldSort:!0,threshold:.45,location:0,distance:100,maxPatternLength:32,minMatchCharLength:1,keys:s}))}),[s,a]);const k=(0,u.usePrevious)(a??[]);return(0,n.useEffect)((()=>{if(w.current&&v&&k!==a){w.current.setCollection(a);const t=w.current.search(v);e({searchQuery:v,results:t})}}),[a,v,e,k]),n.default.createElement(c.default,{"data-testid":"search-list-items",className:"searchable-item-list__search",placeholder:g,type:"text",value:v,onChange:e=>T(e.target.value),error:t,fullWidth:!0,startAdornment:n.default.createElement(l.default,{position:"start",style:{marginRight:"12px"}},n.default.createElement(m.default,{size:20,color:"var(--color-icon-muted)"})),autoComplete:"off",autoFocus:!0})}y.propTypes={onSearch:s.default.func,error:s.default.string,listToSearch:s.default.array.isRequired,fuseSearchKeys:s.default.arrayOf(s.default.object).isRequired,searchPlaceholderText:s.default.string,defaultToAll:s.default.bool,shouldSearchForImports:s.default.bool,searchQuery:s.default.string,setSearchQuery:s.default.func}}}},{package:"$root$",file:"ui/pages/swaps/searchable-item-list/list-item-search/list-item-search.component.js"}],[4400,{"./item-list":4396,"./list-item-search":4398,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=c;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=l(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=i(e("prop-types")),s=i(e("./item-list")),o=i(e("./list-item-search"));function i(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(l=function(e){return e?a:t})(e)}function c({className:e,defaultToAll:t,fuseSearchKeys:a,itemSelectorError:r,itemsToSearch:i=[],listTitle:l,maxListItems:c,onClickItem:u,onOpenImportTokenModalClick:d,Placeholder:p,searchPlaceholderText:f,hideRightLabels:m,hideItemIf:g,listContainerClassName:h,shouldSearchForImports:_,searchQuery:y,setSearchQuery:v}){const E=(0,n.useRef)(),w=(0,n.useMemo)((()=>t?i:[]),[t,i]),[b,T]=(0,n.useState)(w);return(0,n.useEffect)((()=>{y||T(w)}),[w.length,y]),n.default.createElement("div",{className:e},n.default.createElement(o.default,{listToSearch:i,fuseSearchKeys:a,onSearch:({searchQuery:e="",results:t=[]})=>{v(e),T(t)},error:r,searchPlaceholderText:f,defaultToAll:t,shouldSearchForImports:_,searchQuery:y,setSearchQuery:v}),n.default.createElement(s.default,{searchQuery:y,results:b,onClickItem:u,onOpenImportTokenModalClick:d,Placeholder:p,listTitle:l,maxListItems:c,containerRef:E,hideRightLabels:m,hideItemIf:g,listContainerClassName:h}))}c.propTypes={itemSelectorError:r.default.string,itemsToSearch:r.default.array,onClickItem:r.default.func,onOpenImportTokenModalClick:r.default.func,Placeholder:r.default.func,className:r.default.string,searchPlaceholderText:r.default.string,fuseSearchKeys:r.default.arrayOf(r.default.shape({name:r.default.string,weight:r.default.number})),listTitle:r.default.string,defaultToAll:r.default.bool,maxListItems:r.default.number,hideRightLabels:r.default.bool,hideItemIf:r.default.func,listContainerClassName:r.default.string,shouldSearchForImports:r.default.bool,searchQuery:r.default.string,setSearchQuery:r.default.func}}}},{package:"$root$",file:"ui/pages/swaps/searchable-item-list/searchable-item-list.js"}],[4401,{"./select-quote-popover":4405},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./select-quote-popover"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/select-quote-popover/index.js"}],[4402,{"./quote-details":4403},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./quote-details"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/select-quote-popover/quote-details/index.js"}],[4403,{"../../../../components/ui/info-tooltip":3963,"../../../../contexts/i18n":4047,"../../../../selectors":4436,"../../exchange-rate-display":4384,"prop-types":3032,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=d(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=e("react-redux"),s=u(e("prop-types")),o=e("../../../../contexts/i18n"),i=u(e("../../../../components/ui/info-tooltip")),l=u(e("../../exchange-rate-display")),c=e("../../../../selectors");function u(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(d=function(e){return e?a:t})(e)}const p=({slippage:e,sourceTokenValue:t,sourceTokenSymbol:a,destinationTokenValue:s,destinationTokenSymbol:u,liquiditySourceKey:d,minimumAmountReceived:p,feeInEth:f,networkFees:m,metaMaskFee:g,hideEstimatedGasFee:h})=>{const _=(0,n.useContext)(o.I18nContext),y=(0,r.useSelector)(c.getUseCurrencyRateCheck);return n.default.createElement("div",{className:"quote-details"},n.default.createElement("div",{className:"quote-details__row"},n.default.createElement("div",{className:"quote-details__detail-header"},_("swapRate")),n.default.createElement("div",{className:"quote-details__detail-content"},n.default.createElement(l.default,{primaryTokenValue:t,primaryTokenDecimals:1,primaryTokenSymbol:a,secondaryTokenValue:s,secondaryTokenDecimals:1,secondaryTokenSymbol:u}))),n.default.createElement("div",{className:"quote-details__row"},n.default.createElement("div",{className:"quote-details__detail-header"},_("swapMaxSlippage"),n.default.createElement(i.default,{position:"bottom",contentText:_("swapSlippageTooltip")})),n.default.createElement("div",{className:"quote-details__detail-content"},`${e}%`)),n.default.createElement("div",{className:"quote-details__row"},n.default.createElement("div",{className:"quote-details__detail-header"},_("swapAmountReceived"),n.default.createElement(i.default,{position:"bottom",contentText:_("swapAmountReceivedInfo")})),n.default.createElement("div",{className:"quote-details__detail-content"},n.default.createElement("span",null,p),n.default.createElement("span",{className:"quote-details__bold"},` ${u}`))),!h&&n.default.createElement("div",{className:"quote-details__row"},n.default.createElement("div",{className:"quote-details__detail-header"},_("swapEstimatedNetworkFees"),n.default.createElement(i.default,{position:"bottom",contentText:_("swapEstimatedNetworkFeesInfo")})),n.default.createElement("div",{className:"quote-details__detail-content"},n.default.createElement("span",null,f),n.default.createElement("span",{className:"quote-details__light-grey"},y&&` (${m})`))),n.default.createElement("div",{className:"quote-details__row"},n.default.createElement("div",{className:"quote-details__detail-header"},_("swapSource"),n.default.createElement(i.default,{position:"bottom",contentText:_("swapSourceInfo")})),n.default.createElement("div",{className:"quote-details__detail-content"},_(d))),n.default.createElement("div",{className:"quote-details__row quote-details__row--high"},n.default.createElement("div",{className:"quote-details__detail-header"},n.default.createElement("img",{src:"./images/logo/metamask-fox.svg",className:"quote-details__metafox-logo",alt:""}),_("swapMetaMaskFee")),n.default.createElement("div",{className:"quote-details__detail-content"},_("swapMetaMaskFeeDescription",[g]))))};p.propTypes={slippage:s.default.number.isRequired,sourceTokenValue:s.default.string.isRequired,sourceTokenSymbol:s.default.string.isRequired,destinationTokenValue:s.default.string.isRequired,destinationTokenSymbol:s.default.string.isRequired,liquiditySourceKey:s.default.string.isRequired,minimumAmountReceived:s.default.string.isRequired,feeInEth:s.default.string.isRequired,networkFees:s.default.string.isRequired,metaMaskFee:s.default.number.isRequired,hideEstimatedGasFee:s.default.bool};var f=p;a.default=f}}},{package:"$root$",file:"ui/pages/swaps/select-quote-popover/quote-details/quote-details.js"}],[4404,{"prop-types":3032},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.QUOTE_DATA_ROWS_PROPTYPES_SHAPE=void 0;var n,r=(n=e("prop-types"))&&n.__esModule?n:{default:n};const s=r.default.shape({aggId:r.default.string.isRequired,amountReceiving:r.default.string.isRequired,destinationTokenDecimals:r.default.number.isRequired,destinationTokenSymbol:r.default.string.isRequired,destinationTokenValue:r.default.string.isRequired,isBestQuote:r.default.bool,networkFees:r.default.string.isRequired,quoteSource:r.default.string.isRequired,rawNetworkFees:r.default.string.isRequired,slippage:r.default.number.isRequired,sourceTokenDecimals:r.default.number.isRequired,sourceTokenSymbol:r.default.string.isRequired,sourceTokenValue:r.default.string.isRequired});a.QUOTE_DATA_ROWS_PROPTYPES_SHAPE=s}}},{package:"$root$",file:"ui/pages/swaps/select-quote-popover/select-quote-popover-constants.js"}],[4405,{"../../../components/ui/button":3904,"../../../components/ui/popover":3999,"../../../contexts/i18n":4047,"./quote-details":4402,"./select-quote-popover-constants":4404,"./sort-list":4406,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=p(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=d(e("prop-types")),s=e("../../../contexts/i18n"),o=d(e("../../../components/ui/popover")),i=d(e("../../../components/ui/button")),l=d(e("./quote-details")),c=d(e("./sort-list")),u=e("./select-quote-popover-constants");function d(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(p=function(e){return e?a:t})(e)}function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},f.apply(this,arguments)}const m=({quoteDataRows:e=[],onClose:t=null,onSubmit:a=null,swapToSymbol:r,initialAggId:u,onQuoteDetailsIsOpened:d,hideEstimatedGasFee:p})=>{const m=(0,n.useContext)(s.I18nContext),[g,h]=(0,n.useState)(1),[_,y]=(0,n.useState)(null),[v,E]=(0,n.useState)(u),[w,b]=(0,n.useState)("sortList"),[T,k]=(0,n.useState)(null),C=(0,n.useCallback)((()=>{a(v),t()}),[v,t,a]),S=(0,n.useCallback)((()=>{k(null),b("sortList")}),[]),N=(0,n.useCallback)((e=>E(e)),[E]),O=(0,n.useCallback)((t=>{const a=e.find((e=>e.aggId===t));b("quoteDetails"),d(),k(a)}),[e,d]),x=(0,n.useCallback)((()=>n.default.createElement("div",{className:"select-quote-popover__popover-bg",onClick:t})),[t]),I=n.default.createElement(n.default.Fragment,null,n.default.createElement(i.default,{type:"secondary",className:"page-container__footer-button select-quote-popover__button",onClick:t},m("close")),n.default.createElement(i.default,{type:"primary",className:"page-container__footer-button select-quote-popover__button",onClick:C},m("swapSelect")));return n.default.createElement("div",{className:"select-quote-popover"},n.default.createElement(o.default,{title:m("quoteDetails"===w?"swapSelectAQuote":"swapQuoteDetails"),subtitle:"sortList"===w?m("swapSelectQuotePopoverDescription"):null,onClose:t,CustomBackground:x,className:"select-quote-popover__popover-wrap",footerClassName:"swaps__footer",footer:"quoteDetails"===w?null:I,onBack:"quoteDetails"===w?S:null},"sortList"===w&&n.default.createElement(c.default,{quoteDataRows:e,selectedAggId:v,onSelect:N,onCaretClick:O,swapToSymbol:r,sortDirection:g,setSortDirection:h,sortColumn:_,setSortColumn:y,hideEstimatedGasFee:p}),"quoteDetails"===w&&T&&n.default.createElement(l.default,f({},T,{hideEstimatedGasFee:p}))))};m.propTypes={onClose:r.default.func,onSubmit:r.default.func,swapToSymbol:r.default.string,quoteDataRows:r.default.arrayOf(u.QUOTE_DATA_ROWS_PROPTYPES_SHAPE),initialAggId:r.default.string,onQuoteDetailsIsOpened:r.default.func,hideEstimatedGasFee:r.default.bool.isRequired};var g=m;a.default=g}}},{package:"$root$",file:"ui/pages/swaps/select-quote-popover/select-quote-popover.js"}],[4406,{"./sort-list":4407},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./sort-list"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/select-quote-popover/sort-list/index.js"}],[4407,{"../../../../components/ui/icon/sun-check-icon.component":3956,"../../../../components/ui/info-tooltip":3963,"../../../../contexts/i18n":4047,"../../../../selectors":4436,"../select-quote-popover-constants":4404,"bignumber.js":1853,classnames:1980,"prop-types":3032,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=h;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=m(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=e("react-redux"),s=f(e("prop-types")),o=f(e("classnames")),i=f(e("bignumber.js")),l=f(e("../../../../components/ui/icon/sun-check-icon.component")),c=e("../../../../contexts/i18n"),u=e("../select-quote-popover-constants"),d=f(e("../../../../components/ui/info-tooltip")),p=e("../../../../selectors");function f(e){return e&&e.__esModule?e:{default:e}}function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(m=function(e){return e?a:t})(e)}const g=()=>n.default.createElement("svg",{width:"6",height:"9",viewBox:"0 0 6 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.default.createElement("path",{d:"M0.7948 4.96973C0.365112 4.96973 0.150269 5.47754 0.462769 5.77051L2.78699 8.09473C2.96277 8.29004 3.25574 8.29004 3.45105 8.09473L5.77527 5.77051C6.06824 5.47754 5.85339 4.96973 5.44324 4.96973H0.7948ZM5.77527 2.91895L3.45105 0.594727C3.25574 0.418945 2.96277 0.418945 2.78699 0.594727L0.462769 2.91895C0.150269 3.23145 0.365112 3.71973 0.7948 3.71973H5.44324C5.85339 3.71973 6.06824 3.23145 5.77527 2.91895Z",fill:"var(--color-primary-default)"}));function h({quoteDataRows:e,selectedAggId:t,onSelect:a,onCaretClick:s,swapToSymbol:u,sortDirection:f,setSortDirection:m,sortColumn:h=null,setSortColumn:_,hideEstimatedGasFee:y}){const v=(0,n.useContext)(c.I18nContext),[E,w]=(0,n.useState)(!1),b=(0,r.useSelector)(p.getUseCurrencyRateCheck),T=e=>{e===h?m(-1*f):_(e)},k=(0,n.useMemo)((()=>[...e].sort(((e,t)=>{if(null===h&&e.isBestQuote)return-1;if(null===h&&t.isBestQuote)return 1;if(null===h){const a=new i.default(e.destinationTokenValue).toString(16),n=new i.default(t.destinationTokenValue).toString(16);return a[a.length-1]<n[n.length-1]?-1:1}return"quoteSource"===h?e[h]>t[h]?-1*f:f:new i.default(e[h]).gt(t[h])?-1*f:f}))),[e,h,f]),C=k.findIndex((({aggId:e})=>t===e));return n.default.createElement("div",{className:"select-quote-popover__sort-list"},n.default.createElement("div",{className:"select-quote-popover__column-headers"},n.default.createElement("div",{className:"select-quote-popover__column-header select-quote-popover__receiving","data-testid":"select-quote-popover__receiving",onClick:()=>T("destinationTokenValue")},n.default.createElement("span",{className:"select-quote-popover__receiving-symbol"},u),n.default.createElement("div",{className:"select-quote-popover__receiving-label"},n.default.createElement("span",null,v("swapReceiving")),n.default.createElement(d.default,{position:"bottom",contentText:v("swapReceivingInfoTooltip")}),n.default.createElement(g,null))),n.default.createElement("div",{className:"select-quote-popover__column-header select-quote-popover__network-fees select-quote-popover__network-fees-header","data-testid":"select-quote-popover__network-fees-header",onClick:()=>T("rawNetworkFees")},!y&&b&&n.default.createElement(n.default.Fragment,null,n.default.createElement("span",null,v("swapEstimatedNetworkFees")),n.default.createElement(d.default,{position:"bottom",contentText:v("swapEstimatedNetworkFeesInfo")}),n.default.createElement(g,null))),n.default.createElement("div",{className:"select-quote-popover__column-header select-quote-popover__quote-source","data-testid":"select-quote-popover__quote-source",onClick:()=>T("quoteSource")},v("swapQuoteSource"),n.default.createElement("div",{className:"select-quote-popover__quote-source-toggle"},n.default.createElement(g,null)))),k.map((({destinationTokenValue:e,networkFees:t,isBestQuote:r,quoteSource:i,aggId:c},u)=>n.default.createElement("div",{className:(0,o.default)("select-quote-popover__row",{"select-quote-popover__row--selected":C===u,"select-quote-popover__row--no-hover":E}),onClick:()=>a(c),key:`select-quote-popover-row-${u}`,"data-testid":`select-quote-popover-row-${u}`},n.default.createElement("div",{className:"select-quote-popover__receiving"},n.default.createElement("div",{className:"select-quote-popover__receiving-value"},r&&n.default.createElement(l.default,{reverseColors:C!==u}),n.default.createElement("div",{className:"select-quote-popover__receiving-value-text",title:e},e)),"RFQ"===i&&n.default.createElement("span",{className:"select-quote-popover__zero-slippage"},v("swapZeroSlippage"))),n.default.createElement("div",{className:"select-quote-popover__network-fees"},!y&&b&&t),n.default.createElement("div",{className:"select-quote-popover__quote-source"},n.default.createElement("div",{className:(0,o.default)("select-quote-popover__quote-source-label",{"select-quote-popover__quote-source-label--green":"AGG"===i,"select-quote-popover__quote-source-label--orange":"RFQ"===i,"select-quote-popover__quote-source-label--blue":"DEX"===i})},i)),n.default.createElement("div",{className:"select-quote-popover__caret-right","data-testid":`select-quote-popover__caret-right-${u}`,onClick:e=>{e.stopPropagation(),s(c)},onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1)},n.default.createElement("i",{className:"fa fa-angle-up"}))))))}h.propTypes={selectedAggId:s.default.string.isRequired,onSelect:s.default.func.isRequired,onCaretClick:s.default.func.isRequired,swapToSymbol:s.default.string.isRequired,quoteDataRows:s.default.arrayOf(u.QUOTE_DATA_ROWS_PROPTYPES_SHAPE).isRequired,sortDirection:s.default.number.isRequired,setSortDirection:s.default.func.isRequired,sortColumn:s.default.string,setSortColumn:s.default.func.isRequired,hideEstimatedGasFee:s.default.bool.isRequired}}}},{package:"$root$",file:"ui/pages/swaps/select-quote-popover/sort-list/sort-list.js"}],[4408,{"./slippage-buttons":4409},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./slippage-buttons"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/slippage-buttons/index.js"}],[4409,{"../../../../shared/constants/swaps":3413,"../../../components/ui/box":3900,"../../../components/ui/button":3904,"../../../components/ui/button-group":3902,"../../../components/ui/info-tooltip":3963,"../../../components/ui/toggle-button":4028,"../../../components/ui/typography":4039,"../../../contexts/i18n":4047,"../../../helpers/constants/design-system":4070,"../swaps.util":4420,classnames:1980,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=y;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=_(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=h(e("prop-types")),s=h(e("classnames")),o=e("../../../contexts/i18n"),i=h(e("../../../components/ui/button-group")),l=h(e("../../../components/ui/button")),c=h(e("../../../components/ui/info-tooltip")),u=h(e("../../../components/ui/toggle-button")),d=h(e("../../../components/ui/box")),p=h(e("../../../components/ui/typography")),f=e("../../../helpers/constants/design-system"),m=e("../swaps.util"),g=e("../../../../shared/constants/swaps");function h(e){return e&&e.__esModule?e:{default:e}}function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(_=function(e){return e?a:t})(e)}function y({onSelect:e,maxAllowedSlippage:t,currentSlippage:a,smartTransactionsEnabled:r,smartTransactionsOptInStatus:h,setSmartTransactionsOptInStatus:_,currentSmartTransactionsError:y,isDirectWrappingEnabled:v}){const E=(0,n.useContext)(o.I18nContext),[w,b]=(0,n.useState)((()=>"number"!=typeof a||Object.values(g.Slippage).includes(a)?"":a.toString())),[T,k]=(0,n.useState)(!1),[C,S]=(0,n.useState)((()=>a===g.Slippage.high?1:a===g.Slippage.default?0:"number"==typeof a?2:0)),[N,O]=(0,n.useState)((()=>a!==g.Slippage.default)),[x,I]=(0,n.useState)(null);let P="";w&&(Number(w)<0?P=E("swapSlippageNegative"):Number(w)>0&&Number(w)<=1?P=E("swapLowSlippageError"):Number(w)>=5&&Number(w)<=t?P=E("swapHighSlippageWarning"):Number(w)>t&&(P=E("swapsExcessiveSlippageWarning")));const M=w||E("swapCustom");return(0,n.useEffect)((()=>{x&&T&&window.document.activeElement!==x&&x.focus()}),[x,T]),n.default.createElement("div",{className:"slippage-buttons"},n.default.createElement("button",{onClick:()=>O(!N),className:(0,s.default)("slippage-buttons__header",{"slippage-buttons__header--open":N})},n.default.createElement("div",{className:"slippage-buttons__header-text"},E("swapsAdvancedOptions")),N?n.default.createElement("i",{className:"fa fa-angle-up"}):n.default.createElement("i",{className:"fa fa-angle-down"})),n.default.createElement("div",{className:"slippage-buttons__content"},N&&n.default.createElement(n.default.Fragment,null,!v&&n.default.createElement("div",{className:"slippage-buttons__dropdown-content"},n.default.createElement("div",{className:"slippage-buttons__buttons-prefix"},n.default.createElement("div",{className:"slippage-buttons__prefix-text"},E("swapsMaxSlippage")),n.default.createElement(c.default,{position:"top",contentText:E("swapSlippageTooltip")})),n.default.createElement(i.default,{defaultActiveButtonIndex:2!==C||w?C:1,variant:"radiogroup",newActiveButtonIndex:C,className:(0,s.default)("button-group","slippage-buttons__button-group")},n.default.createElement(l.default,{onClick:()=>{b(""),k(!1),S(0),e(g.Slippage.default)}},E("swapSlippagePercent",[g.Slippage.default])),n.default.createElement(l.default,{onClick:()=>{b(""),k(!1),S(1),e(g.Slippage.high)}},E("swapSlippagePercent",[g.Slippage.high])),n.default.createElement(l.default,{className:(0,s.default)("slippage-buttons__button-group-custom-button",{"radio-button--danger":P}),onClick:()=>{S(2),k(!0)}},T?n.default.createElement("div",{className:(0,s.default)("slippage-buttons__custom-input",{"slippage-buttons__custom-input--danger":P})},n.default.createElement("input",{"data-testid":"slippage-buttons__custom-slippage",onChange:t=>{const{value:a}=t.target;!isNaN(Number(a))&&(b(a),e(Number(a)))},type:"text",maxLength:"4",ref:I,onBlur:()=>{k(!1)},value:w||""})):M,(w||T)&&n.default.createElement("div",{className:"slippage-buttons__percentage-suffix"},"%")))),r&&n.default.createElement(d.default,{marginTop:2,display:f.DISPLAY.FLEX},n.default.createElement(d.default,{display:f.DISPLAY.FLEX,alignItems:f.AlignItems.center,paddingRight:3},n.default.createElement(p.default,{variant:f.TypographyVariant.H6,boxProps:{paddingRight:2},fontWeight:f.FONT_WEIGHT.BOLD},E("smartTransaction")),y?n.default.createElement(c.default,{position:"top",contentText:(0,m.getTranslatedStxErrorMessage)(y,E)}):n.default.createElement(c.default,{position:"top",contentText:E("stxTooltip")})),n.default.createElement(u.default,{value:h,onToggle:e=>{_(!e,e)},offLabel:E("off"),onLabel:E("on"),disabled:Boolean(y)}))),P&&n.default.createElement("div",{className:"slippage-buttons__error-text"},P)))}y.propTypes={onSelect:r.default.func.isRequired,maxAllowedSlippage:r.default.number.isRequired,currentSlippage:r.default.number,smartTransactionsEnabled:r.default.bool.isRequired,smartTransactionsOptInStatus:r.default.bool,setSmartTransactionsOptInStatus:r.default.func,currentSmartTransactionsError:r.default.string,isDirectWrappingEnabled:r.default.bool}}}},{package:"$root$",file:"ui/pages/swaps/slippage-buttons/slippage-buttons.js"}],[4410,{react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(){return r.default.createElement("svg",{width:"15",height:"13",viewBox:"0 0 15 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.default.createElement("path",{d:"M14.4946 6.14779C14.4863 5.93594 14.3991 5.69108 14.2539 5.53666L9.51334 0.49958C9.1921 0.21091 8.57613 0.0917437 8.21709 0.425509C7.86344 0.754237 7.87396 1.39178 8.22627 1.72181L11.5595 5.25889L1.1618 5.25889C0.670919 5.25889 0.272949 5.65687 0.272949 6.14779C0.272949 6.6387 0.670919 7.03668 1.1618 7.03668L11.5595 7.03668L8.22627 10.5738C7.92297 10.8776 7.86691 11.5376 8.21709 11.8701C8.56718 12.2025 9.20529 12.0963 9.51334 11.796L14.2539 6.75891C14.4161 6.58653 14.4952 6.38428 14.4946 6.14779Z",fill:"#D6D9DC"}))};var n,r=(n=e("react"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/smart-transaction-status/arrow-icon.js"}],[4411,{react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(){return r.default.createElement("svg",{width:"41",height:"39",viewBox:"0 0 41 39",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.default.createElement("path",{d:"M34.5805 6.55143C36.1394 8.11033 37.3994 9.91222 38.3237 11.8681C38.7066 12.6782 39.0318 13.5148 39.2968 14.3714L39.3242 14.4606C39.4816 14.9785 39.6171 15.5037 39.73 16.0347C40.6511 20.3654 40.0335 24.9029 37.9511 28.8509C35.6001 33.308 31.5749 36.6487 26.7609 38.138C24.3773 38.8754 21.8717 39.1361 19.3873 38.9052C16.9029 38.6743 14.4883 37.9563 12.2813 36.7922C10.2608 35.7264 8.52045 34.3588 7.08333 32.7636C5.61245 31.1448 4.43054 29.2824 3.59178 27.2574C3.32329 26.6092 2.89685 25.2767 2.89685 25.2767H6.89583C7.68667 27.4068 8.96033 29.362 10.6288 30.9609L10.6318 30.96C11.5096 31.8005 12.501 32.5516 13.595 33.1786C15.8742 34.483 18.4736 35.1864 21.1455 35.1864C25.1768 35.1864 29.0429 33.585 31.8935 30.7345C34.744 27.8839 36.3455 24.0177 36.3455 19.9865C36.3455 18.7267 36.1891 17.483 35.8871 16.2814C35.8206 16.017 35.7471 15.7546 35.6666 15.4945C34.4752 11.6432 31.8027 8.42306 28.237 6.54231C24.6713 4.66156 20.5045 4.27429 16.6533 5.46571C12.8837 6.63189 9.71868 9.21706 7.82253 12.6699L12.8961 15.307L3.28331 18.3447L0.245605 8.73191L4.45005 10.9171C6.81537 6.56278 10.7905 3.30177 15.5303 1.83546C17.3658 1.26761 19.2587 0.986653 21.1455 0.986694C26.1846 0.986694 31.0173 2.98824 34.5805 6.55143Z",fill:"var(--color-primary-default)"}),r.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.1252 22.1036L14.7107 18.689L12.0926 21.3257L18.1252 27.3584L30.2322 15.2515L27.614 12.6148L18.1252 22.1036Z",fill:"var(--color-primary-default)"}))};var n,r=(n=e("react"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/smart-transaction-status/canceled-icon.js"}],[4412,{"./smart-transaction-status":4414},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./smart-transaction-status"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/smart-transaction-status/index.js"}],[4413,{react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(){return r.default.createElement("svg",{width:"41",height:"39",viewBox:"0 0 41 39",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.default.createElement("path",{d:"M34.6806 6.55143C36.2395 8.11033 37.4995 9.91222 38.4238 11.8681C38.8067 12.6782 39.1319 13.5148 39.3969 14.3714L39.4243 14.4606C39.5817 14.9785 39.7172 15.5037 39.8301 16.0347C40.7512 20.3654 40.1336 24.9029 38.0512 28.8509C35.7002 33.308 31.675 36.6487 26.861 38.138C24.4773 38.8754 21.9718 39.1361 19.4874 38.9052C17.003 38.6743 14.5884 37.9563 12.3814 36.7922C10.3609 35.7264 8.62055 34.3588 7.18343 32.7636C5.71254 31.1448 4.53064 29.2824 3.69188 27.2574C3.42339 26.6092 2.99695 25.2767 2.99695 25.2767H6.99592C7.78677 27.4068 9.06042 29.362 10.7289 30.9609L10.7319 30.96C11.6097 31.8005 12.6011 32.5516 13.6951 33.1786C15.9743 34.483 18.5737 35.1864 21.2456 35.1864C25.2769 35.1864 29.143 33.585 31.9936 30.7345C34.8441 27.8839 36.4456 24.0177 36.4456 19.9865C36.4456 18.7267 36.2892 17.483 35.9872 16.2814C35.9207 16.017 35.8471 15.7546 35.7667 15.4945C34.5753 11.6432 31.9028 8.42306 28.3371 6.54231C24.7714 4.66156 20.6046 4.27429 16.7534 5.46571C12.9838 6.63189 9.81878 9.21706 7.92263 12.6699L12.9962 15.307L3.3834 18.3447L0.345703 8.73191L4.55015 10.9171C6.91547 6.56278 10.8906 3.30177 15.6304 1.83546C17.4659 1.26761 19.3588 0.986653 21.2456 0.986694C26.2847 0.986694 31.1174 2.98824 34.6806 6.55143Z",fill:"#D73A49"}),r.default.createElement("path",{d:"M18.5849 19.9869L15.1454 23.4264L17.9845 26.2655L21.424 22.826L24.8635 26.2655L27.7026 23.4264L24.2631 19.9869L27.7026 16.5473L24.8635 13.7082L21.424 17.1478L17.9845 13.7082L15.1454 16.5473L18.5849 19.9869Z",fill:"#D73A49"}))};var n,r=(n=e("react"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/smart-transaction-status/reverted-icon.js"}],[4414,{"../../../../shared/constants/metametrics":3408,"../../../../shared/constants/swaps":3413,"../../../../shared/constants/transaction":3417,"../../../../shared/lib/transactions-controller-utils":3425,"../../../components/ui/box":3900,"../../../components/ui/typography":4039,"../../../components/ui/url-icon":4044,"../../../contexts/i18n":4047,"../../../contexts/metametrics":4048,"../../../ducks/metamask/metamask":4062,"../../../ducks/swaps/swaps":4066,"../../../helpers/constants/design-system":4070,"../../../helpers/constants/routes":4074,"../../../selectors":4436,"../../../store/actions":4443,"../create-new-swap":4378,"../swaps-footer":4418,"../swaps.util":4420,"../view-on-block-explorer":4421,"./arrow-icon":4410,"./canceled-icon":4411,"./reverted-icon":4413,"./success-icon":4415,"./timer-icon":4416,"./unknown-icon":4417,"@metamask/etherscan-link":1221,lodash:2932,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(){var e,t,a,A,R,D,j,L,F,U,W;const[q,B]=(0,n.useState)(!1),H=(0,n.useContext)(l.I18nContext),G=(0,s.useHistory)(),$=(0,r.useDispatch)(),K=(0,r.useSelector)(c.getFetchParams,i.isEqual)||{},{destinationTokenInfo:V={},sourceTokenInfo:Q={}}=(null==K?void 0:K.metaData)||{},Y=(0,r.useSelector)(u.isHardwareWallet),Z=(0,r.useSelector)(u.getHardwareWalletType),z=(0,r.useSelector)(c.getSelectedQuote,i.isEqual),X=(0,r.useSelector)(c.getTopQuote,i.isEqual),J=z||X,ee=(0,r.useSelector)(c.getCurrentSmartTransactions,i.isEqual),te=(0,r.useSelector)(c.getSmartTransactionsOptInStatus),ae=(0,r.useSelector)(u.getCurrentChainId),ne=(0,r.useSelector)(u.getRpcPrefsForCurrentProvider,r.shallowEqual),re=(0,r.useSelector)(c.getSwapsNetworkConfig,r.shallowEqual),se=(0,r.useSelector)(c.getSmartTransactionsEnabled),oe=(0,r.useSelector)(c.getCurrentSmartTransactionsEnabled),ie=ne.blockExplorerUrl??d.SWAPS_CHAINID_DEFAULT_BLOCK_EXPLORER_URL_MAP[ae]??null,le=(0,r.useSelector)(p.getNativeCurrency),ce=(0,r.useSelector)(u.conversionRateSelector),ue=(0,r.useSelector)(u.getUSDConversionRate),de=(0,r.useSelector)(u.getCurrentCurrency);let pe,fe,me=E.SmartTransactionStatus.pending,ge={};if(ee&&ee.length>0){var he,_e,ye,ve;ge=ee[ee.length-1],pe=null===(he=ge)||void 0===he?void 0:he.uuid,me=(null===(_e=ge)||void 0===_e?void 0:_e.status)||E.SmartTransactionStatus.pending,fe=null===(ye=ge)||void 0===ye||null===(ve=ye.statusMetadata)||void 0===ve?void 0:ve.cancellationFeeWei}const[Ee,we]=(0,n.useState)(re.stxStatusDeadline),be={needs_two_confirmations:!0,token_from:Q.symbol??(null===(e=ge)||void 0===e?void 0:e.sourceTokenSymbol),token_from_amount:(null==K?void 0:K.value)??(null===(t=ge)||void 0===t?void 0:t.swapTokenValue),token_to:V.symbol??(null===(a=ge)||void 0===a?void 0:a.destinationTokenSymbol),request_type:null!=K&&K.balanceError?"Quote":"Order",slippage:null==K?void 0:K.slippage,custom_slippage:2===(null==K?void 0:K.slippage),is_hardware_wallet:Y,hardware_wallet_type:Z,stx_enabled:se,current_stx_enabled:oe,stx_user_opt_in:te};let Te;var ke;null!=J&&J.destinationAmount&&(Te=(0,S.calcTokenAmount)(null==J?void 0:J.destinationAmount,V.decimals??(null===(ke=ge)||void 0===ke?void 0:ke.destinationTokenDecimals)).toPrecision(8));const Ce=(0,n.useContext)(T.MetaMetricsContext),Se=me===E.SmartTransactionStatus.pending,Ne=Se||me===E.SmartTransactionStatus.success,Oe=null===(A=ge)||void 0===A||null===(R=A.statusMetadata)||void 0===R?void 0:R.minedHash;(0,n.useEffect)((()=>{Ce({event:"STX Status Page Loaded",category:v.MetaMetricsEventCategory.Swaps,sensitiveProperties:be})}),[]),(0,n.useEffect)((()=>{let e;if(Se&&pe){const t=()=>{const t=Math.round((Date.now()-ge.time)/1e3);if(t>re.stxStatusDeadline)return we(0),void clearInterval(e);we(re.stxStatusDeadline-t)};e=setInterval(t,1e3),t()}return()=>clearInterval(e)}),[$,Se,pe,ge.time,re.stxStatusDeadline]),(0,n.useEffect)((()=>{$((0,y.setBackgroundSwapRouteState)("smartTransactionStatus")),setTimeout((()=>{$((0,y.stopPollingForQuotes)())}),1e3)}),[$]);let xe,Ie,Pe,Me,Ae=H("stxPendingPrivatelySubmittingSwap");Se&&(q?Ae=H("stxTryingToCancel"):fe>0&&(Ae=H("stxPendingPubliclySubmittingSwap")));if(me===E.SmartTransactionStatus.success){var Re,De;if(Ae=H("stxSuccess"),V.symbol||null!==(Re=ge)&&void 0!==Re&&Re.destinationTokenSymbol)xe=H("stxSuccessDescription",[V.symbol??(null===(De=ge)||void 0===De?void 0:De.destinationTokenSymbol)]);Pe=n.default.createElement(N.default,null)}else"cancelled_user_cancelled"===me||(null===(D=ge)||void 0===D||null===(j=D.statusMetadata)||void 0===j?void 0:j.minedTx)===E.SmartTransactionStatus.cancelled?(Ae=H("stxUserCancelled"),xe=H("stxUserCancelledDescription"),Pe=n.default.createElement(x.default,null)):me.startsWith("cancelled")||me.includes("deadline_missed")?(Ae=H("stxCancelled"),xe=H("stxCancelledDescription"),Ie=H("stxCancelledSubDescription"),Pe=n.default.createElement(x.default,null)):"unknown"===me?(Ae=H("stxUnknown"),xe=H("stxUnknownDescription"),Pe=n.default.createElement(I.default,null)):"reverted"===me&&(Ae=H("stxFailure"),xe=H("stxFailureDescription",[n.default.createElement("a",{className:"smart-transaction-status__support-link",key:"smart-transaction-status-support-link",href:"https://support.metamask.io",target:"_blank",rel:"noopener noreferrer"},H("customerSupport"))]),Pe=n.default.createElement(O.default,null));Oe&&pe&&(Me=(0,o.getBlockExplorerLink)({hash:Oe,chainId:ae},{blockExplorerUrl:ie}));const je=ge.cancellable&&!q,Le=()=>{let e;return fe>0&&({feeInFiat:e}=(0,b.getFeeForSmartTransaction)({chainId:ae,currentCurrency:de,conversionRate:ce,USDConversionRate:ue,nativeCurrencySymbol:le,feeInWeiDec:fe})),n.default.createElement(g.default,{marginBottom:0},n.default.createElement("a",{className:"smart-transaction-status__cancel-swap-link",href:"#",onClick:e=>{null==e||e.preventDefault(),B(!0),Ce({event:"Cancel STX",category:v.MetaMetricsEventCategory.Swaps,sensitiveProperties:be}),$((0,c.cancelSwapsSmartTransaction)(pe))}},e?H("cancelSwapForFee",[e]):H("cancelSwapForFree")))};return n.default.createElement("div",{className:"smart-transaction-status"},n.default.createElement(g.default,{paddingLeft:8,paddingRight:8,height:_.BLOCK_SIZES.FULL,justifyContent:_.JustifyContent.flexStart,display:_.DISPLAY.FLEX,className:"smart-transaction-status__content"},n.default.createElement(g.default,{marginTop:10,marginBottom:0,display:_.DISPLAY.FLEX,justifyContent:_.JustifyContent.center,alignItems:_.AlignItems.center},n.default.createElement(m.default,{color:_.TextColor.textAlternative,variant:_.TypographyVariant.H6},`${(null==K?void 0:K.value)&&Number(K.value).toFixed(5)} `),n.default.createElement(m.default,{color:_.TextColor.textAlternative,variant:_.TypographyVariant.H6,fontWeight:_.FONT_WEIGHT.BOLD,boxProps:{marginLeft:1,marginRight:2}},Q.symbol??(null===(L=ge)||void 0===L?void 0:L.sourceTokenSymbol)),Q.iconUrl?n.default.createElement(h.default,{url:Q.iconUrl,className:"main-quote-summary__icon",name:Q.symbol??(null===(F=ge)||void 0===F?void 0:F.destinationTokenSymbol),fallbackClassName:"main-quote-summary__icon-fallback"}):null,n.default.createElement(g.default,{display:_.DISPLAY.BLOCK,marginLeft:2,marginRight:2},n.default.createElement(P.default,null)),V.iconUrl?n.default.createElement(h.default,{url:V.iconUrl,className:"main-quote-summary__icon",name:V.symbol??(null===(U=ge)||void 0===U?void 0:U.destinationTokenSymbol),fallbackClassName:"main-quote-summary__icon-fallback"}):null,n.default.createElement(m.default,{color:_.TextColor.textAlternative,variant:_.TypographyVariant.H6,boxProps:{marginLeft:2}},`~${Te&&Number(Te).toFixed(5)} `),n.default.createElement(m.default,{color:_.TextColor.textAlternative,variant:_.TypographyVariant.H6,fontWeight:_.FONT_WEIGHT.BOLD,boxProps:{marginLeft:1}},V.symbol??(null===(W=ge)||void 0===W?void 0:W.destinationTokenSymbol))),n.default.createElement(g.default,{marginTop:3,className:"smart-transaction-status__background-animation smart-transaction-status__background-animation--top"}),Pe&&n.default.createElement(g.default,{marginTop:3,marginBottom:2},Pe),Se&&n.default.createElement(g.default,{marginTop:7,marginBottom:1,display:_.DISPLAY.FLEX,justifyContent:_.JustifyContent.center,alignItems:_.AlignItems.center},n.default.createElement(M.default,null),n.default.createElement(m.default,{color:_.TextColor.textAlternative,variant:_.TypographyVariant.H6,boxProps:{marginLeft:1}},`${H("stxSwapCompleteIn")} `),n.default.createElement(m.default,{color:_.TextColor.textAlternative,variant:_.TypographyVariant.H6,fontWeight:_.FONT_WEIGHT.BOLD,boxProps:{marginLeft:1},className:"smart-transaction-status__remaining-time"},(0,b.showRemainingTimeInMinAndSec)(Ee))),n.default.createElement(m.default,{color:_.TextColor.textDefault,variant:_.TypographyVariant.H4,fontWeight:_.FONT_WEIGHT.BOLD},Ae),Se&&n.default.createElement("div",{className:"smart-transaction-status__loading-bar-container"},n.default.createElement("div",{className:"smart-transaction-status__loading-bar",style:{width:100/re.stxStatusDeadline*(re.stxStatusDeadline-Ee)+"%"}})),xe&&n.default.createElement(m.default,{variant:_.TypographyVariant.H6,boxProps:{...Me&&{margin:[1,0,0]}},color:_.TextColor.textAlternative},xe),Me&&n.default.createElement(C.default,{blockExplorerUrl:Me,sensitiveTrackingProperties:be}),n.default.createElement(g.default,{marginTop:3,className:"smart-transaction-status__background-animation smart-transaction-status__background-animation--bottom"}),Ie&&n.default.createElement(m.default,{variant:_.TypographyVariant.H7,boxProps:{marginTop:8},color:_.TextColor.textAlternative},Ie)),je&&pe&&Se&&n.default.createElement(Le,null),me===E.SmartTransactionStatus.success?n.default.createElement(k.default,{sensitiveTrackingProperties:be}):null,n.default.createElement(w.default,{onSubmit:async()=>{Ne?(await $((0,c.prepareToLeaveSwaps)()),G.push(f.DEFAULT_ROUTE)):G.push(f.BUILD_QUOTE_ROUTE)},onCancel:async()=>{await $((0,c.prepareToLeaveSwaps)()),G.push(f.DEFAULT_ROUTE)},submitText:H(Ne?"close":"tryAgain"),hideCancel:Ne,cancelText:H("close"),className:"smart-transaction-status__swaps-footer"}))};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=R(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=e("react-redux"),s=e("react-router-dom"),o=e("@metamask/etherscan-link"),i=e("lodash"),l=e("../../../contexts/i18n"),c=e("../../../ducks/swaps/swaps"),u=e("../../../selectors"),d=e("../../../../shared/constants/swaps"),p=e("../../../ducks/metamask/metamask"),f=e("../../../helpers/constants/routes"),m=A(e("../../../components/ui/typography")),g=A(e("../../../components/ui/box")),h=A(e("../../../components/ui/url-icon")),_=e("../../../helpers/constants/design-system"),y=e("../../../store/actions"),v=e("../../../../shared/constants/metametrics"),E=e("../../../../shared/constants/transaction"),w=A(e("../swaps-footer")),b=e("../swaps.util"),T=e("../../../contexts/metametrics"),k=A(e("../create-new-swap")),C=A(e("../view-on-block-explorer")),S=e("../../../../shared/lib/transactions-controller-utils"),N=A(e("./success-icon")),O=A(e("./reverted-icon")),x=A(e("./canceled-icon")),I=A(e("./unknown-icon")),P=A(e("./arrow-icon")),M=A(e("./timer-icon"));function A(e){return e&&e.__esModule?e:{default:e}}function R(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(R=function(e){return e?a:t})(e)}}}},{package:"$root$",file:"ui/pages/swaps/smart-transaction-status/smart-transaction-status.js"}],[4415,{react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(){return r.default.createElement("svg",{width:"39",height:"39",viewBox:"0 0 39 39",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.default.createElement("path",{d:"M34.5457 19.8983C34.5457 23.9296 32.9443 27.7958 30.0937 30.6463C27.2432 33.4969 23.377 35.0983 19.3457 35.0983C15.3144 35.0983 11.4482 33.4969 8.59768 30.6463C5.74713 27.7958 4.1457 23.9296 4.1457 19.8983C4.1457 15.867 5.74713 12.0008 8.59768 9.15029C11.4482 6.29974 15.3144 4.69832 19.3457 4.69832C20.7897 4.69832 22.1957 4.90732 23.5257 5.28732L26.5087 2.30432C24.3047 1.39232 21.8917 0.898315 19.3457 0.898315C16.8506 0.898315 14.3799 1.38977 12.0747 2.3446C9.76953 3.29944 7.67499 4.69897 5.91067 6.46329C2.34748 10.0265 0.345703 14.8592 0.345703 19.8983C0.345703 24.9374 2.34748 29.7702 5.91067 33.3333C7.67499 35.0977 9.76953 36.4972 12.0747 37.452C14.3799 38.4069 16.8506 38.8983 19.3457 38.8983C24.3848 38.8983 29.2175 36.8965 32.7807 33.3333C36.3439 29.7702 38.3457 24.9374 38.3457 19.8983H34.5457ZM11.5747 16.2503L8.8957 18.9483L17.4457 27.4983L36.4457 8.49832L33.7667 5.80032L17.4457 22.1213L11.5747 16.2503Z",fill:"#28A745"}))};var n,r=(n=e("react"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/smart-transaction-status/success-icon.js"}],[4416,{react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(){return r.default.createElement("svg",{width:"15",height:"14",viewBox:"0 0 15 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.default.createElement("path",{d:"M7.36621 0.0810547C3.62012 0.0810547 0.584961 3.11621 0.584961 6.8623C0.584961 10.6084 3.62012 13.6436 7.36621 13.6436C11.1123 13.6436 14.1475 10.6084 14.1475 6.8623C14.1475 3.11621 11.1123 0.0810547 7.36621 0.0810547ZM7.36621 12.3311C4.33105 12.3311 1.89746 9.89746 1.89746 6.8623C1.89746 3.85449 4.33105 1.39355 7.36621 1.39355C10.374 1.39355 12.835 3.85449 12.835 6.8623C12.835 9.89746 10.374 12.3311 7.36621 12.3311ZM9.03418 9.4873C9.19824 9.59668 9.38965 9.56934 9.49902 9.40527L10.0186 8.72168C10.1279 8.55762 10.1006 8.36621 9.93652 8.25684L8.13184 6.91699V3.03418C8.13184 2.87012 7.96777 2.70605 7.80371 2.70605H6.92871C6.7373 2.70605 6.60059 2.87012 6.60059 3.03418V7.5459C6.60059 7.62793 6.62793 7.7373 6.70996 7.79199L9.03418 9.4873Z",fill:"var(--color-primary-default)"}))};var n,r=(n=e("react"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/smart-transaction-status/timer-icon.js"}],[4417,{react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(){return r.default.createElement("svg",{width:"39",height:"39",viewBox:"0 0 39 39",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.default.createElement("circle",{cx:"19.1533",cy:"19.2715",r:"17.1",stroke:"var(--color-primary-default)",strokeWidth:"3.8"}),r.default.createElement("path",{d:"M16.712 21.5034C16.712 20.7834 16.88 20.1834 17.216 19.7034C17.568 19.2074 18.08 18.7274 18.752 18.2634C19.008 18.0874 19.264 17.9274 19.52 17.7834C19.776 17.6394 20 17.4874 20.192 17.3274C20.4 17.1514 20.56 16.9674 20.672 16.7754C20.8 16.5674 20.864 16.3194 20.864 16.0314C20.864 15.5354 20.688 15.1594 20.336 14.9034C20 14.6474 19.592 14.5194 19.112 14.5194C18.616 14.5194 18.16 14.6794 17.744 14.9994C17.344 15.3034 17.144 15.7674 17.144 16.3914H13.52C13.52 15.6394 13.664 14.9354 13.952 14.2794C14.24 13.6074 14.632 13.0314 15.128 12.5514C15.64 12.0554 16.232 11.6634 16.904 11.3754C17.592 11.0874 18.328 10.9434 19.112 10.9434C19.896 10.9434 20.616 11.0794 21.272 11.3514C21.944 11.6234 22.512 11.9834 22.976 12.4314C23.456 12.8794 23.824 13.3994 24.08 13.9914C24.352 14.5674 24.488 15.1754 24.488 15.8154C24.488 16.2314 24.456 16.6234 24.392 16.9914C24.344 17.3594 24.24 17.7114 24.08 18.0474C23.936 18.3834 23.728 18.7114 23.456 19.0314C23.184 19.3514 22.84 19.6634 22.424 19.9674C21.784 20.4474 21.272 20.8234 20.888 21.0954C20.52 21.3674 20.336 21.6474 20.336 21.9354V21.9594H16.712V21.5034ZM18.512 28.4634C18.16 28.4634 17.824 28.3994 17.504 28.2714C17.2 28.1274 16.928 27.9434 16.688 27.7194C16.464 27.4794 16.28 27.2074 16.136 26.9034C16.008 26.5834 15.944 26.2474 15.944 25.8954C15.944 25.5434 16.008 25.2154 16.136 24.9114C16.28 24.5914 16.464 24.3194 16.688 24.0954C16.928 23.8554 17.2 23.6714 17.504 23.5434C17.824 23.3994 18.16 23.3274 18.512 23.3274C18.864 23.3274 19.192 23.3994 19.496 23.5434C19.816 23.6714 20.088 23.8554 20.312 24.0954C20.552 24.3194 20.736 24.5914 20.864 24.9114C21.008 25.2154 21.08 25.5434 21.08 25.8954C21.08 26.2474 21.008 26.5834 20.864 26.9034C20.736 27.2074 20.552 27.4794 20.312 27.7194C20.088 27.9434 19.816 28.1274 19.496 28.2714C19.192 28.3994 18.864 28.4634 18.512 28.4634Z",fill:"var(--color-primary-default)"}))};var n,r=(n=e("react"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/smart-transaction-status/unknown-icon.js"}],[4418,{"./swaps-footer":4419},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./swaps-footer"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/swaps-footer/index.js"}],[4419,{"../../../components/ui/page-container/page-container-footer":3994,"../../../contexts/i18n":4047,classnames:1980,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=u;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=c(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=l(e("prop-types")),s=l(e("classnames")),o=e("../../../contexts/i18n"),i=l(e("../../../components/ui/page-container/page-container-footer"));function l(e){return e&&e.__esModule?e:{default:e}}function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(c=function(e){return e?a:t})(e)}function u({onCancel:e,hideCancel:t,onSubmit:a,submitText:r,disabled:l,showTermsOfService:c,showTopBorder:u,className:d="",cancelText:p}){const f=(0,n.useContext)(o.I18nContext);return n.default.createElement("div",{className:"swaps-footer"},n.default.createElement("div",{className:(0,s.default)("swaps-footer__buttons",d,{"swaps-footer__buttons--border":u})},n.default.createElement(i.default,{onCancel:e,hideCancel:t,cancelText:p||f("back"),onSubmit:a,submitText:r,footerClassName:(0,s.default)("swaps-footer__custom-page-container-footer-class",d),footerButtonClassName:(0,s.default)("swaps-footer__custom-page-container-footer-button-class",{"swaps-footer__custom-page-container-footer-button-class--single":t}),disabled:l})),c&&n.default.createElement("div",{className:"swaps-footer__bottom-text",onClick:()=>global.platform.openTab({url:"https://metamask.io/terms.html"})},f("termsOfService")))}u.propTypes={onCancel:r.default.func,hideCancel:r.default.bool,onSubmit:r.default.func.isRequired,submitText:r.default.string,disabled:r.default.bool,showTermsOfService:r.default.bool,showTopBorder:r.default.bool,className:r.default.string,cancelText:r.default.string}}}},{package:"$root$",file:"ui/pages/swaps/swaps-footer/swaps-footer.js"}],[4420,{"../../../shared/constants/common":3403,"../../../shared/constants/network":3409,"../../../shared/constants/swaps":3413,"../../../shared/lib/fetch-with-cache":3419,"../../../shared/lib/swaps-utils":3422,"../../../shared/lib/transactions-controller-utils":3425,"../../../shared/modules/conversion.utils":3431,"../../../shared/modules/hexstring-utils":3435,"../../../shared/modules/swaps.utils":3443,"../../helpers/utils/confirm-tx.util":4090,"bignumber.js":1853},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.countDecimals=a.StxErrorTypes=void 0,a.fetchAggregatorMetadata=async function(e){const t=(0,p.getBaseApi)("aggregatorMetadata",e),a=await(0,c.default)(t,{method:"GET",headers:_},{cacheRefreshTime:g}),n={};for(const e in a)(0,p.validateData)(E,a[e],t)&&(n[e]=a[e]);return n},a.fetchSwapsFeatureFlags=async function(){const e=s.SWAPS_API_V2_BASE_URL;return await(0,c.default)(`${e}/featureFlags`,{method:"GET",headers:_},{cacheRefreshTime:6e5})},a.fetchSwapsGasPrices=async function(e){const t=(0,p.getBaseApi)("gasPrices",e),a=await(0,c.default)(t,{method:"GET",headers:_},{cacheRefreshTime:3e4});if(!(0,p.validateData)(b,a,t))throw new Error(`${t} response is invalid`);const{SafeGasPrice:n,ProposeGasPrice:r,FastGasPrice:s}=a;return{safeLow:n,average:r,fast:s}},a.fetchToken=async function(e,t){const a=(0,p.getBaseApi)("token",t);return await(0,c.default)(`${a}?address=${e}`,{method:"GET",headers:_},{cacheRefreshTime:g})},a.fetchTokenPrice=async function(e){var t;const a=`contract_addresses=${e}&vs_currencies=eth`,n=await(0,c.default)(`https://api.coingecko.com/api/v3/simple/token_price/ethereum?${a}`,{method:"GET"},{cacheRefreshTime:6e4});return null==n||null===(t=n[e])||void 0===t?void 0:t.eth},a.fetchTokens=async function(e){const t=(0,p.getBaseApi)("tokens",e),a=await(0,c.default)(t,{method:"GET",headers:_},{cacheRefreshTime:g});return[s.SWAPS_CHAINID_DEFAULT_TOKEN_MAP[e]||null,...a.filter((a=>(0,p.validateData)(y,a,t,false)&&!((0,o.isSwapsDefaultTokenSymbol)(a.symbol,e)||(0,o.isSwapsDefaultTokenAddress)(a.address,e))))]},a.fetchTopAssets=async function(e){const t=(0,p.getBaseApi)("topAssets",e),a=await(0,c.default)(t,{method:"GET",headers:_},{cacheRefreshTime:g})||[];return a.reduce(((e,a,n)=>(0,p.validateData)(v,a,t)?{...e,[a.address]:{index:String(n)}}:e),{})},a.formatSwapsValueForDisplay=C,a.getNetworkNameByChainId=a.getFeeForSmartTransaction=void 0,a.getRenderableNetworkFeesForQuote=k,a.parseSmartTransactionsError=a.isContractAddressValid=a.getTranslatedStxErrorMessage=a.getSwapsLivenessForNetwork=void 0,a.quotesToRenderableData=function({quotes:e,gasPrice:t,conversionRate:a,currentCurrency:n,approveGas:s,tokenConversionRates:i,chainId:l,smartTransactionEstimatedGas:c,nativeCurrencySymbol:u,multiLayerL1ApprovalFeeTotal:p}){return Object.values(e).map((e=>{const{destinationAmount:m=0,sourceAmount:g=0,sourceTokenInfo:h,destinationTokenInfo:_,slippage:y,aggType:v,aggregator:E,gasEstimateWithRefund:w,averageGas:b,fee:S,trade:N,multiLayerL1TradeFeeTotal:O}=e;let x=null;null!==O&&null!==p?x=(0,f.sumHexes)(O||"0x0",p||"0x0"):null!==O&&(x=O);const I=(0,d.calcTokenAmount)(g,h.decimals).toString(10),P=(0,d.calcTokenAmount)(m,_.decimals).toPrecision(8);let M=null,A=null,R=null,D=null;({feeInFiat:M,feeInEth:A,rawNetworkFees:R,rawEthFee:D}=k({tradeGas:w||(0,f.decimalToHex)(b||8e5),approveGas:s,gasPrice:t,currentCurrency:n,conversionRate:a,tradeValue:N.value,sourceSymbol:h.symbol,sourceAmount:g,chainId:l,multiLayerL1FeeTotal:x})),c&&({feeInFiat:M,feeInEth:A}=T({chainId:l,currentCurrency:n,conversionRate:a,nativeCurrencySymbol:u,feeInWeiDec:c.feeEstimate}));const j=new r.BigNumber(100-y).div(100),L=new r.BigNumber(P).times(j).toFixed(6),F=i[_.address],U=(0,o.isSwapsDefaultTokenSymbol)(_.symbol,l)?(0,d.calcTokenAmount)(m,_.decimals).minus(D,10):new r.BigNumber(F||0,10).times((0,d.calcTokenAmount)(m,_.decimals),10).minus(D,10);let W,q=y;return"AGG"===v?W="swapAggregator":"RFQ"===v?(W="swapRequestForQuotation",q=0):W="DEX"===v?"swapDecentralizedExchange":"CONTRACT"===v?"swapDirectContract":"swapUnknown",{aggId:E,amountReceiving:`${P} ${_.symbol}`,destinationTokenDecimals:_.decimals,destinationTokenSymbol:_.symbol,destinationTokenValue:C(P),destinationIconUrl:_.iconUrl,isBestQuote:e.isBestQuote,liquiditySourceKey:W,feeInEth:A,detailedNetworkFees:`${A} (${M})`,networkFees:M,quoteSource:v,rawNetworkFees:R,slippage:q,sourceTokenDecimals:h.decimals,sourceTokenSymbol:h.symbol,sourceTokenValue:I,sourceTokenIconUrl:h.iconUrl,ethValueOfTrade:U,minimumAmountReceived:L,metaMaskFee:S}}))},a.showRemainingTimeInMinAndSec=void 0;var n,r=e("bignumber.js"),s=e("../../../shared/constants/swaps"),o=e("../../../shared/modules/swaps.utils"),i=e("../../../shared/constants/network"),l=e("../../helpers/utils/confirm-tx.util"),c=(n=e("../../../shared/lib/fetch-with-cache"))&&n.__esModule?n:{default:n},u=e("../../../shared/modules/hexstring-utils"),d=e("../../../shared/lib/transactions-controller-utils"),p=e("../../../shared/lib/swaps-utils"),f=e("../../../shared/modules/conversion.utils"),m=e("../../../shared/constants/common");const g=3e5,h="usd",_={"X-Client-Id":s.SWAPS_CLIENT_ID},y=[{property:"address",type:"string",validator:e=>(0,u.isValidHexAddress)(e,{allowNonPrefixed:!1})},{property:"symbol",type:"string",validator:e=>(0,p.truthyString)(e)&&e.length<=12},{property:"decimals",type:"string|number",validator:e=>Number(e)>=0&&Number(e)<=36}],v=y.slice(0,2),E=[{property:"color",type:"string",validator:e=>Boolean(e.match(/^#[A-Fa-f0-9]+$/u))},{property:"title",type:"string",validator:p.truthyString},{property:"icon",type:"string",validator:e=>Boolean(e.match(/^data:image/u))}],w=e=>!isNaN(e)&&e.match(/^[.0-9]+$/u)&&!isNaN(parseFloat(e)),b=[{property:"SafeGasPrice",type:"string",validator:w},{property:"ProposeGasPrice",type:"string",validator:w},{property:"FastGasPrice",type:"string",validator:w}];const T=({chainId:e,currentCurrency:t,conversionRate:a,USDConversionRate:n,nativeCurrencySymbol:r,feeInWeiDec:o})=>{var i;const c=(0,f.decimalToHex)(o),u=(0,f.getValueFromWeiHex)({value:c,toDenomination:m.EtherDenomination.ETH,numberOfDecimals:5}),d=(0,f.getValueFromWeiHex)({value:c,toCurrency:t,conversionRate:a,numberOfDecimals:2});let p;p=t===h?d:(0,f.getValueFromWeiHex)({value:c,toCurrency:h,conversionRate:n,numberOfDecimals:2});return{feeInUsd:p,feeInFiat:(0,l.formatCurrency)(d,t),feeInEth:`${u} ${r||(null===(i=s.SWAPS_CHAINID_DEFAULT_TOKEN_MAP[e])||void 0===i?void 0:i.symbol)}`,rawEthFee:u}};function k({tradeGas:e,approveGas:t,gasPrice:a,currentCurrency:n,conversionRate:i,USDConversionRate:c,tradeValue:u,sourceSymbol:p,sourceAmount:g,chainId:_,nativeCurrencySymbol:y,multiLayerL1FeeTotal:v}){const E=new r.BigNumber(e||"0x0",16).plus(t||"0x0",16).toString(16);let w=(0,d.calcGasTotal)(E,a);null!==v&&(w=(0,f.sumHexes)(w||"0x0",v||"0x0"));const b=new r.BigNumber(u,16).minus((0,o.isSwapsDefaultTokenSymbol)(p,_)?g:0,10).toString(16),T=new r.BigNumber(w,16).plus(b,16).toString(16),k=(0,f.getValueFromWeiHex)({value:T,toDenomination:m.EtherDenomination.ETH,numberOfDecimals:5}),C=(0,f.getValueFromWeiHex)({value:T,toCurrency:n,conversionRate:i,numberOfDecimals:2}),S=(0,l.formatCurrency)(C,n);let N;N=n===h?C:(0,f.getValueFromWeiHex)({value:T,toCurrency:h,conversionRate:c,numberOfDecimals:2});return{rawNetworkFees:C,feeInUsd:N,rawEthFee:k,feeInFiat:S,feeInEth:`${k} ${y||s.SWAPS_CHAINID_DEFAULT_TOKEN_MAP[_].symbol}`,nonGasFee:b}}function C(e){let t=(0,d.toPrecisionWithoutTrailingZeros)(e,12);return t.match(/e[+-]/u)&&(t=new r.BigNumber(t).toFixed()),t}a.getFeeForSmartTransaction=T;a.isContractAddressValid=(e,t)=>!(!e||!s.ALLOWED_CONTRACT_ADDRESSES[t])&&s.ALLOWED_CONTRACT_ADDRESSES[t].some((t=>e.toLowerCase()===t.toLowerCase()));const S=e=>{switch(e){case i.CHAIN_IDS.MAINNET:return s.ETHEREUM;case i.CHAIN_IDS.BSC:return s.BSC;case i.CHAIN_IDS.POLYGON:return s.POLYGON;case i.CHAIN_IDS.GOERLI:return s.GOERLI;case i.CHAIN_IDS.AVALANCHE:return s.AVALANCHE;case i.CHAIN_IDS.OPTIMISM:return s.OPTIMISM;case i.CHAIN_IDS.ARBITRUM:return s.ARBITRUM;default:return""}};a.getNetworkNameByChainId=S;a.getSwapsLivenessForNetwork=(e,t={})=>{const a=S(e);if([i.CHAIN_IDS.LOCALHOST,i.CHAIN_IDS.GOERLI].includes(e))return{swapsFeatureIsLive:!0};if(!t[a])return{swapsFeatureIsLive:!1};return t[a].extensionActive?{swapsFeatureIsLive:!0}:{swapsFeatureIsLive:t[a].fallbackToV1}};a.countDecimals=e=>{var t;return e&&Math.floor(e)!==e&&(null===(t=e.toString().split(".")[1])||void 0===t?void 0:t.length)||0};let N;a.showRemainingTimeInMinAndSec=e=>{if(!Number.isInteger(e))return"0:00";return`${Math.floor(e/60)}:${(e%60).toString().padStart(2,"0")}`},a.StxErrorTypes=N,function(e){e.unavailable="unavailable",e.notEnoughFunds="not_enough_funds",e.regularTxPending="regular_tx_pending"}(N||(a.StxErrorTypes=N={}));a.getTranslatedStxErrorMessage=(e,t)=>{switch(e){case N.unavailable:case N.regularTxPending:return t("stxErrorUnavailable");case N.notEnoughFunds:return t("stxErrorNotEnoughFunds");default:return t("stxErrorUnavailable")}};a.parseSmartTransactionsError=e=>{const t=e.slice(12);return JSON.parse(t.trim())}}}},{package:"$root$",file:"ui/pages/swaps/swaps.util.ts"}],[4421,{"./view-on-block-explorer":4422},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./view-on-block-explorer"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/view-on-block-explorer/index.js"}],[4422,{"../../../../shared/constants/metametrics":3408,"../../../components/ui/box":3900,"../../../contexts/i18n":4047,"../../../contexts/metametrics":4048,"../../../helpers/utils/util":4108,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=p;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=d(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=u(e("prop-types")),s=u(e("../../../components/ui/box")),o=e("../../../contexts/i18n"),i=e("../../../helpers/utils/util"),l=e("../../../contexts/metametrics"),c=e("../../../../shared/constants/metametrics");function u(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(d=function(e){return e?a:t})(e)}function p({blockExplorerUrl:e,sensitiveTrackingProperties:t}){const a=(0,n.useContext)(o.I18nContext),r=(0,n.useContext)(l.MetaMetricsContext),u=(0,i.getURLHostName)(e);return n.default.createElement(s.default,{marginTop:6,className:"view-on-block-explorer"},n.default.createElement("button",{onClick:()=>{r({event:c.MetaMetricsEventName.ExternalLinkClicked,category:c.MetaMetricsEventCategory.Swaps,sensitiveProperties:t,properties:{link_type:c.MetaMetricsEventLinkType.TransactionBlockExplorer,location:"Swap Transaction",url_domain:u}}),global.platform.openTab({url:e})}},a("viewOnCustomBlockExplorer",[a("blockExplorerSwapAction"),u])))}p.propTypes={blockExplorerUrl:r.default.string.isRequired,sensitiveTrackingProperties:r.default.object.isRequired}}}},{package:"$root$",file:"ui/pages/swaps/view-on-block-explorer/view-on-block-explorer.js"}],[4423,{"./view-quote":4425},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./view-quote"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/swaps/view-quote/index.js"}],[4424,{"../../../../shared/constants/gas":3404,"../../../components/ui/actionable-message/actionable-message":3896,"../../../components/ui/box":3900,"../../../components/ui/tooltip":4035,"../../../contexts/i18n":4047,"../../../helpers/constants/design-system":4070,classnames:1980,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=m;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=f(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=p(e("prop-types")),s=p(e("classnames")),o=e("../../../contexts/i18n"),i=p(e("../../../components/ui/actionable-message/actionable-message")),l=p(e("../../../components/ui/tooltip")),c=p(e("../../../components/ui/box")),u=e("../../../helpers/constants/design-system"),d=e("../../../../shared/constants/gas");function p(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(f=function(e){return e?a:t})(e)}function m(e){const{usedQuote:t,sourceTokenValue:a,destinationTokenValue:r,onAcknowledgementClick:p,acknowledged:f,priceSlippageFromSource:m,priceSlippageFromDestination:g,priceDifferencePercentage:h,priceSlippageUnknownFiatValue:_}=e,y=(0,n.useContext)(o.I18nContext);let v="",E="",w="",b="";return _?(v=y("swapPriceUnavailableTitle"),E=y("swapPriceUnavailableDescription"),w=d.GasRecommendations.high,b=y("tooltipApproveButton")):(v=y("swapPriceDifferenceTitle",[h]),E=y("swapPriceDifference",[a,t.sourceTokenInfo.symbol,m,r,t.destinationTokenInfo.symbol,g]),w=t.priceSlippage.bucket,b=y("tooltipApproveButton")),n.default.createElement("div",{className:(0,s.default)("view-quote__price-difference-warning-wrapper",w)},n.default.createElement(i.default,{message:n.default.createElement("div",{className:"view-quote__price-difference-warning-contents"},n.default.createElement("div",{className:"view-quote__price-difference-warning-contents-text"},n.default.createElement(c.default,{display:u.DISPLAY.FLEX,justifyContent:u.JustifyContent.spaceBetween,paddingBottom:2},n.default.createElement("div",{className:"view-quote__price-difference-warning-contents-title"},v),n.default.createElement(l.default,{position:"bottom",title:y("swapPriceImpactTooltip")},n.default.createElement("i",{className:"fa fa-info-circle"}))),E,!f&&n.default.createElement("div",{className:"view-quote__price-difference-warning-contents-actions"},n.default.createElement("button",{onClick:()=>{p()}},b))))}))}m.propTypes={usedQuote:r.default.object,sourceTokenValue:r.default.string,destinationTokenValue:r.default.string,onAcknowledgementClick:r.default.func,acknowledged:r.default.bool,priceSlippageFromSource:r.default.string,priceSlippageFromDestination:r.default.string,priceDifferencePercentage:r.default.number,priceSlippageUnknownFiatValue:r.default.bool}}}},{package:"$root$",file:"ui/pages/swaps/view-quote/view-quote-price-difference.js"}],[4425,{"../../../../app/scripts/lib/util":82,"../../../../shared/constants/gas":3404,"../../../../shared/constants/metametrics":3408,"../../../../shared/constants/swaps":3413,"../../../../shared/lib/metamask-controller-utils":3420,"../../../../shared/lib/swaps-utils":3422,"../../../../shared/lib/transactions-controller-utils":3425,"../../../../shared/modules/conversion.utils":3431,"../../../../shared/modules/string-utils":3442,"../../../../shared/modules/transaction.utils":3444,"../../../components/ui/actionable-message/actionable-message":3896,"../../../components/ui/box":3900,"../../../components/ui/pulse-loader":4001,"../../../contexts/i18n":4047,"../../../contexts/metametrics":4048,"../../../ducks/metamask/metamask":4062,"../../../ducks/swaps/swaps":4066,"../../../helpers/constants/routes":4074,"../../../helpers/utils/optimism/fetchEstimatedL1Fee":4102,"../../../hooks/gasFeeInput/useGasFeeInputs":4114,"../../../hooks/useEqualityCheck":4126,"../../../hooks/useEthFiatAmount":4127,"../../../hooks/usePrevious":4133,"../../../hooks/useTokenTracker":4145,"../../../selectors":4436,"../../../store/actionConstants":4442,"../../../store/actions":4443,"../../confirm-approve/confirm-approve.util":4167,"../countdown-timer":4375,"../fee-card":4386,"../main-quote-summary":4393,"../select-quote-popover":4401,"../swaps-footer":4418,"../swaps.util":4420,"./view-quote-price-difference":4424,"@sentry/browser":1403,"bignumber.js":1853,classnames:1980,lodash:2932,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(){var e,t,a,$,K,Q;const Y=(0,s.useHistory)(),Z=(0,r.useDispatch)(),z=(0,n.useContext)(u.I18nContext),X=(0,n.useContext)(h.MetaMetricsContext),[J,ee]=(0,n.useState)(!1),[te,ae]=(0,n.useState)(!1),[ne,re]=(0,n.useState)(!1),[se,oe]=(0,n.useState)(!1),[ie,le]=(0,n.useState)(null),[ce,ue]=(0,n.useState)(null),[de,pe]=(0,n.useState)(null),[fe]=(0,n.useState)(Date.now()),[me,ge]=(0,n.useState)(!1),he=[I.GasRecommendations.high,I.GasRecommendations.medium],_e=(0,r.useSelector)(y.getBackgroundSwapRouteState),ye=(0,r.useSelector)(y.getQuotes,i.isEqual);(0,n.useEffect)((()=>{Object.values(ye).length?"awaiting"===_e&&Y.push(T.AWAITING_SWAP_ROUTE):Y.push(T.BUILD_QUOTE_ROUTE)}),[Y,ye,_e]);const ve=(0,r.useSelector)(y.getQuotesLastFetched),Ee=(0,r.useSelector)(y.getUsedSwapsGasPrice),we=(0,r.useSelector)(y.getCustomSwapsGas),be=(0,r.useSelector)(y.getCustomMaxFeePerGas),Te=(0,r.useSelector)(y.getCustomMaxPriorityFeePerGas),ke=(0,r.useSelector)(y.getSwapsUserFeeLevel),Ce=(0,r.useSelector)(v.getTokenExchangeRates,i.isEqual),Se=(0,f.useEqualityCheck)(Ce),{balance:Ne}=(0,r.useSelector)(v.getSelectedAccount,r.shallowEqual),Oe=(0,r.useSelector)(v.conversionRateSelector),xe=(0,r.useSelector)(v.getUSDConversionRate),Ie=(0,r.useSelector)(v.getIsMultiLayerFeeNetwork),Pe=(0,r.useSelector)(v.getCurrentCurrency),Me=(0,r.useSelector)(E.getTokens,i.isEqual),Ae=(0,r.useSelector)(v.checkNetworkAndAccountSupports1559),Re=(0,r.useSelector)(y.getBalanceError),De=(0,r.useSelector)(y.getFetchParams,i.isEqual),je=(0,r.useSelector)(y.getApproveTxParams,r.shallowEqual),Le=(0,r.useSelector)(y.getSelectedQuote,i.isEqual),Fe=(0,r.useSelector)(y.getTopQuote,i.isEqual),Ue=Le||Fe,We=(null==Ue||null===(e=Ue.trade)||void 0===e?void 0:e.value)??"0x0",qe=(0,r.useSelector)(y.getSwapsQuoteRefreshTime),Be=(0,r.useSelector)(v.getSwapsDefaultToken,i.isEqual),He=(0,r.useSelector)(v.getCurrentChainId),Ge=(0,r.useSelector)(E.getNativeCurrency),$e=(0,r.useSelector)(y.getReviewSwapClickedTimestamp),Ke=(0,r.useSelector)(y.getSmartTransactionsOptInStatus),Ve=(0,r.useSelector)(y.getSmartTransactionsEnabled),Qe=(0,r.useSelector)(y.getSwapsSTXLoading),Ye=(0,r.useSelector)(y.getCurrentSmartTransactionsError),Ze=(0,r.useSelector)(y.getSmartTransactionsError),ze=(0,r.useSelector)(y.getSmartTransactionFees,i.isEqual),Xe=(0,r.useSelector)(y.getCurrentSmartTransactionsEnabled),Je=(0,r.useSelector)(y.getSwapsNetworkConfig,r.shallowEqual),et=Ue.trade;let tt;Ae&&(tt=(0,g.useGasFeeInputs)(I.GasRecommendations.high,{userFeeLevel:ke||I.GasRecommendations.high}));const{isBestQuote:at}=Ue,nt=null==De?void 0:De.sourceToken,rt={reg_tx_fee_in_usd:undefined,reg_tx_fee_in_eth:undefined,reg_tx_max_fee_in_usd:undefined,reg_tx_max_fee_in_eth:undefined,stx_fee_in_usd:undefined,stx_fee_in_eth:undefined,stx_max_fee_in_usd:undefined,stx_max_fee_in_eth:undefined},st=(null==Ue?void 0:Ue.gasEstimateWithRefund)||`0x${(0,H.decimalToHex)((null==Ue?void 0:Ue.averageGas)||0)}`,ot=(null==Ue?void 0:Ue.gasEstimate)||"0x0",it=new o.default(ot,16).times((null==Ue?void 0:Ue.gasMultiplier)||y.FALLBACK_GAS_MULTIPLIER,10).round(0).toString(16),lt=null!=Ue&&Ue.gasEstimate?it:`0x${(0,H.decimalToHex)((null==Ue?void 0:Ue.maxGas)||0)}`,ct=we||lt;let ut,dt,pt;if(Ae){const{maxFeePerGas:e,maxPriorityFeePerGas:t,gasFeeEstimates:{estimatedBaseFee:a="0"}}=tt;ut=be||(0,H.decGWEIToHexWEI)(e),dt=Te||(0,H.decGWEIToHexWEI)(t),pt=(0,H.addHexes)((0,H.decGWEIToHexWEI)(a),dt)}let ft=(0,U.calcGasTotal)(ct,ut||Ee);null!==ce&&(ft=(0,H.sumHexes)(ft||"0x0",ce||"0x0"));const{tokensWithBalances:mt}=(0,O.useTokenTracker)(Me,!0),gt=nt===Be.address?Be:mt.find((({address:e})=>(0,j.isEqualCaseInsensitive)(e,nt))),ht=gt||Ue.sourceTokenInfo,_t=(null==mt?void 0:mt.length)&&(0,U.calcTokenAmount)(ht.balance||"0x0",ht.decimals).toFixed(9),yt=mt&&gt===undefined,vt=(0,L.parseStandardTokenTransactionData)(null==je?void 0:je.data),Et=vt&&(0,F.getTokenValueParam)(vt),wt=Et&&(null==ht?void 0:ht.decimals)!==undefined&&(0,U.calcTokenAmount)(Et,ht.decimals).toFixed(9),bt=null==je?void 0:je.gas,Tt=(0,n.useMemo)((()=>(0,N.quotesToRenderableData)({quotes:ye,gasPrice:Ae?pt:Ee,conversionRate:Oe,currentCurrency:Pe,approveGas:bt,tokenConversionRates:Se,chainId:He,smartTransactionEstimatedGas:Ve&&Ke&&(null==ze?void 0:ze.tradeTxFees),nativeCurrencySymbol:Ge,multiLayerL1ApprovalFeeTotal:de})),[ye,Ee,pt,Ae,Oe,Pe,bt,Se,He,null==ze?void 0:ze.tradeTxFees,Ge,Ve,Ke,de]),kt=Tt.find((e=>e.aggId===Ue.aggregator)),{destinationTokenDecimals:Ct,destinationTokenSymbol:St,destinationTokenValue:Nt,destinationIconUrl:Ot,sourceTokenDecimals:xt,sourceTokenSymbol:It,sourceTokenValue:Pt,sourceTokenIconUrl:Mt}=kt;let{feeInFiat:At,feeInEth:Rt,rawEthFee:Dt,feeInUsd:jt}=(0,N.getRenderableNetworkFeesForQuote)({tradeGas:st,approveGas:bt,gasPrice:Ae?pt:Ee,currentCurrency:Pe,conversionRate:Oe,USDConversionRate:xe,tradeValue:We,sourceSymbol:It,sourceAmount:Ue.sourceAmount,chainId:He,nativeCurrencySymbol:Ge,multiLayerL1FeeTotal:ce});rt.reg_tx_fee_in_usd=Number(jt),rt.reg_tx_fee_in_eth=Number(Dt);const Lt=(0,N.getRenderableNetworkFeesForQuote)({tradeGas:ct,approveGas:bt,gasPrice:ut||Ee,currentCurrency:Pe,conversionRate:Oe,USDConversionRate:xe,tradeValue:We,sourceSymbol:It,sourceAmount:Ue.sourceAmount,chainId:He,nativeCurrencySymbol:Ge,multiLayerL1FeeTotal:ce});let{feeInFiat:Ft,feeInEth:Ut,rawEthFee:Wt,feeInUsd:qt}=Lt;if(rt.reg_tx_max_fee_in_usd=Number(qt),rt.reg_tx_max_fee_in_eth=Number(Wt),Xe&&Ke&&null!=ze&&ze.tradeTxFees){var Bt;const e=(null==ze?void 0:ze.tradeTxFees.feeEstimate)+((null==ze||null===(Bt=ze.approvalTxFees)||void 0===Bt?void 0:Bt.feeEstimate)||0),t=e*Je.stxMaxFeeMultiplier;({feeInFiat:At,feeInEth:Rt,rawEthFee:Dt,feeInUsd:jt}=(0,N.getFeeForSmartTransaction)({chainId:He,currentCurrency:Pe,conversionRate:Oe,USDConversionRate:xe,nativeCurrencySymbol:Ge,feeInWeiDec:e})),rt.stx_fee_in_usd=Number(jt),rt.stx_fee_in_eth=Number(Dt),rt.estimated_gas=null==ze?void 0:ze.tradeTxFees.gasLimit,({feeInFiat:Ft,feeInEth:Ut,rawEthFee:Wt,feeInUsd:qt}=(0,N.getFeeForSmartTransaction)({chainId:He,currentCurrency:Pe,conversionRate:Oe,USDConversionRate:xe,nativeCurrencySymbol:Ge,feeInWeiDec:t})),rt.stx_max_fee_in_usd=Number(qt),rt.stx_max_fee_in_eth=Number(Wt)}const Ht=new o.default(Ue.sourceAmount),Gt=new o.default(Ue.trade.value||0,10).plus(new o.default(ft,16)),$t=((null==mt?void 0:mt.length)||Re)&&Ht.gt(new o.default(ht.balance||"0x0")),Kt=Gt.gt(new o.default(Ne||"0x0")),Vt=$t?(0,U.toPrecisionWithoutTrailingZeros)((0,U.calcTokenAmount)(Ht,ht.decimals).minus(_t).toString(10),6):null,Qt=Kt?(0,U.toPrecisionWithoutTrailingZeros)(Gt.minus(Ne,16).div("1000000000000000000",10).toString(10),6):null;let Yt;null!=Ze&&Ze.balanceNeededWei&&(Yt=(0,H.decWEIToDecETH)(Ze.balanceNeededWei-Ze.currentBalanceWei));const Zt=(0,r.useSelector)(y.getDestinationTokenInfo,i.isEqual);(0,n.useEffect)((()=>{Xe&&Ke?$t?Z((0,y.setBalanceError)(!0)):Re&&!$t&&Z((0,y.setBalanceError)(!1)):$t||Kt?Z((0,y.setBalanceError)(!0)):!Re||$t||Kt||Z((0,y.setBalanceError)(!1))}),[$t,Kt,Re,Z,Xe,Ke]),(0,n.useEffect)((()=>{const e=Date.now()-ve;e>qe&&!J?(ee(!0),Z((0,w.safeRefetchQuotes)())):e>qe&&(Z((0,w.setSwapsErrorKey)(x.QUOTES_EXPIRED_ERROR)),Y.push(T.SWAPS_ERROR_ROUTE))}),[ve,J,Z,Y,qe]),(0,n.useEffect)((()=>{!ie&&wt&&le(wt)}),[ie,wt]);const zt=(!Xe||!Ke)&&Qt,Xt=Xe&&Ke&&Yt,Jt=(Re||Vt||zt||Xt)&&!se,ea=(0,r.useSelector)(v.isHardwareWallet),ta=(0,r.useSelector)(v.getHardwareWalletType),aa=Object.values(ye).length,na=(0,n.useRef)(),ra=(0,n.useMemo)((()=>({token_from:It,token_from_amount:Pt,token_to:St,token_to_amount:Nt,request_type:null==De?void 0:De.balanceError,slippage:null==De?void 0:De.slippage,custom_slippage:2!==(null==De?void 0:De.slippage),response_time:null==De?void 0:De.responseTime,best_quote_source:null==Fe?void 0:Fe.aggregator,available_quotes:aa,is_hardware_wallet:ea,hardware_wallet_type:ta,stx_enabled:Ve,current_stx_enabled:Xe,stx_user_opt_in:Ke})),[It,Pt,St,Nt,null==De?void 0:De.balanceError,null==De?void 0:De.slippage,null==De?void 0:De.responseTime,null==Fe?void 0:Fe.aggregator,aa,ea,ta,Ve,Xe,Ke]),sa=()=>{X({event:"Edit Spend Limit Opened",category:D.MetaMetricsEventCategory.Swaps,sensitiveProperties:{...ra,custom_spend_limit_set:ie===wt,custom_spend_limit_amount:ie===wt?null:wt}})},oa=(0,n.useCallback)((()=>{X({event:"Best Quote Reviewed",category:D.MetaMetricsEventCategory.Swaps,sensitiveProperties:{...ra,network_fees:At}})}),[X,ra,At]),ia=(0,n.useCallback)((()=>{X({event:"View Quote Page Loaded",category:D.MetaMetricsEventCategory.Swaps,sensitiveProperties:{...ra,response_time:fe-$e}})}),[X,ra,fe,$e]);(0,n.useEffect)((()=>{!na.current&&[It,Pt,St,Nt,De,Fe,aa,At].every((e=>null!==e&&e!==undefined))&&(na.current=!0,oa())}),[De,Fe,aa,At,St,Nt,It,Pt,oa]);const la=Ue.fee,ca=yt?z("swapTokenBalanceUnavailable",[It]):z("swapApproveNeedMoreTokens",[n.default.createElement("span",{key:"swapApproveNeedMoreTokens-1",className:"view-quote__bold"},Vt||Yt||Qt),Vt&&It!==Be.symbol?It:Be.symbol]),ua=null==Ue||null===(t=Ue.priceSlippage)||void 0===t?void 0:t.bucket,da=(0,m.usePrevious)(ua);(0,n.useEffect)((()=>{me&&da===I.GasRecommendations.medium&&ua===I.GasRecommendations.high&&ge(!1)}),[ua,me,da]);let pa=null;const fa=(0,p.useEthFiatAmount)((null==Ue||null===(a=Ue.priceSlippage)||void 0===a?void 0:a.sourceAmountInETH)||0,{showFiat:!0}),ma=(0,p.useEthFiatAmount)((null==Ue||null===($=Ue.priceSlippage)||void 0===$?void 0:$.destinationAmountInETH)||0,{showFiat:!0}),ga=!fa||!ma||Boolean(null==Ue||null===(K=Ue.priceSlippage)||void 0===K?void 0:K.calculationError);let ha=0;null!=Ue&&null!==(Q=Ue.priceSlippage)&&void 0!==Q&&Q.ratio&&(ha=parseFloat(new o.default(Ue.priceSlippage.ratio,10).minus(1,10).times(100,10).toFixed(2),10));const _a=!yt&&!Jt&&Ue&&(he.includes(ua)||ga);_a&&(pa=n.default.createElement(G.default,{usedQuote:Ue,sourceTokenValue:Pt,destinationTokenValue:Nt,priceSlippageFromSource:fa,priceSlippageFromDestination:ma,priceDifferencePercentage:ha,priceSlippageUnknownFiatValue:ga,onAcknowledgementClick:()=>{ge(!0)},acknowledged:me}));const ya=_a&&!me,va=Jt||_a,Ea=Boolean(te||Re||yt||ya||Ae&&pt===undefined||!Ae&&(null===Ee||Ee===undefined)||Xe&&(Ye||Ze)||Xe&&Ke&&!(null!=ze&&ze.tradeTxFees));return(0,n.useEffect)((()=>{if(Xe&&Ke&&!$t){const e={from:et.from,to:et.to,value:et.value,data:et.data,gas:et.gas,chainId:He};V=setInterval((()=>{Qe||Z((0,y.fetchSwapsSmartTransactionFees)({unsignedTransaction:e,approveTxParams:je,fallbackOnNotEnoughFunds:!1}))}),Je.stxGetTransactionsRefreshTime),Z((0,y.fetchSwapsSmartTransactionFees)({unsignedTransaction:e,approveTxParams:je,fallbackOnNotEnoughFunds:!1}))}else V&&clearInterval(V);return()=>clearInterval(V)}),[Z,Xe,Ke,et.data,et.from,et.value,et.gas,et.to,He,Je.stxGetTransactionsRefreshTime,$t]),(0,n.useEffect)((()=>{Z((0,w.setSwapsQuotesPollingLimitEnabled)(!0)),$e&&ia()}),[Z,ia,$e]),(0,n.useEffect)((()=>{!Xe&&Ye&&te&&ae(!1)}),[Xe,Ye,te]),(0,n.useEffect)((()=>{if(!Ie||null==Ue||!Ue.multiLayerL1TradeFeeTotal)return;(async()=>{try{let e="0x0";je&&(e=await(0,B.default)(He,{txParams:{...je,gasPrice:(0,W.addHexPrefix)(je.gasPrice),value:"0x0"}}),pe(e));const t=(0,H.sumHexes)(Ue.multiLayerL1TradeFeeTotal,e);ue(t)}catch(e){(0,c.captureException)(e),ue(null),pe(null)}})()}),[et,je,Ie,He,Ue]),(0,n.useEffect)((()=>{Xe&&Ke&&Z({type:b.SET_SMART_TRANSACTIONS_ERROR,payload:null})}),[Xe,Ke,Z]),n.default.createElement("div",{className:"view-quote"},n.default.createElement("div",{className:(0,l.default)("view-quote__content",{"view-quote__content_modal":ya})},ne&&n.default.createElement(d.default,{quoteDataRows:Tt,onClose:()=>re(!1),onSubmit:e=>Z((0,y.swapsQuoteSelected)(e)),swapToSymbol:St,initialAggId:Ue.aggregator,onQuoteDetailsIsOpened:()=>{X({event:"Quote Details Opened",category:D.MetaMetricsEventCategory.Swaps,sensitiveProperties:{...ra,other_quote_selected:(null==Ue?void 0:Ue.aggregator)!==(null==Fe?void 0:Fe.aggregator),other_quote_selected_source:(null==Ue?void 0:Ue.aggregator)===(null==Fe?void 0:Fe.aggregator)?null:null==Ue?void 0:Ue.aggregator}})},hideEstimatedGasFee:Ve&&Ke}),n.default.createElement("div",{className:(0,l.default)("view-quote__warning-wrapper",{"view-quote__warning-wrapper--thin":!va})},pa,(Jt||yt)&&n.default.createElement(S.default,{message:ca,onClose:()=>oe(!0)})),n.default.createElement("div",{className:"view-quote__countdown-timer-container"},n.default.createElement(P.default,{timeStarted:ve,warningTime:"0:10",labelKey:"swapNewQuoteIn"})),n.default.createElement(k.default,{sourceValue:(0,q.calcTokenValue)(Pt,xt),sourceDecimals:xt,sourceSymbol:It,destinationValue:(0,q.calcTokenValue)(Nt,Ct),destinationDecimals:Ct,destinationSymbol:St,sourceIconUrl:Mt,destinationIconUrl:Ot}),Xe&&Ke&&!(null!=ze&&ze.tradeTxFees)&&!Jt&&n.default.createElement(R.default,{marginTop:0,marginBottom:10},n.default.createElement(A.default,null)),(!Xe||!Ke||(null==ze?void 0:ze.tradeTxFees))&&n.default.createElement("div",{className:(0,l.default)("view-quote__fee-card-container",{"view-quote__fee-card-container--three-rows":je&&(!Re||se)})},n.default.createElement(_.default,{primaryFee:{fee:Rt,maxFee:Ut},secondaryFee:{fee:At,maxFee:Ft},hideTokenApprovalRow:!je||Re&&!se,tokenApprovalSourceTokenSymbol:It,onTokenApprovalClick:()=>{sa(),Z((0,w.showModal)({name:"EDIT_APPROVAL_PERMISSION",decimals:ht.decimals,origin:"MetaMask",setCustomAmount:e=>{const t=""===e?ie:e,a=(0,C.getCustomTxParamsData)(je.data,{customPermissionAmount:t,decimals:ht.decimals});null!=t&&t.length&&je.data!==a&&Z((0,w.setCustomApproveTxData)(a))},tokenAmount:ie,customTokenAmount:ie===wt?null:wt,tokenBalance:_t,tokenSymbol:ht.symbol,requiredMinimum:(0,U.calcTokenAmount)(Ue.sourceAmount,ht.decimals)}))},metaMaskFee:String(la),numberOfQuotes:Object.values(ye).length,onQuotesClick:()=>{X({event:"All Available Quotes Opened",category:D.MetaMetricsEventCategory.Swaps,sensitiveProperties:{...ra,other_quote_selected:(null==Ue?void 0:Ue.aggregator)!==(null==Fe?void 0:Fe.aggregator),other_quote_selected_source:(null==Ue?void 0:Ue.aggregator)===(null==Fe?void 0:Fe.aggregator)?null:null==Ue?void 0:Ue.aggregator}}),re(!0)},chainId:He,isBestQuote:at,maxPriorityFeePerGasDecGWEI:(0,H.hexWEIToDecGWEI)(dt),maxFeePerGasDecGWEI:(0,H.hexWEIToDecGWEI)(ut)}))),n.default.createElement(M.default,{onSubmit:()=>{ae(!0),Re?Zt.symbol===Be.symbol?Y.push(T.DEFAULT_ROUTE):Y.push(`${T.ASSET_ROUTE}/${Zt.address}`):Xe&&Ke&&null!=ze&&ze.tradeTxFees?Z((0,y.signAndSendSwapsSmartTransaction)({unsignedTransaction:et,trackEvent:X,history:Y,additionalTrackingParams:rt})):Z((0,y.signAndSendTransactions)(Y,X,rt))},submitText:z(Xe&&Ke&&Qe?"preparingSwap":"swap"),hideCancel:!0,disabled:Ea,className:va?"view-quote__thin-swaps-footer":"",showTopBorder:!0}))};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=K(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=e("react-redux"),s=e("react-router-dom"),o=$(e("bignumber.js")),i=e("lodash"),l=$(e("classnames")),c=e("@sentry/browser"),u=e("../../../contexts/i18n"),d=$(e("../select-quote-popover")),p=e("../../../hooks/useEthFiatAmount"),f=e("../../../hooks/useEqualityCheck"),m=e("../../../hooks/usePrevious"),g=e("../../../hooks/gasFeeInput/useGasFeeInputs"),h=e("../../../contexts/metametrics"),_=$(e("../fee-card")),y=e("../../../ducks/swaps/swaps"),v=e("../../../selectors"),E=e("../../../ducks/metamask/metamask"),w=e("../../../store/actions"),b=e("../../../store/actionConstants"),T=e("../../../helpers/constants/routes"),k=$(e("../main-quote-summary")),C=e("../../confirm-approve/confirm-approve.util"),S=$(e("../../../components/ui/actionable-message/actionable-message")),N=e("../swaps.util"),O=e("../../../hooks/useTokenTracker"),x=e("../../../../shared/constants/swaps"),I=e("../../../../shared/constants/gas"),P=$(e("../countdown-timer")),M=$(e("../swaps-footer")),A=$(e("../../../components/ui/pulse-loader")),R=$(e("../../../components/ui/box")),D=e("../../../../shared/constants/metametrics"),j=e("../../../../shared/modules/string-utils"),L=e("../../../../shared/modules/transaction.utils"),F=e("../../../../shared/lib/metamask-controller-utils"),U=e("../../../../shared/lib/transactions-controller-utils"),W=e("../../../../app/scripts/lib/util"),q=e("../../../../shared/lib/swaps-utils"),B=$(e("../../../helpers/utils/optimism/fetchEstimatedL1Fee")),H=e("../../../../shared/modules/conversion.utils"),G=$(e("./view-quote-price-difference"));function $(e){return e&&e.__esModule?e:{default:e}}function K(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(K=function(e){return e?a:t})(e)}let V}}},{package:"$root$",file:"ui/pages/swaps/view-quote/view-quote.js"}],[4426,{"../../../shared/constants/network":3409,"../../../shared/constants/tokens":3416,"../../../shared/lib/transactions-controller-utils":3425,"../../components/app/approve-content-card/approve-content-card":3486,"../../components/app/confirm-page-container":3513,"../../components/app/custom-spending-cap/custom-spending-cap":3540,"../../components/app/ledger-instruction-field/ledger-instruction-field":3581,"../../components/app/modals/contract-details-modal/contract-details-modal":3614,"../../components/app/network-account-balance-header/network-account-balance-header":3650,"../../components/app/security-provider-banner-message/security-provider-banner-message":3687,"../../components/app/security-provider-banner-message/security-provider-banner-message.constants":3686,"../../components/component-library/icon/deprecated":3836,"../../components/ui/box/box":3899,"../../components/ui/button":3904,"../../components/ui/contract-token-values/contract-token-values":3918,"../../components/ui/dialog":3924,"../../components/ui/page-container":3992,"../../components/ui/review-spending-cap/review-spending-cap":4005,"../../components/ui/simulation-error-message":4011,"../../components/ui/typography/typography":4040,"../../components/ui/url-icon/url-icon":4045,"../../contexts/gasFee":4046,"../../contexts/i18n":4047,"../../ducks/app/app":4054,"../../ducks/confirm-transaction/confirm-transaction.duck":4055,"../../ducks/history/history":4059,"../../helpers/constants/design-system":4070,"../../helpers/utils/util":4108,"../../hooks/useSimulationFailureWarning":4139,"../../selectors":4436,"../../store/actions":4443,"../confirm-approve/confirm-approve.util":4167,"bignumber.js":1853,"prop-types":3032,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=H;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=q(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=e("react-redux"),s=e("react-router-dom"),o=W(e("prop-types")),i=W(e("bignumber.js")),l=W(e("../../components/ui/box/box")),c=W(e("../../components/app/network-account-balance-header/network-account-balance-header")),u=W(e("../../components/ui/url-icon/url-icon")),d=W(e("../../components/ui/typography/typography")),p=e("../../helpers/constants/design-system"),f=e("../../contexts/i18n"),m=W(e("../../components/ui/contract-token-values/contract-token-values")),g=W(e("../../components/ui/button")),h=W(e("../../components/ui/review-spending-cap/review-spending-cap")),_=e("../../components/ui/page-container"),y=W(e("../../components/app/modals/contract-details-modal/contract-details-modal")),v=e("../../selectors"),E=e("../../../shared/constants/network"),w=e("../../store/actions"),b=e("../../ducks/confirm-transaction/confirm-transaction.duck"),T=e("../../ducks/history/history"),k=W(e("../../components/app/approve-content-card/approve-content-card")),C=W(e("../../components/app/custom-spending-cap/custom-spending-cap")),S=W(e("../../components/ui/dialog")),N=e("../../contexts/gasFee"),O=e("../confirm-approve/confirm-approve.util"),x=e("../../ducks/app/app"),I=e("../../helpers/utils/util"),P=e("../../../shared/lib/transactions-controller-utils"),M=e("../../../shared/constants/tokens"),A=e("../../components/app/confirm-page-container"),R=e("../../hooks/useSimulationFailureWarning"),D=W(e("../../components/ui/simulation-error-message")),j=e("../../components/component-library/icon/deprecated"),L=W(e("../../components/app/ledger-instruction-field/ledger-instruction-field")),F=e("../../components/app/security-provider-banner-message/security-provider-banner-message.constants"),U=W(e("../../components/app/security-provider-banner-message/security-provider-banner-message"));function W(e){return e&&e.__esModule?e:{default:e}}function q(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(q=function(e){return e?a:t})(e)}const B=["portfolio.metamask.io"];function H({origin:e,siteImage:t,showCustomizeGasModal:a,useNonceField:o,currentCurrency:W,nativeCurrency:q,ethTransactionTotal:H,fiatTransactionTotal:G,hexTransactionTotal:$,txData:K,isMultiLayerFeeNetwork:V,supportsEIP1559:Q,userAddress:Y,tokenAddress:Z,data:z,isSetApproveForAll:X,isApprovalOrRejection:J,decimals:ee,dappProposedTokenAmount:te,currentTokenBalance:ae,toAddress:ne,tokenSymbol:re,fromAddressIsLedger:se}){var oe,ie;const le=(0,n.useContext)(f.I18nContext),ce=(0,r.useDispatch)(),ue=(0,s.useHistory)(),de=(0,r.useSelector)(T.getMostRecentOverviewPage),{hostname:pe}=new URL(e),fe=B.includes(pe),[me,ge]=(0,n.useState)(!1),[he,_e]=(0,n.useState)(!1),[ye,ve]=(0,n.useState)(!1),[Ee,we]=(0,n.useState)("0"!==te&&!fe),[be,Te]=(0,n.useState)(""),[ke,Ce]=(0,n.useState)(!1),Se=(0,R.useSimulationFailureWarning)(ke),Ne=(0,r.useSelector)(v.getCurrentAccountWithSendEtherInfo),Oe=(0,r.useSelector)(v.getNetworkIdentifier),xe=(0,r.useSelector)(v.getRpcPrefsForCurrentProvider),Ie=(0,r.useSelector)(v.getUnapprovedTxCount),Pe=(0,r.useSelector)(v.getUnapprovedTransactions),Me=(0,r.useSelector)(v.getUseCurrencyRateCheck);let Ae=(0,r.useSelector)(v.getCustomTokenAmount);fe&&te&&(Ae=te);const Re=e=>e.replace(/,/gu,".");let De=M.NUM_W_OPT_DECIMAL_COMMA_OR_DOT_REGEX.test(Ae)?Re(Ae).toString():"0";const je=(0,P.calcTokenAmount)(M.MAX_TOKEN_ALLOWANCE_AMOUNT,ee);if(Ae.length>1&&Number(Ae)){new i.default(Ae).greaterThan(je)&&(De=0)}const Le=De?(0,O.getCustomTxParamsData)(z,{customPermissionAmount:De,decimals:ee}):null;let Fe={...K};Le&&(Fe={...Fe,txParams:{...Fe.txParams,data:Le}});const Ue=(0,r.useSelector)((e=>(0,v.transactionFeeSelector)(e,Fe))),We=(0,r.useSelector)((e=>(0,v.getKnownMethodData)(e,z))),{balanceError:qe}=(0,N.useGasFeeContext)(),Be=Ee&&(""===Ae||""!==be),He=!Ee&&qe,Ge=E.NETWORK_TO_NAME_MAP[Fe.chainId]||Oe,$e=()=>{ve(!1),we(!0)},Ke=""===Ae,Ve=n.default.createElement(l.default,{marginTop:4,key:Z},n.default.createElement(m.default,{tokenName:re,address:Z,chainId:Fe.chainId,rpcPrefs:xe}));return n.default.createElement(l.default,{className:"token-allowance-container page-container"},n.default.createElement(l.default,null,n.default.createElement(A.ConfirmPageContainerNavigation,null)),(null==K||null===(oe=K.securityProviderResponse)||void 0===oe?void 0:oe.flagAsDangerous)!==undefined&&(null==K||null===(ie=K.securityProviderResponse)||void 0===ie?void 0:ie.flagAsDangerous)!==F.SECURITY_PROVIDER_MESSAGE_SEVERITIES.NOT_MALICIOUS||null!=K&&K.securityProviderResponse&&0===Object.keys(K.securityProviderResponse).length?n.default.createElement(U.default,{securityProviderResponse:K.securityProviderResponse}):null,n.default.createElement(l.default,{paddingLeft:4,paddingRight:4,alignItems:p.AlignItems.center,display:p.DISPLAY.FLEX,flexDirection:p.FLEX_DIRECTION.ROW,justifyContent:p.JustifyContent.spaceBetween},n.default.createElement(l.default,null,!Ee&&n.default.createElement(g.default,{type:"inline",onClick:()=>$e()},n.default.createElement(d.default,{variant:p.TypographyVariant.H6,color:p.TextColor.textMuted,fontWeight:p.FONT_WEIGHT.BOLD},"<"," ",le("back")))),n.default.createElement(l.default,{textAlign:p.TEXT_ALIGN.END},n.default.createElement(d.default,{variant:p.TypographyVariant.H7,color:p.TextColor.textMuted,fontWeight:p.FONT_WEIGHT.BOLD},Ee?1:2," ",le("ofTextNofM")," 2"))),n.default.createElement(c.default,{networkName:Ge,accountName:Ne.name,accountBalance:ae,tokenName:re,accountAddress:Y,chainId:Fe.chainId}),n.default.createElement(l.default,{display:p.DISPLAY.FLEX,flexDirection:p.FLEX_DIRECTION.ROW,justifyContent:p.JustifyContent.center},n.default.createElement(l.default,{display:p.DISPLAY.FLEX,alignItems:p.AlignItems.center,marginTop:6,marginRight:12,marginBottom:8,marginLeft:12,paddingTop:2,paddingRight:4,paddingBottom:2,paddingLeft:2,borderColor:p.Color.borderMuted,borderStyle:p.BorderStyle.solid,borderWidth:1,className:"token-allowance-container__icon-display-content"},n.default.createElement(u.default,{className:"token-allowance-container__icon-display-content__siteimage-identicon",fallbackClassName:"token-allowance-container__icon-display-content__siteimage-identicon",name:e,url:t}),n.default.createElement(d.default,{variant:p.TypographyVariant.H6,fontWeight:p.FONT_WEIGHT.NORMAL,color:p.TextColor.textAlternative,boxProps:{marginLeft:1,marginTop:2}},e))),n.default.createElement(l.default,{marginLeft:4,marginRight:4},n.default.createElement(d.default,{variant:p.TypographyVariant.H3,fontWeight:p.FONT_WEIGHT.BOLD,align:p.TEXT_ALIGN.CENTER},Ee?le("setSpendingCap",[Ve]):n.default.createElement(l.default,null,"0"===Ae||Ke?le("revokeSpendingCap",[Ve]):n.default.createElement(l.default,null,le("reviewSpendingCap"),Ve)))),n.default.createElement(l.default,{marginTop:1,display:p.DISPLAY.FLEX,flexDirection:p.FLEX_DIRECTION.ROW,justifyContent:p.JustifyContent.center},n.default.createElement(g.default,{type:"link",onClick:()=>ge(!0),className:"token-allowance-container__verify-link"},n.default.createElement(d.default,{variant:p.TypographyVariant.H6,color:p.Color.primaryDefault},le("verifyContractDetails")))),n.default.createElement(l.default,{margin:[4,4,3,4]},Ee?n.default.createElement(C.default,{txParams:null==K?void 0:K.txParams,tokenName:re,currentTokenBalance:ae,dappProposedValue:te,siteOrigin:e,passTheErrorText:e=>Te(e),decimals:ee,setInputChangeInProgress:_e}):n.default.createElement(h.default,{tokenName:re,currentTokenBalance:ae,tokenValue:isNaN(parseFloat(Ae))?te:Re(Ae),onEdit:()=>$e()})),!Ee&&qe&&n.default.createElement(S.default,{type:"error",className:"send__error-dialog"},le("insufficientFundsForGas")),!Ee&&n.default.createElement(l.default,{className:"token-allowance-container__card-wrapper"},Se&&n.default.createElement(l.default,{paddingTop:0,paddingRight:4,paddingBottom:4,paddingLeft:4},n.default.createElement(D.default,{userAcknowledgedGasMissing:ke,setUserAcknowledgedGasMissing:()=>Ce(!0)})),n.default.createElement(k.default,{symbol:n.default.createElement(j.Icon,{name:j.ICON_NAMES.TAG}),title:le("transactionFee"),showEdit:!0,showAdvanceGasFeeOptions:!0,onEditClick:a,renderTransactionDetailsContent:!0,noBorder:o||!ye,supportsEIP1559:Q,isMultiLayerFeeNetwork:V,ethTransactionTotal:H,nativeCurrency:q,fullTxData:Fe,userAcknowledgedGasMissing:ke,renderSimulationFailureWarning:Se,hexTransactionTotal:$,fiatTransactionTotal:G,currentCurrency:W,useCurrencyRateCheck:Me})),n.default.createElement(l.default,{display:p.DISPLAY.FLEX,flexDirection:p.FLEX_DIRECTION.ROW,justifyContent:p.JustifyContent.center},n.default.createElement(g.default,{type:"link",onClick:()=>ve(!ye),className:"token-allowance-container__view-details"},n.default.createElement(d.default,{variant:p.TypographyVariant.H6,color:p.TextColor.primaryDefault,marginRight:1},le("viewDetails")),ye?n.default.createElement("i",{className:"fa fa-sm fa-angle-up"}):n.default.createElement("i",{className:"fa fa-sm fa-angle-down"}))),ye?n.default.createElement(l.default,{display:p.DISPLAY.FLEX,flexDirection:p.FLEX_DIRECTION.COLUMN,alignItems:p.AlignItems.center,className:"token-allowance-container__full-tx-content"},n.default.createElement(l.default,{className:"token-allowance-container__data"},n.default.createElement(k.default,{symbol:n.default.createElement("i",{className:"fa fa-file"}),title:le("data"),renderDataContent:!0,noBorder:!0,supportsEIP1559:Q,isSetApproveForAll:X,fullTxData:Fe,userAcknowledgedGasMissing:ke,renderSimulationFailureWarning:Se,isApprovalOrRejection:J,data:Le||z,useCurrencyRateCheck:Me}))):null,!Ee&&se&&n.default.createElement(l.default,{paddingLeft:2,paddingRight:2},n.default.createElement(L.default,{showDataInstruction:!0})),n.default.createElement(_.PageContainerFooter,{cancelText:le("reject"),submitText:le(Ee?"next":"approveButtonText"),onCancel:()=>(ce((0,w.updateCustomNonce)("")),ce((0,x.setCustomTokenAmount)("")),void ce((0,w.cancelTx)(Fe)).then((()=>{ce((0,b.clearConfirmTransaction)()),ue.push(de)}))),onSubmit:()=>Ee?(ve(!1),void we(!1)):(()=>{const{name:e}=We;Ue.gasEstimationObject.baseFeePerGas&&(Fe.estimatedBaseFee=Ue.gasEstimationObject.baseFeePerGas),e&&(Fe.contractMethodName=e),te&&(Fe.dappProposedTokenAmount=te,Fe.originalApprovalAmount=te),Ae?(Fe.customTokenAmount=Ae,Fe.finalApprovalAmount=Ae):te!==undefined&&(Fe.finalApprovalAmount=te),ae&&(Fe.currentTokenBalance=ae),ce((0,w.updateCustomNonce)("")),ce((0,w.updateAndApproveTx)(Fe)).then((()=>{ce((0,b.clearConfirmTransaction)()),ue.push(de)}))})(),disabled:he||Be||He},Ie>1&&n.default.createElement(g.default,{type:"link",onClick:e=>{e.preventDefault(),ce((0,w.showModal)({name:"REJECT_TRANSACTIONS",unapprovedTxCount:Ie,onSubmit:async()=>{await ce((0,w.cancelTxs)((0,I.valuesFor)(Pe))),ce((0,b.clearConfirmTransaction)()),ue.push(de)}}))}},le("rejectTxsN",[Ie]))),me&&n.default.createElement(y.default,{tokenName:re,onClose:()=>ge(!1),tokenAddress:Z,toAddress:ne,chainId:Fe.chainId,rpcPrefs:xe}))}H.propTypes={origin:o.default.string,siteImage:o.default.string,showCustomizeGasModal:o.default.func,useNonceField:o.default.bool,currentCurrency:o.default.string,nativeCurrency:o.default.string,ethTransactionTotal:o.default.string,fiatTransactionTotal:o.default.string,hexTransactionTotal:o.default.string,txData:o.default.object,isMultiLayerFeeNetwork:o.default.bool,supportsEIP1559:o.default.bool,userAddress:o.default.string,tokenAddress:o.default.string,data:o.default.string,isSetApproveForAll:o.default.bool,isApprovalOrRejection:o.default.bool,decimals:o.default.string,dappProposedTokenAmount:o.default.string,currentTokenBalance:o.default.string,toAddress:o.default.string,tokenSymbol:o.default.string,fromAddressIsLedger:o.default.bool}}}},{package:"$root$",file:"ui/pages/token-allowance/token-allowance.js"}],[4427,{"./token-details-page":4428},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return r.default}});var n,r=(n=e("./token-details-page"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/token-details/index.js"}],[4428,{"../../../shared/constants/network":3409,"../../../shared/modules/string-utils":3442,"../../components/component-library":3840,"../../components/component-library/icon/deprecated":3836,"../../components/ui/box":3900,"../../components/ui/button":3904,"../../components/ui/identicon":3962,"../../components/ui/tooltip":4035,"../../components/ui/typography":4039,"../../contexts/i18n":4047,"../../ducks/metamask/metamask":4062,"../../helpers/constants/design-system":4070,"../../helpers/constants/routes":4074,"../../hooks/useCopyToClipboard":4123,"../../hooks/useTokenFiatAmount":4144,"../../hooks/useTokenTracker":4145,"../../selectors":4436,"../../store/actions":4443,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(){var e,t;const a=(0,r.useDispatch)(),k=(0,s.useHistory)(),C=(0,n.useContext)(u.I18nContext),S=(0,r.useSelector)(o.getTokens),N=(0,r.useSelector)(i.getTokenList),{address:O}=(0,s.useParams)(),x=N[O.toLowerCase()],I=null==x||null===(e=x.aggregators)||void 0===e?void 0:e.join(", "),P=S.find((({address:e})=>(0,w.isEqualCaseInsensitive)(e,O))),{tokensWithBalances:M}=(0,d.useTokenTracker)([P]),A=null===(t=M[0])||void 0===t?void 0:t.string,R=(0,p.useTokenFiatAmount)(null==P?void 0:P.address,A,null==P?void 0:P.symbol),D=(0,r.useSelector)((e=>({nickname:e.metamask.provider.nickname,type:e.metamask.provider.type}))),{nickname:j,type:L}=D,[F,U]=(0,l.useCopyToClipboard)();if(!P)return n.default.createElement(s.Redirect,{to:{pathname:g.DEFAULT_ROUTE}});return n.default.createElement(y.default,{className:"page-container token-details"},n.default.createElement(y.default,{marginLeft:5,marginRight:6},n.default.createElement(v.default,{fontWeight:E.FONT_WEIGHT.BOLD,margin:0,marginTop:4,variant:E.TypographyVariant.H6,color:E.TextColor.textDefault,className:"token-details__title"},C("tokenDetails"),n.default.createElement(_.default,{type:"link",onClick:()=>k.push(`${g.ASSET_ROUTE}/${P.address}`),className:"token-details__closeButton"})),n.default.createElement(y.default,{display:E.DISPLAY.FLEX,marginTop:4},n.default.createElement(v.default,{align:E.TEXT_ALIGN.CENTER,fontWeight:E.FONT_WEIGHT.BOLD,margin:0,marginRight:5,variant:E.TypographyVariant.H4,color:E.TextColor.textDefault,className:"token-details__token-value"},A||""),n.default.createElement(y.default,{marginTop:1},n.default.createElement(c.default,{diameter:32,address:P.address,image:x?x.iconUrl:P.image}))),n.default.createElement(v.default,{margin:0,marginTop:4,variant:E.TypographyVariant.H7,color:E.TextColor.textAlternative},R||""),n.default.createElement(v.default,{margin:0,marginTop:6,variant:E.TypographyVariant.H9,color:E.TextColor.textAlternative,fontWeight:E.FONT_WEIGHT.BOLD},C("tokenContractAddress")),n.default.createElement(y.default,{display:E.DISPLAY.FLEX},n.default.createElement(v.default,{variant:E.TypographyVariant.H7,margin:0,marginTop:2,color:E.TextColor.textDefault,overflowWrap:E.OVERFLOW_WRAP.BREAK_WORD,className:"token-details__token-address"},P.address),n.default.createElement(h.default,{position:"bottom",title:C(F?"copiedExclamation":"copyToClipboard"),containerClassName:"token-details__copy-icon"},n.default.createElement(T.ButtonIcon,{ariaLabel:"copy",name:F?b.ICON_NAMES.COPY_SUCCESS:b.ICON_NAMES.COPY,className:"token-details__copyIcon",onClick:()=>U(P.address),color:E.IconColor.primaryDefault,size:b.ICON_SIZES.SM}))),n.default.createElement(v.default,{variant:E.TypographyVariant.H9,margin:0,marginTop:4,color:E.TextColor.textAlternative,fontWeight:E.FONT_WEIGHT.BOLD},C("tokenDecimalTitle")),n.default.createElement(v.default,{variant:E.TypographyVariant.H7,margin:0,marginTop:1,color:E.TextColor.textDefault},P.decimals),n.default.createElement(v.default,{variant:E.TypographyVariant.H9,margin:0,marginTop:4,color:E.TextColor.textAlternative,fontWeight:E.FONT_WEIGHT.BOLD},C("network")),n.default.createElement(v.default,{variant:E.TypographyVariant.H7,margin:1,marginTop:0,color:E.TextColor.textDefault},L===m.NETWORK_TYPES.RPC?j??C("privateNetwork"):C(L)),I&&n.default.createElement(n.default.Fragment,null,n.default.createElement(v.default,{variant:E.TypographyVariant.H9,margin:0,marginTop:4,color:E.TextColor.textAlternative,fontWeight:E.FONT_WEIGHT.BOLD},C("tokenList")),n.default.createElement(v.default,{variant:E.TypographyVariant.H7,margin:0,marginTop:1,color:E.TextColor.textDefault},`${I}.`)),n.default.createElement(_.default,{type:"secondary",className:"token-details__hide-token-button",onClick:()=>{a((0,f.showModal)({name:"HIDE_TOKEN_CONFIRMATION",token:P,history:k}))}},n.default.createElement(v.default,{variant:E.TypographyVariant.H6,color:E.TextColor.primaryDefault},C("hideToken")))))};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=C(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=e("react-redux"),s=e("react-router-dom"),o=e("../../ducks/metamask/metamask"),i=e("../../selectors"),l=e("../../hooks/useCopyToClipboard"),c=k(e("../../components/ui/identicon")),u=e("../../contexts/i18n"),d=e("../../hooks/useTokenTracker"),p=e("../../hooks/useTokenFiatAmount"),f=e("../../store/actions"),m=e("../../../shared/constants/network"),g=e("../../helpers/constants/routes"),h=k(e("../../components/ui/tooltip")),_=k(e("../../components/ui/button")),y=k(e("../../components/ui/box")),v=k(e("../../components/ui/typography")),E=e("../../helpers/constants/design-system"),w=e("../../../shared/modules/string-utils"),b=e("../../components/component-library/icon/deprecated"),T=e("../../components/component-library");function k(e){return e&&e.__esModule?e:{default:e}}function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(C=function(e){return e?a:t})(e)}}}},{package:"$root$",file:"ui/pages/token-details/token-details-page.js"}],[4429,{"./unlock-page.container":4431},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){var n;Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var r=((n=e("./unlock-page.container"))&&n.__esModule?n:{default:n}).default;a.default=r}}},{package:"$root$",file:"ui/pages/unlock-page/index.js"}],[4430,{"../../../shared/constants/metametrics":3408,"../../../shared/lib/ui-utils":3426,"../../components/ui/button":3904,"../../components/ui/mascot":3979,"../../components/ui/text-field":4025,"../../helpers/constants/routes":4074,"../../helpers/utils/build-types":4088,"./unlock-page.util":4432,events:1944,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=e("events"),r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=g(t);if(a&&a.has(e))return a.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=r?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}n.default=e,a&&a.set(e,n);return n}(e("react")),s=m(e("prop-types")),o=m(e("../../components/ui/button")),i=m(e("../../components/ui/text-field")),l=m(e("../../components/ui/mascot")),c=e("../../helpers/constants/routes"),u=e("../../../shared/constants/metametrics"),d=e("../../../shared/lib/ui-utils"),p=e("../../helpers/utils/build-types"),f=e("./unlock-page.util");function m(e){return e&&e.__esModule?e:{default:e}}function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(g=function(e){return e?a:t})(e)}function h(e,t,a){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(a!==undefined){var n=a.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class _ extends r.Component{constructor(...e){super(...e),h(this,"state",{password:"",error:null}),h(this,"submitting",!1),h(this,"failed_attempts",0),h(this,"animationEventEmitter",new n.EventEmitter),h(this,"handleSubmit",(async e=>{e.preventDefault(),e.stopPropagation();const{password:t}=this.state,{onSubmit:a,forceUpdateMetamaskState:n}=this.props;if(""!==t&&!this.submitting){this.setState({error:null}),this.submitting=!0;try{await a(t),this.context.trackEvent({category:u.MetaMetricsEventCategory.Navigation,event:u.MetaMetricsEventName.AppUnlocked,properties:{failed_attempts:this.failed_attempts}},{isNewVisit:!0})}catch({message:e}){this.failed_attempts+=1,"Incorrect password"===e&&(await n(),this.context.trackEvent({category:u.MetaMetricsEventCategory.Navigation,event:u.MetaMetricsEventName.AppUnlockedFailed,properties:{reason:"incorrect_password",failed_attempts:this.failed_attempts}})),this.setState({error:e}),this.submitting=!1}}}))}UNSAFE_componentWillMount(){const{isUnlocked:e,history:t}=this.props;e&&t.push(c.DEFAULT_ROUTE)}handleInputChange({target:e}){if(this.setState({password:e.value,error:null}),e.getBoundingClientRect){const t=e,a=t.getBoundingClientRect(),n=(0,f.getCaretCoordinates)(t,t.selectionEnd);this.animationEventEmitter.emit("point",{x:a.left+n.left-t.scrollLeft,y:a.top+n.top-t.scrollTop})}}renderSubmitButton(){return r.default.createElement(o.default,{type:"submit","data-testid":"unlock-submit",style:{backgroundColor:"var(--color-primary-default)",color:"var(--color-primary-inverse)",marginTop:"20px",height:"60px",fontWeight:"400",boxShadow:"none",borderRadius:"100px"},disabled:!this.state.password,variant:"contained",size:"large",onClick:this.handleSubmit},this.context.t("unlock"))}render(){const{password:e,error:t}=this.state,{t:a}=this.context,{onRestore:n}=this.props;return r.default.createElement("div",{className:"unlock-page__container"},r.default.createElement("div",{className:"unlock-page","data-testid":"unlock-page"},r.default.createElement("div",{className:"unlock-page__mascot-container"},r.default.createElement(l.default,{animationEventEmitter:this.animationEventEmitter,width:"120",height:"120"}),(0,p.isBeta)()?r.default.createElement("div",{className:"unlock-page__mascot-container__beta"},a("beta")):null),r.default.createElement("h1",{className:"unlock-page__title"},a("welcomeBack")),r.default.createElement("div",null,a("unlockMessage")),r.default.createElement("form",{className:"unlock-page__form",onSubmit:this.handleSubmit},r.default.createElement(i.default,{id:"password","data-testid":"unlock-password",label:a("password"),type:"password",value:e,onChange:e=>this.handleInputChange(e),error:t,autoFocus:!0,autoComplete:"current-password",theme:"material",fullWidth:!0})),this.renderSubmitButton(),r.default.createElement("div",{className:"unlock-page__links"},r.default.createElement(o.default,{type:"link",key:"import-account",className:"unlock-page__link",onClick:()=>n()},a("forgotPassword"))),r.default.createElement("div",{className:"unlock-page__support"},a("needHelp",[r.default.createElement("a",{href:d.SUPPORT_LINK,target:"_blank",rel:"noopener noreferrer",key:"need-help-link",onClick:()=>{this.context.trackEvent({category:u.MetaMetricsEventCategory.Navigation,event:u.MetaMetricsEventName.SupportLinkClicked,properties:{url:d.SUPPORT_LINK}},{contextPropsIntoEventProperties:[u.MetaMetricsContextProp.PageTitle]})}},a("needHelpLinkText"))]))))}}a.default=_,h(_,"contextTypes",{trackEvent:s.default.func,t:s.default.func}),h(_,"propTypes",{history:s.default.object.isRequired,isUnlocked:s.default.bool,onRestore:s.default.func,onSubmit:s.default.func,forceUpdateMetamaskState:s.default.func})}}},{package:"$root$",file:"ui/pages/unlock-page/unlock-page.component.js"}],[4431,{"../../../app/scripts/lib/util":82,"../../../shared/constants/app":3401,"../../helpers/constants/routes":4074,"../../store/actions":4443,"./unlock-page.component":4430,"react-redux":3130,"react-router-dom":3150,redux:3194},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n,r=e("react-redux"),s=e("react-router-dom"),o=e("redux"),i=e("../../../app/scripts/lib/util"),l=e("../../../shared/constants/app"),c=e("../../helpers/constants/routes"),u=e("../../store/actions"),d=(n=e("./unlock-page.component"))&&n.__esModule?n:{default:n};var p=(0,o.compose)(s.withRouter,(0,r.connect)((e=>{const{metamask:{isUnlocked:t}}=e;return{isUnlocked:t}}),(e=>({tryUnlockMetamask:t=>e((0,u.tryUnlockMetamask)(t)),markPasswordForgotten:()=>e((0,u.markPasswordForgotten)()),forceUpdateMetamaskState:()=>(0,u.forceUpdateMetamaskState)(e)})),((e,t,a)=>{const{markPasswordForgotten:n,tryUnlockMetamask:r,...s}=t,{history:o,onSubmit:u,...d}=a;return{...e,...s,...d,onRestore:async()=>{await n(),o.push(c.RESTORE_VAULT_ROUTE),(0,i.getEnvironmentType)()===l.ENVIRONMENT_TYPE_POPUP&&global.platform.openExtensionInBrowser(c.RESTORE_VAULT_ROUTE)},onSubmit:u||(async e=>{await r(e),o.push(c.DEFAULT_ROUTE)}),history:o}})))(d.default);a.default=p}}},{package:"$root$",file:"ui/pages/unlock-page/unlock-page.container.js"}],[4432,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.getCaretCoordinates=function(e,t){const a=document.createElement("div");a.id="password-mirror-div",document.body.appendChild(a);const n=window.getComputedStyle(e);a.textContent=new Array(t+1).join("•");const r=document.createElement("span");r.textContent="•",a.appendChild(r);const s={top:r.offsetTop+parseInt(n.borderTopWidth,10),left:r.offsetLeft+parseInt(n.borderLeftWidth,10)};return document.body.removeChild(a),s}}}},{package:"$root$",file:"ui/pages/unlock-page/unlock-page.util.js"}],[4433,{".":4436,"../../shared/constants/gas":3404,"../../shared/constants/transaction":3417,"../../shared/lib/transactions-controller-utils":3425,"../../shared/modules/conversion.utils":3431,"../../shared/modules/gas.utils":3434,"../../shared/modules/string-utils":3442,"../../shared/modules/transaction.utils":3444,"../ducks/metamask/metamask":4062,"../helpers/utils/confirm-tx.util":4090,"../helpers/utils/tx-helper":4107,"./custom-gas":4434,"./selectors":4439,reselect:3201},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.unconfirmedTransactionsListSelector=a.unconfirmedTransactionsHashSelector=a.unconfirmedTransactionsCountSelector=a.unconfirmedMessagesHashSelector=a.txDataSelector=a.transactionFeeSelector=a.tokenAddressSelector=a.sendTokenTokenAmountAndToAddressSelector=a.currentCurrencySelector=a.conversionRateSelector=a.contractExchangeRateSelector=void 0;var n,r=e("reselect"),s=(n=e("../helpers/utils/tx-helper"))&&n.__esModule?n:{default:n},o=e("../helpers/utils/confirm-tx.util"),i=e("../../shared/modules/transaction.utils"),l=e("../ducks/metamask/metamask"),c=e("../../shared/constants/transaction"),u=e("../../shared/constants/gas"),d=e("../../shared/modules/gas.utils"),p=e("../../shared/modules/string-utils"),f=e("../../shared/lib/transactions-controller-utils"),m=e("../../shared/modules/conversion.utils"),g=e("./custom-gas"),h=e("./selectors"),_=e(".");const y=e=>e.metamask.unapprovedTxs,v=e=>e.metamask.unapprovedMsgs,E=e=>e.metamask.unapprovedPersonalMsgs,w=e=>e.metamask.unapprovedDecryptMsgs,b=e=>e.metamask.unapprovedEncryptionPublicKeyMsgs,T=e=>e.metamask.unapprovedTypedMessages,k=(0,r.createSelector)(y,v,E,w,b,T,h.deprecatedGetCurrentNetworkId,h.getCurrentChainId,((e={},t={},a={},n={},r={},o={},i,l)=>(0,s.default)(e,t,a,n,r,o,i,l)||[]));a.unconfirmedTransactionsListSelector=k;const C=(0,r.createSelector)(y,v,E,w,b,T,h.deprecatedGetCurrentNetworkId,h.getCurrentChainId,((e={},t={},a={},n={},r={},s={},o,l)=>({...Object.keys(e).reduce(((t,a)=>{const n={...t};return(0,i.transactionMatchesNetwork)(e[a],l,o)&&(n[a]=e[a]),n}),{}),...t,...a,...n,...r,...s})));a.unconfirmedTransactionsHashSelector=C;const S=(0,r.createSelector)(v,E,w,b,T,((e={},t={},a={},n={},r={})=>({...e,...t,...a,...n,...r})));a.unconfirmedMessagesHashSelector=S;const N=(0,r.createSelector)(y,(e=>e.metamask.unapprovedMsgCount),(e=>e.metamask.unapprovedPersonalMsgCount),(e=>e.metamask.unapprovedDecryptMsgCount),(e=>e.metamask.unapprovedEncryptionPublicKeyMsgCount),(e=>e.metamask.unapprovedTypedMessagesCount),h.deprecatedGetCurrentNetworkId,h.getCurrentChainId,((e={},t=0,a=0,n=0,r=0,s=0,o,l)=>Object.keys(e).filter((t=>(0,i.transactionMatchesNetwork)(e[t],l,o))).length+s+t+a+n+r));a.unconfirmedTransactionsCountSelector=N;const O=e=>e.metamask.currentCurrency;a.currentCurrencySelector=O;const x=e=>e.metamask.conversionRate;a.conversionRateSelector=x;const I=e=>e.confirmTransaction.txData;a.txDataSelector=I;const P=(0,r.createSelector)((e=>e.confirmTransaction.tokenProps),(e=>e&&e.decimals)),M=(0,r.createSelector)((e=>e.confirmTransaction.tokenData),(e=>e&&e.args||[])),A=(0,r.createSelector)(I,(e=>e&&e.txParams||{})),R=(0,r.createSelector)(A,(e=>e&&e.to));a.tokenAddressSelector=R;const D=(0,r.createSelector)(M,P,((e,t)=>{let a="",n="0";if(e&&e.length){a=e._to;let r=e._value.toString();t&&(r=(0,f.calcTokenAmount)(r,t).toFixed()),n=(0,o.roundExponential)(r)}return{toAddress:a,tokenAmount:n}}));a.sendTokenTokenAmountAndToAddressSelector=D;const j=(0,r.createSelector)((e=>e.metamask.contractExchangeRates),R,((e,t)=>e[Object.keys(e).find((e=>(0,p.isEqualCaseInsensitive)(e,t)))]));a.contractExchangeRateSelector=j;a.transactionFeeSelector=function(e,t){var a,n,r,s;const i=O(e),p=x(e),f=(0,l.getNativeCurrency)(e),h=(0,l.getGasFeeEstimates)(e)||{},y=(0,l.getGasEstimateType)(e),v=(0,_.checkNetworkAndAccountSupports1559)(e),E={gasLimit:(null===(a=t.txParams)||void 0===a?void 0:a.gas)??"0x0"};if(v){var w;const{gasPrice:e="0"}=h,a=h[t.userFeeLevel]||{};if((null===(w=t.txParams)||void 0===w?void 0:w.type)===c.TransactionEnvelopeType.legacy){var b;E.gasPrice=(null===(b=t.txParams)||void 0===b?void 0:b.gasPrice)??(0,m.decGWEIToHexWEI)(e)}else{var T,k,C,S;const{suggestedMaxPriorityFeePerGas:n,suggestedMaxFeePerGas:r}=a;E.maxFeePerGas=null===(T=t.txParams)||void 0===T||!T.maxFeePerGas||t.userFeeLevel!==u.CUSTOM_GAS_ESTIMATE&&r?(0,m.decGWEIToHexWEI)(r||e):null===(k=t.txParams)||void 0===k?void 0:k.maxFeePerGas,E.maxPriorityFeePerGas=null===(C=t.txParams)||void 0===C||!C.maxPriorityFeePerGas||t.userFeeLevel!==u.CUSTOM_GAS_ESTIMATE&&n?n&&(0,m.decGWEIToHexWEI)(n)||E.maxFeePerGas:null===(S=t.txParams)||void 0===S?void 0:S.maxPriorityFeePerGas,E.baseFeePerGas=(0,m.decGWEIToHexWEI)(h.estimatedBaseFee)}}else switch(y){case u.GasEstimateTypes.none:E.gasPrice=(null===(n=t.txParams)||void 0===n?void 0:n.gasPrice)??"0x0";break;case u.GasEstimateTypes.ethGasPrice:E.gasPrice=(null===(r=t.txParams)||void 0===r?void 0:r.gasPrice)??(0,m.decGWEIToHexWEI)(h.gasPrice);break;case u.GasEstimateTypes.legacy:E.gasPrice=(null===(s=t.txParams)||void 0===s?void 0:s.gasPrice)??(0,g.getAveragePriceEstimateInHexWEI)(e);case u.GasEstimateTypes.feeMarket:}const{txParams:{value:N="0x0"}={}}=t,I=(0,m.getValueFromWeiHex)({value:N,fromCurrency:f,toCurrency:i,conversionRate:p,numberOfDecimals:2}),P=(0,m.getValueFromWeiHex)({value:N,fromCurrency:f,toCurrency:f,conversionRate:p,numberOfDecimals:6}),M=(0,d.getMinimumGasTotalInHexWei)(E),A=(0,d.getMaximumGasTotalInHexWei)(E),R=(0,o.getTransactionFee)({value:M,fromCurrency:f,toCurrency:i,numberOfDecimals:2,conversionRate:p}),D=(0,o.getTransactionFee)({value:A,fromCurrency:f,toCurrency:i,numberOfDecimals:2,conversionRate:p}),j=(0,o.getTransactionFee)({value:M,fromCurrency:f,toCurrency:f,numberOfDecimals:6,conversionRate:p});return{hexTransactionAmount:N,fiatTransactionAmount:I,ethTransactionAmount:P,hexMinimumTransactionFee:M,fiatMinimumTransactionFee:R,hexMaximumTransactionFee:A,fiatMaximumTransactionFee:D,ethTransactionFee:j,fiatTransactionTotal:(0,o.addFiat)(R,I),ethTransactionTotal:(0,o.addEth)(j,P),hexTransactionTotal:(0,m.sumHexes)(N,M),gasEstimationObject:E}}}}},{package:"$root$",file:"ui/selectors/confirm-transaction.js"}],[4434,{".":4436,"../../app/scripts/lib/util":82,"../../shared/constants/common":3403,"../../shared/constants/gas":3404,"../../shared/lib/transactions-controller-utils":3425,"../../shared/modules/Numeric":3427,"../../shared/modules/conversion.utils":3431,"../ducks/metamask/metamask":4062,"../ducks/send":4064,"../helpers/utils/confirm-tx.util":4090,"../helpers/utils/formatters":4092},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.basicPriceEstimateToETHTotal=y,a.getAverageEstimate=h,a.getAveragePriceEstimateInHexWEI=function(e){return E(h(e))},a.getBasicGasEstimateLoadingStatus=function(e){return!1===w(e)},a.getCustomGasLimit=function(e){return e.gas.customData.limit},a.getCustomGasPrice=m,a.getDefaultActiveButtonIndex=function(e,t,a){return e.map((({priceInHexWei:e})=>e)).lastIndexOf((0,n.addHexPrefix)(t||a))},a.getFastPriceEstimate=_,a.getFastPriceEstimateInHexWEI=function(e){return E(_(e)||"0x0")},a.getGasPriceInHexWei=E,a.getIsCustomNetworkGasPriceFetched=function(e){return(0,c.getGasEstimateType)(e)===l.GasEstimateTypes.ethGasPrice&&!(0,f.getIsMainnet)(e)},a.getIsEthGasPriceFetched=function(e){return(0,c.getGasEstimateType)(e)===l.GasEstimateTypes.ethGasPrice&&(0,f.getIsMainnet)(e)},a.getIsGasEstimatesFetched=w,a.getNoGasPriceFetched=function(e){return(0,c.getGasEstimateType)(e)===l.GasEstimateTypes.none},a.getRenderableConvertedCurrencyFee=function(e,t,a,n){const o=y(new d.Numeric(e,10).toBase(16).toString(),t),i=(0,r.decEthToConvertedCurrency)(o,a,n);return(0,s.formatCurrency)(i,a)},a.getRenderableEthFee=function(e,t,a=9,n="ETH"){const r=y(new d.Numeric(e,10).toBase(16).toString(),t,a);return(0,o.formatETHFee)(r,n)},a.getSafeLowEstimate=g,a.isCustomPriceExcessive=function(e,t=!1){const a=t?(0,i.getGasPrice)(e):m(e),n=_(e);if(!a||!n)return!1;return new d.Numeric(a,16,p.EtherDenomination.WEI).toDenomination(p.EtherDenomination.GWEI).greaterThan(Math.floor(1.5*n),10)},a.isCustomPriceSafe=function(e){const t=g(e),a=m(e);if(!a)return!0;if(!t)return!1;return new d.Numeric(a,16,p.EtherDenomination.WEI).toDenomination(p.EtherDenomination.GWEI).greaterThan(t,10)},a.isCustomPriceSafeForCustomNetwork=function(e){const t=h(e),a=m(e);if(!a)return!0;if(!t)return!1;return new d.Numeric(a,16,p.EtherDenomination.WEI).toDenomination(p.EtherDenomination.GWEI).greaterThan(t,10)},a.priceEstimateToWei=v;var n=e("../../app/scripts/lib/util"),r=e("../../shared/modules/conversion.utils"),s=e("../helpers/utils/confirm-tx.util"),o=e("../helpers/utils/formatters"),i=e("../ducks/send"),l=e("../../shared/constants/gas"),c=e("../ducks/metamask/metamask"),u=e("../../shared/lib/transactions-controller-utils"),d=e("../../shared/modules/Numeric"),p=e("../../shared/constants/common"),f=e(".");function m(e){return e.gas.customData.price}function g(e){const t=(0,c.getGasFeeEstimates)(e);return(0,c.getGasEstimateType)(e)===l.GasEstimateTypes.legacy?null==t?void 0:t.low:null}function h(e){const t=(0,c.getGasFeeEstimates)(e);return(0,c.getGasEstimateType)(e)===l.GasEstimateTypes.legacy?null==t?void 0:t.medium:null}function _(e){const t=(0,c.getGasFeeEstimates)(e);return(0,c.getGasEstimateType)(e)===l.GasEstimateTypes.legacy?null==t?void 0:t.high:null}function y(e,t,a=9){return new d.Numeric((0,u.calcGasTotal)(t,e),16,p.EtherDenomination.GWEI).round(a).toBase(10).toString()}function v(e){return new d.Numeric(e,16,p.EtherDenomination.GWEI).toDenomination(p.EtherDenomination.WEI).round(9).toString()}function E(e){const t=new d.Numeric(e,10).toBase(16).toString();return(0,n.addHexPrefix)(v(t))}function w(e){const t=(0,c.getGasEstimateType)(e);return!(0,c.isEIP1559Network)(e)&&t!==l.GasEstimateTypes.none}}}},{package:"$root$",file:"ui/selectors/custom-gas.js"}],[4435,{"../helpers/constants/routes":4074},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.getFirstTimeFlowType=void 0,a.getFirstTimeFlowTypeRoute=function(e){const{firstTimeFlowType:t}=e.metamask;let a;a="create"===t?n.ONBOARDING_CREATE_PASSWORD_ROUTE:"import"===t?n.ONBOARDING_IMPORT_WITH_SRP_ROUTE:n.DEFAULT_ROUTE;return a},a.getOnboardingInitiator=void 0;var n=e("../helpers/constants/routes");a.getFirstTimeFlowType=e=>e.metamask.firstTimeFlowType;a.getOnboardingInitiator=e=>{const{onboardingTabs:t}=e.metamask;if(!t||1!==Object.keys(t).length)return null;const a=Object.keys(t)[0];return{location:a,tabId:t[a]}}}}},{package:"$root$",file:"ui/selectors/first-time-flow.js"}],[4436,{"./confirm-transaction":4433,"./custom-gas":4434,"./first-time-flow":4435,"./metametrics":4437,"./permissions":4438,"./selectors":4439,"./transactions":4440},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0});var n=e("./confirm-transaction");Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in a&&a[e]===n[e]||Object.defineProperty(a,e,{enumerable:!0,get:function(){return n[e]}}))}));var r=e("./custom-gas");Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in a&&a[e]===r[e]||Object.defineProperty(a,e,{enumerable:!0,get:function(){return r[e]}}))}));var s=e("./first-time-flow");Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in a&&a[e]===s[e]||Object.defineProperty(a,e,{enumerable:!0,get:function(){return s[e]}}))}));var o=e("./metametrics");Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in a&&a[e]===o[e]||Object.defineProperty(a,e,{enumerable:!0,get:function(){return o[e]}}))}));var i=e("./permissions");Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in a&&a[e]===i[e]||Object.defineProperty(a,e,{enumerable:!0,get:function(){return i[e]}}))}));var l=e("./selectors");Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in a&&a[e]===l[e]||Object.defineProperty(a,e,{enumerable:!0,get:function(){return l[e]}}))}));var c=e("./transactions");Object.keys(c).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in a&&a[e]===c[e]||Object.defineProperty(a,e,{enumerable:!0,get:function(){return c[e]}}))}))}}},{package:"$root$",file:"ui/selectors/index.js"}],[4437,{reselect:3201},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.selectMatchingFragment=a.selectFragments=a.selectFragmentBySuccessEvent=a.selectFragmentById=void 0;var n=e("reselect");const r=e=>e.metamask.fragments;a.selectFragments=r;const s=(0,n.createSelector)(r,((e,t)=>t),((e,t)=>t.persist?Object.values(e).find((e=>e.successEvent===t.successEvent)):undefined));a.selectFragmentBySuccessEvent=s;const o=(0,n.createSelector)(r,((e,t)=>t),((e,t)=>t&&null!=e&&e[t]?e[t]:undefined));a.selectFragmentById=o;const i=(0,n.createSelector)(((e,t)=>s(e,t.fragmentOptions)),((e,t)=>o(e,t.existingId)),((e,t)=>t??e));a.selectMatchingFragment=i}}},{package:"$root$",file:"ui/selectors/metametrics.js"}],[4438,{".":4436,"../../shared/constants/permissions":3410},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.activeTabHasPermissions=function(e){var t;const{activeTab:a,metamask:n}=e,{subjects:r={}}=n;return Boolean(Object.keys((null===(t=r[a.origin])||void 0===t?void 0:t.permissions)||{}).length>0)},a.getAccountToConnectToActiveTab=function(e){const t=(0,r.getSelectedAddress)(e),a=i(e),{metamask:{identities:n}}=e,s=Object.keys(n).length;if(a.length&&a.length!==s&&-1===a.findIndex((e=>e===t)))return n[t];return undefined},a.getAddressConnectedSubjectMap=function(e){const t=(0,r.getSubjectMetadata)(e),a=l(e),n={};return Object.keys(a).forEach((e=>{const{iconUrl:r,name:s}=t[e]||{};a[e].forEach((t=>{const a=s||e;n[t]=n[t]?{...n[t],[e]:{iconUrl:r,name:a}}:{[e]:{iconUrl:r,name:a}}}))})),n},a.getConnectedSubjectsForAllAddresses=function(e){const t=s(e),a=(0,r.getSubjectMetadata)(e),n={};return Object.entries(t).forEach((([e,t])=>{c(t).forEach((t=>{n[t]||(n[t]=[]),n[t].push(a[e]||{})}))})),n},a.getConnectedSubjectsForSelectedAddress=function(e){const{selectedAddress:t}=e.metamask,a=s(e),n=(0,r.getSubjectMetadata)(e),o=[];return Object.entries(a).forEach((([e,a])=>{if(!c(a).includes(t))return;const{extensionId:r,name:s,iconUrl:i}=n[e]||{};o.push({extensionId:r,origin:e,name:s,iconUrl:i})})),o},a.getFirstPermissionRequest=function(e){const t=p(e);return t&&t[0]?t[0]:null},a.getLastConnectedInfo=function(e){const{permissionHistory:t={}}=e.metamask;return Object.keys(t).reduce(((e,a)=>(t[a].eth_accounts&&(e[a]=JSON.parse(JSON.stringify(t[a].eth_accounts))),e)),{})},a.getOrderedConnectedAccountsForActiveTab=function(e){var t,a;const{activeTab:n,metamask:{permissionHistory:s}}=e,o=null===(t=s[n.origin])||void 0===t||null===(a=t.eth_accounts)||void 0===a?void 0:a.accounts,l=(0,r.getMetaMaskAccountsOrdered)(e),c=i(e);return l.filter((e=>c.includes(e.address))).map((e=>({...e,lastActive:null==o?void 0:o[e.address]}))).sort((({lastSelected:e},{lastSelected:t})=>e===t?0:e===undefined?1:t===undefined?-1:t-e))},a.getPermissionSubjects=s,a.getPermissions=function(e,t){var a;return null===(a=s(e)[t])||void 0===a?void 0:a.permissions},a.getPermissionsForActiveTab=function(e){var t;const{activeTab:a,metamask:n}=e,{subjects:r={}}=n,s=(null===(t=r[a.origin])||void 0===t?void 0:t.permissions)??{};return Object.keys(s).map((e=>({key:e,value:s[e]})))},a.getPermissionsRequests=p,a.getPermittedAccounts=o,a.getPermittedAccountsByOrigin=l,a.getPermittedAccountsForCurrentTab=i,a.getRequestState=function(e,t){var a;return null===(a=e.metamask.pendingApprovals[t])||void 0===a?void 0:a.requestState},a.getRequestType=function(e,t){var a;return null===(a=e.metamask.pendingApprovals[t])||void 0===a?void 0:a.type},a.getSubjectsWithPermission=function(e,t){const a=s(e),n=[];return Object.entries(a).forEach((([a,{permissions:s}])=>{if(s[t]){const{extensionId:t,name:s,iconUrl:o}=(0,r.getTargetSubjectMetadata)(e,a)||{};n.push({extensionId:t,origin:a,name:s,iconUrl:o})}})),n};var n=e("../../shared/constants/permissions"),r=e(".");function s(e){return e.metamask.subjects||{}}function o(e,t){return d(u(function(e,t){var a;return t&&(null===(a=e.metamask.subjects)||void 0===a?void 0:a[t])}(e,t)))}function i(e){return o(e,(0,r.getOriginOfCurrentTab)(e))}function l(e){const t=s(e);return Object.keys(t).reduce(((e,a)=>{const n=c(t[a]);return n.length>0&&(e[a]=n),e}),{})}function c(e){return d(u(e))}function u(e={}){var t;return(null===(t=e.permissions)||void 0===t?void 0:t.eth_accounts)||{}}function d(e){const t=function(e={}){return Array.isArray(e.caveats)&&e.caveats.find((e=>e.type===n.CaveatTypes.restrictReturnedAccounts))}(e);return t&&Array.isArray(t.value)?t.value:[]}function p(e){return Object.values(e.metamask.pendingApprovals).filter((({type:e})=>"wallet_requestPermissions"===e)).map((({requestData:e})=>e))}}}},{package:"$root$",file:"ui/selectors/permissions.js"}],[4439,{"../../app/scripts/lib/util":82,"../../shared/constants/app":3401,"../../shared/constants/bridge":3402,"../../shared/constants/hardware-wallets":3405,"../../shared/constants/keyring":3406,"../../shared/constants/labels":3407,"../../shared/constants/network":3409,"../../shared/constants/swaps":3413,"../../shared/constants/time":3415,"../../shared/constants/tokens":3416,"../../shared/constants/transaction":3417,"../../shared/modules/conversion.utils":3431,"../../shared/modules/string-utils":3442,"../ducks/app/app":4054,"../ducks/metamask/metamask":4062,"../helpers/utils/util":4108,"../pages/confirmation/templates":4206,lodash:2932,reselect:3201},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.accountsWithSendEtherInfoSelector=W,a.checkNetworkAndAccountSupports1559=function(e){return(0,_.isEIP1559Network)(e)},a.checkNetworkOrAccountNotSupports1559=function(e){return(0,_.isNotEIP1559Network)(e)},a.deprecatedGetCurrentNetworkId=C,a.doesAddressRequireLedgerHidConnection=function(e,t){const a=(0,_.isAddressLedger)(e,t),n=(0,_.getLedgerTransportType)(e)===i.LedgerTransportTypes.webhid,r=(0,y.getLedgerWebHidConnectedStatus)(e)!==i.WebHIDConnectedStatuses.connected,s=(0,y.getLedgerTransportStatus)(e)!==i.HardwareTransportStates.verified;return a&&n&&(r||s)},a.getAccountName=function(e,t){const a=Object.values(e).find((e=>(0,v.isEqualCaseInsensitive)(e.address,t)));return a&&""!==a.name?a.name:""},a.getAccountType=function(e){const t=T(e);switch(t&&t.type){case l.KeyringType.trezor:case l.KeyringType.ledger:case l.KeyringType.lattice:return"hardware";case l.KeyringType.imported:return"imported";default:return"default"}},a.getAccountsWithLabels=function(e){return R(e).map((({address:e,name:t,balance:a})=>({address:e,addressLabel:`${t.length<u.TRUNCATED_NAME_CHAR_LIMIT?t:`${t.slice(0,u.TRUNCATED_NAME_CHAR_LIMIT-1)}...`} (${(0,f.shortenAddress)(e)})`,label:t,balance:a})))},a.getAddressBook=F,a.getAddressBookEntry=U,a.getAddressBookEntryOrAccountName=function(e,t){const a=U(e,t)||Object.values(e.metamask.identities).find((e=>(0,v.isEqualCaseInsensitive)(e.address,t)));return a&&""!==a.name?a.name:t},a.getAdvancedGasFeeValues=function(e){return e.metamask.advancedGasFee},a.getAdvancedInlineGasShown=function(e){return Boolean(e.metamask.featureFlags.advancedInlineGas)},a.getAllAccountsOnNetworkAreEmpty=function(e){const t=A(e)??{},a=Object.values(t).every((e=>"0x0"===e||"0x00"===e)),n=0===x(e);return a&&n},a.getAllNetworks=function(e){const t=ue(e)||{},a=Q(e),n=e=>e.chainId===o.CHAIN_IDS.LOCALHOST,r=[];r.push({chainId:o.CHAIN_IDS.MAINNET,nickname:o.MAINNET_DISPLAY_NAME,rpcUrl:o.CHAIN_ID_TO_RPC_URL_MAP[o.CHAIN_IDS.MAINNET],rpcPrefs:{imageUrl:o.ETH_TOKEN_IMAGE_URL},providerType:o.NETWORK_TYPES.MAINNET}),r.push(...Object.entries(t).filter((([,e])=>!n(e)&&e.chainId!==o.CHAIN_IDS.MAINNET)).map((([,e])=>e))),a&&r.push({chainId:o.CHAIN_IDS.GOERLI,nickname:o.GOERLI_DISPLAY_NAME,rpcUrl:o.CHAIN_ID_TO_RPC_URL_MAP[o.CHAIN_IDS.GOERLI],providerType:o.NETWORK_TYPES.GOERLI},{chainId:o.CHAIN_IDS.SEPOLIA,nickname:o.SEPOLIA_DISPLAY_NAME,rpcUrl:o.CHAIN_ID_TO_RPC_URL_MAP[o.CHAIN_IDS.SEPOLIA],providerType:o.NETWORK_TYPES.SEPOLIA},{chainId:o.CHAIN_IDS.LINEA_TESTNET,nickname:o.LINEA_TESTNET_DISPLAY_NAME,rpcUrl:o.CHAIN_ID_TO_RPC_URL_MAP[o.CHAIN_IDS.LINEA_TESTNET],provderType:o.NETWORK_TYPES.LINEA_TESTNET},...Object.entries(t).filter((([,e])=>n(e))).map((([,e])=>e)));return r},a.getAppIsLoading=function(e){return e.appState.isLoading},a.getBlockExplorerLinkText=function(e,t=!1){const a=me(e),n=Z(e);let r={firstPart:"addBlockExplorer",secondPart:""};n.blockExplorerUrl?r=t?{firstPart:"blockExplorerView",secondPart:(0,f.getURLHostName)(n.blockExplorerUrl)}:{firstPart:"viewinExplorer",secondPart:"blockExplorerAccountAction"}:!1===a&&(r=t?{firstPart:"etherscanViewOn",secondPart:""}:{firstPart:"viewOnEtherscan",secondPart:"blockExplorerAccountAction"});return r},a.getCurrentAccountWithSendEtherInfo=q,a.getCurrentChainId=b,a.getCurrentCurrency=function(e){return e.metamask.currentCurrency},a.getCurrentEthBalance=B,a.getCurrentKeyring=T,a.getCurrentNetworkTransactionList=void 0,a.getCurrentQRHardwareState=function(e){const{qrHardware:t}=e.metamask;return t||{}},a.getCustomNonceValue=function(e){return String(e.metamask.customNonceValue)},a.getCustomTokenAmount=function(e){return e.appState.customTokenAmount},a.getDetectedTokensInCurrentNetwork=function(e){var t,a;const n=b(e),r=N(e);return null===(t=e.metamask.allDetectedTokens)||void 0===t||null===(a=t[n])||void 0===a?void 0:a[r]},a.getEnsResolutionByAddress=function(e,t){if(e.metamask.ensResolutionsByAddress[t])return e.metamask.ensResolutionsByAddress[t];const a=U(e,t)||Object.values(e.metamask.identities).find((e=>(0,v.isEqualCaseInsensitive)(e.address,t)));return(null==a?void 0:a.name)||""},a.getFeatureFlags=function(e){return e.metamask.featureFlags},a.getFullTxData=void 0,a.getGasIsLoading=function(e){return e.appState.gasIsLoading},a.getHardwareWalletType=function(e){const t=T(e);return k(e)?t.type:undefined},a.getInfuraBlocked=function(e){return Boolean(e.metamask.infuraBlocked)},a.getIpfsGateway=function(e){return e.metamask.ipfsGateway},a.getIsAdvancedGasFeeDefault=function(e){const{advancedGasFee:t}=e.metamask;return Boolean(null==t?void 0:t.maxBaseFee)&&Boolean(null==t?void 0:t.priorityFee)},a.getIsBridgeChain=function(e){const t=b(e);return p.ALLOWED_BRIDGE_CHAIN_IDS.includes(t)},a.getIsBuyableChain=function(e){const t=b(e);return Object.keys(o.BUYABLE_CHAINS_MAP).includes(t)},a.getIsCustomNetwork=me,a.getIsDynamicTokenListAvailable=pe,a.getIsMainnet=$,a.getIsMultiLayerFeeNetwork=function(e){return de(e)},a.getIsNetworkUsed=function(e){const t=b(e),{usedNetworks:a}=e.metamask;return Boolean(a[t])},a.getIsNonStandardEthChain=function(e){return!($(e)||K(e))},a.getIsOptimism=de,a.getIsSwapsChain=function(e){const t=b(e);return d.ALLOWED_PROD_SWAPS_CHAIN_IDS.includes(t)},a.getIsTestnet=K,a.getIsTokenDetectionInactiveOnMainnet=fe,a.getIsTokenDetectionSupported=function(e){const t=ie(e),a=pe(e);return t&&a},a.getIsTransactionSecurityCheckEnabled=function(e){return e.metamask.transactionSecurityCheckEnabled},a.getIstokenDetectionInactiveOnNonMainnetSupportedNetwork=function(e){const t=ie(e),a=$(e);return pe(e)&&!t&&!a},a.getKnownMethodData=function(e,t){if(!t)return null;const a=(0,s.addHexPrefix)(t).slice(0,10),{knownMethodData:n}=e.metamask;return n&&n[a]},a.getMetaMaskAccountsOrdered=a.getMetaMaskAccountsConnected=a.getMetaMaskAccounts=a.getMemoizedMetadataContractName=a.getMemoizedMetaMaskIdentities=a.getMemoizedAddressBook=void 0,a.getMetaMaskAccountsRaw=M,a.getMetaMaskCachedBalances=A,a.getMetaMaskIdentities=P,a.getMetaMaskKeyrings=I,a.getMetadataContractName=function(e,t){const a=le(e),n=Object.values(a).find((e=>(0,v.isEqualCaseInsensitive)(e.address,t)));return n&&""!==n.name?n.name:""},a.getMetricsNetworkIdentifier=function(e){const{provider:t}=e.metamask;return t.type===o.NETWORK_TYPES.RPC?t.rpcUrl:t.type},a.getNativeCurrencyImage=function(e){var t;const a=null===(t=(0,_.getNativeCurrency)(e))||void 0===t?void 0:t.toUpperCase();return o.NATIVE_CURRENCY_TOKEN_IMAGE_MAP[a]},a.getNetworkConfigurations=ue,a.getNetworkIdentifier=function(e){const{metamask:{provider:{type:t,nickname:a,rpcUrl:n}}}=e;return a||n||t},a.getNetworkSupportsSettingGasFees=function(e){return!de(e)},a.getNetworksTabSelectedNetworkConfigurationId=function(e){return e.appState.selectedNetworkConfigurationId},a.getNewNetworkAdded=function(e){return e.appState.newNetworkAddedName},a.getNewNftAddedMessage=function(e){return e.appState.newNftAddedMessage},a.getNewTokensImported=function(e){return e.appState.newTokensImported},a.getNextSuggestedNonce=function(e){return Number(e.metamask.nextNonce)},a.getNumberOfAccounts=function(e){return Object.keys(e.metamask.accounts).length},a.getNumberOfTokens=x,a.getOpenSeaEnabled=function(e){return Boolean(e.metamask.openSeaEnabled)},a.getOriginOfCurrentTab=function(e){return e.activeTab.origin},a.getPreferences=V,a.getProvider=ce,a.getRemoveNftMessage=function(e){return e.appState.removeNftMessage},a.getRpcPrefsForCurrentProvider=Z,a.getSelectedAccount=L,a.getSelectedAccountCachedBalance=j,a.getSelectedAddress=N,a.getSelectedIdentity=O,a.getShouldHideZeroBalanceTokens=function(e){const{hideZeroBalanceTokens:t}=V(e);return t},a.getShouldShowFiat=function(e){const t=$(e),a=me(e),n=(0,_.getConversionRate)(e),r=ge(e),{showFiatInTestnets:s}=V(e);return Boolean((t||a||s)&&r&&n)},a.getShouldShowSeedPhraseReminder=function(e){const{tokens:t,seedPhraseBackedUp:a,dismissSeedBackUpReminder:n}=e.metamask,r=B(e)??0;return!1===a&&(parseInt(r,16)>0||t.length>0)&&!1===n},a.getShowBetaHeader=function(e){return e.metamask.showBetaHeader},a.getShowOutdatedBrowserWarning=function(e){const{outdatedBrowserWarningLastShown:t}=e.metamask;if(!t)return!0;return(new Date).getTime()-t>=2*h.DAY},a.getShowRecoveryPhraseReminder=function(e){const{recoveryPhraseReminderLastShown:t,recoveryPhraseReminderHasBeenShown:a}=e.metamask,n=(new Date).getTime(),r=a?90*h.DAY:2*h.DAY;return n-t>=r},a.getShowTestNetworks=Q,a.getShowWhatsNewPopup=function(e){return e.appState.showWhatsNewPopup},a.getSortedAnnouncementsToShow=function(e){const t=Object.values(e.metamask.announcements),a=function(e){const t=T(e),a=(null==t?void 0:t.type)===l.KeyringType.ledger,n=window.navigator.hid!==undefined,r=(0,_.getLedgerTransportType)(e)===i.LedgerTransportTypes.live,s=window.navigator.userAgent.includes("Firefox");return{1:!1,2:!1,3:!1,4:!1,5:!1,6:!1,7:!1,8:n&&a&&r,9:!1,10:!1,11:!1,12:!1,13:!1,14:!1,15:!1,16:!1,17:!1,18:!0,19:!0,20:a&&s}}(e),n=t.filter((e=>!e.isShown&&a[e.id]));return n.sort(((e,t)=>new Date(t.date)-new Date(e.date)))},a.getSubjectMetadata=Y,a.getSuggestedAssets=function(e){return e.metamask.suggestedAssets},a.getSwapsDefaultToken=function(e){const t=L(e),{balance:a}=t,n=b(e);return{...d.SWAPS_CHAINID_DEFAULT_TOKEN_MAP[n],balance:(0,w.hexToDecimal)(a),string:(0,w.getValueFromWeiHex)({value:a,numberOfDecimals:4,toDenomination:"ETH"})}},a.getTargetAccount=function(e,t){return S(e)[t]},a.getTargetAccountWithSendEtherInfo=function(e,t){const a=W(e);return(0,f.getAccountByAddress)(a,t)},a.getTargetSubjectMetadata=function(e,t){return Y(e)[t]},a.getTheme=function(e){return e.metamask.theme},a.getTokenExchangeRates=a.getTokenDetectionSupportNetworkByChainId=void 0,a.getTokenList=le,a.getTotalUnapprovedCount=function(e){const{unapprovedMsgCount:t=0,unapprovedPersonalMsgCount:a=0,unapprovedDecryptMsgCount:n=0,unapprovedEncryptionPublicKeyMsgCount:r=0,unapprovedTypedMessagesCount:s=0,pendingApprovalCount:o=0}=e.metamask;return t+a+n+r+s+H(e)+o+function(e){const{suggestedAssets:t=[]}=e.metamask;return t.length}(e)},a.getTotalUnapprovedMessagesCount=function(e){const{unapprovedMsgCount:t=0,unapprovedPersonalMsgCount:a=0,unapprovedDecryptMsgCount:n=0,unapprovedEncryptionPublicKeyMsgCount:r=0,unapprovedTypedMessagesCount:s=0}=e.metamask;return t+a+n+r+s},a.getTotalUnapprovedSignatureRequestCount=function(e){const{unapprovedMsgCount:t=0,unapprovedPersonalMsgCount:a=0,unapprovedTypedMessagesCount:n=0}=e.metamask;return t+a+n},a.getTxData=a.getTransaction=void 0,a.getUSDConversionRate=function(e){return e.metamask.usdConversionRate},a.getUnapprovedConfirmations=G,a.getUnapprovedTemplatedConfirmations=function(e){return G(e).filter((e=>m.TEMPLATED_CONFIRMATION_MESSAGE_TYPES.includes(e.type)))},a.getUnapprovedTransactions=a.getUnapprovedTransaction=void 0,a.getUnapprovedTxCount=H,a.getUseCurrencyRateCheck=ge,a.getUseNftDetection=function(e){return Boolean(e.metamask.useNftDetection)},a.getUseNonceField=function(e){return Boolean(e.metamask.useNonceField)},a.getUseTokenDetection=ie,a.getWeb3ShimUsageStateForOrigin=function(e,t){return e.metamask.web3ShimUsageOrigins[t]},a.hasUnsignedQRHardwareMessage=function(e){const{type:t,msgParams:a}=e.confirmTransaction.txData;if(!t||!a)return!1;const{from:n}=a,{keyrings:r}=e.metamask,s=r.find((e=>e.type===l.KeyringType.qr));if(!s)return!1;switch(t){case c.MESSAGE_TYPE.ETH_SIGN_TYPED_DATA:case c.MESSAGE_TYPE.ETH_SIGN:case c.MESSAGE_TYPE.PERSONAL_SIGN:return Boolean(s.accounts.find((e=>e.toLowerCase()===n.toLowerCase())));default:return!1}},a.hasUnsignedQRHardwareTransaction=function(e){const{txParams:t}=e.confirmTransaction.txData;if(!t)return!1;const{from:a}=t,{keyrings:n}=e.metamask,r=n.find((e=>e.type===l.KeyringType.qr));if(!r)return!1;return Boolean(r.accounts.find((e=>e.toLowerCase()===a.toLowerCase())))},a.isBalanceCached=function(e){const t=e.metamask.accounts[N(e)].balance,a=j(e);return Boolean(!t&&a)},a.isCurrentProviderCustom=function(e){const t=ce(e);return t.type===o.NETWORK_TYPES.RPC&&!Object.values(o.CHAIN_IDS).includes(t.chainId)},a.isHardwareWallet=k,a.isNetworkLoading=function(e){return e.metamask.networkStatus!==o.NetworkStatus.Available};var n=e("reselect"),r=e("lodash"),s=e("../../app/scripts/lib/util"),o=e("../../shared/constants/network"),i=e("../../shared/constants/hardware-wallets"),l=e("../../shared/constants/keyring"),c=e("../../shared/constants/app"),u=e("../../shared/constants/labels"),d=e("../../shared/constants/swaps"),p=e("../../shared/constants/bridge"),f=e("../helpers/utils/util"),m=e("../pages/confirmation/templates"),g=e("../../shared/constants/tokens"),h=e("../../shared/constants/time"),_=e("../ducks/metamask/metamask"),y=e("../ducks/app/app"),v=e("../../shared/modules/string-utils"),E=e("../../shared/constants/transaction"),w=e("../../shared/modules/conversion.utils");function b(e){const{chainId:t}=e.metamask.provider;return t}function T(e){const t=O(e);if(!t)return null;return(0,_.findKeyringForAddress)(e,t.address)}function k(e){var t;const a=T(e);return Boolean(null==a||null===(t=a.type)||void 0===t?void 0:t.includes("Hardware"))}function C(e){return e.metamask.networkId??"loading"}const S=(0,n.createSelector)(M,A,((e,t)=>Object.entries(e).reduce(((e,[a,n])=>null===n.balance||n.balance===undefined?{...e,[a]:{...n,balance:t&&t[a]}}:{...e,[a]:n}),{})));function N(e){return e.metamask.selectedAddress}function O(e){const t=N(e),{identities:a}=e.metamask;return a[t]}function x(e){const{tokens:t}=e.metamask;return t?t.length:0}function I(e){return e.metamask.keyrings}function P(e){return e.metamask.identities}function M(e){return e.metamask.accounts}function A(e){const t=b(e),a=C(e);return e.metamask.cachedBalances[t]??e.metamask.cachedBalances[a]}a.getMetaMaskAccounts=S;const R=(0,n.createSelector)(I,P,S,((e,t,a)=>e.reduce(((e,t)=>e.concat(t.accounts)),[]).filter((e=>Boolean(t[e]))).map((e=>({...t[e],...a[e]})))));a.getMetaMaskAccountsOrdered=R;const D=(0,n.createSelector)(R,(e=>e.map((({address:e})=>e.toLowerCase()))));function j(e){const t=A(e),a=N(e);return t&&t[a]}function L(e){return S(e)[N(e)]}a.getMetaMaskAccountsConnected=D;function F(e){const t=b(e);return e.metamask.addressBook[t]?Object.values(e.metamask.addressBook[t]):[]}function U(e,t){return F(e).find((e=>(0,v.isEqualCaseInsensitive)(e.address,t)))}function W(e){const t=S(e),a=P(e);return Object.entries(a).map((([e,a])=>({...a,...t[e]})))}function q(e){const t=N(e),a=W(e);return(0,f.getAccountByAddress)(a,t)}function B(e){var t;return null===(t=q(e))||void 0===t?void 0:t.balance}function H(e){const{unapprovedTxs:t={}}=e.metamask;return Object.keys(t).length}function G(e){const{pendingApprovals:t}=e.metamask;return Object.values(t)}function $(e){return b(e)===o.CHAIN_IDS.MAINNET}function K(e){const t=b(e);return o.TEST_CHAINS.includes(t)}function V({metamask:e}){return e.preferences}function Q(e){const{showTestNetworks:t}=V(e);return Boolean(t)}function Y(e){return e.metamask.subjectMetadata}function Z(e){const{provider:{rpcPrefs:t={}}={}}=e.metamask;return t}a.getTokenExchangeRates=e=>e.metamask.contractExchangeRates;const z=(0,n.createSelectorCreator)(n.defaultMemoize,r.isEqual),X=z(P,(e=>e));a.getMemoizedMetaMaskIdentities=X;const J=z(F,(e=>e));a.getMemoizedAddressBook=J;const ee=z(le,((e,t)=>t),((e,t)=>{const a=Object.values(e).find((e=>(0,v.isEqualCaseInsensitive)(e.address,t)));return a&&""!==a.name?a.name:""}));a.getMemoizedMetadataContractName=ee;const te=e=>e.metamask.unapprovedTxs;a.getUnapprovedTransactions=te;const ae=e=>e.metamask.currentNetworkTxList;a.getCurrentNetworkTransactionList=ae;const ne=e=>e.confirmTransaction.txData;a.getTxData=ne;const re=z(te,((e,t)=>t),((e,t)=>Object.values(e).find((({id:e})=>e===t))||{}));a.getUnapprovedTransaction=re;const se=z(ae,((e,t)=>t),((e,t)=>Object.values(e).find((({id:e})=>e===t))||{}));a.getTransaction=se;const oe=z(ne,((e,t,a)=>a===E.TransactionStatus.unapproved?re(e,t):se(e,t)),((e,t,a,n)=>n),((e,t,a)=>{let n={...e,...t};return t&&t.simulationFails&&(e.simulationFails=t.simulationFails),a&&(n={...n,txParams:{...n.txParams,data:a}}),n}));function ie(e){return Boolean(e.metamask.useTokenDetection)}function le(e){return fe(e)?g.STATIC_MAINNET_TOKEN_LIST:e.metamask.tokenList}function ce(e){return e.metamask.provider}function ue(e){return e.metamask.networkConfigurations}function de(e){return b(e)===o.CHAIN_IDS.OPTIMISM||b(e)===o.CHAIN_IDS.OPTIMISM_TESTNET}a.getFullTxData=oe;function pe(e){const t=b(e);return[o.CHAIN_IDS.MAINNET,o.CHAIN_IDS.BSC,o.CHAIN_IDS.POLYGON,o.CHAIN_IDS.AVALANCHE].includes(t)}function fe(e){const t=$(e);return!ie(e)&&t}function me(e){const t=b(e);return!o.CHAIN_ID_TO_RPC_URL_MAP[t]}function ge(e){return Boolean(e.metamask.useCurrencyRateCheck)}a.getTokenDetectionSupportNetworkByChainId=e=>{switch(b(e)){case o.CHAIN_IDS.MAINNET:return o.MAINNET_DISPLAY_NAME;case o.CHAIN_IDS.BSC:return o.BSC_DISPLAY_NAME;case o.CHAIN_IDS.POLYGON:return o.POLYGON_DISPLAY_NAME;case o.CHAIN_IDS.AVALANCHE:return o.AVALANCHE_DISPLAY_NAME;default:return""}}}}},{package:"$root$",file:"ui/selectors/selectors.js"}]],[],{});