}).fail(n)}.bind(this,i,t)));varr=t.toLowerCase(),a=n.capitalization[r];returna&&Date.now()-a[1]<36e5?void(i.channel=a[0]):voido.push(newRSVP.Promise(function(e,t,o,i){l.ws_send("get_display_name",t,function(s,r){vara=s?r:o;n.capitalization[t]=[a,Date.now()],e.channel=a,i()})||(e.channel=o,i()),setTimeout(function(e,t,n){e.channel||(e.channel=t),n()}.bind(this,e,o,i),5e3)}.bind(this,i,r,t)))}},a=function(){o.length?RSVP.all(o).then(e,e):e()};t=[];for(varc=0;c<i.length;c++){varu=i[c];l._twitch_set_to_channel[u]?r(u,l._twitch_set_to_channel[u]):t.push(u)}t.length>0?(l.ws_send("twitch_sets",t,function(e,n){if(t=[],e){for(varoinn)n.hasOwnProperty(o)&&(l._twitch_set_to_channel[o]=n[o],r(o,n[o]));localStorage.ffzTwitchSets=JSON.stringify(l._twitch_set_to_channel)}a()}),setTimeout(function(){t.length&&a()},5e3)):a()})]).then(function(){for(vart={},n=0;n<o[0].length;n++){vari=o[0][n];l._twitch_emote_sets[i]&&(t[i]=l._twitch_emote_sets[i])}e(t)},function(){e({})})}).then(function(s){try{if("my_emotes"!=t.getAttribute("data-page"))return;t.innerHTML="";vara=o[1],c=[];for(varuins)if(s.hasOwnProperty(u)){vard=s[u];d.channel&&d.emotes&&d.emotes.length&&c.push([1,d.channel,d])}for(varh=0;h<a.length;h++){varu=a[h],d=l.emote_sets[u];l.feature_friday&&u==l.feature_friday.set||d.count>0&&c.push([2,d.id,d])}c.sort(function(e,t){if(e[0]<t[0])return-1;if(e[0]>t[0])return1;varn=e[1].toLowerCase(),o=t[1].toLowerCase();return("twitch turbo"===n||"global emoticons"===n)&&(n="zzz"+n),("twitch turbo"===o||"global emoticons"===o)&&(o="zzz"+o),o>n?-1:n>o?1:0});for(varh=0;h<c.length;h++){varm,_,p,f=2===c[h][0],d=c[h][2],g=document.createElement("div"),v=document.createElement("div"),b=f?"FrankerFaceZ":d.source;if(f){p=[];for(varyind.emotes){varw=d.emotes[y];w.hidden||p.push({code:w.name,url:w.url,width:w.width,height:w.height})}_="global"===d.id?"Global Emoticons":d.id,m=d.icon||"http://cdn.frankerfacez.com/channel/global/devicon.png"}elsep=d.emotes,_=n.get_capitalization(d.channel),m=d.badge;if(p.length){g.className="heading",g.innerHTML='<span class="right">'+b+"</span>"+_,m&&(g.style.backgroundImage='url("'+m+'")'),v.className="emoticon-grid",v.appendChild(g);for(vark=0;k<p.length;k++){varw=p[k],F=r[w.code]||w.code,E=document.createElement("span");if(E.className="emoticon tooltip",E.style.backgroundImage='url("'+(w.url?w.url:i+w.id+"/1.0")+'")',w.height&&(E.style.height=w.height+"px"),w.width&&(E.style.width=w.width+"px"),!w.url){varz='image-set(url("'+i+w.id+'/1.0") 1x, url("'+i+w.id+'/2.0") 2x, url("'+i+w.id+'/3.0") 4x)';E.style.backgroundImage="-webkit-"+z,E.style.backgroundImage="-moz-"+z,E.style.backgroundImage="-ms-"+z,E.style.backgroundImage=z}E.title=F,E.addEventListener("click",l._add_emote.bind(l,e,F)),v.appendChild(E)}t.appendChild(v)}}if(!c.length){varv=document.createElement("div");v.className="chat-menu-content center",v.innerHTML="Error Loading Subscriptions",t.appendChild(v)}}catch(C){l.log("My Emotes Menu Error",C),t.innerHTML="";varv=document.createElement("div"),g=document.createElement("div"),x=document.createElement("p");g.className="heading",g.innerHTML="Error Loading Menu",v.appendChild(g),x.className="clearfix",x.textContent=C,v.appendChild(x),v.className="chat-menu-content",t.appendChild(v)}})}}},{"../constants":3}],23:[function(){vart=e.FrankerFaceZ;t.prototype.setup_notifications=function(){this.log("Adding event handler for window focus."),e.addEventListener("focus",this.clear_notifications.bind(this))},t.settings_info.highlight_notifications={type:"boolean",value:!1,category:"Chat",visible:function(){return!this.has_bttv},name:"Highlight Notifications",help:"Display notifications when a highlighted word appears in chat in an unfocused tab.",on_update:function(e,t){if(e&&t){if("denied"===Notification.permission)returnthis.log("Notifications have been denied by the user."),voidthis.settings.set("highlight_notifications",!1);if("granted"!==Notification.permission){varn=this;Notification.requestPermission(function(e){"denied"===e&&(n.log("Notifications have been denied by the user."),n