-
Notifications
You must be signed in to change notification settings - Fork 13
/
299.d7fb0e5fb832836b151e.js
1 lines (1 loc) · 28.1 KB
/
299.d7fb0e5fb832836b151e.js
1
"use strict";(this.webpackChunkBitShares2_light=this.webpackChunkBitShares2_light||[]).push([[299],{9540:(e,t,s)=>{s.d(t,{A:()=>z});var a=s(64741),n=s(96540),r=s(9404),i=s.n(r),o=s(68477),l=s.n(o),c=s(87040),h=s(80849),p=s.n(h),m=s(16e3),d=s(9476),u=s(96366),g=s(60819),b=s(90184),k=s(36234),y=s(36247),v=s(84259),f=s(24180),E=s(46128);class A extends n.Component{static defaultProps={noSymbols:!1};constructor(){super(),this.statsInterval=null}_onClick(e){`/market/${e}`!==this.props.location.pathname&&(y.A.switchMarket(),this.props.history.push(`/market/${e}`))}componentDidMount(){this.statsChecked=new Date,this.props.base.get&&this.props.base.get("id")&&this.props.quote.get&&this.props.quote.get("id")&&(this.statsInterval=y.A.getMarketStatsInterval(35e3,this.props.base,this.props.quote))}componentWillUnmount(){this.statsInterval&&this.statsInterval()}shouldComponentUpdate(e){return!c.A.are_equal_shallow(e,this.props)}_onStar(e,t,s){s.preventDefault(),this.props.starred?v.A.removeStarMarket(e,t):v.A.addStarMarket(e,t)}render(){let{quote:e,base:t,noSymbols:s,stats:a,starred:r}=this.props;if(!e||!t)return null;let i=e.get("symbol")+"_"+t.get("symbol"),o=e.get("symbol")+":"+t.get("symbol"),l=this.props.getDynamicObject(e.get("dynamic_asset_data_id")),h=this.props.getDynamicObject(t.get("dynamic_asset_data_id")),p=c.A.convertPrice(e,t),m={};this.props.leftAlign&&(m.textAlign="left");let d="button outline",g=null;this.props.compact&&(d+=" no-margin",g={marginBottom:0,fontSize:"0.75rem",padding:"4px 10px",borderRadius:"0px",letterSpacing:"0.05rem"});let y=this.props.columns.map((s=>{switch(s.name){case"star":let m=r?"gold-star":"grey-star";return n.createElement("td",{onClick:this._onStar.bind(this,e.get("symbol"),t.get("symbol")),key:s.index},n.createElement(k.A,{className:m,name:"fi-star",title:"icons.fi_star.symbol"}));case"vol":let y=a?a.volumeBase:0;return n.createElement("td",{onClick:this._onClick.bind(this,i),className:"text-right",key:s.index},c.A.format_volume(y));case"change":let v=c.A.format_number(a&&a.change?a.change:0,2),f="0.00"===v?"":v>0?"change-up":"change-down";return n.createElement("td",{onClick:this._onClick.bind(this,i),className:"text-right "+f,key:s.index},v+"%");case"marketName":return n.createElement("td",{onClick:this._onClick.bind(this,i),key:s.index},n.createElement("div",{className:d,style:g},o));case"market":return n.createElement("td",{onClick:this._onClick.bind(this,i),key:s.index},this.props.name);case"price":let A=a&&a.price?a.price.toReal():a&&a.close&&a.close.quote.amount&&a.close.base.amount?c.A.get_asset_price(a.close.quote.amount,e,a.close.base.amount,t,!0):c.A.get_asset_price(p.quote.amount,e,p.base.amount,t,!0),_=6;return-1!==["BTC","OPEN.BTC","TRADE.BTC","GOLD","SILVER"].indexOf(t.get("symbol"))&&(_=8),n.createElement("td",{onClick:this._onClick.bind(this,i),className:"text-right",key:s.index},c.A.format_number(A,A>1e3?0:A>10?2:_));case"quoteSupply":return n.createElement("td",{onClick:this._onClick.bind(this,i),key:s.index},l?n.createElement(u.A,{style:{fontWeight:"bold"},amount:parseInt(l.get("current_supply"),10),asset:e.get("id")}):null);case"baseSupply":return n.createElement("td",{onClick:this._onClick.bind(this,i),key:s.index},h?n.createElement(u.A,{style:{fontWeight:"bold"},amount:parseInt(h.get("current_supply"),10),asset:t.get("id")}):null);case"issuer":return n.createElement("td",{onClick:this._onClick.bind(this,i),key:s.index},n.createElement(b.A,{account:e.get("issuer")}));case"add":return n.createElement("td",{style:{textAlign:"right"},key:s.index,onClick:this.props.onCheckMarket.bind(this,i)},n.createElement(E.Tooltip,{title:this.props.isDefault?"This market is a default market and cannot be removed":null},n.createElement("input",{type:"checkbox",checked:!!this.props.isChecked||this.props.isDefault,disabled:this.props.isDefault})));case"remove":return n.createElement("td",{key:s.index,className:"clickable",onClick:this.props.removeMarket},n.createElement("span",{style:{marginBottom:"6px",marginRight:"6px",zIndex:999},className:"text float-right remove"},"–"))}})).sort(((e,t)=>e.key>t.key)),v="clickable";return this.props.current&&(v+=" activeMarket"),n.createElement("tr",{className:v,style:m},y)}}A=(0,f.y)(A);const _=(0,g.A)(A,{propNames:["quote","base"],defaultProps:{tempComponent:"tr"},withDynamic:!0});var S=s(74248),M=s(58586),x=s(72181),C=s(91001),w=s(44352),B=s(32485),T=s.n(B),N=s(57763),q=s(10658),I=s.n(q),L=s(40702),F=s(72090),W=s(83599),U=(s(54392),s(28690));class V extends n.Component{constructor(){super(),this.state={backingAsset:"",error:!1,valid:!1}}_onMoveUp(e){const t=this.props.quotes.findIndex((t=>t===e));v.A.modifyPreferedBases({oldIndex:t,newIndex:t-1})}_onMoveDown(e){const t=this.props.quotes.findIndex((t=>t===e));v.A.modifyPreferedBases({oldIndex:t,newIndex:t+1})}_onRemove(e){const t=this.props.quotes.findIndex((t=>t===e));t>=0&&v.A.modifyPreferedBases({remove:t})}_onAdd(e){-1===this.props.quotes.findIndex((t=>t===e.get("symbol")))&&v.A.modifyPreferedBases({add:e.get("symbol")})}_onInputBackingAsset(e){this.setState({backingAsset:e.toUpperCase(),error:null})}_onFoundBackingAsset(e){e&&(this.props.quotes.includes(e.get("symbol"))?this.setState({error:"Asset already being used",isValid:!1}):this.setState({isValid:!0}))}render(){const{error:e}=this.state,t=this.props.quotes.size;return n.createElement(E.Modal,{title:I().translate("exchange.quote_selection"),closable:!1,visible:this.props.visible,id:"quote_selection",overlay:!0,onCancel:this.props.hideModal,footer:[n.createElement(E.Button,{onClick:this.props.hideModal},I().translate("modal.close"))]},n.createElement("section",{className:"no-border-bottom"},n.createElement("table",{className:"table"},n.createElement("thead",null,n.createElement("tr",null,n.createElement("th",null),n.createElement("th",null,n.createElement(p(),{content:"account.quote"})),n.createElement("th",{style:{textAlign:"center"}},n.createElement(p(),{content:"exchange.move_down"})),n.createElement("th",{style:{textAlign:"center"}},n.createElement(p(),{content:"exchange.move_up"})),n.createElement("th",{style:{textAlign:"center"}},n.createElement(p(),{content:"exchange.remove"})))),n.createElement("tbody",null,this.props.quotes.map(((e,s)=>n.createElement("tr",{key:e},n.createElement("td",null,s+1),n.createElement("td",null,e),n.createElement("td",{className:"text-center"},s!==t-1&&n.createElement(k.A,{onClick:this._onMoveDown.bind(this,e),name:"chevron-down",className:"clickable"})),n.createElement("td",{className:"text-center"},0!==s&&n.createElement(k.A,{onClick:this._onMoveUp.bind(this,e),name:"chevron-down",className:"clickable rotate180"})),n.createElement("td",{className:"text-center"},t>1&&n.createElement(k.A,{onClick:this._onRemove.bind(this,e),name:"cross-circle",className:"clickable"}))))))),n.createElement("br",null),n.createElement("div",null,n.createElement(N.A,{label:"exchange.custom_quote",onChange:this._onInputBackingAsset.bind(this),asset:this.state.backingAsset,assetInput:this.state.backingAsset,tabIndex:1,style:{width:"100%",paddingRight:"10px"},onFound:this._onFoundBackingAsset.bind(this),onAction:this._onAdd.bind(this),action_label:"exchange.add_quote",disableActionButton:!!e,noLabel:!0}),n.createElement("div",{className:"error-area"},e))))}}var D=s(27584);class P extends n.Component{static defaultProps={maxRows:20,onlyLiquid:!1};constructor(e){super(),this.state=this._getInitialState(e)}_getInitialState(e){let t=!!e.findMarketTab||e.viewSettings.get(`myMarketsBase_${e.index}`);return{open:void 0===t||t,inverseSort:e.viewSettings.get("myMarketsInvert",!0),sortBy:e.viewSettings.get("myMarketsSort","volume")}}UNSAFE_componentWillReceiveProps(e){e.findMarketTab!==this.props.findMarketTab&&this.setState(this._getInitialState(e))}shouldComponentUpdate(e,t){return!(e.markets&&this.props.markets&&c.A.are_equal_shallow(t,this.state)&&c.A.are_equal_shallow(e.markets,this.props.markets)&&e.starredMarkets===this.props.starredMarkets&&e.marketStats===this.props.marketStats&&e.userMarkets===this.props.userMarkets)}_inverseSort(){v.A.changeViewSetting({myMarketsInvert:!this.state.myMarketsInvert}),this.setState({inverseSort:!this.state.inverseSort})}_changeSort(e){e!==this.state.sortBy?(v.A.changeViewSetting({myMarketsSort:e}),this.setState({sortBy:e})):this._inverseSort()}_onToggle(){if(!this.props.findMarketTab){let e=!this.state.open;this.setState({open:e});let t={};t[`myMarketsBase_${this.props.index}`]=e,v.A.changeViewSetting(t)}}_onToggleUserMarket(e){let[t,s]=e.split("_"),a=!this.props.userMarkets.get(e);v.A.setUserMarket(t,s,a)}render(){let{columns:e,markets:t,base:s,marketStats:a,starredMarkets:r,current:i}=this.props,{sortBy:o,inverseSort:l,open:c}=this.state;if(!t||!t.length)return null;let h=e.map((e=>{switch(e.name){case"market":return n.createElement("th",{key:e.name,className:"clickable",onClick:this._changeSort.bind(this,"name")},n.createElement(p(),{content:"exchange.market"}));case"vol":return n.createElement("th",{key:e.name,className:"clickable",onClick:this._changeSort.bind(this,"volume"),style:{textAlign:"right"}},n.createElement(p(),{content:"exchange.vol_short"}));case"price":return n.createElement("th",{key:e.name,style:{textAlign:"right"}},n.createElement(p(),{content:"exchange.price"}));case"quoteSupply":return n.createElement("th",{key:e.name},n.createElement(p(),{content:"exchange.base_supply"}));case"baseSupply":return n.createElement("th",{key:e.name},n.createElement(p(),{content:"exchange.quote_supply"}));case"change":return n.createElement("th",{key:e.name,className:"clickable",onClick:this._changeSort.bind(this,"change"),style:{textAlign:"right"}},n.createElement(p(),{content:"exchange.change"}));case"issuer":return n.createElement("th",{key:e.name},n.createElement(p(),{content:"explorer.assets.issuer"}));case"add":return n.createElement("th",{key:e.name,style:{textAlign:"right"}},n.createElement(p(),{content:"account.perm.confirm_add"}));default:return n.createElement("th",{key:e.name})}})),m=t.map((t=>this.props.onlyLiquid&&a.get(t.id)&&0==a.get(t.id).volumeBase?null:n.createElement(_,{key:t.id,name:"others"===s?n.createElement("span",null,n.createElement(C.A,{name:t.quote}),":",n.createElement(C.A,{name:t.base})):n.createElement(C.A,{dataPlace:"left",name:t.quote}),quote:t.quote,base:t.base,columns:e,leftAlign:!0,compact:!0,noSymbols:!0,stats:a.get(t.id),starred:r.has(t.id),current:i===t.id,isChecked:this.props.userMarkets.has(t.id),isDefault:this.props.defaultMarkets&&this.props.defaultMarkets.has(t.id),onCheckMarket:this._onToggleUserMarket.bind(this),location:this.props.location,history:this.props.history}))).filter((e=>null!==e)).sort(((e,t)=>{let s=e.key.split("_"),n=t.key.split("_"),r=a.get(s[0]+"_"+s[1]),i=a.get(n[0]+"_"+n[1]);switch(o){case"name":return s[0]>n[0]?l?-1:1:s[0]<n[0]?l?1:-1:s[1]>n[1]?l?-1:1:s[1]<n[1]?l?1:-1:0;case"volume":return r&&i?l?i.volumeBase-r.volumeBase:r.volumeBase-i.volumeBase:0;case"change":return r&&i?l?i.change-r.change:r.change-i.change:0}}));return n.createElement("div",{style:{paddingRight:10}},c?n.createElement("table",{className:"table table-hover text-right"},n.createElement("thead",null,n.createElement("tr",null,h)),m&&m.length?n.createElement("tbody",null,m):null):null)}}class O extends n.Component{static defaultProps={activeTab:"my-market",setMinWidth:!1};constructor(e){super(),this.state={isQuoteModalVisible:!1,inverseSort:e.viewSettings.get("myMarketsInvert",!0),sortBy:e.viewSettings.get("myMarketsSort","volume"),activeTab:e.viewSettings.get("favMarketTab","my-market"),activeMarketTab:e.viewSettings.get("activeMarketTab",0),lookupQuote:null,lookupBase:null,inputValue:"",minWidth:"100%",findBaseInput:"BTS",activeFindBase:"BTS"},this._setMinWidth=this._setMinWidth.bind(this),this.getAssetList=(0,a.A)(w.A.getAssetList.defer,150),this.showQuoteModal=this.showQuoteModal.bind(this),this.hideQuoteModal=this.hideQuoteModal.bind(this)}shouldComponentUpdate(e,t){return this.state.activeTab!==t.activeTab?this._changeTab(t.activeTab):e.tabHeader||this.state.activeTab===e.activeTab||this._changeTab(e.activeTab),!(i().is(e.searchAssets,this.props.searchAssets)&&i().is(e.markets,this.props.markets)&&i().is(e.starredMarkets,this.props.starredMarkets)&&i().is(e.defaultMarkets,this.props.defaultMarkets)&&i().is(e.marketStats,this.props.marketStats)&&c.A.are_equal_shallow(t,this.state)&&e.current===this.props.current&&e.minWidth===this.props.minWidth&&e.listHeight===this.props.listHeight&&e.preferredBases===this.props.preferredBases&&e.onlyStars===this.props.onlyStars&&e.onlyLiquid===this.props.onlyLiquid&&e.assetsLoading===this.props.assetsLoading&&e.userMarkets===this.props.userMarkets)}UNSAFE_componentWillMount(){if(this.props.setMinWidth&&window.addEventListener("resize",this._setMinWidth,{capture:!1,passive:!0}),this.props.currrent){const e=this.props.current.split("_")[1],t=this.props.preferredBases.findIndex((t=>t===e));-1!==t&&t!==this.state.activeMarketTab&&this.setState({activeMarketTab:t})}}componentDidMount(){let e=this.refs.favorites;l().initialize(e),this._setMinWidth(),this.state.activeTab!==this.props.activeTab&&setTimeout((()=>{this._changeTab(this.props.activeTab)}),100)}componentWillUnmount(){this.props.setMinWidth&&window.removeEventListener("resize",this._setMinWidth),clearTimeout(this.timer)}UNSAFE_componentWillReceiveProps(e){this.props.myMarketTab&&!e.myMarketTab&&this.refs.findSearchInput&&this.refs.findSearchInput.focus()}hideQuoteModal(){this.setState({isQuoteModalVisible:!1})}showQuoteModal(){this.setState({isQuoteModalVisible:!0})}_setMinWidth(){this.props.setMinWidth&&this.refs.favorites&&"my-market"===this.props.activeTab&&this.state.minWidth!==this.refs.favorites.offsetWidth&&this.setState({minWidth:this.refs.favorites.offsetWidth})}componentDidUpdate(){if(this.refs.favorites){let e=this.refs.favorites;l().update(e)}}_inverseSort(){v.A.changeViewSetting({myMarketsInvert:!this.state.myMarketsInvert}),this.setState({inverseSort:!this.state.inverseSort})}_changeSort(e){e!==this.state.sortBy?(v.A.changeViewSetting({myMarketsSort:e}),this.setState({sortBy:e})):this._inverseSort()}_goMarkets(){this.props.history.push("/markets")}_changeTab(e){v.A.changeViewSetting({favMarketTab:e}),this.setState({activeTab:e}),this._setMinWidth()}_onInputName(e,t){let s=t.target.value.trim().toUpperCase(),a=!F.ChainValidation.is_valid_symbol_error(s,!0);this.setState({inputValue:s}),s&&s.length>=2&&!a||(this.state.inputValue!==s&&this.timer&&clearTimeout(this.timer),this.timer=setTimeout((()=>{this._lookupAssets(s,e)}),1500))}_lookupAssets(e,t=!1){if(!e&&""!==e)return;let s=e.toUpperCase().split(":"),a=s[0],n=2===s.length?s[1]:null;this.setState({lookupQuote:a,lookupBase:n}),v.A.changeViewSetting.defer({marketLookupInput:e.toUpperCase()}),this.getAssetList(a,50,t)}toggleActiveMarketTab(e){v.A.changeViewSetting({activeMarketTab:e}),this.setState({activeMarketTab:e})}_onInputBaseAsset(e){this.setState({findBaseInput:e.toUpperCase(),error:null})}_onFoundBaseAsset(e){e&&this.setState({activeFindBase:e.get("symbol")})}clearInput=()=>{this.setState({myMarketFilter:""})};handleSearchUpdate=e=>{this.setState({myMarketFilter:e.target.value&&e.target.value.toUpperCase()})};_getMarkets(){const{searchAssets:e,defaultMarkets:t,onlyStars:s,userMarkets:a,preferredBases:n,starredMarkets:r}=this.props,{activeTab:o,lookupQuote:l,lookupBase:c,myMarketFilter:h,activeMarketTab:p}=this.state,m=(0,U.wM)(n);let d=this._getBases(),u=[],g={},b=[];const k="my-market"===o;e.size&&e.filter((e=>{try{if(e.options.description){let t=JSON.parse(e.options.description);if("visible"in t&&!t.visible)return!1}}catch(e){}return-1!==e.symbol.indexOf(l)&&e.symbol.length>=l.length})).forEach((e=>{d.forEach((t=>{let s=e.symbol+"_"+t;t!==e.symbol&&u.push([s,{quote:e.symbol,base:t}])}))})),u=u.filter((e=>!c||e[1].quote===l));let y=k?t:i().Map(u);function v(e,t,a,i,o){return{otherMarkets:a.filter((e=>{if(e.base===e.quote)return!1;if(k){const t=e.quote+"_"+e.base;return h?-1!==t.indexOf(h):!(s&&!r.has(t))}return!(l.length<1)&&-1!==e.quote.indexOf(l)})).map((s=>{let a=s.quote+"_"+s.base;if(-1!==t.indexOf(s.base)){i[e]||(i[e]=[]);let t={id:a,quote:s.quote,base:s.base};return i[e].find((e=>e.id===a))||i[e].push(t),null}if(!n.includes(s.base)&&-1===m.indexOf(s.base))return{id:a,quote:s.quote,base:s.base}})).filter((e=>!!e)).take(k?100:20).toArray().concat(o),baseGroups:i}}if(k&&a.size&&a.forEach(((e,t)=>{y.has(t)||(y=y.set(t,e))})),y.size>0){const e=k?n.get(p):this.state.activeFindBase;({otherMarkets:b,baseGroups:g}=v(e,[e],y,g,b)),U.fL.forEach((t=>{let s=`${t}.${e}`;if(F.ChainStore.getAsset(s)){let t=y.map((e=>{if(e.quote===e.base)return null;let t=`${e.quote}_${s}`;return y.has(t)?null:{base:s,quote:e.quote}}),{}).filter((e=>!!e));({otherMarkets:b,baseGroups:g}=v(e,[e,s],t,g,b))}}))}return{baseGroups:g,otherMarkets:b}}_getBases(){let{preferredBases:e,searchAssets:t}=this.props,{lookupQuote:s,lookupBase:a}=this.state,n=t.filter((e=>a&&a.length?0===e.symbol.indexOf(a):-1!==e.symbol.indexOf(s))).map((t=>{if(a&&a.length){if(0===t.symbol.indexOf(a))return t.symbol}else if(e.includes(t.symbol)&&t.symbol.length>=s.length&&t.symbol.length<s.length+3)return t.symbol})).filter((e=>!!e)).toArray();return n=n.concat(e.filter((e=>!a||!a.length||0===e.indexOf(a))).toArray()),n=n.filter((e=>!(a&&a.length>1)||0===e.indexOf(a))),n}render(){let{starredMarkets:e,marketStats:t,columns:a,assetsLoading:r,preferredBases:i,current:o,viewSettings:l,listHeight:c}=this.props,{activeMarketTab:h,activeTab:d}=this.state;const u="my-market"===d;let g=i.map((e=>e));u||(i=i.clear(),i=i.push(this.state.activeFindBase)),u||(h=0);let{baseGroups:b,otherMarkets:k}=this._getMarkets();const f=k&&k.length;let E="mymarkets-header clickable",A=T()(E,{inactive:!u}),_=T()(E,{inactive:u}),S={minWidth:this.state.minWidth,minHeight:"6rem"};c&&(S.height=c);const M=s(10658);return n.createElement("div",{className:this.props.className,style:this.props.style},this.props.tabHeader?n.createElement("div",{style:this.props.headerStyle,className:"grid-block shrink left-orderbook-header bottom-header"},n.createElement("div",{ref:"myMarkets",className:A,onClick:this._changeTab.bind(this,"my-market"),"data-intro":M.translate("walkthrough.my_markets_tab")},n.createElement(p(),{content:"exchange.market_name"})),n.createElement("div",{className:_,onClick:this._changeTab.bind(this,"find-market"),"data-intro":M.translate("walkthrough.find_markets_tab")},n.createElement(p(),{content:"exchange.more"}))):null,this.props.noHeader||this.props.tabHeader?null:n.createElement("div",{style:this.props.headerStyle},n.createElement("div",{className:"exchange-content-header"},n.createElement("span",null,n.createElement(p(),{content:"exchange.market_name"})))),this.props.controls?n.createElement("div",{className:"small-12 medium-6",style:{padding:"1rem 0"}},this.props.controls?n.createElement("div",{style:{paddingBottom:"0.5rem"}},this.props.controls):null):null,u?n.createElement("div",{className:"grid-block vertical shrink",style:{width:"100%",textAlign:"left",padding:"0 0.5rem 0.75rem 0.5rem"}},n.createElement("div",null,n.createElement("label",{style:{margin:"3px 0 0"}},n.createElement("input",{style:{position:"relative",top:3},className:"no-margin",type:"checkbox",checked:this.props.onlyLiquid,onChange:()=>{v.A.changeViewSetting({onlyLiquid:!this.props.onlyLiquid})}}),n.createElement("span",{style:{paddingLeft:"0.4rem"}},n.createElement(p(),{content:"exchange.show_only_liquid"}))),n.createElement("label",{style:{margin:"3px 0 0"}},n.createElement("input",{style:{position:"relative",top:3},className:"no-margin",type:"checkbox",checked:this.props.onlyStars,onChange:()=>{y.A.toggleStars()}}),n.createElement("span",{style:{paddingLeft:"0.4rem"}},n.createElement(m.A,{string:"exchange.show_only_star_formatter",keys:[{type:"icon",value:"fi-star",className:"gold-star",arg:"star_icon"}]}))),n.createElement("br",null)),n.createElement("div",{className:"search-wrapper"},n.createElement("form",null,n.createElement("div",{className:"filter inline-block"},n.createElement(D.A,{style:{fontSize:"0.9rem",height:"inherit",position:"relative"},className:"no-margin market-filter-input",value:this.state.myMarketFilter,onChange:this.handleSearchUpdate}))))):n.createElement("div",{style:{width:"100%",textAlign:"left",padding:"0.75rem 0.5rem"}},n.createElement("table",null,n.createElement("tbody",null,n.createElement("tr",{style:{width:"100%"}},n.createElement("td",null,n.createElement(N.A,{onAssetSelect:this._onFoundBaseAsset.bind(this),assets:g,onChange:this._onInputBaseAsset.bind(this),asset:this.state.findBaseInput,assetInput:this.state.findBaseInput,tabIndex:1,style:{width:"100%",paddingBottom:"1.5rem"},onFound:this._onFoundBaseAsset.bind(this),label:"exchange.quote",noLabel:!0,inputStyle:{fontSize:"0.9rem"}}))),n.createElement("tr",{style:{width:"100%"}},n.createElement("td",null,n.createElement("label",null,n.createElement(p(),{content:"account.user_issued_assets.name"}),":"),n.createElement("input",{style:{fontSize:"0.9rem",position:"relative",top:1},type:"text",value:this.state.inputValue,onChange:this._onInputName.bind(this,!0),placeholder:I().translate("exchange.search"),maxLength:16,tabIndex:2,ref:"findSearchInput"}),this.state.assetNameError?n.createElement("div",{className:"error-area",style:{paddingTop:10}},n.createElement("span",{style:{wordBreak:"break-all"}},n.createElement(p(),{content:"explorer.asset.invalid",name:this.state.inputValue}))):null))))),n.createElement("ul",{className:"mymarkets-tabs",style:{marginBottom:0}},u&&n.createElement("li",{key:"quote_edit",style:{textTransform:"uppercase"},onClick:this.showQuoteModal,className:"mymarkets-tab"}," + "),u||this.state.inputValue?i.map(((e,t)=>e?n.createElement("li",{key:e,onClick:this.toggleActiveMarketTab.bind(this,t),className:T()("mymarkets-tab",{active:h===t})},e):null)):null,u&&f?n.createElement("li",{key:"others",style:{textTransform:"uppercase"},onClick:this.toggleActiveMarketTab.bind(this,i.size+1),className:T()("mymarkets-tab",{active:h===i.size+1})},n.createElement(p(),{content:"exchange.others"})):null),n.createElement("div",{style:S,className:"table-container grid-block vertical mymarkets-list",ref:"favorites"},r?n.createElement("div",{style:{position:"absolute",paddingTop:"3rem",textAlign:"center",width:"100%"}},n.createElement(L.A,{type:"three-bounce"})):null,i.filter((e=>e===i.get(h))).map(((s,r)=>n.createElement(P,{userMarkets:this.props.userMarkets,defaultMarkets:this.props.defaultMarkets,index:r,allowChange:!1,key:s,current:o,starredMarkets:e,marketStats:t,viewSettings:l,columns:u?a:this.props.findColumns||a,markets:b[s],base:s,maxRows:u?20:10,findMarketTab:!u,location:this.props.location,history:this.props.history,onlyLiquid:this.props.onlyLiquid&&u}))),h===i.size+1&&u&&f?n.createElement(P,{userMarkets:this.props.userMarkets,index:i.size,current:o,starredMarkets:e,marketStats:t,viewSettings:l,columns:a,markets:k,base:"others",maxRows:u?20:10,findMarketTab:!u,location:this.props.location,history:this.props.history}):null),n.createElement(V,{visible:this.state.isQuoteModalVisible,hideModal:this.hideQuoteModal,showModal:this.showQuoteModal,quotes:this.props.preferredBases}))}}O=(0,W.Ay)(O,50,{leading:!1});class Q extends n.Component{render(){return n.createElement(O,this.props)}}const z=(0,d.N)(Q,{listenTo:()=>[S.A,M.A,x.A],getProps:()=>({starredMarkets:S.A.getState().starredMarkets,onlyLiquid:S.A.getState().viewSettings.get("onlyLiquid",!0),defaultMarkets:S.A.getState().defaultMarkets,viewSettings:S.A.getState().viewSettings,preferredBases:S.A.getState().preferredBases,marketStats:M.A.getState().allMarketStats,userMarkets:S.A.getState().userMarkets,searchAssets:x.A.getState().assets,onlyStars:M.A.getState().onlyStars,assetsLoading:x.A.getState().assetsLoading})})},90184:(e,t,s)=>{s.d(t,{A:()=>o});var a=s(96540),n=s(12569),r=s(72342);class i extends a.Component{static propTypes={account:n.A.ChainObject.isRequired};static defaultProps={autosubscribe:!1};render(){return this.props.account?a.createElement("span",null,this.props.account.get("name")):null}}const o=(0,r.A)(i)},57763:(e,t,s)=>{s.d(t,{A:()=>A});var a=s(96540),n=s(80849),r=s.n(n),i=s(72090),o=s(12569),l=s(72342),c=s(10658),h=s.n(c),p=s(62611),m=s(96366),d=s(9404),u=s.n(d),g=s(32485),b=s.n(g),k=s(60819),y=s(5556),v=s.n(y);class f extends a.Component{static propTypes={value:v().string,onChange:v().func};render(){return 0!==this.props.assets.length&&this.props.value?a.createElement(p.A,{entries:this.props.assets.map((e=>e&&e.get("symbol"))).filter((e=>!!e)),values:this.props.assets.reduce(((e,t)=>(t&&t.get("symbol")&&(e[t.get("symbol")]=t),e)),{}),singleEntry:this.props.assets[0]?a.createElement(m.A,{asset:this.props.assets[0].get("id"),amount:0,hide_amount:!0}):null,value:"",onChange:this.props.onChange}):null}}f=(0,k.A)(f,{asList:!0});class E extends a.Component{static propTypes={label:v().string,error:v().string,placeholder:v().string,onChange:v().func,onFound:v().func,assetInput:v().string,asset:o.A.ChainAsset,tabIndex:v().number,disableActionButton:v().bool};static defaultProps={disabled:!1};getAsset(){return this.props.asset}getError(e=this.props.assetInput){let t=this.props.error;return t||!e||this.getNameType(e)||(t=h().translate("explorer.asset.invalid",{name:e})),t}getNameType(e){return e?i.ChainValidation.is_valid_symbol_error(e,!0)?null:"symbol":null}onInputChanged(e){let t=e.target.value.trim().substr(0,16).toUpperCase();this.props.onChange&&t!==this.props.assetInput&&this.props.onChange(t)}onKeyDown(e){13===e.keyCode&&(this.onFound(e),this.onAction(e))}componentDidMount(){this.props.onFound&&this.props.asset&&this.props.onFound(this.props.asset)}UNSAFE_componentWillReceiveProps(e){this.props.onFound&&e.asset!==this.props.asset&&this.props.onFound(e.asset)}onFound(e){e.preventDefault(),!this.props.onFound||this.getError()||this.props.disableActionButton||this.props.asset&&this.props.onFound(this.props.asset)}onAssetSelect(e){e&&(this.props.onFound(e),this.props.onChange(e.get("symbol")))}onAction(e){e.preventDefault(),!this.props.onAction||this.getError()||this.props.disableActionButton||this.props.asset&&this.props.onAction(this.props.asset)}render(){let e,{disabled:t,noLabel:s}=this.props,n=this.getError();t||(this.props.asset?e=this.props.asset.get("symbol"):!n&&this.props.assetInput&&(n=h().translate("explorer.asset.not_found",{name:this.props.assetInput})));let i=b()("button",{disabled:!this.props.asset||n||this.props.disableActionButton});return a.createElement("div",{className:"asset-selector",style:this.props.style},a.createElement("div",null,a.createElement("div",{className:"header-area"},n||s?null:a.createElement("label",{className:"right-label"}," ",a.createElement("span",null,e)),a.createElement(r(),{component:"label",content:this.props.label})),a.createElement("div",{className:"input-area"},a.createElement("div",{className:"inline-label input-wrapper"},a.createElement("input",{className:this.props.inputClass,style:this.props.inputStyle,disabled:this.props.disabled,type:"text",value:this.props.assetInput||"",placeholder:this.props.placeholder||h().translate("explorer.assets.symbol"),ref:"user_input",onChange:this.onInputChanged.bind(this),onKeyDown:this.onKeyDown.bind(this),tabIndex:this.props.tabIndex}),a.createElement("div",{className:"form-label select floating-dropdown"},this.props.asset?a.createElement(f,{ref:this.props.refCallback,value:this.props.asset.get("symbol"),assets:u().List(this.props.assets),onChange:this.onAssetSelect.bind(this)}):null),this.props.children,this.props.onAction?a.createElement("button",{className:i,onClick:this.onAction.bind(this)},a.createElement(r(),{content:this.props.action_label})):null)),a.createElement("div",{className:"error-area",style:{paddingBottom:"10px"}},a.createElement("span",{style:{wordBreak:"break-all"}},n))))}}const A=(0,l.A)(E)},14830:(e,t,s)=>{s.d(t,{A:()=>i});var a=s(96540),n=s(44038),r=s(94689);class i extends a.Component{static defaultProps={component:"span",enterTimeout:2e3};constructor(){super(),this.state={animateEnter:!1},this.timer=null}componentDidMount(){this.enableAnimation()}resetAnimation(){this.setState({animateEnter:!1}),this.enableAnimation()}enableAnimation(){this.timer=setTimeout((()=>{this.timer&&this.setState({animateEnter:!0})}),2e3)}componentWillUnmount(){clearTimeout(this.timer),this.timer=null}render(){return this.props.children?a.createElement(n.A,{component:this.props.component,id:this.props.id,className:this.props.className},a.Children.map(this.props.children,((e,t)=>a.createElement(r.A,{key:t,classNames:this.props.transitionName,timeout:{enter:this.props.enterTimeout},exit:!1,enter:this.state.animateEnter},e)))):a.createElement(this.props.component)}}}}]);