"use strict";(self.webpackChunkreact_widget=self.webpackChunkreact_widget||[]).push([[971],{84313:(e,t,a)=>{function n(e){let t="";return t=e<1e6?c(e):e<1e9?c(e/1e6)+"M":c(e/1e9)+"B",t}a.d(t,{G:()=>c,k:()=>n});const c=(e,t=!0)=>{const a=Math.abs(e)>=1?2:-Math.floor(Math.log10(Math.abs(e)));let n=a>2?a+3:a;const c=Number(e).toFixed(18);return"0"===parseFloat(c).toString().replace(/(\.[0-9]*[1-9])0+$/,"$1").replace(/\.$/,"")?"0.00":Number(e).toLocaleString("en-US",{minimumFractionDigits:n?Math.max(2,n):2,maximumFractionDigits:n?Math.max(2,n):4,useGrouping:t})}},91705:(e,t,a)=>{a.d(t,{Ay:()=>r,K0:()=>m,OL:()=>o,Or:()=>u,hQ:()=>l,kf:()=>h,tA:()=>i,vq:()=>s});var n=a(51609),c=a(98505);function r(e){return(0,n.createElement)("div",{className:"ccpw_icon"},(0,n.createElement)("img",{id:e.coin_id,alt:e.coin_id,src:e.logo}))}function l(e){return ccpw_react_data.home_url+"/"+ccpw_react_data.cmc_slug+"/"+e.symbol+"/"+e.coin_id}function s(){return 1==ccpw_react_data.cmc_enabled}function i(e){return e<0?(0,n.createElement)(c.k6A,null):(0,n.createElement)(c.zce,null)}function m(e,t){return"USD"==t||Object.keys(e).length<2?1:Object.entries(e).find((e=>e[0]==t))[1]}function o(e){let t=[];return Object.entries(e).forEach((e=>t.push(e[1].symbol+"USDT"))),t}function u(e){let t=[];return Object.entries(e).forEach((e=>t.push(e[1]))),t}function h(e){return(0,n.createElement)("span",{className:"ccpw-changes "+(e.percent_change_24h<0?"down":"up")},i(e.percent_change_24h),e.percent_change_24h,"%")}},28971:(e,t,a)=>{a.r(t),a.d(t,{default:()=>m});var n=a(51609),c=a(84313),r=a(65789),l=a(91705),s=a(42583),i=a.n(s);function m(e){const t=e.applocalize.appLocalizer,[a,s]=(0,n.useState)("1"),[m,o]=(0,n.useState)([]),[u,h]=(0,n.useState)(),[p,d]=(0,n.useState)(!1);function _(e,t){let a="";return Object.entries(e).forEach((function(e,n){e[1].keys==t&&(a=e[1].data)})),a}(0,n.useEffect)((()=>{const a=e.coinsData;if(!a)return;let n;n="custom"==t.show_coins?a.found:a.all;let r=[];t.mt_currency.forEach((function(e,t){let s=[],m=(0,l.K0)(a.fiat,e),o=i()(e);Object.entries(n).forEach((function(t,a){let n={id:t[1].coin_id,logo:t[1].logo,hchanges24h:t[1].percent_change_24h,name:t[1].name,coin_id:t[1].coin_id,price:o+(0,c.G)("BTC"==e?t[1].price/m:t[1].price*m),symbol:t[1].symbol};s.push(n)})),r.push({keys:e,data:s})})),o(r),h(_(r,r[0].keys)),s(r[0].keys),"on"==t.display_changes&&d(!0)}),[e.coinsData]);const g=e=>{h(_(m,e.target.id)),s(e.target.id)};return(0,n.createElement)(n.Fragment,null,null!=u&&0!=u.length?(0,n.createElement)(n.Fragment,null,(0,n.createElement)("ul",{className:"multi-currency-tab"},m.map(((e,t)=>(0,n.createElement)("li",{key:t,id:e.keys,className:a===`${e.keys}`?"active-tab":null,onClick:g},(0,n.createElement)("span",{id:e.keys},e.keys))))),(0,n.createElement)("ul",{className:"multi-currency-tab-content"},u.map(((e,t)=>(0,n.createElement)("li",{id:e.id,key:e.id},(0,n.createElement)("div",{className:"mtab-content"},1==(0,l.vq)()?(0,n.createElement)("a",{className:"cmc_links",title:e.name,href:(0,l.hQ)(e)},(0,n.createElement)("span",{className:"mtab_icon"},(0,l.Ay)(e)),(0,n.createElement)("span",{className:"mtab_name"},e.name,"(",e.symbol,")")," "):(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"mtab_icon"},(0,n.createElement)("div",{className:"ccpw_icon"},(0,n.createElement)("img",{id:e.id,alt:e.id,src:e.logo}))),(0,n.createElement)("span",{className:"mtab_name"},e.name,"(",e.symbol,")")),(0,n.createElement)("div",{className:"tab-price-area"},(0,n.createElement)("span",{className:"mtab_price",dangerouslySetInnerHTML:{__html:e.price}}),1==p?(0,n.createElement)("span",{className:e.hchanges24h<0?"mtab_ down":"mtab_ up"},(0,l.tA)(e.hchanges24h),e.hchanges24h,"%"):null))))))):(0,n.createElement)(r.A,{loader:3,width:1e3}))}}}]);