!function(){var e={3783:function(e,t){!function(e){"use strict";const t={BTC:"₿",ETH:"Ξ",USD:"$",CAD:"C$",GBP:"£",EUR:"€",CHF:"Fr.",SEK:"kr",JPY:"¥",CNY:"¥",INR:"₹",RUB:"₽",AUD:"A$",HKD:"HK$",SGD:"S$",TWD:"NT$",BRL:"R$",KRW:"₩",ZAR:"R",MYR:"RM",IDR:"Rp",NZD:"NZ$",MXN:"MX$",PHP:"₱",DKK:"kr.",PLN:"zł",AED:"DH",ARS:"$",CLP:"CLP",CZK:"Kč",HUF:"Ft",ILS:"₪",KWD:"KD",LKR:"Rs",NOK:"kr",PKR:"₨",SAR:"SR",THB:"฿",TRY:"₺",XAU:"XAU",XAG:"XAG",XDR:"XDR"},r={MYR:{location:{start:!0},forLocales:{en:!0}},SGD:{location:{start:!0},forLocales:{en:!0}},PHP:{location:{start:!0},forLocales:{en:!0}},BTC:{location:{start:!0},forLocales:{en:!0}},ETH:{location:{start:!0},forLocales:{en:!0}}};function o(){return!("object"!=typeof Intl||!Intl||"function"!=typeof Intl.NumberFormat)}function n(e){return"BTC"===e||"ETH"===e}function a(e){return n(e)||null==t[e]}function c(e,o="en"){const n=e.match(/^[A-Z]{3}\s?/);if(null!=n){const a=n[0].trim(),c=r[a];return c&&c.location.start&&c.forLocales[o]?e.replace(n[0],t[a]):e}const a=e.match(/[A-Z]{3}$/);if(null!=a){const n=a[0],c=r[n];return c&&c.location.end&&c.forLocales[o]?e.replace(n,t[n]):e}return e}function i(e,t,r,o){try{const n={style:"currency",currency:e,currencyDisplay:"symbol"};return void 0!==r?(n.minimumFractionDigits=r,n.maximumFractionDigits=r):void 0!==o&&(n.maximumSignificantDigits=o),new Intl.NumberFormat(t,n)}catch(o){return l(e,t,r)}}function l(e,t,r=2){return e=e.toUpperCase(),r>2?{format:t=>a(e)?`${t.toFixed(r)} ${e}`:`${e} ${t.toFixed(r)}`}:{format:r=>a(e)?`${r.toLocaleString(t)} ${e}`:`${e} ${r.toLocaleString(t)}`}}function s(e,t,r,c){return!o()||a(e)&&!n(e)?l(e,t,r):i(e,t,r,c)}let d,u,p,m,y,g,f,_,h,v,b,w={};function S(){w={}}function C(e,t){const r=`${e}-${t}`,o=w[r];p=o?o.currencyFormatterNormal:s(e,t),m=o?o.currencyFormatterNoDecimal:s(e,t,0),y=o?o.currencyFormatterMedium:s(e,t,3),g=o?o.currencyFormatterTwoDecimal:s(e,t,2),f=o?o.currencyFormatterSmall:s(e,t,6),_=o?o.currencyFormatterVerySmall:s(e,t,8),h=o?o.currencyFormatterVeryVerySmall:s(e,t,12),v=o?o.currencyFormatter15DP:s(e,t,15),b=o?o.currencyFormatter18DP:s(e,t,18),null==o&&(w[r]={},w[r].currencyFormatterNormal=p,w[r].currencyFormatterNoDecimal=m,w[r].currencyFormatterMedium=y,w[r].currencyFormatterTwoDecimal=g,w[r].currencyFormatterSmall=f,w[r].currencyFormatterVerySmall=_,w[r].currencyFormatterVeryVerySmall=h,w[r].currencyFormatter15DP=v,w[r].currencyFormatter18DP=b)}const L=50,T=1e3,x=1e5;function F(e,t,r="en",o=!1,n=!1){if(t=t.toUpperCase(),d===t&&u==r||(d=t,u=r,C(t,r)),!0===n&&e>100)return c(m.format(e),r);if("object"==typeof n&&null!==n){if(o){let t=n.hasOwnProperty("decimalPlaces")?e.toFixed(n.decimalPlaces):e;return""+parseFloat(t).toPrecision(n.significantFigures)/1}return n.hasOwnProperty("decimalPlaces")&&n.hasOwnProperty("significantFigures")?c(s(t,r,void 0,n.significantFigures).format(Number.parseFloat(e.toFixed(n.decimalPlaces))),r):c(s(t,r,n.decimalPlaces,n.significantFigures).format(e),r)}if(!a(t)){const n=Math.abs(e);return o?n<1e-12?e.toFixed(18):n<1e-9?e.toFixed(15):n<10**-6?e.toFixed(12):n<.001?e.toFixed(8):n<1?e.toFixed(6):e.toFixed(2):c(0===n?p.format(e):n<1e-12?b.format(e):n<1e-9?v.format(e):n<10**-6?h.format(e):n<.05?_.format(e):n<1?f.format(e):"JPY"===t&&n<100?g.format(e):n>x?m.format(e):p.format(e),r)}{let t=parseFloat(e);if(o)return 0===e?t.toFixed(2):t.toPrecision(8);if(0===e)return c(p.format(e),r);if(t>=T)return c(m.format(e),r);if(t>=L&&t=1&&t=1e-6&&t<1)return c(_.format(e),r);if(t>=1e-9&&t<10**-6)return c(h.format(e),r);if(t>=1e-12&&t<1e-9)return c(v.format(e),r);if(t<1e-12)return c(b.format(e),r)}}e.clearCache=S,e.formatCurrency=F,e.isCrypto=a,Object.defineProperty(e,"__esModule",{value:!0})}(t)},6875:function(e,t,r){"use strict";var o=r(1669);const n=ceranking_widget_convert.customParams,a=ceranking_widget_convert.coinType_Fiat,c=ceranking_widget_convert.coinType_Crypto;let i,l;let s,d,u=0;void 0!==n?(s=n.fromCoin,d=n.toCoin):(s="",d="");let p,m,y,g={},f={},_="",h="",v=0,b=!0,w=30;const S=5;let C=!1;function L(e,t,r,o){let i=0,l=null,s=null;t.amount=t.amount.replace(" ","").replace(",","."),t.coin_type==c&&r.coin_type==a?(i=t.amount*e[t.id][r.id],l=t.custom_id,s=r.id):t.coin_type==a&&r.coin_type==c?(i=1*t.amount/e[r.id][t.id],l=t.id,s=r.custom_id):t.coin_type==c&&r.coin_type==c&&(i=t.amount*e[t.id].usd/e[r.id].usd,l=t.custom_id,s=r.custom_id),t.amount=parseFloat(t.amount),(!t.amount||t.amount<0)&&(t.amount=1);let d="";if(d=ceranking_widget_convert.isAmountRemoved?"/"+ceranking_widget_convert.convertMask.replace("{fromCurrency}",l).replace("{toCurrency}",s).replace("?amount={amount}","")+"/":"/"+ceranking_widget_convert.convertMask.replace("{fromCurrency}",l).replace("{toCurrency}",s).replace("{amount}",s),-1!==d.indexOf("null")&&(d="/"),C&&void 0!==n?.calledFrom&&"oneConverter"!==n.calledFrom&&async function(e,t){return await fetch(e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)})}("/wp-json/ceranking/v2/get-convert-on-exchange",{coinId:t.id}).then((e=>e.json())).then((e=>{let t=document.getElementById("convert-on-exchange-button"),r=document.querySelector('[data-el="currency_convert"]');if(null===t)return!1;let o=t.querySelector("span");void 0!==e.url&&""!==e.url&&void 0!==e.text&&""!==e.text?(t.href=e.url,o.innerHTML=e.text,t.target="_blank",t.style.display="flex",r.classList.contains("hide-by-default")&&(r.classList.remove("hidden"),r.classList.add("hidden"))):(t.style.display="none",t.href="#",o.innerHTML="Not Available Yet",t.target="_self",r.classList.contains("hide-by-default")&&r.classList.remove("hidden"))})),C=!0,r.elem.value=function(e){let t=(e+="").split("."),r=t[0],o=t.length>1?","+t[1]:"";var n=/(\d+)(\d{3})/;for(;n.test(r);)r=r.replace(n,"$1 $2");return r+o}(i),void 0!==n.calledFrom&&"oneConverter"!==n.calledFrom&&("undefined"==typeof ceranking_coin_price_prediction||void 0===ceranking_coin_price_prediction.coinId)){const e=r.elem.closest('[data-el="currency-dropdown-wrap"]').closest('[data-el="c-bic-conversor-input-wrap"]').parentNode.querySelector('[data-el="currency_convert"]');e&&e.setAttribute("href",d)}return j(o)}function T(e){const t=JSON.parse(e.dataset.details),r=e.closest('[data-el="currency-dropdown"]'),o=r.querySelector('[data-el="currency-dropdown-logo"]'),n=e.closest('[data-el="currency-dropdown-wrap"]');t.coin_type==a?o.innerText=t.logo:(o.src=t.logo,o.alt=t.name),r.querySelector('[data-el="currency-dropdown-symbol"]').innerText=t.symbol,n.setAttribute("data-symbol",t.symbol),n.setAttribute("data-id",t.id),n.setAttribute("data-custom_id",t.custom_id),n.querySelector('[data-el="currency-dropdown-field"]').dispatchEvent(new KeyboardEvent("keyup")),n.setAttribute("data-name",t.name)}function x(e){e.closest('[data-el="c-bic-conversor-input-wrap"]').querySelectorAll('[data-el="currency-dropdown-wrap"]').forEach((e=>{e.setAttribute("data-from",0)}));e.closest('[data-el="currency-dropdown-wrap"]').setAttribute("data-from",1)}function F(e,t){let r=n.changeValTableC2C.replace(/{from_amount}/gi,"1").replace(/{from_coin}/gi,e.symbol.toUpperCase()).replace(/{to_coin}/gi,t.symbol.toUpperCase());const o=n.changeValTableC2C,a=n.changeValTableFor;let c=o.replace(/{from_amount}/gi,e.amount).replace(/{from_coin}/gi,e.symbol.toUpperCase()).replace(/{to_coin}/gi,t.symbol.toUpperCase()),i=a.replace(/{from_coin}/gi,e.symbol.toUpperCase()).replace(/{from_amount}/gi,"1"),l=a.replace(/{from_coin}/gi,e.symbol.toUpperCase()).replace(/{from_amount}/gi,e.amount),s=document.getElementById("ChangeInValueTable"),d=s.querySelector("thead tr th:nth-child(2)"),u=s.querySelector("thead tr th:nth-child(3)"),p=s.querySelector("thead tr th:nth-child(4)"),m=s.querySelector("thead tr th:nth-child(5)");d.innerHTML=r,u.innerHTML=i,p.innerHTML=c,m.innerHTML=l}function E(e,t,r){return t=void 0!==t?t:{amount:1},new Promise(((r,o)=>{try{const o=convert_single_rowHistoryTableTemplate;let n=0,a=new Date,c={},i=new Array,l=new Array,s=0,d=0;for(let t in e){let r=new Date(e[t][0]);c[r.toLocaleDateString()]=e[t],r.toLocaleDateString()==a.toLocaleDateString()&&l.push(e[t][1])}for(let e in c)i.push(c[e]);i=i.reverse();let u="";const p=document.querySelector("#ChangeInValueTable tbody");for(let e in i){let r,a=o,c=new Date(i[e][0]).toDateString().split(" "),l=i[e][1],p=0,m=0,y=0,g=0;if(e0?"up":"down",parseInt(e)!==i.length-1&&(n++,n>30||(l=A(l),p=A(p),a=a.replace(/{date}/gi,c[2]+" "+c[1]+" "+c[3]),a=a.replace(/{dayofweek}/gi,c[0]),a=a.replace(/{date_day}/gi,c[2]),a=a.replace(/{date_month}/gi,c[1]),a=a.replace(/{price}/gi,l),a=a.replace(/{price_amount_style}/gi,""),a=a.replace(/{price_change_amount_style}/gi,r),a=a.replace(/{price_change}/gi,p),a=a.replace(/{price_change_percent}/gi,m),a=a.replace(/{price_change_percent_class}/gi,r),a=a.replace(/{price_amount}/gi,y),a=a.replace(/{price_change_amount}/gi,g),u+=a))}p.innerHTML=u;let m=A(Math.max.apply(null,l)),y=A(Math.min.apply(null,l));r({maxAmount:m,minAmount:y,priceChangePercentLast:d,priceChangeLast:s})}catch(e){o(e)}}))}function A(e){if(null===e)return 0;if(e>1||e<-1)return e.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g,",");let t="";if(e<0&&(t="-",e=Math.abs(e)),void 0!==e){let r=e.toString();if(r.includes("E")||e<1)return r=function(e,t=!0){let r=null;if(null===e)return"0";if(e=e.toUpperCase(),e.includes("E+")){let t=e.split("E+"),o=t[0].split(".");r=o[0]+"0".repeat(Math.abs(parseInt(t[1]))+1)+"."+o[1]}else if(e.includes("E-")&&t){let t=e.split("E-"),o=t[0].split("."),n=o[0]+o[1],a=n.substring(0,4);a=n.length>4&&parseInt(n[4])>5?(parseInt(a)+1).toString():a,r="0."+"0".repeat(Math.abs(parseInt(t[1]))-1)+a}else if(e.includes("E")){let t=e.split("E"),o=t[0].split(".");r=o[0]+"0".repeat(Math.abs(parseInt(t[1]))+1)+"."+o[1]}else if(parseFloat(e)<1&&t){let t=e.split(/0\.(0*)(\d.*)/),o=(t[0]||"")+(t[1]||""),n=t[2]||"";if(n.length>0){let e=n.substring(0,4);e=n.length>4&&parseInt(n[4])>5?(parseInt(e)+1).toString():e,r="0."+(""!==o?"0".repeat(o.length):"")+e}}return r||e}(r),t+r}return 1}function q(e,t,r){let n=void 0!==t?t.symbol.toUpperCase():"",a=void 0!==r?r.symbol.toUpperCase():"",c="1 "+n+" = {point.y} "+a+"";"undefined"!=typeof Highcharts&&Highcharts.chart("convert-price-history",{legend:{enabled:!1},credits:{enabled:!1},chart:{backgroundColor:"transparent",height:300},title:{text:""},subtitle:{},xAxis:{type:"datetime",reversed:o("body").hasClass("rtl")},yAxis:{title:{text:ceranking_convert_single.graph_text_1.replace("%s",n)},opposite:o("body").hasClass("rtl")},responsive:{rules:[{condition:{maxWidth:500},chartOptions:{yAxis:{labels:{align:"left",x:0,y:-2},title:{text:""}}}}]},series:[{type:"line",id:"prices-volume",name:a,data:e,color:"#0ba523",label:{enabled:!1},tooltip:{useHTML:!0,xDateFormat:" %A, %e %b %Y",pointFormat:c}}]})}function k(e,t){let r=n.pageTitle,o=r.includes("{from_symbol}"),a=document.querySelector("h1"),c=o?"{from_symbol}":"{from_coin}",i=o?"{amount}":"{from_amount}",l=o?"{to_symbol}":"{to_coin}",s=o?"{from_name}":"{from_coin_name}",d=o?"{to_name}":"{to_coin_name}";r=r.replace(new RegExp(i),e.amount).replace(new RegExp(c,"g"),e.symbol.toUpperCase()).replace(new RegExp(s,"g"),e.name).replace(/{to_amount}/g,e.amount).replace(new RegExp(l,"g"),t.symbol.toUpperCase()).replace(new RegExp(d,"g"),t.name).replace(new RegExp(i),e.amount),a.textContent=r}function D(e,t,r){if(void 0!==n?.calledFrom&&"oneConverter"===n.calledFrom&&!1===b){const{maxAmount:o,minAmount:a,priceChangePercentLast:c,priceChangeLast:i}=r;let l=n.randomCoins,s=n.historicalTextTitle.replace("{FromCoin}",e.symbol).replace("{ToCurrency}",t.symbol);document.querySelector(".convert-one-block__header_col.historical-title").querySelector("h3").textContent=s;let d,u,m,y,g=n.historicalText;d=e.amount,"crypto"==e.coin_type?(u=p*parseFloat(e.amount),m=p):(u=parseFloat(e.amount)/p,m=1/p),y=A(i),u=A(u),m=A(m),g=g.replace(/{from_amount}/g,d).replace(/{from_coin}/g,e.symbol).replace(/{to_amount}/g,u).replace(/{to_coin}/g,t.id.toUpperCase()).replace(/{random_coin_1}/g,l[0]).replace(/{random_coin_2}/g,l[1]).replace(/{random_coin_3}/g,l[2]).replace(/{timestamp}/g,function(){const e=new Date;return e.getFullYear()+"/"+(e.getMonth()+1).toString().padStart(2,"0")+"/"+e.getDate().toString().padStart(2,"0")+" "+e.getHours().toString().padStart(2,"0")+":"+e.getMinutes().toString().padStart(2,"0")}()).replace("{max_to_amount}",o).replace("{min_to_amount}",a).replace("{price_change_percent}",c+"%").replace("{price_change}",y).replace("{base_exchange}",m),document.querySelector("#page-description").textContent=g}}function I(e,t){let r=e.symbol,o=e.amount,a=t.symbol,c=n.changeInTheValue,i=document.querySelector(".convert-one-block__header_col.change-in-value h3");c=c.replace(/{from_amount}/g,o).replace(/{from_coin}/g,r).replace(/{to_coin}/g,a),i.textContent=c}function M(e,t){return s!==_&&""!==s&&"crypto"===e.coin_type||d!==h&&""!==d&&"crypto"===t.coin_type}function P(e,t){return d!==h&&""!==d&&"fiat"===t.coin_type||s!==_&&""!==s&&"fiat"===e.coin_type}async function N(e,t){return new Promise((async(r,o)=>{try{let o,n=function(e,t){let r="price_"+e.id+"_"+t.id;const o=localStorage.getItem(r);if(null===o)return!1;{let e=JSON.parse(o);const t=new Date,n=new Date(e.timestamp);return(t.getTime()-n.getTime())/6e4>S?(localStorage.removeItem(r),!1):e}}(e,t);if(!1!==n&&null!=n&&"undefined"!==n&&"null"!==n&&"NaN"!==n)o=n.prices;else{let r="/wp-json/ceranking-cg-api/v3/simple/price?"+("crypto"===e.coin_type&&"crypto"===t.coin_type?"ids="+e.id+","+t.id+"&vs_currencies=usd":"crypto"===e.coin_type&&"fiat"===t.coin_type?"ids="+e.id+"&vs_currencies="+t.id:"fiat"===e.coin_type&&"crypto"===t.coin_type?"ids="+t.id+"&vs_currencies="+e.id:"");const n=await fetch(r,{method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded"}});o=await n.json()}const[a,c]="crypto"===e.coin_type?[e.id,t.id]:[t.id,e.id];p=o[a][c],r(o)}catch(e){o(e)}}))}function j(e){let t=e.querySelector('[data-from="0"]');h=t.getAttribute("data-id");let r,o,n=t.getAttribute("data-custom_id"),a=t.getAttribute("data-currency_type"),c=t.querySelector('[data-el="currency-dropdown-field"]').value,i=t.querySelector('[data-el="currency-dropdown-field"]');if("fiat"===a){r=t.querySelector('div span[data-el="currency-dropdown-logo"]').textContent;const n=e.querySelectorAll('li[data-el="currency-dropdown-list-item"]');for(const e of n){const t=JSON.parse(e.getAttribute("data-details"));if(t.id===h){o=t.name;break}}}else r=t.querySelector('div img[data-el="currency-dropdown-logo"]').getAttribute("src"),o=h.toUpperCase();let l=t.getAttribute("data-symbol").toUpperCase();return{amount:c,id:h,custom_id:n,coin_type:a,elem:i,symbol:l,logo:r,name:o}}async function H(e,t,r,o=!1){return new Promise(((o,n)=>{let a,c,i;"crypto"==e.coin_type?(a=e.id,c=t.id):(a=t.id,c=e.id);let l=function(e,t){let r=e.id+"_"+t.id;const o=localStorage.getItem(r);if(null===o)return!1;{let e=JSON.parse(o);const t=new Date,n=new Date(e.timestamp);return(t.getTime()-n.getTime())/6e4>S?(localStorage.removeItem(r),!1):e}}(e,t);!1===l||null==l||"undefined"===l||"null"===l||"NaN"===l?fetch("/wp-json/ceranking-cg-api/v3/coins/market_chart?coinId="+a+"&vs_currency="+c+"&days="+r,{method:"GET",headers:{"Content-Type":"application/json"}}).then((e=>e.json())).then((n=>{for(let r in n.prices)"fiat"===t.coin_type?n.prices[r][1]=parseFloat(n.prices[r][1]):"fiat"==e.coin_type&&(n.prices[r][1]=1/parseFloat(n.prices[r][1]));i=n.prices,function(e,t,r,o){let n=e.id+"_"+t.id+"_"+o;const a=new Date,c={prices:r,timestamp:a.getTime()};localStorage.setItem(n,JSON.stringify(c))}(e,t,i,r),o(i)})).catch((e=>{console.error(e),n(e)})):o(l.prices)}))}!1===document.querySelector("body").classList.contains("cer-convert-widget-inited")&&(!function(){const e=document.querySelectorAll('[data-el="currency-dropdown"]'),t=document.querySelectorAll('[data-el="currency-dropdown-list-item"]');e&&e.forEach((e=>{e.addEventListener("click",(e=>{if("input"===e.target.nodeName.toLocaleLowerCase())return!1;const t=e.currentTarget,r=t.querySelector('[data-el="currency-dropdown-list"]'),o=t.querySelector('[data-el="currency-dropdown-arrow"]');if(t.classList.toggle("active"),r)if(r.classList.contains("hidden")){const e=document.querySelectorAll('[data-el="currency-dropdown-list"]'),t=document.querySelectorAll('[data-el="currency-dropdown-arrow"]');e.forEach((e=>{e.classList.add("hidden")})),t.forEach((e=>{e.classList.remove("rotate-180")})),o.classList.add("rotate-180"),r.classList.remove("hidden")}else o.classList.remove("rotate-180"),r.classList.add("hidden")}))})),t&&t.forEach((e=>{e.addEventListener("click",(async e=>{T(e.currentTarget)}))}))}(),document.querySelectorAll('[data-el="currency-dropdown-clear"]').forEach((e=>{e.addEventListener("click",(e=>{const t=e.currentTarget.previousElementSibling;x(t),t.value="",t.dispatchEvent(new KeyboardEvent("keyup"))}))})),document.querySelectorAll('[data-el="currency-dropdown-field"]').forEach((e=>{e.addEventListener("input",(e=>{const t=e.target;t.value=t.value.replace(/[^0-9.]/g,"").trim(),u=t.value}))})),document.querySelectorAll('[data-el="currency_swap"]').forEach((e=>{e.addEventListener("click",(e=>{const t=e.currentTarget,r=t.parentNode.querySelectorAll('[data-el="currency-dropdown-wrap"]'),o=r[0].querySelector('[data-el="currency-dropdown-field"]'),n=r[1].querySelector('[data-el="currency-dropdown-field"]'),a=r[0],c=r[1];a.classList.contains("order-1")?(a.classList.remove("order-1"),a.classList.add("order-3")):(a.classList.add("order-1"),a.classList.remove("order-3")),c.classList.contains("order-3")?(c.classList.remove("order-3"),c.classList.add("order-1")):(c.classList.remove("order-1"),c.classList.add("order-3")),t.parentNode.dispatchEvent(new CustomEvent("currencySwapped",{bubbles:!1,detail:{field1:{el:o,value:o.value},field2:{el:n,value:n.value}}}))}))})),document.querySelectorAll('[data-el="currency-dropdown-field"]').forEach((e=>{e.addEventListener("input",(e=>{x(e.target)}))})),function(){const e=document.querySelectorAll('[data-el="currency-dropdown-search"]');e&&e.forEach((e=>{e.addEventListener("keyup",(e=>{l&&clearTimeout(l);const t=e.target;l=setTimeout((()=>{const e="val="+t.value+"&filter=coinid-with-fiat",r=ceranking_widget_convert.local_api_url+"filter-data?"+e;fetch(r).then((e=>e.json())).then((e=>{const r=t.closest('[data-el="currency-dropdown-list"]');if(r.querySelectorAll('[data-el="currency-dropdown-list-item"]').forEach((e=>e.remove())),e){e.forEach((e=>{let t=`${e.logo}`,o=convert_widget_rowTemplate;const n=e.logo.replace("/large/","/thumb/");e.coin_type==c&&(t=``),o=o.replace(/{logolink}/gi,n),o=o.replace(/{id}/gi,e.id),o=o.replace(/{custom_id}/gi,e.custom_id),o=o.replace(/{name}/gi,e.name),o=o.replace(/{symbol}/gi,e.symbol),o=o.replace(/{logo}/gi,t),o=o.replace(/{cointype}/gi,e.coin_type),r.insertAdjacentHTML("beforeend",o)}));const t=r.querySelectorAll('[data-el="currency-dropdown-list-item"]');t&&t.forEach((e=>{e.addEventListener("click",(async e=>{T(e.currentTarget)}))}))}})).catch((e=>{console.error("Error on coin search: ",e)}))}),130)}))}))}(),document.querySelectorAll('[data-el="currency-dropdown-field"]').forEach((e=>{e.addEventListener("keyup",(e=>{i&&clearTimeout(i);const t=e.target;i=setTimeout((()=>{const e=t.closest('[data-el="currency-dropdown-wrap"]').parentNode;let r=function(e){let t=e.querySelector('[data-from="1"]');_=t.getAttribute("data-id");let r,o,n=t.getAttribute("data-custom_id"),a=t.getAttribute("data-currency_type"),c=t.querySelector('[data-el="currency-dropdown-field"]').value,i=t.querySelector('[data-el="currency-dropdown-field"]');if("crypto"===a)r=t.querySelector('div img[data-el="currency-dropdown-logo"]').getAttribute("src"),o=_.toUpperCase();else{r=t.querySelector('div span[data-el="currency-dropdown-logo"]').textContent;const n=e.querySelectorAll('li[data-el="currency-dropdown-list-item"]');for(const e of n){const t=JSON.parse(e.getAttribute("data-details"));if(t.id===_){o=t.name;break}}}let l=t.getAttribute("data-symbol").toUpperCase();return{amount:c,id:_,custom_id:n,coin_type:a,elem:i,symbol:l,logo:r,name:o}}(e),o=j(e),a=document.getElementsByClassName("js-change-interval");for(let e=0;e{q(e,r,o),E(e,r,o).then((e=>{D(r,o,e)}))}))}));(g!==r||P()||M())&&(void 0===n?.calledFrom||"oneConverter"===n.calledFrom?(!0===b&&H(r,o,w,!0).then((e=>{q(e,r,o),E(e,r,o).then((e=>{D(r,o,e),b=!1}));let t=document.getElementsByClassName("js-change-interval");for(let e=0;e{if(o=L(t,r,o,e),(s===r.id&&r.amount!==y||!0===b)&&(k(r,o),I(r,o),F(r,o),H(r,o,w,!0).then((e=>{E(e,r,o).then((e=>{D(r,o,e),b=!1}))}))),M(r,o)||P(r,o)){let e={event:"select coin",coinid:"crypto"===r.coin_type?r.id:o.id};void 0!==window.dataLayer&&window.dataLayer.push(e),k(r,o),I(r,o),F(r,o),H(r,o,w).then((e=>{q(e,r,o),E(e,r,o).then((e=>{D(r,o,e),b=!1}))})),function(e,t){fetch("/wp-json/ceranking/v2/fill-coin-to-fiat-table?fromCoinId="+e.id+"&toCoinId="+t.id,{method:"GET"}).then((e=>e.text())).then((r=>{const o=n.convertFromTo,a=document.querySelector("#amountToPrice_From-To"),c=document.querySelector("#amountToPrice_To-From"),i=document.querySelector("#coin-converter-table__crypto"),l=document.querySelector("#coin-converter-table__fiat"),u=document.querySelector("#fiat-converter-table__crypto"),p=document.querySelector("#fiat-converter-table__fiat"),m=document.querySelector("#fiat-converter-table-header"),y=document.querySelector("#coin-converter-table-header"),g=JSON.parse(r),f={};if(f.coinToFiat=g.coinToFiat.replace(/\\/g,""),f.fiatToCoin=g.fiatToCoin.replace(/\\/g,""),m.innerHTML=o.replace(/{from_coin}/g,t.symbol).replace(/{to_coin}/g,e.symbol),y.innerHTML=o.replace(/{from_coin}/g,e.symbol).replace(/{to_coin}/g,t.symbol),i.innerHTML=s.toUpperCase(),l.innerHTML=d.toUpperCase(),u.innerHTML=s.toUpperCase(),p.innerHTML=d.toUpperCase(),a.innerHTML=f.coinToFiat,c.innerHTML=f.fiatToCoin,"fiat"==t.coin_type){const r=document.querySelectorAll("span.converter-table-fiat__logo");for(let e=0;e{console.error(e)}))}(r,o);const t="crypto"===r.coin_type?r.id:o.id;fetch("/wp-json/ceranking/v2/coin-convert-to-fiats?coinId="+t,{method:"GET"}).then((e=>e.text())).then((e=>{document.querySelector('section[data-el="popular-convert-widget"]').innerHTML=e})).catch((e=>{console.error(e)})),function(e,t){s=_,d=h,g=e,f=t}(r,o)}0===v&&(v=r.amount),b=!1})),b=!1,y=r.amount,m=o.amount):N(r,o).then((t=>{o=L(t,r,o,e)})))}),500)}))})),document.querySelectorAll('[data-el="currency-dropdown-wrap"]').forEach((e=>{1==e.getAttribute("data-from")&&e.querySelector('[data-el="currency-dropdown-field"]').dispatchEvent(new KeyboardEvent("keyup")),e.getAttribute("data-currency_type")==c&&e.querySelector('[data-el="currency-dropdown-search"]').dispatchEvent(new KeyboardEvent("keyup"))})),function(){const e=document.querySelectorAll('[data-el="c-bic-conversor"]'),t=e=>{const t=e.querySelectorAll('[data-el="currency-dropdown"]'),r=e.querySelectorAll('[data-el="currency-dropdown-list"]'),o=e.querySelectorAll('[data-el="currency-dropdown-arrow"]');t.forEach((e=>{e&&e.classList.remove("active")})),r.forEach((e=>{e&&e.classList.add("hidden")})),o.forEach((e=>{e&&e.classList.remove("rotate-180")}))},r=r=>{e.forEach((e=>{e.contains(r.target)||t(e)}))},o=r=>{"escape"===r.key.toLocaleLowerCase()&&e.forEach((e=>{t(e)}))};document.addEventListener("click",r),document.addEventListener("keydown",o)}(),document.querySelector("body").classList.add("cer-convert-widget-inited"))},1669:function(e){"use strict";e.exports=jQuery}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}};return e[o].call(a.exports,a,a.exports,r),a.exports}r.d=function(e,t){for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=r(3783);var t={create:function(e,t){return localStorage.setItem(e,t)},read:function(e){return localStorage.getItem(e)},erase:function(e){return localStorage.removeItem(e)}};r(6875);r(1669)((function(r){var o={"convert-table-1":{page:1,per_page:10,filters:[],sort:"market_cap",sort_dir:"desc"},"convert-table-2":{page:1,per_page:10,filters:[],sort:"market_cap",sort_dir:"desc"}},n=!1,a=convert_single_currencies,c=convert_single_top5Coins,i=convert_single_convertLinkTemplate,l=convert_single_coinLinkTemplate;function s(e){r("body").on("click","#"+e+" .js-exch-favorite",(function(){r(this).toggleClass("active");var o=d("CEFConvert_"+e),n=r(this).closest("tr").data("id"),a=r.inArray(n,o);return-1!==a&&o.splice(a,1),r(this).hasClass("active")&&o.push(n),t.create("CEFConvert_"+e,o.join(",")),!1}));var o=d("CEFConvert_"+e);for(var n in o)r("#"+e+' tr[data-id="'+o[n]+'"] .js-exch-favorite').addClass("active")}function d(e){var r=t.read(e);return r=null!=r?r.split(","):[]}function u(e){let t=e.toString(),r=null;if(e<1){let o=(t.split(".")[1]||"").length;r=e;for(let e=0;e4&&(r=t.slice(0,e+6),parseInt(t[e+6])>5)){let t="."+"0".repeat(e+3)+"1";r=(parseFloat(r)+parseFloat(t)).toString()}break}return parseFloat(r).toFixed(4)}return function(e,t="",r=","){let o=parseInt(e,10),n=e.substring(e.indexOf(".")+1);for(;o>1e3;)t=r+(1e3+o).toString().substr(-3)+t,o=Math.floor(o/1e3);return(t=o+t)+(0===n.length?null:"."+n)}(e.toFixed(2))}r("body").on("click",".js-load-more",(function(){var t=parseInt(r(this).attr("data-page"));t+=1,r(this).attr("data-page",t);var s=r(this).closest(".convert-one-block__content").find("table").attr("id");return o[s].page=t,function(t){if(n)return!1;r.ajax({url:ceranking_convert_single.local_api_url+"get-coins",method:"GET",dataType:"json",data:o[t],beforeSend:function(){n=!0,r("#"+t).find("tbody").css("opacity","0.4")},complete:function(s){n=!1;var u=s.responseJSON;!function(t,o){var n=convert_single_rowTopCryptoRatesTemplate,s=d("CEFConvert_"+o);for(var u in t){var p=t[u],m=n,y=[],g=2;if("convert-table-1"==o)for(var u in a){g++;var f=a[u],_=i,h=(0,e.formatCurrency)(p.current_price/f.rateToUsd,f.symbol);_=(_=(_=_.replace(/{fromCurrency}/gi,p.custom_id)).replace(/{toCurrency}/gi,f.symbol.toLowerCase())).replace(/{amount}/gi,1),y.push(''+h+"")}if("convert-table-2"==o)for(var u in c){g++;f=c[u],_=i;let t=(0,e.formatCurrency)(p.current_price/f.current_price,f.symbol);_=(_=(_=_.replace(/{fromCurrency}/gi,p.custom_id)).replace(/{toCurrency}/gi,f.symbol.toLowerCase())).replace(/{amount}/gi,1),y.push(''+t+"")}if(-1!==r.inArray(p.id,s))var v=" active";else v="";m=(m=(m=(m=(m=(m=(m=m.replace(/{coin_id}/gi,p.id)).replace(/{coin_link}/gi,l.replace("{id}",p.custom_id))).replace(/{logo}/gi,'')).replace(/{name}/gi,p.name)).replace(/{symbol}/gi,p.symbol.toUpperCase())).replace(/{prices_list}/gi,y.join(""))).replace(/{favActive_class}/gi,v),r("#"+o).find("tbody").append(m)}}(u.answer,t),r("#"+t).find("tbody").css("opacity",1),u.pages<=o[t].page&&r("#"+t+" .js-load-more").hide()}})}(s),!1})),r(document).ready((function(){s("convert-table-1"),s("convert-table-2"),r('.js-change-interval[data-interval="30"]').trigger("click"),function(){let e=[];r('[data-el="pcw-price"]').each((function(){r(this).data("el-id")&&e.push(r(this).data("el-id"))}));let t="crypto"==convert_single_fromCurrencyData.coin_type?convert_single_fromCurrencyData.id:convert_single_toCurrencyData.id;r.get("/wp-json/ceranking-cg-api/v3/simple/price",{ids:t,vs_currencies:e.join(",")},(function(e){for(let t in e)for(let o in e[t])r('[data-el="pcw-price"][data-el-id="'+o+'"]').text(u(e[t][o]))}),"json")}()})),r(".show-more-js").on("click",(function(){r(".show-more").toggleClass("show")}))}))}()}();