function error(t){$(t).parentsUntil(".icon").parent().remove()}$(document).ready(function(){function t(t,a,e){var t=$(t).find("img"),o=$(t).attr("src").replace(a,e);$(t).attr("src",o)}function a(t){$(t).val().length>0?($(".icon").css("display","none"),$('a[data-icon*="'+$(t).val().toLowerCase()+'"]').parent().css("display","block"),$('a[data-name*="'+$(t).val().toLowerCase()+'"]').parent().css("display","block"),$('').insertAfter(t),$(".close-search").click(function(){e(t)})):e(t)}function e(t){$(".close-search").remove(),$(".icon").css("display","block"),$(t).val("")}var o=["svg","128","32","32@2x"],c=["color","black","icon","white"];$("form .search").on("input",function(){a($(this))}),$("form").submit(function(t){t.preventDefault(),a($("form .search"))}),$.getJSON("https://api.coinmarketcap.com/v1/ticker/?limit=0",function(a){$.getJSON("manifest.json",function(e){var o="",c=0;e.icons.forEach(function(t){var e=a.find(function(a){return a.symbol.toLowerCase()===t}),n=e?e.name:t,i=n.split(" ").join("-").toLowerCase();-1===o.indexOf('data-icon="'+t+'"')&&(o+='
',o+='',o+='
',o+='
',o+=''+t+'',o+="
",o+='
',o+=n+''+t+"
",o+="
",o+="
",o+="",o+="",c++)}),$(".row.icons").html(o),$(".icon").hover(function(){t($(this),"black","color")}),$(".icon").mouseleave(function(){t($(this),"color","black")}),$(".count-cryptos").text(c)})}),$("#infoIcon").on("show.bs.modal",function(t){var a=$(t.relatedTarget),e=$(this),n=a.data("icon"),i="",s=0,r=0;for(i+='',i+="",i+="",i+='";c[r];){l=o[s].replace("@","-");i+='",r++}for(r=0,i+="",i+="",i+="";o[s];){var l;if(i+="",i+='","svg"==o[s])d=".svg";else if("32@2x"==o[s])d="@2x.png";else var d=".png";for(;c[r];)i+='",r++;r=0,s++,i+=""}i+="",i+="
'+n+"
'+c[r]+"
'+o[s]+"',i+=''+n+'',i+="
",e.find(".modal-title").text(n),e.find(".modal-body").html(i)})});