function mighty_get_url(e){var n=document.createElement("a");return n.href=e,n}function mighty_get_host_name(e){var n;return void 0===e||null===e||""===e||e.match(/^\#/)?"":-1===(e=mighty_get_url(e)).href.search(/^http[s]?:\/\//)?"":(n=e.href.split("/")[2],(n=n.split(":")[0]).toLowerCase())}function mighty_base64_encode(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,n){return String.fromCharCode("0x"+n)}))}document.addEventListener("DOMContentLoaded",function(e){if("undefined"!=typeof mighty_url&&"undefined"!=typeof mighty_api_token){var n=1;"undefined"!=typeof mighty_type&&(2==mighty_type&&(n=2),0==mighty_type&&(n=0));var l=document.getElementsByTagName("a");if("undefined"==typeof mighty_domains)if("undefined"==typeof mighty_exclude_domains);else for(o=0;o<l.length;o++){var t=mighty_get_host_name(l[o].getAttribute("href"));t.length>0&&-1===mighty_exclude_domains.indexOf(t)?l[o].href=mighty_url+"full/?api="+encodeURIComponent(mighty_api_token)+"&url="+mighty_base64_encode(l[o].href)+"&type="+encodeURIComponent(n):"magnet:"===l[o].protocol&&(l[o].href=mighty_url+"full/?api="+encodeURIComponent(mighty_api_token)+"&url="+mighty_base64_encode(l[o].href)+"&type="+encodeURIComponent(n))}else for(var o=0;o<l.length;o++)(t=mighty_get_host_name(l[o].getAttribute("href"))).length>0&&mighty_domains.indexOf(t)>-1?l[o].href=mighty_url+"full/?api="+encodeURIComponent(mighty_api_token)+"&url="+mighty_base64_encode(l[o].href)+"&type="+encodeURIComponent(n):"magnet:"===l[o].protocol&&(l[o].href=mighty_url+"full/?api="+encodeURIComponent(mighty_api_token)+"&url="+mighty_base64_encode(l[o].href)+"&type="+encodeURIComponent(n))}});