!function(t){!functione(t,s,o){functioni(a,r){if(!s[a]){if(!t[a]){vard="function"==typeofrequire&&require;if(!r&&d)returnd(a,!0);if(n)returnn(a,!0);thrownewError("Cannot find module '"+a+"'")}varu=s[a]={exports:{}};t[a][0].call(u.exports,function(e){vars=t[a][1][e];returni(s?s:e)},u,u.exports,e,t,s,o)}returns[a].exports}for(varn="function"==typeofrequire&&require,a=0;a<o.length;a++)i(o[a]);returni}({1:[function(e){vars=t.FrankerFaceZ,o=e("./constants"),i=e("./utils");s.settings_info.show_badges={type:"boolean",value:!0,category:"Chat Appearance",name:"Additional Badges",help:"Show additional badges for bots, FrankerFaceZ donors, and other special users."},s.settings_info.transparent_badges={type:"boolean",value:!1,category:"Chat Appearance",no_bttv:!0,name:"Transparent Badges",help:"Make chat badges transparent for a nice, clean look. On light chat, non-subscriber badges are inverted to remain visible.",on_update:function(t){this.has_bttv||document.body.classList.toggle("ffz-transparent-badges",t)}},s.prototype.setup_badges=function(){this.has_bttv||document.body.classList.toggle("ffz-transparent-badges",this.settings.transparent_badges),this.log("Preparing badge system."),this.badges={},this.log("Creating badge style element.");vart=this._badge_style=document.createElement("style");t.id="ffz-badge-css",document.head.appendChild(t),this.log("Adding legacy donor badges."),this._legacy_add_donors()},s.ws_commands.reload_badges=function(){this._legacy_load_bots(),this._legacy_load_donors()},s.ws_commands.set_badge=function(t){vare=t[0],s=t[1],o=t[2],i=this.users[e]=this.users[e]||{},n=i.badges=i.badges||{};void0===o||null===o?deleten[s]:n[s]=o};varn=function(t){vare=".badges .ffz-badge-"+t.id+" { background-color: "+t.color+'; background-image: url("'+t.image+'"); '+(t.extra_css||"")+"}";returnt.transparent_image&&(e+=".ffz-transparent-badges .badges .ffz-badge-"+t.id+' { background-image: url("'+t.transparent_image+'"); }'),e};s.prototype.bttv_badges=function(t){if(this.settings.show_badges){vare=t.sender,s=this.users[e],o=[],i=-1,n=BetterTTV.settings.get("alphaTags");if(s&&s.badges){t.badges||(t.badges=[]);for(vara=0;a<t.badges.length;a++){varr=t.badges[a];if("subscriber"==r.type||"turbo"==r.type){i=a;break}}for(vardins.badges)if(s.badges.hasOwnProperty(d)){varr=s.badges[d],u=this.badges[r.id]||{},c=r.title||u.title,l="";if(void0!==u.visible){varh=u.visible;if("function"==typeofh&&(h=h.bind(this)(null,e)),!h)continue}if(u.replaces){for(varf=!1,a=0;a<t.badges.length;a++){varm=t.badges[a];if(m.type===u.replaces_type){m.type="ffz-badge-replacement "+m.type,m.description+=", "+(r.title||u.title)+'" style="background-image: url("'+(r.image||u.image)+"")",f=!0;break}}if(f)continue}r.image&&(l+="background-image: url(""+r.image+""); "),r.color&&!n&&(l+="background-color: "+r.color+"; "),r.extra_css&&(l+=r.extra_css),l&&(c+='" style="'+l),o.push([(-1==i?1:-1)*d,{type:"ffz-badge-"+r.id+(n?" alpha":""),name:"",description:c}])}if(o.sort(function(t,e){returnt[0]-e[0]}),-1==i)for(;o.length;)t.badges.push(o.shift()[1]);elsefor(;o.length;)t.badges.insertAt(i,o.shift()[1])}}},s.prototype.render_badges=function(t,e){if(!this.settings.show_badges)returne;vars=t.get("msgObject.from"),o=t.get("msgObject.room")||App.__container__.lookup("controller:chat").get("currentRoom.id"),i=this.users[s];if(!i||!i.badges)returne;for(varnini.badges)if(i.badges.hasOwnProperty(n)){vara=i.badges[n],r=this.badges[a.id]||{},d=e[n];if(void0!==r.visible){varu=r.visible;if("function"==typeofu&&(u=u.bind(this)(o,s,t,e)),!u)continue}if(d){varc=a.hasOwnProperty("replaces")?a.replaces:r.replaces;if(!c)continue;d.image=a.image||r.image,d.klass+=" ffz-badge-replacement",d.title+=", "+(a.title||r.title)}elsee[n]={klass:"ffz-badge-"+a.id,title:a.title||r.title,image:a.image,color:a.color,extra_css:a.extra_css}}returne},s.prototype.render_badge=function(t){if(this.settings.show_badges){vare=t.get("msgObject.from"),s=App.__container__.lookup("controller:chat").get("currentRoom.id"),o=t.$(".badges"),i=
},{}],5:[function(){vare=t.FrankerFaceZ;e.settings_info.developer_mode={type:"boolean",value:!1,storage_key:"ffzDebugMode",visible:function(){returnthis.settings.developer_mode||Date.now()-parseInt(localStorage.ffzLastDevMode||"0")<6048e5},category:"Debugging",name:"Developer Mode",help:"Load FrankerFaceZ from the local development server instead of the CDN. Please refresh after changing this setting.",on_update:function(){localStorage.ffzLastDevMode=Date.now()}},e.ffz_commands.developer_mode=function(t,e){vars,e=e&&e.length?e[0].toLowerCase():null;return"y"==e||"yes"==e||"true"==e||"on"==e?s=!0:("n"==e||"no"==e||"false"==e||"off"==e)&&(s=!1),void0===s?"Developer Mode is currently "+(this.settings.developer_mode?"enabled.":"disabled."):(this.settings.set("developer_mode",s),"Developer Mode is now "+(s?"enabled":"disabled")+". Please refresh your browser.")},e.ffz_commands.developer_mode.help="Usage: /ffz developer_mode <on|off>\nEnable or disable Developer Mode. When Developer Mode is enabled, the script will be reloaded from //localhost:8000/script.js instead of from the CDN."},{}],6:[function(e){vars=t.FrankerFaceZ,o=e("../utils"),i=e("../constants");s.prototype.setup_channel=function(){this.log("Creating channel style element.");vart=this._channel_style=document.createElement("style");t.id="ffz-channel-css",document.head.appendChild(t),document.body.classList.toggle("ffz-hide-view-count",!this.settings.channel_views),this.log("Creating channel style element.");vart=this._channel_style=document.createElement("style");t.id="ffz-channel-css",document.head.appendChild(t),this.log("Hooking the Ember Channel Index view.");vare=App.__container__.resolve("view:channel/index"),o=this;if(e){this._modify_cindex(e);try{e.create().destroy()}catch(i){}for(varninEmber.View.views)if(Ember.View.views.hasOwnProperty(n)){vara=Ember.View.views[n];ainstanceofe&&(this.log("Manually updating Channel Index view.",a),this._modify_cindex(a),a.ffzInit())}this.log("Hooking the Ember Channel model."),e=App.__container__.resolve("model:channel"),e&&(e.reopen({ffz_host_target:void0,setHostMode:function(t){returno.settings.hosted_channels?(this.set("ffz_host_target",t.target),this._super(t)):(this.set("ffz_host_target",void0),this._super({target:void0,delay:0}))}}),this.log("Hooking the Ember Channel controller."),e=App.__container__.lookup("controller:channel"),e&&(e.reopen({ffzUpdateUptime:function(){o._cindex&&o._cindex.ffzUpdateUptime()}.observes("isLive","content.id"),ffzUpdateInfo:function(){this._ffz_update_timer&&clearTimeout(this._ffz_update_timer),this.get("content.id")&&(this._ffz_update_timer=setTimeout(this.ffzCheckUpdate.bind(this),6e4))}.observes("content.id"),ffzCheckUpdate:function(){vart=this,e=t.get("content.id");e&&Twitch.api&&Twitch.api.get("streams/"+e,{},{version:3}).done(function(e){if(!e||!e.stream)returnt.set("stream.created_at",null),voidt.set("stream.viewers",0);t.set("stream.created_at",e.stream.created_at||null),t.set("stream.viewers",e.stream.viewers||0);vars=e.stream.game||e.stream.channel&&e.stream.channel.game;s&&(t.set("game",s),t.set("rollbackData.game",s)),e.stream.channel&&(e.stream.channel.status&&t.set("status",e.stream.channel.status),e.stream.channel.views&&t.set("views",e.stream.channel.views),e.stream.channel.followers&&t.get("content.followers.isLoaded")&&t.set("content.followers.total",e.stream.channel.followers))}).always(function(){t.ffzUpdateInfo()})},ffzUpdateTitle:function(){vart=this.get("content.name"),e=this.get("content.display_name");e&&(s.capitalization[t]=[e,Date.now()]),o._cindex&&o._cindex.ffzFixTitle()}.observes("content.status","content.id"),ffzHostTarget:function(){vart=this.get("content.hostModeTarget"),e=t&&t.get("name"),i=t&&t.get("id"),n=t&&t.get("display_name");i!==o.__old_host_target&&(o.__old_host_target&&o.ws_send("unsub_channel",o.__old_host_target),i?(o.ws_send("sub_channel",i),o.__old_host_target=i):deleteo.__old_host_target),n&&(s.capitalization[e]=[n,Date.now()]),o.settings.group_tabs&&o._chatv&&o._chatv.ffzRebuildTabs(),o.settings.follow_buttons&&o
if(s){if(t){varn=e.rooms&&e.rooms[t]&&e.rooms[t].room,a=n&&n._ffz_tab;if(a){varr=o.format_unread(t===i?0:n.get("unreadCount"));a.querySelector("span").innerHTML=r}}for(vard=s.querySelectorAll(".ffz-chat-tab"),u=0;u<d.length;u++){vara=d[u],t=a.getAttribute("data-room"),n=e.rooms&&e.rooms[t]&&e.rooms[t];if(n){varr=o.format_unread(t===i?0:n.room.get("unreadCount"));a.querySelector("span").innerHTML=r}}}}},ffzBuildTab:function(t,n,a,r){{vard,u,c=document.createElement("span"),l="",h=n.get("id"),f=n.get("isGroupRoom"),m=n===t.get("controller.currentRoom");m||-1!==e.settings.visible_rooms.indexOf(h)}returnc.setAttribute("data-room",n.id),c.className="ffz-chat-tab tooltip",c.classList.toggle("current-channel",a),c.classList.toggle("host-channel",r),c.classList.toggle("group-chat",f),c.classList.toggle("active",m),u=o.format_unread(m?0:n.get("unreadCount")),d=n.get("tmiRoom.displayName")||(f?n.get("tmiRoom.name"):s.get_capitalization(n.get("id"),function(t){u=o.format_unread(m?0:n.get("unreadCount")),c.innerHTML=l+o.sanitize(t)+"<span>"+u+"</span>"})),a?(l=i.CAMERA,c.title="Current Channel"):r?(l=i.EYE,c.title="Hosted Channel"):c.title=f?"Group Chat":"Pinned Channel",c.innerHTML=l+o.sanitize(d)+"<span>"+u+"</span>",c.addEventListener("click",function(){vare=t.get("controller");e.focusRoom(n),e.set("showList",!1)}),n._ffz_tab=c,c},ffzDisableTabs:function(){this._ffz_tabs&&(this._ffz_tabs.parentElement.removeChild(this._ffz_tabs),deletethis._ffz_tabs,deletethis._ffz_invite),this._ffz_host&&(-1===e.settings.pinned_rooms.indexOf(this._ffz_host)&&this._ffz_host_room&&(this.get("controller.currentRoom")===this._ffz_host_room&&this.get("controller").blurRoom(),this._ffz_host_room.destroy()),deletethis._ffz_host,deletethis._ffz_host_room),this.$(".chat-room").css("top",""),this.$(".chat-header").removeClass("hidden")}})},s.prototype.connect_extra_chat=function(){vart=this.get_user();if(t&&t.login&&(!this.rooms[t.login]||this.rooms[t.login].room)){vare=App.__container__.resolve("model:room");e&&e.findOne(t.login)}if(!this.has_bttv){for(vars=0;s<this.settings.pinned_rooms.length;s++)this._join_room(this.settings.pinned_rooms[s],!0);this._chatv&&(!this.has_bttv&&this.settings.group_tabs&&this._chatv.ffzRebuildTabs(),this._chatv.ffzRebuildMenu())}},s.prototype._join_room=function(t,e){vars=!1;if(-1===this.settings.pinned_rooms.indexOf(t)&&(this.settings.pinned_rooms.push(t),this.settings.set("pinned_rooms",this.settings.pinned_rooms),s=!0),this.rooms[t]&&this.rooms[t].room)returns&&!e&&!this.has_bttv&&this._chatv&&this.settings.group_tabs&&this._chatv.ffzRebuildTabs(),s;{varo=App.__container__.resolve("model:room");o&&o.findOne(t)}return!e&&!this.has_bttv&&this._chatv&&this.settings.group_tabs&&this._chatv.ffzRebuildTabs(),!e&&this._chatv&&this._chatv.ffzRebuildMenu(),s},s.prototype._leave_room=function(t,e){vars=!1;if(-1!==this.settings.pinned_rooms.indexOf(t)&&(this.settings.pinned_rooms.removeObject(t),this.settings.set("pinned_rooms",this.settings.pinned_rooms),s=!0),!this.rooms[t]||!this.rooms[t].room)returns;varo=App.__container__.lookup("controller:chat"),i=this.rooms[t].room,n=this.get_user();return!o||o.get("currentChannelRoom.id")===t||this._chatv&&this._chatv._ffz_host===t?s:(o.get("currentRoom.id")===t&&o.blurRoom(),n&&n.login===t||i.destroy(),!e&&!this.has_bttv&&this._chatv&&this.settings.group_tabs&&this._chatv.ffzRebuildTabs(),!e&&this._chatv&&this._chatv.ffzRebuildMenu(),s)},s.chat_commands.join=function(t,e){if(!e||!e.length||e.length>1)return"Join Usage: /join <channel>";vars=e[0].toLowerCase();return"#"===s.charAt(0)&&(s=s.substr(1)),this._join_room(s)?"Joining "+s+". You will always connect to this channel's chat unless you later /part from it.":"You have already joined "+s+'. Please use "/part '+s+'" to leave it.'},s.chat_commands.part=function(t,e){if(!e||!e.length||e.length>1)return"Part Usage: /part <channel>";vars=e[0].toLowerCase();return"#"===s.charAt(0)&&(s=s.substr(1)),this._leave_room(s)?"Leaving "+s+".":this.rooms[s]?"You do not have "+s+"pinnedandyoucannotleavethecurrentchannel
}varM=o.querySelector("button.mod");if(M){varA=l.get("cardInfo.isChannelOwner"),F=ffz.get_user();can_op=A||F&&F.is_admin||F&&F.is_staff,can_op||M.parentElement.removeChild(M)}varR=o.querySelector(".interface > button.message-button");if(R){R.innerHTML="W",R.classList.add("glyph-only"),R.classList.add("message"),R.title="Whisper User",jQuery(R).tipsy();varI=document.createElement("button");I.className="message-button button glyph-only message tooltip",I.innerHTML=r,I.title="Message User",I.addEventListener("click",function(){t.open("http://www.twitch.tv/message/compose?to="+l.get("cardInfo.user.id"))}),R.parentElement.insertBefore(I,R.nextSibling)}varO=document.createElement("button");if(O.className="alias button glyph-only tooltip",O.innerHTML=n.EDIT,O.title="Set Alias",O.addEventListener("click",function(){vart=l.get("cardInfo.user.id"),e=u.aliases[t],s=prompt("Alias for User: "+t+"\n\nPlease enter an alias for the user. Leave it blank to remove the alias.",e);if(null!==s&&void0!==s){s=s.trim(),s||(s=void0),u.aliases[t]=s,u.save_aliases(),Ember.propertyDidChange(l,"userName");vari=o.querySelector("h3.name"),n=i&&i.querySelector("a");n&&(i=n),i&&i.classList.toggle("ffz-alias",s)}}),R)R.parentElement.insertBefore(O,R);else{varH=o.querySelector(".interface > .follow-button");H&&H.parentElement.insertBefore(O,H.nextSibling)}if(u.settings.mod_card_history){varB=App.__container__.lookup("controller:chat"),D=B&&B.get("currentRoom"),j=D&&u.rooms&&u.rooms[D.get("id")],N=j&&j.user_history&&j.user_history[l.get("cardInfo.user.id")];if(N&&N.length){varP=document.createElement("ul"),U=!1;P.className="interface clearfix chat-history";for(varz=0;z<N.length;z++){vare=N[z],V=document.createElement("li");V.className="message-line chat-line clearfix",V.classList.toggle("ffz-alternate",U),U=!U,e.style&&V.classList.add(e.style),V.innerHTML=(s?'<span class="timestamp float-left">'+s.getTime(e.date)+"</span> ":"")+'<span class="message">'+("action"===e.style?"*"+e.from+" ":"")+u.render_tokens(e.cachedTokens)+"</span>";for(varq=V.querySelectorAll("a.deleted-link"),Z=0;Z<q.length;Z++)q[Z].addEventListener("click",u._deleted_link_click);jQuery(".html-tooltip",V).tipsy({html:!0}),P.appendChild(V)}o.appendChild(P),P.scrollTop=P.scrollHeight}}varW=o.getBoundingClientRect(),G=document.body.getBoundingClientRect();if(W.bottom>G.bottom){varY=W.bottom-G.bottom;W.top-Y>G.top&&(o.style.top=W.top-Y+"px")}this.$().draggable({start:function(){o.focus()}}),o.focus()}catch($){try{u.error("ModerationCardView didInsertElement: "+$)}catch($){}}}})},o.chat_commands.purge=function(t,e){if(!e||!e.length)return"Purge Usage: /p username [more usernames separated by spaces]";if(e.length>10)return"Please only purge up to 10 users at once.";for(vars=0;s<e.length;s++){varo=e[s];o&&t.room.send("/timeout "+o+" 1")}},o.chat_commands.p=function(t,e){returno.chat_commands.purge.bind(this)(t,e)},o.chat_commands.p.enabled=function(){returnthis.settings.short_commands},o.chat_commands.t=function(t,e){returne&&e.length?voidt.room.send("/timeout "+e.join(" ")):"Timeout Usage: /t username [duration]"},o.chat_commands.t.enabled=function(){returnthis.settings.short_commands},o.chat_commands.b=function(t,e){if(!e||!e.length)return"Ban Usage: /b username [more usernames separated by spaces]";if(e.length>10)return"Please only ban up to 10 users at once.";for(vars=0;s<e.length;s++){varo=e[s];o&&t.room.send("/ban "+o)}},o.chat_commands.b.enabled=function(){returnthis.settings.short_commands},o.chat_commands.u=function(t,e){if(!e||!e.length)return"Unban Usage: /u username [more usernames separated by spaces]";if(e.length>10)return"Please only unban up to 10 users at once.";for(vars=0;s<e.length;s++){varo=e[s];o&&t.room.send("/unban "+o)}},o.chat_commands.u.enabled=function(){returnthis.settings.short_commands}},{"../constants":4,"../utils":34}],11:[function(){vare=t.FrankerFaceZ;e.settings_info.player_stats={type:"boolean",value:!1,no_mobile:!0,category:"Channel Metadata",name:"Stream Latency",help:"<i>NewHTML5PlayerOnly.</i>Displayyourcurrentstreaml
})},s.prototype.load_global_sets=function(t,e){vars=this;jQuery.getJSON(((e||0)%2===0?o.API_SERVER:o.API_SERVER_2)+"v1/set/global").done(function(t){s.default_sets=t.default_sets;vare=s.global_sets=[],o=t.sets||{};s.feature_friday&&s.feature_friday.set&&(-1===s.global_sets.indexOf(s.feature_friday.set)&&s.global_sets.push(s.feature_friday.set),-1===s.default_sets.indexOf(s.feature_friday.set)&&s.default_sets.push(s.feature_friday.set));for(variino)if(o.hasOwnProperty(i)){varn=o[i];e.push(i),s._load_set_json(i,void0,n)}}).fail(function(o){return404==o.status?"function"==typeoft&&t(!1):(e=e||0,e++,50>e?s.load_global_sets(t,e):"function"==typeoft&&t(!1))})},s.prototype.load_set=function(t,e,s){vari=this;jQuery.getJSON(((s||0)%2===0?o.API_SERVER:o.API_SERVER_2)+"v1/set/"+t).done(function(s){i._load_set_json(t,e,s&&s.set)}).fail(function(o){return404==o.status?"function"==typeofe&&e(!1):(s=s||0,s++,10>s?i.load_set(t,e,s):"function"==typeofe&&e(!1))})},s.prototype.unload_set=function(t){vare=this.emote_sets[t];e&&(this.log("Unloading emoticons for set: "+t),i.update_css(this._emote_style,t,null),deletethis.emote_sets[t])},s.prototype._load_set_json=function(t,e,s){if(!s)return"function"==typeofe&&e(!1);varo=this.emote_sets[t]&&this.emote_sets[t].users||[];this.emote_sets[t]=s,s.users=o,s.count=0;varn="",a=s.emoticons;s.emoticons={};for(vard=0;d<a.length;d++){varu=a[d];u.klass="ffz-emote-"+u.id,u.set_id=t,u.srcSet=u.urls[1]+" 1x",u.urls[2]&&(u.srcSet+=", "+u.urls[2]+" 2x"),u.urls[4]&&(u.srcSet+=", "+u.urls[4]+" 4x"),u.regex="!"===u.name[u.name.length-1]?newRegExp("(^|\\W|\\b)("+u.name+")(?=\\W|$)","g"):newRegExp("(^|\\W|\\b)("+u.name+")\\b","g"),n+=r(u),s.count++,s.emoticons[u.id]=u}i.update_css(this._emote_style,t,n+(s.css||"")),this.log("Updated emoticons for set #"+t+": "+s.title,s),this._cindex&&this._cindex.ffzFixTitle(),this.update_ui_link(),e&&e(!0,s)}},{"./constants":4,"./utils":34}],15:[function(e){vars=t.FrankerFaceZ,o=(e("../constants"),e("../utils"));s.prototype.find_bttv=function(e,s){returnthis.has_bttv=!1,t.BTTVLOADED?this.setup_bttv(s||0):void(s>=6e4?this.log("BetterTTV was not detected after 60 seconds."):setTimeout(this.find_bttv.bind(this,e,(s||0)+e),e))},s.prototype.setup_bttv=function(t){this.log("BetterTTV was detected after "+t+"ms. Hooking."),this.has_bttv=!0,document.body.classList.remove("ffz-dark"),this._dark_style&&(this._dark_style.parentElement.removeChild(this._dark_style),this._dark_style=void0),this._chat_style&&(o.update_css(this._chat_style,"chat_font_size",""),o.update_css(this._chat_style,"chat_ts_font_size","")),this.settings.group_tabs&&this._chatv&&this._chatv.ffzDisableTabs(),this._roomv&&(this.settings.chat_hover_pause&&this._roomv.ffzDisableFreeze(),this.settings.room_status&&this._roomv.ffzUpdateStatus()),document.body.classList.remove("ffz-chat-colors"),document.body.classList.remove("ffz-chat-colors-gray"),document.body.classList.remove("ffz-chat-background"),document.body.classList.remove("ffz-chat-padding"),document.body.classList.remove("ffz-chat-separator"),document.body.classList.remove("ffz-chat-separator-3d"),document.body.classList.remove("ffz-sidebar-swap"),document.body.classList.remove("ffz-transparent-badges"),document.body.classList.remove("ffz-high-contrast-chat"),this.settings.following_count&&(this._schedule_following_count(),this._draw_following_count()),this.is_dashboard&&this._update_subscribers(),document.body.classList.add("ffz-bttv");vare=BetterTTV.chat.helpers.sendMessage,s=this;BetterTTV.chat.helpers.sendMessage=function(t){varo=t.split(" ",1)[0].toLowerCase();return"/ffz"!==o?e(t):voids.run_ffz_command(t.substr(5),BetterTTV.chat.store.currentRoom)};vari,n=BetterTTV.chat.handlers.onPrivmsg;BetterTTV.chat.handlers.onPrivmsg=function(t,e){i=t;vars=n(t,e);returni=null,s};vara=BetterTTV.chat.templates.privmsg;BetterTTV.chat.templates.privmsg=function(t,e,o,n,r){try{returns.bttv_badges(r),'<div class="chat-line'+(t?" highlight":"")+(e?" action":"")+(o?" admin":"")+'" data-sender="'+(r.sender||"").toLowerCase()+'" data-room="'+i+'
vare=/\/emoticons\/v1\/(\d+)\/1\.0/.exec(t),s=e?parseInt(e[1]):null;return0/0===s&&(s=null),o.SRC_IDS[t]=s,s};vard=newDate(0).toLocaleTimeString().toUpperCase();o.settings_info.twenty_four_timestamps={type:"boolean",value:-1===d.lastIndexOf("PM")&&-1===d.lastIndexOf("AM"),category:"Chat Appearance",no_bttv:!0,name:"24hr Timestamps",help:"Display timestamps in chat in the 24 hour format rather than 12 hour."},o.settings_info.show_deleted_links={type:"boolean",value:!1,category:"Chat Moderation",no_bttv:!0,name:"Show Deleted Links",help:"Do not delete links based on room settings or link length."},o.prototype.setup_tokenization=function(){if(s=t.require&&t.require("ember-twitch-chat/helpers/chat-line-helpers"),!s)returnthis.log("Unable to get chat helper functions.");this.log("Hooking Ember chat line helpers.");vare=this;s.getTime=function(t){if(void0===t||null===t)return"?:??";vars=t.getHours(),o=t.getMinutes();returns>12&&!e.settings.twenty_four_timestamps?s-=12:0!==s||e.settings.twenty_four_timestamps||(s=12),s+":"+(10>o?"0":"")+o},s.linkifyMessage=function(t,s){varo=e.settings.show_deleted_links;return_.chain(t).map(function(t){if(!_.isString(t))returnt;vare=t.match(LINK);returne&&e.length?_.zip(t.split(LINK),_.map(e,function(t){vare=t.length>255;returno||!s&&!e?{isLink:!0,href:t}:{isLink:!0,isDeleted:!0,isLong:e,href:t}})):[t]}).flatten().compact().value()}},o.prototype.tokenize_chat_line=function(e,i,n){if(e.cachedTokens)returne.cachedTokens;vara=e.message,r=this.get_user(),d=e.room,u=r&&e.from===r.login,c=e.tags&&e.tags.emotes,l=[a];if(s&&s.linkifyMessage){varh=a.labels||[],f=-1!==h.indexOf("owner")||-1!==h.indexOf("staff")||-1!==h.indexOf("admin")||-1!==h.indexOf("global_mod")||-1!==h.indexOf("mod")||"admin"===a.style;l=s.linkifyMessage(l,n&&!f)}r&&r.login&&s&&s.mentionizeMessage&&(l=s.mentionizeMessage(l,r.login,u)),s&&s.emoticonizeMessage&&(l=s.emoticonizeMessage(l,c)),this.settings.replace_bad_emotes&&(l=this.tokenize_replace_emotes(l)),l=this._remove_banned(l),l=this.tokenize_emotes(e.from,d,l,u),this.settings.parse_emoji&&(l=this.tokenize_emoji(l));varm=e.tags&&e.tags["display-name"];if(m&&m.length&&(o.capitalization[e.from]=[m.trim(),Date.now()]),!u){l=this.tokenize_mentions(l);for(varp=0;p<l.length;p++){varg=l[p];if("whisper"===e.style||!_.isString(g)&&g.mentionedUser&&!g.own){if(e.ffz_has_mention=!0,d&&!this.has_bttv&&this.settings.group_tabs&&this._chatv&&this._chatv._ffz_tabs){varv=this._chatv._ffz_tabs.querySelector('.ffz-chat-tab[data-room="'+d+'"]');v&&!v.classList.contains("active")&&v.classList.add("tab-mentioned")}if(this._chatv&&this.settings.highlight_notifications&&!this.embed_in_dash&&!document.hasFocus()&&!i){varb,y=this.rooms[d]&&this.rooms[d].room;if(this.settings.group_tabs&&(-1!==this.settings.pinned_rooms.indexOf(d)||this._chatv._ffz_host)||y.get("isGroupRoom")||y===this._chatv.get("controller.currentChannelRoom")){b=y&&y.get("isGroupRoom")?y.get("tmiRoom.displayName"):o.get_capitalization(d),m=m||Twitch.display.capitalize(e.from),a="action"===e.style?"* "+m+" "+a:m+": "+a;"whisper"===e.style?this.show_notification(a,"Twitch Chat Whisper","ffz_whisper_notice",1e3*this.settings.notification_timeout,function(){t.focus()}):this.show_notification(a,"Twitch Chat Mention in "+b,d,1e3*this.settings.notification_timeout,function(){t.focus();vare=App.__container__.lookup("controller:chat");y&&e&&e.focusRoom(y)})}}break}}}returne.cachedTokens=l,l},o.prototype.tokenize_line=function(t,e,o,i,n){if("string"==typeofo&&(o=[o]),s&&s.linkifyMessage&&(o=s.linkifyMessage(o)),s&&s.mentionizeMessage){vara=this.get_user();a&&a.login&&(o=s.mentionizeMessage(o,a.login,t===a.login))}returni||(o=this.tokenize_emotes(t,e,o),this.settings.replace_bad_emotes&&(o=this.tokenize_replace_emotes(o))),this.settings.parse_emoji&&!n&&(o=this.tokenize_emoji(o)),o},o.prototype.render_tokens=function(t,e){vars=this;return_.map(t,function(t){if(t.emoticonSrc){vara,r,d;if(t.ffzEmote){varu=s.emote_sets&&s.emote_sets[t.ffzEmoteSet],c=u&&u.emoticons&&u.emoticons[t.ffzEmote];a=c?i.sanitize(s._emote_to
this._emotes_for_sets(e,t,[L[v]],A,"http://cdn.frankerfacez.com/script/devicon.png","FrankerFaceZ")}this._feature_friday_ui(o,e,t)},name:"Channel",icon:o.ZREKNARF},s.prototype._emotes_for_sets=function(t,e,s,o,i,n){vara=document.createElement("div"),r=0;if(a.className="emoticon-grid",null!=o){vard=document.createElement("div");if(d.className="heading",n){varu=document.createElement("span");u.className="right",u.appendChild(document.createTextNode(n)),d.appendChild(u)}d.appendChild(document.createTextNode(o)),i&&(d.style.backgroundImage='url("'+i+'")'),a.appendChild(d)}for(varc=[],l=0;l<s.length;l++){varh=this.emote_sets[s[l]];if(h&&h.emoticons)for(varfinh.emoticons)h.emoticons.hasOwnProperty(f)&&!h.emoticons[f].hidden&&c.push(h.emoticons[f])}c.sort(function(t,e){vars=t.name.toLowerCase(),o=e.name.toLowerCase();returno>s?-1:s>o?1:0});for(varl=0;l<c.length;l++){varm=c[l],_=null;(m.urls[2]||m.urls[4])&&(_='url("'+m.urls[1]+'") 1x',m.urls[2]&&(_+=', url("'+m.urls[2]+'") 2x'),m.urls[4]&&(_+=', url("'+m.urls[4]+'") 4x')),r++;varu=document.createElement("span");if(u.className="emoticon tooltip",u.style.backgroundImage='url("'+m.urls[1]+'")',_){varp="image-set("+_+")";u.style.backgroundImage="-webkit-"+p,u.style.backgroundImage="-moz-"+p,u.style.backgroundImage="-ms-"+p,u.style.backgroundImage=p}u.style.width=m.width+"px",u.style.height=m.height+"px",u.title=this._emote_tooltip(m),u.addEventListener("click",this._add_emote.bind(this,e,m.name)),a.appendChild(u)}r||(a.innerHTML+="This channel has no emoticons.",a.className="emoticon-grid ffz-no-emotes center"),t.appendChild(a)},s.prototype._add_emote=function(t,e){vars,o,i;this.has_bttv?(s=t.get("element").querySelector("textarea"),o=s.value):(i=t.get("controller.currentRoom"),o=i.get("messageToSend")||""),o+=(o&&" "!==o.substr(-1)?" ":"")+(e.name||e),s?s.value=o:i.set("messageToSend",o)}},{"../constants":4,"../utils":34}],27:[function(e){vars=t.FrankerFaceZ,o=e("../constants");s.prototype.build_ui_link=function(t){vare=document.createElement("a");returne.className="ffz-ui-toggle",e.innerHTML=o.CHAT_BUTTON,e.addEventListener("click",this.build_ui_popup.bind(this,t)),this.update_ui_link(e),e},s.prototype.update_ui_link=function(e){vars=t.App&&App.__container__.lookup("controller:chat");if(e=e||document.querySelector("a.ffz-ui-toggle"),e&&s){varo=s.get("currentRoom.id"),i=this.rooms[o],n=!1,a=this.has_bttv?BetterTTV.settings.get("darkenedMode"):!1,r=this.has_bttv?BetterTTV.settings.get("showBlueButtons"):!1,d=this.feature_friday&&this.feature_friday.live;if(i&&i.set){varu=this.emote_sets[i.set];u&&u.count>0&&(n=!0)}e.classList.toggle("no-emotes",!n),e.classList.toggle("live",d),e.classList.toggle("dark",a),e.classList.toggle("blue",r)}}},{"../constants":4}],28:[function(e){vars=t.FrankerFaceZ,o=e("../constants"),i=e("../utils"),n="http://static-cdn.jtvnw.net/emoticons/v1/";s.settings_info.replace_twitch_menu={type:"boolean",value:!1,category:"Chat Input",name:"Replace Twitch Emoticon Menu",help:"Completely replace the default Twitch emoticon menu.",on_update:function(t){document.body.classList.toggle("ffz-menu-replace",t)}},s.settings_info.global_emotes_in_menu={type:"boolean",value:!1,category:"Chat Input",name:"Display Global Emotes in My Emotes",help:"Display the global Twitch emotes in the My Emoticons menu."},s.settings_info.emoji_in_menu={type:"boolean",value:!1,category:"Chat Input",name:"Display Emoji in My Emotes",help:"Display the supported emoji images in the My Emoticons menu."},s.settings_info.emote_menu_collapsed={value:[],visible:!1},s.prototype.setup_my_emotes=function(){if(this._twitch_set_to_channel={},this._twitch_badges={},localStorage.ffzTwitchSets)try{this._twitch_set_to_channel=JSON.parse(localStorage.ffzTwitchSets),this._twitch_badges=JSON.parse(localStorage.ffzTwitchBadges)}catch(t){}this._twitch_set_to_channel[0]="global",this._twitch_set_to_channel[33]="turbo_faces",this._twitch_set_to_channel[42]="turbo_faces",this._twitch_badges.global="//cdn.frankerfacez.com/script/twitch_logo.png",this._twitch_badges.turbo_faces=this._twitch_badg