|
|
@@ -1,87 +1,89 @@
|
|
|
"use strict";(function(){
|
|
|
-var m;function p(a){this.id=a;this.version=0}p.prototype.update=function(a,b){void 0!==a.name&&(this.name=a.name);this.version=Math.max(this.version,b)};function aa(a){this.a=a.desc;this.name=a.name;this.type=a.type;this.usage=a.usage;this.N=a.category}function ba(){this.b={};this.a=[]}
|
|
|
-ba.prototype.update=function(a,b){this.b=JSON.parse(a.emoji_use);a.highlight_words?this.a=(a.highlight_words||"").split(",").filter(function(a){return""!==a.trim()}):a.highlights&&(this.a=a.highlights);this.version=Math.max(this.version,b)};function ca(){this.o=null;this.m={};this.a={};this.b=null;this.l={version:0,data:{}};this.i={version:0,data:{}};this.c={};this.w=0}"undefined"!==typeof module&&(module.J.ya=ca,module.J.za=p,module.J.Ba=aa);function t(a){this.id=a;this.D=!1;this.a=this.b=0;this.i={};this.version=0}
|
|
|
-t.prototype.update=function(a,b,c){void 0!==a.name&&(this.name=a.name);void 0!==a.is_archived&&(this.l=a.is_archived);void 0!==a.is_member&&(this.w=a.is_member);void 0!==a.last_read&&(this.b=Math.max(parseFloat(a.last_read),this.b));void 0!==a.last_msg&&(this.a=parseFloat(a.last_msg));void 0!==a.is_private&&(this.o=a.is_private);a.latest&&(this.a=parseFloat(a.latest.ts));void 0!==a.is_starred&&(this.D=a.is_starred);if(a.members&&(this.i={},a.members))for(var d=0,e=a.members.length;d<e;d++){var f=
|
|
|
-b.a[a.members[d]];this.i[f.id]=f;f.m[this.id]=this}this.version=Math.max(this.version,c)};function w(a,b){t.call(this,a);this.c=b;this.name=this.c.name;this.o=!0;b.l=this}w.prototype=Object.create(t.prototype);w.prototype.constructor=w;"undefined"!==typeof module&&(module.J.Ga=t,module.J.Fa=w);function x(a,b){this.C=a.user;this.username=a.username;this.id=a.id||a.ts;this.s=parseFloat(a.ts);this.text="";this.u=[];this.c=this.O=this.D=!1;this.A={};this.version=b;this.update(a,b)}function y(a,b){x.call(this,a,b)}function A(a,b){x.call(this,a,b)}
|
|
|
-x.prototype.update=function(a,b){if(a){if(this.text=a.text||"",a.attachments&&(this.u=a.attachments),this.D=!!a.is_starred,this.O=!!a.edited,this.c=!!a.removed,a.reactions){var c={};a.reactions.forEach(function(a){c[a.name]=[];a.users.forEach(function(b){c[a.name].push(b)})});this.A=c}}else this.c=!0;this.version=b};function C(a,b,c,d){this.id="string"===typeof a?a:a.id;this.a=[];this.c=b;c&&da(this,c,d)}
|
|
|
-function da(a,b,c){var d=0;b.forEach(function(a){d=Math.max(this.push(a,c),d)}.bind(a));ea(a)}C.prototype.b=function(a,b){return!0===a.isMeMessage?new y(a,b):!0===a.isNotice?new A(a,b):new x(a,b)};C.prototype.push=function(a,b){for(var c,d=!1,e,f=0,g=this.a.length;f<g;f++)if(c=this.a[f],c.id===a.id){e=c.update(a,b);d=!0;break}d||(c=this.b(a,b),this.a.push(c),e=c.s);for(;this.a.length>this.c;)this.a.shift();return e||0};
|
|
|
-function fa(a){for(var b=D.b[G.id],c=0,d=b.a.length;c<d&&a>=b.a[c].s;c++)if(b.a[c].s===a)return b.a[c];return null}function ea(a){a.a.sort(function(a,c){return a.s-c.s})}y.prototype=Object.create(x.prototype);y.prototype.constructor=y;A.prototype=Object.create(x.prototype);A.prototype.constructor=A;"undefined"!==typeof module&&(module.J={Da:x,Ca:y,Ea:A,Ha:C});function ga(a){this.id=a;this.b={small:"",va:""};this.m={};this.l=this.a=null;this.version=0}ga.prototype.update=function(a,b){void 0!==a.name&&(this.name=a.name);void 0!==a.deleted&&(this.i=a.deleted);void 0!==a.status&&(this.status=a.status);void 0!==a.presence&&(this.c="away"!==a.presence);void 0!==a.isPresent&&(this.c=a.isPresent);a.isBot&&(this.w=a.isBot);a.profile&&(this.b.small=a.profile.icon_small,this.b.va=a.profile.icon_large);this.version=Math.max(this.version,b)};
|
|
|
-"undefined"!==typeof module&&(module.J.Aa=ga);var H={},I;function ha(){if(!c){for(var a=0,b=navigator.languages.length;a<b;a++)if(H.hasOwnProperty(navigator.languages[a])){var c=navigator.languages[a];break}c||(c="en")}I=H[c];console.log("Loading language pack: "+c);if(I.f)for(a in I.f)document.getElementById(a).textContent=I.f[a]};H.fr={xa:"Utilisateur inconnu",wa:"Channel inconnu",ia:"Nouveau message",ha:"Reseau",O:"(edité)",ka:"(visible seulement par vous)",D:"Favoris",m:"Discutions",ma:"Discutions priv\u00e9es",ok:"Ok",da:"Annuler",V:function(a){"string"!==typeof a&&(a=parseFloat(a));var b=new Date,c=new Date;a=new Date(1E3*a);b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0);c.setTime(b.getTime());c.setDate(c.getDate()-1);return a.getTime()>b.getTime()?a.toLocaleTimeString():a.getTime()>c.getTime()?
|
|
|
-"hier, "+a.toLocaleTimeString():a.toLocaleString()},f:{fileUploadCancel:"Annuler",neterror:"Impossible de se connecter au chat !"}};H.en={xa:"Unknown member",wa:"Unknown channel",ia:"New message",ha:"Network",O:"(edited)",ka:"(only visible to you)",D:"Starred",m:"Channels",ma:"Direct messages",ok:"Ok",da:"Cancel",V:function(a){"string"!==typeof a&&(a=parseFloat(a));var b=new Date,c=new Date;a=new Date(1E3*a);b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0);c.setTime(b.getTime());c.setDate(c.getDate()-1);return a.getTime()>b.getTime()?a.toLocaleTimeString():a.getTime()>c.getTime()?"yesterday, "+a.toLocaleTimeString():
|
|
|
-a.toLocaleString()},f:{fileUploadCancel:"Cancel",neterror:"Cannot connect to chat !"}};var J=function(){function a(a){this.text="";this.g=a}function b(a,b,c){this.L=b;this.h=null;this.j=[];this.a=c||"";this.$="<"===this.a;this.X="*"===this.a;this.Z="_"===this.a;this.ba="~"===this.a||"-"===this.a;this.aa=">"===this.a;this.i=":"===this.a;this.o="`"===this.a;this.Y="```"===this.a;this.g=a;this.w=null;this.b=!1}function c(a){this.text=a;this.a=null}b.prototype.ea=function(){return this.X&&!!this.b||this.g instanceof b&&this.g.ea()};b.prototype.ja=function(){return this.Z&&!!this.b||this.g instanceof
|
|
|
-b&&this.g.ja()};b.prototype.na=function(){return this.ba&&!!this.b||this.g instanceof b&&this.g.na()};b.prototype.l=function(){return this.i&&!!this.b||this.g instanceof b&&this.g.l()};b.prototype.fa=function(){return this.o&&!!this.b||this.g instanceof b&&this.g.fa()};b.prototype.ga=function(){return this.Y&&!!this.b||this.g instanceof b&&this.g.ga()};b.prototype.oa=function(){for(var a=0,c=this.j.length;a<c;a++)if(this.j[a]instanceof b&&(!this.j[a].b||this.j[a].oa()))return!0;return!1};b.prototype.pa=
|
|
|
-function(a,b){if("<"===this.a&&">"===a[b])return!0;if(a.substr(b,this.a.length)===this.a){if(this.h&&this.oa())return this.h.ca();if(this.sa())return!0}return!1};b.prototype.sa=function(){for(var a=this;a;){for(var c=0,f=a.j.length;c<f;c++)if(a.j[c]instanceof b||a.j[c].text.length)return!0;a=a.w}return!1};b.prototype.ca=function(){var a=new b(this.g,this.L,this.a);a.w=this;this.h&&this.h instanceof b&&(a.h=this.h.ca(),a.j=[a.h]);return a};b.prototype.ta=function(a,b){return this.i&&(" "===a[b]||"\t"===
|
|
|
-a[b])||(this.i||this.$||this.X||this.Z||this.ba||this.o)&&"\n"===a[b]?!1:!0};b.prototype.ua=function(b,c){if(this.o||this.Y||this.i)return null;if(!this.h||this.h instanceof a){var d=b[c+1];d="A"<=d&&"Z">=d||"a"<=d&&"z">=d||"0"<=d&&"9">=d||-1!=="\u00e0\u00e8\u00ec\u00f2\u00f9\u00c0\u00c8\u00cc\u00d2\u00d9\u00e1\u00e9\u00ed\u00f3\u00fa\u00fd\u00c1\u00c9\u00cd\u00d3\u00da\u00dd\u00e2\u00ea\u00ee\u00f4\u00fb\u00c2\u00ca\u00ce\u00d4\u00db\u00e3\u00f1\u00f5\u00c3\u00d1\u00d5\u00e4\u00eb\u00ef\u00f6\u00fc\u00ff\u00c4\u00cb\u00cf\u00d6\u00dc\u0178\u00e7\u00c7\u00df\u00d8\u00f8\u00c5\u00e5\u00c6\u00e6\u0153".indexOf(d);
|
|
|
-if("```"===b.substr(c,3))return"```";if(-1!==["`","\n"].indexOf(b[c])||-1!==["*","~","-","_"].indexOf(b[c])&&(d||-1!=="*`~-_:<".split("").indexOf(b[c+1]))||-1!==[":","<"].indexOf(b[c])&&d)return b[c]}return null};a.prototype.c=function(a,b){this.text+=a[b];return 1};b.prototype.c=function(c,e){var d=this.h&&this.h.pa?this.h.pa(c,e):null;if(d)return c=this.h.a.length,this.h.qa(e),d instanceof b&&(this.h=d,this.j.push(d)),c;if(!this.h||this.h.b||this.h instanceof a||this.h.ta(c,e)){if(d=this.ua(c,e))return this.h=
|
|
|
-new b(this,e,d),this.j.push(this.h),this.h.a.length;if(!this.h||this.h.b)this.h=new a(this),this.j.push(this.h);return this.h.c(c,e)}d=this.h.L+1;this.ra().U(this.h.L);this.h=new a(this);this.h.c(c,d-1);this.j.pop();this.j.push(this.h);return d-e};b.prototype.qa=function(a){for(var b=this;b;)b.b=a,b=b.w};b.prototype.ra=function(){for(var a=this;a.g&&a.g instanceof b;)a=a.g;return a};b.prototype.U=function(a){this.b&&this.b>=a&&(this.b=!1);this.j.forEach(function(c){c instanceof b&&c.U(a)})};a.prototype.innerHTML=
|
|
|
-function(){return this.g.l()?":"+this.text+":":this.text};a.prototype.outerHTML=function(){var a="span",b=[];this.g.ga()?b.push("codeblock"):this.g.fa()?b.push("code"):(this.$&&(a="a"),this.g.ea()&&b.push("bold"),this.g.ja()&&b.push("italic"),this.g.na()&&b.push("strike"),this.g.l()&&b.push("emoji"));return"<"+a+(b.length?' class="'+b.join(" ")+'"':"")+">"+this.innerHTML()+"</"+a+">"};b.prototype.outerHTML=function(){var a="";this.aa&&(a+='<span class="quote">');this.j.forEach(function(b){a+=b.outerHTML()});
|
|
|
-this.aa&&(a+="</span>");return a};c.prototype.c=function(a){for(var b=this.text.length;a<b;)a+=this.a.c(this.text,a);this.o()};c.prototype.l=function(){this.a=new b(this,0);this.c(0)};c.prototype.b=function(a){for(var c=0,d=a.j.length;c<d;c++){var g=a.j[c];if(g instanceof b)if(g.b){if(g=this.b(g))return g}else return g}return null};c.prototype.i=function(a,c){a.g instanceof b&&(a.g.j.splice(a.g.j.indexOf(a)+(c?1:0)),a.g.h=a.g.j[a.g.j.length-1],this.i(a.g,!0))};c.prototype.o=function(){var b=this.b(this.a);
|
|
|
-if(b){this.i(b,!1);this.a.U(b.L);var c=new a(b.g);c.c(this.text,b.L);b.g.j.push(c);b.g.h=c;this.c(b.L+1)}};c.prototype.w=function(){return this.a?this.a.outerHTML():""};return function(a){a=new c(a);a.l();return a.w()}}();function ia(a,b){this.c=a;this.content=b;this.f=ja(this);this.b=ka(this);this.a=[];this.i=[]}
|
|
|
-function ja(a){var b=document.createElement("div"),c=document.createElement("header"),d=document.createElement("span"),e=document.createElement("span"),f=document.createElement("div"),g=document.createElement("footer");b.a=document.createElement("span");b.b=document.createElement("span");d.textContent=a.c;"string"==typeof a.content?f.innerHTML=a.content:f.appendChild(a.content);c.className=la;d.className=ma;e.className=na;e.textContent="x";c.appendChild(d);c.appendChild(e);b.appendChild(c);f.className=
|
|
|
-oa;b.appendChild(f);b.b.className=pa;b.b.textContent=I.da;b.b.addEventListener("click",function(){K(a,!1)});e.addEventListener("click",function(){K(a,!1)});b.a.addEventListener("click",function(){K(a,!0)});g.appendChild(b.b);b.a.className=pa;b.a.textContent=I.ok;g.appendChild(b.a);g.className=qa+" "+ra;b.appendChild(g);b.className=sa;return b}function K(a,b){(b?a.a:a.i).forEach(function(a){a()});a.close()}
|
|
|
-function ka(a){var b=document.createElement("div");b.className=ta;b.addEventListener("click",function(){K(this,!1)}.bind(a));return b}function ua(a,b,c){a.f.a.textContent=b;a.f.b.textContent=c;return a}ia.prototype.R=function(a){a=a||document.body;a.appendChild(this.b);a.appendChild(this.f);return this};ia.prototype.close=function(){this.f.remove();this.b.remove();return this};function va(a,b){a.a.push(b);return a};var pa="button",qa="button-container",sa="dialog",ta="dialog-overlay",la="dialog-title",ma="dialog-title-label",na="dialog-title-close",oa="dialog-body",ra="dialog-footer";var wa=[],xa=0;
|
|
|
-function ya(){var a=document.createDocumentFragment(),b=Object.keys(D.a.m||{}),c=[],d=[],e=[],f=[];b.sort(function(a,b){return a[0]!==b[0]?a[0]-b[0]:D.a.m[a].name.localeCompare(D.a.m[b].name)});b.forEach(function(a){a=D.a.m[a];if(!a.l&&!1!==a.w)if(a instanceof w){if(!a.c.i){var b=document.createElement("li");var g=document.createElement("a");b.id="room_"+a.id;g.href="#"+a.id;b.className="slack-context-room slack-ims";g.textContent=a.c.name;b.appendChild(za());b.appendChild(g);a.c.c||b.classList.add("away");
|
|
|
-G===a&&b.classList.add("selected");a.a>a.b&&(b.classList.add("unread"),0<=M.indexOf(a)&&b.classList.add("unreadHi"));b&&(a.D?c.push(b):f.push(b))}}else b=document.createElement("li"),g=document.createElement("a"),b.id="room_"+a.id,g.href="#"+a.id,a.o?(b.className="slack-context-room slack-group",b.dataset.count=Object.keys(a.i||{}).length):b.className="slack-context-room slack-channel",G===a&&b.classList.add("selected"),g.textContent=a.name,b.appendChild(za()),b.appendChild(g),a.a>a.b&&(b.classList.add("unread"),
|
|
|
-0<=M.indexOf(a)&&b.classList.add("unreadHi")),b&&(a.D?c.push(b):a.o?e.push(b):d.push(b))});c.length&&a.appendChild(Aa(I.D));c.forEach(function(b){a.appendChild(b)});d.length&&a.appendChild(Aa(I.m));d.forEach(function(b){a.appendChild(b)});e.forEach(function(b){a.appendChild(b)});f.length&&a.appendChild(Aa(I.ma));f.forEach(function(b){a.appendChild(b)});document.getElementById("chanList").textContent="";document.getElementById("chanList").appendChild(a);Ba();N();Ca(function(a){document.getElementById("slackCtx").style.backgroundImage=
|
|
|
-"url("+a+")"})}function Da(){var a=D.a.c,b;for(b in D.a.b.m)if(!D.a.b.m[b].l){var c=document.getElementById("room_"+b);a[b]?c.classList.add("slack-context-typing"):c.classList.remove("slack-context-typing")}for(var d in D.a.a)(b=D.a.a[d].l)&&!b.l&&(c=document.getElementById("room_"+b.id))&&(a[b.id]?c.classList.add("slack-context-typing"):c.classList.remove("slack-context-typing"));Ea()}
|
|
|
-function Ea(){var a=D.a.c;document.getElementById("whoistyping").textContent="";if(G&&a[G.id]){var b=document.createDocumentFragment(),c=!1,d;for(d in a[G.id])(a=D.a.a[d])?b.appendChild(Fa(a)):c=!0;c&&(D.c=0);document.getElementById("whoistyping").appendChild(b)}}function Ga(a){a?document.body.classList.remove("no-network"):document.body.classList.add("no-network");N()}
|
|
|
-function Ha(){var a=G.name||(G.c?G.c.name:void 0);if(!a){var b=[];G.i.forEach(function(a){b.push(a.name)});a=b.join(", ")}document.getElementById("currentRoomTitle").textContent=a;Ia();O();document.getElementById("fileUploadContainer").classList.add("hidden");Ja();P&&(P=null,Q());R&&(R=null,Q());Ea()}
|
|
|
-function Q(){if(P){document.body.classList.add("replyingTo");var a=document.getElementById("replyToContainer"),b=document.createElement("a");b.addEventListener("click",function(){P=null;Q()});b.className="replyto-close";b.textContent="x";a.textContent="";a.appendChild(b);a.appendChild(P.H())}else document.body.classList.remove("replyingTo"),document.getElementById("replyToContainer").textContent="";O()}
|
|
|
-function S(){if(R){document.body.classList.add("replyingTo");var a=document.getElementById("replyToContainer"),b=document.createElement("a");b.addEventListener("click",function(){R=null;S()});b.className="replyto-close";b.textContent="x";a.textContent="";a.appendChild(b);a.appendChild(R.H());document.getElementById("msgInput").value=R.text}else document.body.classList.remove("replyingTo"),document.getElementById("replyToContainer").textContent="";O()}
|
|
|
-window.toggleReaction=function(a,b,c){var d=D.b[a];if(d){a:{for(var e=0,f=d.a.length;e<f;e++)if(d.a[e].id==b){d=d.a[e];break a}d=null}d&&(e=D.a.b.id,d.A[c]&&-1!==d.A[c].indexOf(e)?(d=new XMLHttpRequest,d.open("DELETE","api/reaction?room="+a+"&msg="+b+"&reaction="+encodeURIComponent(c),!0),d.send(null)):Ka(a,b,c))}};
|
|
|
-function La(a){for(var b={};!b[a];){var c=D.a.l.data[a];if(c)if("alias:"==c.substr(0,6))b[a]=!0,a=c.substr(6);else{a=document.createElement("span");a.className="emoji-custom emoji";a.style.backgroundImage="url('"+c+"')";break}break}return a}function Ma(a,b){document.getElementById("linkFavicon").href=a||b?"favicon.png?h="+a+"&m="+b:"favicon_ok.png"}
|
|
|
-function N(){var a=M.length,b="";if(T)b="!"+I.ha+" - ",document.getElementById("linkFavicon").href="favicon_err.png";else if(a)b="(!"+a+") - ",Ma(a,a);else{var a=0,c;for(c in D.a.m){var d=D.a.m[c];d.a>d.b&&a++}a&&(b="("+a+") - ");Ma(0,a)}D.a.o&&(b+=D.a.o.name);document.title=b}
|
|
|
-function Na(){if("Notification"in window)if("granted"===Notification.permission){var a=Date.now();if(xa+3E4<a){var b=new Notification(I.ia);xa=a;setTimeout(function(){b.close()},5E3)}}else"denied"!==Notification.permission&&Notification.requestPermission()}
|
|
|
-function Ia(){var a=document.createDocumentFragment(),b=G.id,c=null,d=0,e=null,f;wa=[];D.b[b]&&D.b[b].a.forEach(function(b){if(b.c)b.K();else{var k=b.I(),g=!1;c&&c.C===b.C&&b.C?30>Math.abs(d-b.s)&&!(b instanceof y)?e.classList.add("slackmsg-same-ts"):d=b.s:(d=b.s,g=!0);(!c||c.s<=G.b)&&b.s>G.b?k.classList.add("slackmsg-first-unread"):k.classList.remove("slackmsg-first-unread");if(b instanceof y)e=c=null,d=0,a.appendChild(k),f=null;else{if(g||!f){var g=D.a.a[b.C],n=b.username,h=document.createElement("div"),
|
|
|
-r=document.createElement("div"),q=document.createElement("span");h.M=document.createElement("img");h.M.className="slackmsg-author-img";q.className="slackmsg-author-name";g?(q.textContent=g.name,h.M.src=g.b.small):(q.textContent=n||"?",h.M.src="");r.appendChild(h.M);r.appendChild(q);r.className="slackmsg-author";h.className="slackmsg-authorGroup";h.appendChild(r);h.content=document.createElement("div");h.content.className="slackmsg-author-messages";h.appendChild(h.content);f=h;wa.push(f);a.appendChild(f)}c=
|
|
|
-b;e=k;f.content.appendChild(k)}}});b=document.getElementById("chatWindow");b.textContent="";b.appendChild(a);b.scrollTop=b.scrollHeight-b.clientHeight;window.hasFocus&&Ja()}
|
|
|
-function Oa(a){function b(a,b){for(b=b||a.target;b!==a.currentTarget&&b;){if(b.classList.contains("slackmsg-item"))return b.id;b=b.parentElement}}for(var c,d,e=a.target;e!==a.currentTarget&&e&&!e.classList.contains("slackmsg-hover");){if(e.parentElement&&e.classList.contains("slackmsg-attachment-actions-item")){d=b(a,e);var f=e.dataset.attachmentIndex,g=e.dataset.actionIndex;d&&void 0!==f&&void 0!==g&&(d=parseFloat(d.split("_")[1]),(c=fa(d))&&c.u[f]&&c.u[f].actions&&c.u[f].actions[g]&&Pa(c,c.u[f],
|
|
|
-c.u[f].actions[g]))}else if(e.parentElement&&e.parentElement.classList.contains("slackmsg-hover")){if(d=b(a,e))d=parseFloat(d.split("_")[1]),(c=fa(d))&&e.classList.contains("slackmsg-hover-reply")?(R&&(R=null,S()),P!==c&&(P=c,Q())):c&&e.classList.contains("slackmsg-hover-reaction")?Qa.R(document.body,function(a){a&&Ka(G.id,c.id,a)}):c&&e.classList.contains("slackmsg-hover-edit")?(P&&(P=null,Q()),R!==c&&(R=c,S())):c&&e.classList.contains("slackmsg-hover-remove")&&(P&&(P=null,Q()),R&&(R=null,S()),Ra(c));
|
|
|
-break}e=e.parentElement}}function Pa(a,b,c){function d(){var d=JSON.stringify({actions:[c],attachment_id:b.id,callback_id:b.callback_id,channel_id:e,is_ephemeral:a instanceof A,message_ts:a.id}),g=a.C,k=new FormData,l=new XMLHttpRequest;k.append("payload",d);k.append("service_id",g);l.open("POST","api/attachmentAction");l.send(k)}var e=G.id;c.confirm?va(ua(new ia(c.confirm.title,c.confirm.text),c.confirm.ok_text,c.confirm.dismiss_text),d).R():d()}
|
|
|
-function O(){document.getElementById("msgInput").focus()}function Ba(){var a=document.location.hash.substr(1),b=D.a.m[a];b&&b!==G?Sa(b):(a=D.a.a[a])&&a.o&&Sa(a.o)}function Ta(){var a=document.getElementById("chatWindow").getBoundingClientRect().top;wa.forEach(function(b){var c=b.M,d=c.clientHeight;b=b.getBoundingClientRect();c.style.top=Math.max(0,Math.min(a-b.top,b.height-d-d/2))+"px"})}
|
|
|
+var m;function p(a){this.id=a;this.version=0}p.prototype.update=function(a,b){void 0!==a.name&&(this.name=a.name);this.version=Math.max(this.version,b)};function aa(a){this.a=a.desc;this.name=a.name;this.type=a.type;this.usage=a.usage;this.O=a.category}function ba(){this.a={};this.B=[]}
|
|
|
+ba.prototype.update=function(a,b){this.a=JSON.parse(a.emoji_use);a.highlight_words?this.B=(a.highlight_words||"").split(",").filter(function(a){return""!==a.trim()}):a.highlights&&(this.B=a.highlights);this.version=Math.max(this.version,b)};function ca(){this.s=null;this.m={};this.a={};this.b=null;this.l={version:0,data:{}};this.j={version:0,data:{}};this.f={};this.w=0}"undefined"!==typeof module&&(module.J.Fa=ca,module.J.Ga=p,module.J.Ia=aa);function t(a){this.id=a;this.F=!1;this.a=this.b=0;this.j={};this.version=0}
|
|
|
+t.prototype.update=function(a,b,c){void 0!==a.name&&(this.name=a.name);void 0!==a.is_archived&&(this.l=a.is_archived);void 0!==a.is_member&&(this.w=a.is_member);void 0!==a.last_read&&(this.b=Math.max(parseFloat(a.last_read),this.b));void 0!==a.last_msg&&(this.a=parseFloat(a.last_msg));void 0!==a.is_private&&(this.s=a.is_private);a.latest&&(this.a=parseFloat(a.latest.ts));void 0!==a.is_starred&&(this.F=a.is_starred);if(a.members&&(this.j={},a.members))for(var d=0,e=a.members.length;d<e;d++){var g=
|
|
|
+b.a[a.members[d]];this.j[g.id]=g;g.m[this.id]=this}this.version=Math.max(this.version,c)};function w(a,b){t.call(this,a);this.f=b;this.name=this.f.name;this.s=!0;b.l=this}w.prototype=Object.create(t.prototype);w.prototype.constructor=w;"undefined"!==typeof module&&(module.J.Na=t,module.J.Ma=w);function x(a,b){this.D=a.user;this.username=a.username;this.id=a.id||a.ts;this.o=parseFloat(a.ts);this.text="";this.u=[];this.f=this.P=this.F=!1;this.A={};this.version=b;this.update(a,b)}function y(a,b){x.call(this,a,b)}function A(a,b){x.call(this,a,b)}
|
|
|
+x.prototype.update=function(a,b){if(a){if(this.text=a.text||"",a.attachments&&(this.u=a.attachments),this.F=!!a.is_starred,this.P=!!a.edited,this.f=!!a.removed,a.reactions){var c={};a.reactions.forEach(function(a){c[a.name]=[];a.users.forEach(function(b){c[a.name].push(b)})});this.A=c}}else this.f=!0;this.version=b};function D(a,b,c,d){this.id="string"===typeof a?a:a.id;this.a=[];this.f=b;c&&da(this,c,d)}
|
|
|
+function da(a,b,c){var d=0;b.forEach(function(a){d=Math.max(this.push(a,c),d)}.bind(a));ea(a)}D.prototype.b=function(a,b){return!0===a.isMeMessage?new y(a,b):!0===a.isNotice?new A(a,b):new x(a,b)};D.prototype.push=function(a,b){for(var c,d=!1,e,g=0,f=this.a.length;g<f;g++)if(c=this.a[g],c.id===a.id){e=c.update(a,b);d=!0;break}d||(c=this.b(a,b),this.a.push(c),e=c.o);for(;this.a.length>this.f;)this.a.shift();return e||0};
|
|
|
+function fa(a){for(var b=E.b[H.id],c=0,d=b.a.length;c<d&&a>=b.a[c].o;c++)if(b.a[c].o===a)return b.a[c];return null}function ea(a){a.a.sort(function(a,c){return a.o-c.o})}y.prototype=Object.create(x.prototype);y.prototype.constructor=y;A.prototype=Object.create(x.prototype);A.prototype.constructor=A;"undefined"!==typeof module&&(module.J={Ka:x,Ja:y,La:A,Oa:D});function ga(a){this.id=a;this.b={small:"",Ca:""};this.m={};this.l=this.a=null;this.version=0}ga.prototype.update=function(a,b){void 0!==a.name&&(this.name=a.name);void 0!==a.deleted&&(this.j=a.deleted);void 0!==a.status&&(this.status=a.status);void 0!==a.presence&&(this.f="away"!==a.presence);void 0!==a.isPresent&&(this.f=a.isPresent);a.isBot&&(this.w=a.isBot);a.profile&&(this.b.small=a.profile.icon_small,this.b.Ca=a.profile.icon_large);this.version=Math.max(this.version,b)};
|
|
|
+"undefined"!==typeof module&&(module.J.Ha=ga);var I={},J;function ha(){if(!c){for(var a=0,b=navigator.languages.length;a<b;a++)if(I.hasOwnProperty(navigator.languages[a])){var c=navigator.languages[a];break}c||(c="en")}J=I[c];console.log("Loading language pack: "+c);if(J.c)for(a in J.c)document.getElementById(a).textContent=J.c[a]};I.fr={Ea:"Utilisateur inconnu",Da:"Channel inconnu",va:"Nouveau message",ua:"Reseau",P:"(edité)",wa:"(visible seulement par vous)",F:"Favoris",m:"Discutions",ya:"Discutions priv\u00e9es",ok:"Ok",ta:"Annuler",Y:function(a){"string"!==typeof a&&(a=parseFloat(a));var b=new Date,c=new Date;a=new Date(1E3*a);b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0);c.setTime(b.getTime());c.setDate(c.getDate()-1);return a.getTime()>b.getTime()?a.toLocaleTimeString():a.getTime()>c.getTime()?
|
|
|
+"hier, "+a.toLocaleTimeString():a.toLocaleString()},c:{fileUploadCancel:"Annuler",neterror:"Impossible de se connecter au chat !"}};I.en={Ea:"Unknown member",Da:"Unknown channel",va:"New message",ua:"Network",P:"(edited)",wa:"(only visible to you)",F:"Starred",m:"Channels",ya:"Direct messages",ok:"Ok",ta:"Cancel",Y:function(a){"string"!==typeof a&&(a=parseFloat(a));var b=new Date,c=new Date;a=new Date(1E3*a);b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0);c.setTime(b.getTime());c.setDate(c.getDate()-1);return a.getTime()>b.getTime()?a.toLocaleTimeString():a.getTime()>c.getTime()?"yesterday, "+a.toLocaleTimeString():
|
|
|
+a.toLocaleString()},c:{fileUploadCancel:"Cancel",neterror:"Cannot connect to chat !"}};var K=function(){function a(a){this.text="";this.g=a}function b(b,c,d){this.M=c;this.h=null;this.i=[];this.a=d||"";this.ra="<"===this.a;this.aa="*"===this.a;this.ga="_"===this.a;this.U="~"===this.a||"-"===this.a;this.f=">"===this.a||">"===this.a;this.l=":"===this.a;this.ba="`"===this.a;this.qa="```"===this.a;this.ca="\n"===this.a;this.fa=void 0!==d&&-1!==h.B.indexOf(d);this.g=b;this.V=null;this.b=this.ca||this.fa?c+d.length-1:!1;this.fa&&(this.h=new a(this),this.i.push(this.h),this.h.text=d)}function c(a){return"A"<=
|
|
|
+a&&"Z">=a||"a"<=a&&"z">=a||"0"<=a&&"9">=a||-1!=="\u00e0\u00e8\u00ec\u00f2\u00f9\u00c0\u00c8\u00cc\u00d2\u00d9\u00e1\u00e9\u00ed\u00f3\u00fa\u00fd\u00c1\u00c9\u00cd\u00d3\u00da\u00dd\u00e2\u00ea\u00ee\u00f4\u00fb\u00c2\u00ca\u00ce\u00d4\u00db\u00e3\u00f1\u00f5\u00c3\u00d1\u00d5\u00e4\u00eb\u00ef\u00f6\u00fc\u00ff\u00c4\u00cb\u00cf\u00d6\u00dc\u0178\u00e7\u00c7\u00df\u00d8\u00f8\u00c5\u00e5\u00c6\u00e6\u0153".indexOf(a)}function d(a){a=a||l;for(var c=0,f=a.i.length;c<f;c++){var n=a.i[c];if(n instanceof
|
|
|
+b)if(n.b){if(n=d(n))return n}else return n}return null}function e(a,c){a.g instanceof b&&(a.g.i.splice(a.g.i.indexOf(a)+(c?1:0)),a.g.h=a.g.i[a.g.i.length-1],e(a.g,!0))}function g(a){return a}var f,l,h={B:[],S:g,ea:g};b.prototype.ia=function(){return this.aa&&!!this.b||this.g instanceof b&&this.g.ia()};b.prototype.la=function(){return this.ga&&!!this.b||this.g instanceof b&&this.g.la()};b.prototype.ma=function(){return this.U&&!!this.b||this.g instanceof b&&this.g.ma()};b.prototype.Z=function(){return this.l&&
|
|
|
+!!this.b||this.g instanceof b&&this.g.Z()};b.prototype.ka=function(){return this.fa&&!!this.b||this.g instanceof b&&this.g.ka()};b.prototype.ja=function(){return this.ba&&!!this.b||this.g instanceof b&&this.g.ja()};b.prototype.w=function(){return this.qa&&!!this.b||this.g instanceof b&&this.g.w()};b.prototype.na=function(){for(var a=0,c=this.i.length;a<c;a++)if(this.i[a]instanceof b&&(!this.i[a].b||this.i[a].na()))return!0;return!1};b.prototype.oa=function(a){var b=c(f[a-1]);if("<"===this.a&&">"===
|
|
|
+f[a]&&b)return!0;if(!this.f&&f.substr(a,this.a.length)===this.a){if(!b&&(this.aa||this.ga||this.U))return!1;if(this.h&&this.na())return this.h.sa();if(this.za())return!0}return"\n"===f[a]&&this.f?!0:!1};b.prototype.za=function(){for(var a=this;a;){for(var c=0,d=a.i.length;c<d;c++)if(a.i[c]instanceof b||a.i[c].text.length)return!0;a=a.V}return!1};b.prototype.sa=function(){var a=new b(this.g,this.M,this.a);a.V=this;this.h&&this.h instanceof b&&(a.h=this.h.sa(),a.i=[a.h]);return a};b.prototype.Aa=function(a){return this.l&&
|
|
|
+(" "===f[a]||"\t"===f[a])||(this.l||this.ra||this.aa||this.ga||this.U||this.ba)&&"\n"===f[a]?!1:!0};b.prototype.Ba=function(a){if(this.ba||this.l||this.qa)return null;var b=c(f[a+1]);if("```"===f.substr(a,3))return"```";var d=l.$();if(void 0===d||d){if(">"===f.substr(a,4))return">";if(">"===f[a])return f[a]}if(-1!==["`","\n"].indexOf(f[a])||-1!==["*","~","-","_"].indexOf(f[a])&&(b||-1!=="*~-_<&".split("").indexOf(f[a+1]))||-1!==[":","<"].indexOf(f[a])&&b)return f[a];b=0;for(d=h.B.length;b<d;b++){var e=
|
|
|
+h.B[b];if(f.substr(a,e.length)===e)return e}return null};a.prototype.$=function(){if(""!==this.text.trim())return!1};b.prototype.$=function(){for(var a=this.i.length-1;0<=a;a--){var b=this.i[a].$();if(void 0!==b)return b}if(this.ca||this.f)return!0};a.prototype.j=function(a){this.text+=f[a];return 1};b.prototype.j=function(c){var d=this.h&&!this.h.b&&this.h.oa?this.h.oa(c):null;if(d){var f=this.h.a.length;this.h.ha(c);d instanceof b&&(this.h=d,this.i.push(d));return f}if(!this.h||this.h.b||this.h instanceof
|
|
|
+a||this.h.Aa(c)){if(d=this.Ba(c))return this.h=new b(this,c,d),this.i.push(this.h),this.h.a.length;if(!this.h||this.h.b)this.h=new a(this),this.i.push(this.h);return this.h.j(c)}d=this.h.M+1;l.s(this.h.M);this.h=new a(this);this.h.j(d-1);this.i.pop();this.i.push(this.h);return d-c};b.prototype.ha=function(a){for(var b=this;b;)b.b=a,b=b.V};b.prototype.s=function(a){this.b&&this.b>=a&&(this.b=!1);this.i.forEach(function(c){c instanceof b&&c.s(a)})};a.prototype.innerHTML=function(){if(this.g.Z()){for(var a=
|
|
|
+this.g;a&&!a.l;)a=a.g;return a?h.S(a.a+this.text+a.a):h.S(this.text)}return this.g.w()?this.text.replace(/\n/g,"<br/>"):h.ea(this.text)};a.prototype.outerHTML=function(){var a="span",b=[];this.g.w()?b.push("codeblock"):this.g.ja()?b.push("code"):(this.ra&&(a="a"),this.g.ia()&&b.push("bold"),this.g.la()&&b.push("italic"),this.g.ma()&&b.push("strike"),this.g.Z()&&b.push("emoji"),this.g.ka()&&b.push("highlight"));return"<"+a+(b.length?' class="'+b.join(" ")+'"':"")+">"+this.innerHTML()+"</"+a+">"};b.prototype.outerHTML=
|
|
|
+function(){var a="";this.f&&(a+='<span class="quote">');this.ca&&(a+="<br/>");this.i.forEach(function(b){a+=b.outerHTML()});this.f&&(a+="</span>");return a};b.prototype.pa=function(a){this.f&&!this.b&&this.ha(a);this.i.forEach(function(c){c instanceof b&&c.pa(a)})};return function(c,k){k||(k={});h.B=k.B||[];h.S=k.S||g;h.ea=k.ea||g;f=c;l=new b(this,0);k=0;c=f.length;do{for(;k<c;)k+=l.j(k);l.pa(f.length);if(k=d()){e(k,!1);l.s(k.M);var n=new a(k.g);n.j(k.M);k.g.i.push(n);k.g.h=n;k=k.M+1}else k=void 0}while(void 0!==
|
|
|
+k);return l.outerHTML()}}();window._formatText=function(a,b){return K(a,{B:b?b.highlights:void 0})};"undefined"!==typeof module&&(module.J.Pa=K);function ia(a,b){this.f=a;this.content=b;this.c=ja(this);this.b=ka(this);this.a=[];this.j=[]}
|
|
|
+function ja(a){var b=document.createElement("div"),c=document.createElement("header"),d=document.createElement("span"),e=document.createElement("span"),g=document.createElement("div"),f=document.createElement("footer");b.a=document.createElement("span");b.b=document.createElement("span");d.textContent=a.f;"string"==typeof a.content?g.innerHTML=a.content:g.appendChild(a.content);c.className=la;d.className=ma;e.className=na;e.textContent="x";c.appendChild(d);c.appendChild(e);b.appendChild(c);g.className=
|
|
|
+oa;b.appendChild(g);b.b.className=pa;b.b.textContent=J.ta;b.b.addEventListener("click",function(){L(a,!1)});e.addEventListener("click",function(){L(a,!1)});b.a.addEventListener("click",function(){L(a,!0)});f.appendChild(b.b);b.a.className=pa;b.a.textContent=J.ok;f.appendChild(b.a);f.className=qa+" "+ra;b.appendChild(f);b.className=sa;return b}function L(a,b){(b?a.a:a.j).forEach(function(a){a()});a.close()}
|
|
|
+function ka(a){var b=document.createElement("div");b.className=ta;b.addEventListener("click",function(){L(this,!1)}.bind(a));return b}function ua(a,b,c){a.c.a.textContent=b;a.c.b.textContent=c;return a}ia.prototype.T=function(a){a=a||document.body;a.appendChild(this.b);a.appendChild(this.c);return this};ia.prototype.close=function(){this.c.remove();this.b.remove();return this};function va(a,b){a.a.push(b);return a};var pa="button",qa="button-container",sa="dialog",ta="dialog-overlay",la="dialog-title",ma="dialog-title-label",na="dialog-title-close",oa="dialog-body",ra="dialog-footer";var wa=[],xa=0;
|
|
|
+function ya(){var a=document.createDocumentFragment(),b=Object.keys(E.a.m||{}),c=[],d=[],e=[],g=[];b.sort(function(a,b){return a[0]!==b[0]?a[0]-b[0]:E.a.m[a].name.localeCompare(E.a.m[b].name)});b.forEach(function(a){a=E.a.m[a];if(!a.l&&!1!==a.w)if(a instanceof w){if(!a.f.j){var b=document.createElement("li");var f=document.createElement("a");b.id="room_"+a.id;f.href="#"+a.id;b.className="slack-context-room slack-ims";f.textContent=a.f.name;b.appendChild(za());b.appendChild(f);a.f.f||b.classList.add("away");
|
|
|
+H===a&&b.classList.add("selected");a.a>a.b&&(b.classList.add("unread"),0<=M.indexOf(a)&&b.classList.add("unreadHi"));b&&(a.F?c.push(b):g.push(b))}}else b=document.createElement("li"),f=document.createElement("a"),b.id="room_"+a.id,f.href="#"+a.id,a.s?(b.className="slack-context-room slack-group",b.dataset.count=Object.keys(a.j||{}).length):b.className="slack-context-room slack-channel",H===a&&b.classList.add("selected"),f.textContent=a.name,b.appendChild(za()),b.appendChild(f),a.a>a.b&&(b.classList.add("unread"),
|
|
|
+0<=M.indexOf(a)&&b.classList.add("unreadHi")),b&&(a.F?c.push(b):a.s?e.push(b):d.push(b))});c.length&&a.appendChild(Aa(J.F));c.forEach(function(b){a.appendChild(b)});d.length&&a.appendChild(Aa(J.m));d.forEach(function(b){a.appendChild(b)});e.forEach(function(b){a.appendChild(b)});g.length&&a.appendChild(Aa(J.ya));g.forEach(function(b){a.appendChild(b)});document.getElementById("chanList").textContent="";document.getElementById("chanList").appendChild(a);Ba();N();Ca(function(a){document.getElementById("slackCtx").style.backgroundImage=
|
|
|
+"url("+a+")"})}function Da(){var a=E.a.f,b;for(b in E.a.b.m)if(!E.a.b.m[b].l){var c=document.getElementById("room_"+b);a[b]?c.classList.add("slack-context-typing"):c.classList.remove("slack-context-typing")}for(var d in E.a.a)(b=E.a.a[d].l)&&!b.l&&(c=document.getElementById("room_"+b.id))&&(a[b.id]?c.classList.add("slack-context-typing"):c.classList.remove("slack-context-typing"));Ea()}
|
|
|
+function Ea(){var a=E.a.f;document.getElementById("whoistyping").textContent="";if(H&&a[H.id]){var b=document.createDocumentFragment(),c=!1,d;for(d in a[H.id])(a=E.a.a[d])?b.appendChild(Fa(a)):c=!0;c&&(E.f=0);document.getElementById("whoistyping").appendChild(b)}}function Ga(a){a?document.body.classList.remove("no-network"):document.body.classList.add("no-network");N()}
|
|
|
+function Ha(){var a=H.name||(H.f?H.f.name:void 0);if(!a){var b=[];H.j.forEach(function(a){b.push(a.name)});a=b.join(", ")}document.getElementById("currentRoomTitle").textContent=a;Ia();O();document.getElementById("fileUploadContainer").classList.add("hidden");Ja();P&&(P=null,Q());R&&(R=null,Q());Ea()}
|
|
|
+function Q(){if(P){document.body.classList.add("replyingTo");var a=document.getElementById("replyToContainer"),b=document.createElement("a");b.addEventListener("click",function(){P=null;Q()});b.className="replyto-close";b.textContent="x";a.textContent="";a.appendChild(b);a.appendChild(P.I())}else document.body.classList.remove("replyingTo"),document.getElementById("replyToContainer").textContent="";O()}
|
|
|
+function S(){if(R){document.body.classList.add("replyingTo");var a=document.getElementById("replyToContainer"),b=document.createElement("a");b.addEventListener("click",function(){R=null;S()});b.className="replyto-close";b.textContent="x";a.textContent="";a.appendChild(b);a.appendChild(R.I());document.getElementById("msgInput").value=R.text}else document.body.classList.remove("replyingTo"),document.getElementById("replyToContainer").textContent="";O()}
|
|
|
+window.toggleReaction=function(a,b,c){var d=E.b[a];if(d){a:{for(var e=0,g=d.a.length;e<g;e++)if(d.a[e].id==b){d=d.a[e];break a}d=null}d&&(e=E.a.b.id,d.A[c]&&-1!==d.A[c].indexOf(e)?(d=new XMLHttpRequest,d.open("DELETE","api/reaction?room="+a+"&msg="+b+"&reaction="+encodeURIComponent(c),!0),d.send(null)):Ka(a,b,c))}};
|
|
|
+function La(a){for(var b={};!b[a];){var c=E.a.l.data[a];if(c)if("alias:"==c.substr(0,6))b[a]=!0,a=c.substr(6);else{a=document.createElement("span");a.className="emoji-custom emoji";a.style.backgroundImage="url('"+c+"')";break}break}return a}function Ma(a,b){document.getElementById("linkFavicon").href=a||b?"favicon.png?h="+a+"&m="+b:"favicon_ok.png"}
|
|
|
+function N(){var a=M.length,b="";if(T)b="!"+J.ua+" - ",document.getElementById("linkFavicon").href="favicon_err.png";else if(a)b="(!"+a+") - ",Ma(a,a);else{var a=0,c;for(c in E.a.m){var d=E.a.m[c];d.a>d.b&&a++}a&&(b="("+a+") - ");Ma(0,a)}E.a.s&&(b+=E.a.s.name);document.title=b}
|
|
|
+function Na(){if("Notification"in window)if("granted"===Notification.permission){var a=Date.now();if(xa+3E4<a){var b=new Notification(J.va);xa=a;setTimeout(function(){b.close()},5E3)}}else"denied"!==Notification.permission&&Notification.requestPermission()}
|
|
|
+function Ia(){var a=document.createDocumentFragment(),b=H.id,c=null,d=0,e=null,g;wa=[];E.b[b]&&E.b[b].a.forEach(function(b){if(b.f)b.L();else{var f=b.K(),h=!1;c&&c.D===b.D&&b.D?30>Math.abs(d-b.o)&&!(b instanceof y)?e.classList.add("slackmsg-same-ts"):d=b.o:(d=b.o,h=!0);(!c||c.o<=H.b)&&b.o>H.b?f.classList.add("slackmsg-first-unread"):f.classList.remove("slackmsg-first-unread");if(b instanceof y)e=c=null,d=0,a.appendChild(f),g=null;else{if(h||!g){var h=E.a.a[b.D],n=b.username,k=document.createElement("div"),
|
|
|
+r=document.createElement("div"),q=document.createElement("span");k.N=document.createElement("img");k.N.className="slackmsg-author-img";q.className="slackmsg-author-name";h?(q.textContent=h.name,k.N.src=h.b.small):(q.textContent=n||"?",k.N.src="");r.appendChild(k.N);r.appendChild(q);r.className="slackmsg-author";k.className="slackmsg-authorGroup";k.appendChild(r);k.content=document.createElement("div");k.content.className="slackmsg-author-messages";k.appendChild(k.content);g=k;wa.push(g);a.appendChild(g)}c=
|
|
|
+b;e=f;g.content.appendChild(f)}}});b=document.getElementById("chatWindow");b.textContent="";b.appendChild(a);b.scrollTop=b.scrollHeight-b.clientHeight;window.hasFocus&&Ja()}
|
|
|
+function Oa(a){function b(a,b){for(b=b||a.target;b!==a.currentTarget&&b;){if(b.classList.contains("slackmsg-item"))return b.id;b=b.parentElement}}for(var c,d,e=a.target;e!==a.currentTarget&&e&&!e.classList.contains("slackmsg-hover");){if(e.parentElement&&e.classList.contains("slackmsg-attachment-actions-item")){d=b(a,e);var g=e.dataset.attachmentIndex,f=e.dataset.actionIndex;d&&void 0!==g&&void 0!==f&&(d=parseFloat(d.split("_")[1]),(c=fa(d))&&c.u[g]&&c.u[g].actions&&c.u[g].actions[f]&&Pa(c,c.u[g],
|
|
|
+c.u[g].actions[f]))}else if(e.parentElement&&e.parentElement.classList.contains("slackmsg-hover")){if(d=b(a,e))d=parseFloat(d.split("_")[1]),(c=fa(d))&&e.classList.contains("slackmsg-hover-reply")?(R&&(R=null,S()),P!==c&&(P=c,Q())):c&&e.classList.contains("slackmsg-hover-reaction")?Qa.T(document.body,function(a){a&&Ka(H.id,c.id,a)}):c&&e.classList.contains("slackmsg-hover-edit")?(P&&(P=null,Q()),R!==c&&(R=c,S())):c&&e.classList.contains("slackmsg-hover-remove")&&(P&&(P=null,Q()),R&&(R=null,S()),Ra(c));
|
|
|
+break}e=e.parentElement}}function Pa(a,b,c){function d(){var d=JSON.stringify({actions:[c],attachment_id:b.id,callback_id:b.callback_id,channel_id:e,is_ephemeral:a instanceof A,message_ts:a.id}),f=a.D,l=new FormData,h=new XMLHttpRequest;l.append("payload",d);l.append("service_id",f);h.open("POST","api/attachmentAction");h.send(l)}var e=H.id;c.confirm?va(ua(new ia(c.confirm.title,c.confirm.text),c.confirm.ok_text,c.confirm.dismiss_text),d).T():d()}
|
|
|
+function O(){document.getElementById("msgInput").focus()}function Ba(){var a=document.location.hash.substr(1),b=E.a.m[a];b&&b!==H?Sa(b):(a=E.a.a[a])&&a.s&&Sa(a.s)}function Ta(){var a=document.getElementById("chatWindow").getBoundingClientRect().top;wa.forEach(function(b){var c=b.N,d=c.clientHeight;b=b.getBoundingClientRect();c.style.top=Math.max(0,Math.min(a-b.top,b.height-d-d/2))+"px"})}
|
|
|
document.addEventListener("DOMContentLoaded",function(){ha();document.getElementById("chatWindow").addEventListener("click",Oa);window.addEventListener("hashchange",function(){document.location.hash&&"#"===document.location.hash[0]&&Ba()});document.getElementById("fileUploadCancel").addEventListener("click",function(a){a.preventDefault();document.getElementById("fileUploadError").classList.add("hidden");document.getElementById("fileUploadContainer").classList.add("hidden");document.getElementById("fileUploadInput").value=
|
|
|
"";return!1});document.getElementById("fileUploadForm").addEventListener("submit",function(a){a.preventDefault();a=document.getElementById("fileUploadInput");var b=a.value;b&&(b=b.substr(b.lastIndexOf("\\")+1),Ua(b,a.files[0],function(a){var b=document.getElementById("fileUploadError");a?(b.textContent=a,b.classList.remove("hidden")):(b.classList.add("hidden"),document.getElementById("fileUploadInput").value="",document.getElementById("fileUploadContainer").classList.add("hidden"))}));return!1});
|
|
|
-document.getElementById("attachFile").addEventListener("click",function(a){a.preventDefault();G&&document.getElementById("fileUploadContainer").classList.remove("hidden");return!1});document.getElementById("msgForm").addEventListener("submit",function(a){a.preventDefault();a=document.getElementById("msgInput");G&&a.value&&Va(a.value)&&(a.value="",P&&(P=null,Q()),R&&(R=null,Q()),document.getElementById("slashList").textContent="");O();return!1});window.addEventListener("blur",function(){window.hasFocus=
|
|
|
-!1});window.addEventListener("focus",function(){window.hasFocus=!0;xa=0;G&&Ja();O()});document.getElementById("chatWindow").addEventListener("scroll",Ta);var a=0;document.getElementById("msgInput").addEventListener("input",function(){if(G){var b=Date.now();a+3E3<b&&(D.a.b.c||G instanceof w)&&(Wa(),a=b);var b=[],c=this.value;if("/"===this.value[0]){var d=c.indexOf(" "),e=-1!==d,d=-1===d?c.length:d,c=c.substr(0,d);for(g in D.a.i.data){var f=D.a.i.data[g];(!e&&f.name.substr(0,d)===c||e&&f.name===c)&&
|
|
|
-b.push(f)}}b.sort(function(a,b){return a.N.localeCompare(b.N)||a.name.localeCompare(b.name)});var d=document.getElementById("slashList"),e=document.createDocumentFragment();d.textContent="";var g=0;for(c=b.length;g<c;g++){f=b[g];if(k!==f.N){var k=f.N;e.appendChild(Xa(f.N))}e.appendChild(Ya(f))}d.appendChild(e)}});window.hasFocus=!0;(function(){var a=document.getElementById("emojiButton");if("makeEmoji"in window){var c=window.makeEmoji("smile");c?a.innerHTML="<span class='emoji-small'>"+c.outerHTML+
|
|
|
-"</span>":a.style.backgroundImage='url("smile.svg")';(c=window.makeEmoji("paperclip"))?document.getElementById("attachFile").innerHTML="<span class='emoji-small'>"+c.outerHTML+"</span>":document.getElementById("attachFile").style.backgroundImage='url("public/paperclip.svg")';a.addEventListener("click",function(){Qa.R(document.body,function(a){a&&(document.getElementById("msgInput").value+=":"+a+":");O()})})}else a.classList.add("hidden")})();Za()});function za(){var a=document.createElement("span"),b=document.createElement("span"),c=document.createElement("span"),d=document.createElement("span");a.className="typing-container";b.className="typing-dot1";c.className="typing-dot2";d.className="typing-dot3";b.textContent=c.textContent=d.textContent=".";a.appendChild(b);a.appendChild(c);a.appendChild(d);return a}var Aa=function(){var a={};return function(b){var c=a[b];c||(c=a[b]=document.createElement("header"),c.textContent=b);return c}}();
|
|
|
-function $a(a){var b=a.b,c=document.createElement("div"),d=document.createElement("div"),e=document.createElement("ul"),f=document.createElement("li");c.u=document.createElement("ul");c.A=document.createElement("ul");c.s=document.createElement("div");c.W=document.createElement("div");c.T=document.createElement("span");c.id=b+"_"+a.id;c.className="slackmsg-item";c.s.className="slackmsg-ts";c.W.className="slackmsg-msg";c.T.className="slackmsg-author-name";e.className="slackmsg-hover";f.className="slackmsg-hover-reply";
|
|
|
-e.appendChild(f);if("makeEmoji"in window){var g=document.createElement("li"),k=window.makeEmoji("arrow_heading_down"),l=window.makeEmoji("smile"),n=window.makeEmoji("pencil2"),b=window.makeEmoji("x");g.className="slackmsg-hover-reaction";l?(g.classList.add("emoji-small"),g.appendChild(l)):g.style.backgroundImage='url("smile.svg")';k?(f.classList.add("emoji-small"),f.appendChild(k)):f.style.backgroundImage='url("repl.svg")';e.appendChild(g);a.C===D.a.b.id&&(a=document.createElement("li"),a.className=
|
|
|
-"slackmsg-hover-edit",n?a.classList.add("emoji-small"):a.style.backgroundImage='url("edit.svg")',a.appendChild(n),e.appendChild(a),a=document.createElement("li"),a.className="slackmsg-hover-remove",b?a.classList.add("emoji-small"):a.style.backgroundImage='url("remove.svg")',a.appendChild(b),e.appendChild(a))}else f.style.backgroundImage='url("repl.svg")',a.C===D.a.b.id&&(a=document.createElement("li"),a.className="slackmsg-hover-edit",a.style.backgroundImage='url("edit.svg")',e.appendChild(a),a=document.createElement("li"),
|
|
|
-a.className="slackmsg-hover-remove",a.style.backgroundImage='url("remove.svg")',e.appendChild(a));d.appendChild(c.T);d.appendChild(c.W);d.appendChild(c.s);d.appendChild(c.u);b=document.createElement("div");b.innerHTML=I.O;b.className="slackmsg-edited";d.appendChild(b);d.appendChild(c.A);d.className="slackmsg-content";c.u.className="slackmsg-attachments";c.A.className="slackmsg-reactions";c.appendChild(d);c.appendChild(e);return c}
|
|
|
+document.getElementById("attachFile").addEventListener("click",function(a){a.preventDefault();H&&document.getElementById("fileUploadContainer").classList.remove("hidden");return!1});document.getElementById("msgForm").addEventListener("submit",function(a){a.preventDefault();a=document.getElementById("msgInput");H&&a.value&&Va(a.value)&&(a.value="",P&&(P=null,Q()),R&&(R=null,Q()),document.getElementById("slashList").textContent="");O();return!1});window.addEventListener("blur",function(){window.hasFocus=
|
|
|
+!1});window.addEventListener("focus",function(){window.hasFocus=!0;xa=0;H&&Ja();O()});document.getElementById("chatWindow").addEventListener("scroll",Ta);var a=0;document.getElementById("msgInput").addEventListener("input",function(){if(H){var b=Date.now();a+3E3<b&&(E.a.b.f||H instanceof w)&&(Wa(),a=b);var b=[],c=this.value;if("/"===this.value[0]){var d=c.indexOf(" "),e=-1!==d,d=-1===d?c.length:d,c=c.substr(0,d);for(f in E.a.j.data){var g=E.a.j.data[f];(!e&&g.name.substr(0,d)===c||e&&g.name===c)&&
|
|
|
+b.push(g)}}b.sort(function(a,b){return a.O.localeCompare(b.O)||a.name.localeCompare(b.name)});var d=document.getElementById("slashList"),e=document.createDocumentFragment();d.textContent="";var f=0;for(c=b.length;f<c;f++){g=b[f];if(l!==g.O){var l=g.O;e.appendChild(Xa(g.O))}e.appendChild(Ya(g))}d.appendChild(e)}});window.hasFocus=!0;(function(){var a=document.getElementById("emojiButton");if("makeEmoji"in window){var c=window.makeEmoji("smile");c?a.innerHTML="<span class='emoji-small'>"+c.outerHTML+
|
|
|
+"</span>":a.style.backgroundImage='url("smile.svg")';(c=window.makeEmoji("paperclip"))?document.getElementById("attachFile").innerHTML="<span class='emoji-small'>"+c.outerHTML+"</span>":document.getElementById("attachFile").style.backgroundImage='url("public/paperclip.svg")';a.addEventListener("click",function(){Qa.T(document.body,function(a){a&&(document.getElementById("msgInput").value+=":"+a+":");O()})})}else a.classList.add("hidden")})();Za()});function za(){var a=document.createElement("span"),b=document.createElement("span"),c=document.createElement("span"),d=document.createElement("span");a.className="typing-container";b.className="typing-dot1";c.className="typing-dot2";d.className="typing-dot3";b.textContent=c.textContent=d.textContent=".";a.appendChild(b);a.appendChild(c);a.appendChild(d);return a}var Aa=function(){var a={};return function(b){var c=a[b];c||(c=a[b]=document.createElement("header"),c.textContent=b);return c}}();
|
|
|
+function $a(a){var b=a.b,c=document.createElement("div"),d=document.createElement("div"),e=document.createElement("ul"),g=document.createElement("li");c.u=document.createElement("ul");c.A=document.createElement("ul");c.o=document.createElement("div");c.da=document.createElement("div");c.X=document.createElement("span");c.id=b+"_"+a.id;c.className="slackmsg-item";c.o.className="slackmsg-ts";c.da.className="slackmsg-msg";c.X.className="slackmsg-author-name";e.className="slackmsg-hover";g.className=
|
|
|
+"slackmsg-hover-reply";e.appendChild(g);if("makeEmoji"in window){var f=document.createElement("li"),l=window.makeEmoji("arrow_heading_down"),h=window.makeEmoji("smile"),n=window.makeEmoji("pencil2"),b=window.makeEmoji("x");f.className="slackmsg-hover-reaction";h?(f.classList.add("emoji-small"),f.appendChild(h)):f.style.backgroundImage='url("smile.svg")';l?(g.classList.add("emoji-small"),g.appendChild(l)):g.style.backgroundImage='url("repl.svg")';e.appendChild(f);a.D===E.a.b.id&&(a=document.createElement("li"),
|
|
|
+a.className="slackmsg-hover-edit",n?a.classList.add("emoji-small"):a.style.backgroundImage='url("edit.svg")',a.appendChild(n),e.appendChild(a),a=document.createElement("li"),a.className="slackmsg-hover-remove",b?a.classList.add("emoji-small"):a.style.backgroundImage='url("remove.svg")',a.appendChild(b),e.appendChild(a))}else g.style.backgroundImage='url("repl.svg")',a.D===E.a.b.id&&(a=document.createElement("li"),a.className="slackmsg-hover-edit",a.style.backgroundImage='url("edit.svg")',e.appendChild(a),
|
|
|
+a=document.createElement("li"),a.className="slackmsg-hover-remove",a.style.backgroundImage='url("remove.svg")',e.appendChild(a));d.appendChild(c.X);d.appendChild(c.da);d.appendChild(c.o);d.appendChild(c.u);b=document.createElement("div");b.innerHTML=J.P;b.className="slackmsg-edited";d.appendChild(b);d.appendChild(c.A);d.className="slackmsg-content";c.u.className="slackmsg-attachments";c.A.className="slackmsg-reactions";c.appendChild(d);c.appendChild(e);return c}
|
|
|
function ab(a){var b={good:"#2fa44f",warning:"#de9e31",danger:"#d50200"};if(a){if("#"===a[0])return a;if(b[a])return b[a]}return"#e3e4e6"}
|
|
|
-function bb(a,b){var c=document.createElement("li"),d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("a"),g=document.createElement("div"),k=document.createElement("img"),l=document.createElement("a"),n=document.createElement("div"),h=document.createElement("div"),r=document.createElement("div"),q=document.createElement("img"),u=document.createElement("div");c.className="slackmsg-attachment";d.style.borderColor=ab(a.color||"");d.className="slackmsg-attachment-block";
|
|
|
-e.className="slackmsg-attachment-pretext";a.pretext?e.innerHTML=J(a.pretext):e.classList.add("hidden");f.target="_blank";a.title?(f.innerHTML=J(a.title),a.title_link&&(f.href=a.title_link),f.className="slackmsg-attachment-title"):f.className="hidden slackmsg-attachment-title";l.target="_blank";g.className="slackmsg-author";a.author_name&&(l.innerHTML=J(a.author_name),l.href=a.author_link||"",l.className="slackmsg-author-name",k.className="slackmsg-author-img",a.author_icon&&(k.src=a.author_icon,g.appendChild(k)),
|
|
|
-g.appendChild(l));r.className="slackmsg-attachment-thumb";a.thumb_url?(k=document.createElement("img"),k.src=a.thumb_url,r.appendChild(k),d.classList.add("has-thumb"),a.video_html&&(r.dataset.video=a.video_html)):r.classList.add("hidden");n.className="slackmsg-attachment-content";k=J(a.text||"");h.className="slackmsg-attachment-text";k&&""!=k?h.innerHTML=k:h.classList.add("hidden");q.className="slackmsg-attachment-img";a.image_url?q.src=a.image_url:q.classList.add("hidden");u.className="slackmsg-attachment-footer";
|
|
|
-a.footer&&(k=document.createElement("span"),k.className="slackmsg-attachment-footer-text",k.innerHTML=J(a.footer),a.footer_icon&&(l=document.createElement("img"),l.src=a.footer_icon,l.className="slackmsg-attachment-footer-icon",u.appendChild(l)),u.appendChild(k));a.ts&&(k=document.createElement("span"),k.className="slackmsg-ts",k.innerHTML=I.V(a.ts),u.appendChild(k));n.appendChild(r);n.appendChild(h);d.appendChild(f);d.appendChild(g);d.appendChild(n);d.appendChild(q);if(a.fields&&a.fields.length){var v=
|
|
|
-document.createElement("ul");d.appendChild(v);v.className="slackmsg-attachment-fields";a.fields.forEach(function(a){var b=a.title||"",c=a.value||"";a=!!a["short"];var d=document.createElement("li"),e=document.createElement("div"),f=document.createElement("div");d.className="field";a||d.classList.add("field-long");e.className="field-title";e.textContent=b;f.className="field-text";f.innerHTML=J(c);d.appendChild(e);d.appendChild(f);d&&v.appendChild(d)})}if(a.actions&&a.actions.length)for(f=document.createElement("ul"),
|
|
|
-f.className="slackmsg-attachment-actions "+qa,d.appendChild(f),g=0,n=a.actions.length;g<n;g++)(h=a.actions[g])&&(h=cb(b,g,h))&&f.appendChild(h);d.appendChild(u);c.appendChild(e);c.appendChild(d);return c}function cb(a,b,c){var d=document.createElement("li"),e=ab(c.style);d.textContent=c.text;e!==ab()&&(d.style.color=e);d.style.borderColor=e;d.dataset.attachmentIndex=a;d.dataset.actionIndex=b;d.className="slackmsg-attachment-actions-item "+pa;return d}
|
|
|
+function bb(a,b){var c=document.createElement("li"),d=document.createElement("div"),e=document.createElement("div"),g=document.createElement("a"),f=document.createElement("div"),l=document.createElement("img"),h=document.createElement("a"),n=document.createElement("div"),k=document.createElement("div"),r=document.createElement("div"),q=document.createElement("img"),u=document.createElement("div");c.className="slackmsg-attachment";d.style.borderColor=ab(a.color||"");d.className="slackmsg-attachment-block";
|
|
|
+e.className="slackmsg-attachment-pretext";a.pretext?e.innerHTML=K(a.pretext):e.classList.add("hidden");g.target="_blank";a.title?(g.innerHTML=K(a.title),a.title_link&&(g.href=a.title_link),g.className="slackmsg-attachment-title"):g.className="hidden slackmsg-attachment-title";h.target="_blank";f.className="slackmsg-author";a.author_name&&(h.innerHTML=K(a.author_name),h.href=a.author_link||"",h.className="slackmsg-author-name",l.className="slackmsg-author-img",a.author_icon&&(l.src=a.author_icon,f.appendChild(l)),
|
|
|
+f.appendChild(h));r.className="slackmsg-attachment-thumb";a.thumb_url?(l=document.createElement("img"),l.src=a.thumb_url,r.appendChild(l),d.classList.add("has-thumb"),a.video_html&&(r.dataset.video=a.video_html)):r.classList.add("hidden");n.className="slackmsg-attachment-content";l=K(a.text||"");k.className="slackmsg-attachment-text";l&&""!=l?k.innerHTML=l:k.classList.add("hidden");q.className="slackmsg-attachment-img";a.image_url?q.src=a.image_url:q.classList.add("hidden");u.className="slackmsg-attachment-footer";
|
|
|
+a.footer&&(l=document.createElement("span"),l.className="slackmsg-attachment-footer-text",l.innerHTML=K(a.footer),a.footer_icon&&(h=document.createElement("img"),h.src=a.footer_icon,h.className="slackmsg-attachment-footer-icon",u.appendChild(h)),u.appendChild(l));a.ts&&(l=document.createElement("span"),l.className="slackmsg-ts",l.innerHTML=J.Y(a.ts),u.appendChild(l));n.appendChild(r);n.appendChild(k);d.appendChild(g);d.appendChild(f);d.appendChild(n);d.appendChild(q);if(a.fields&&a.fields.length){var v=
|
|
|
+document.createElement("ul");d.appendChild(v);v.className="slackmsg-attachment-fields";a.fields.forEach(function(a){var b=a.title||"",c=a.value||"";a=!!a["short"];var d=document.createElement("li"),e=document.createElement("div"),g=document.createElement("div");d.className="field";a||d.classList.add("field-long");e.className="field-title";e.textContent=b;g.className="field-text";g.innerHTML=K(c);d.appendChild(e);d.appendChild(g);d&&v.appendChild(d)})}if(a.actions&&a.actions.length)for(g=document.createElement("ul"),
|
|
|
+g.className="slackmsg-attachment-actions "+qa,d.appendChild(g),f=0,n=a.actions.length;f<n;f++)(k=a.actions[f])&&(k=cb(b,f,k))&&g.appendChild(k);d.appendChild(u);c.appendChild(e);c.appendChild(d);return c}function cb(a,b,c){var d=document.createElement("li"),e=ab(c.style);d.textContent=c.text;e!==ab()&&(d.style.color=e);d.style.borderColor=e;d.dataset.attachmentIndex=a;d.dataset.actionIndex=b;d.className="slackmsg-attachment-actions-item "+pa;return d}
|
|
|
function Fa(a){var b=document.createElement("li"),c=document.createElement("span");c.textContent=a.name;b.appendChild(za());b.appendChild(c);return b}function Xa(a){var b=document.createElement("lh");b.textContent=a;b.className="slack-command-header";return b}
|
|
|
-function Ya(a){var b=document.createElement("li"),c=document.createElement("span"),d=document.createElement("span"),e=document.createElement("span");c.textContent=a.name;d.textContent=a.usage;e.textContent=a.a;b.appendChild(c);b.appendChild(d);b.appendChild(e);b.className="slack-command-item";c.className="slack-command-name";d.className="slack-command-usage";e.className="slack-command-desc";return b};var Qa=function(){function a(a,b){for(a=a.target;a!==l&&a&&"LI"!==a.nodeName;)a=a.parentElement;a&&"LI"===a.nodeName&&a.id&&"emojibar-"===a.id.substr(0,9)?b(a.id.substr(9)):b(null)}function b(){if(!c())return!1;E&&E(null);return!0}function c(){return l.parentElement?(l.parentElement.removeChild(n),l.parentElement.removeChild(l),!0):!1}function d(a){var b=0;a=void 0===a?u.value:a;if(k()){var c=window.searchEmojis(a);var d=e(c);for(var g in v)v[g].visible&&(v[g].visible=!1,r.removeChild(v[g].f));g=
|
|
|
-0;for(var l=d.length;g<l;g++){var h=d[g].name;var z=v[h];if(!z){z=v;var L=h,E=h;h=window.makeEmoji(c[h]);var n=document.createElement("span");n.appendChild(h);n.className="emoji-medium";h=f(E,n);z=z[L]=h}z.visible||(z.visible=!0,r.appendChild(z.f));b++}}for(g in B)B[g].visible&&(B[g].visible=!1,q.removeChild(B[g].f));d=e(D.a.l.data);g=0;for(l=d.length;g<l;g++)h=d[g].name,""!==a&&h.substr(0,a.length)!==a||"alias:"===D.a.l.data[h].substr(0,6)||(z=B[h],z||(c=B,L=z=h,h=D.a.l.data[h],E=document.createElement("span"),
|
|
|
-n=document.createElement("span"),E.className="emoji emoji-custom",E.style.backgroundImage='url("'+h+'")',n.appendChild(E),n.className="emoji-medium",h=f(L,n),z=c[z]=h),z.visible||(z.visible=!0,q.appendChild(z.f)),b++);return b}function e(a){var b=D.a.b.a.b,c=[],d;for(d in a){var e={name:d,la:0,count:0};a[d].names&&a[d].names.forEach(function(a){e.count+=b[a]||0});c.push(e)}return c=c.sort(function(a,b){var c=b.count-a.count;return c?c:a.la-b.la})}function f(a,b){var c=document.createElement("li");
|
|
|
-c.appendChild(b);c.className="emojibar-list-item";c.id="emojibar-"+a;return{visible:!1,f:c}}function g(a){var b=document.createElement("img"),c=document.createElement("div");b.src=a;c.appendChild(b);c.className="emojibar-header";return c}function k(){return"searchEmojis"in window}var l=document.createElement("div"),n=document.createElement("div"),h=document.createElement("div"),r=document.createElement("ul"),q=document.createElement("ul"),u=document.createElement("input"),v={},B={},F=document.createElement("div"),
|
|
|
-L=document.createElement("span"),V=document.createElement("span"),E;n.addEventListener("click",function(a){var c=l.getBoundingClientRect();(a.screenY<c.top||a.screenY>c.bottom||a.screenX<c.left||a.screenX>c.right)&&b()});n.className="emojibar-overlay";l.className="emojibar";h.className="emojibar-emojis";F.className="emojibar-detail";L.className="emojibar-detail-img";V.className="emojibar-detail-name";r.className=q.className="emojibar-list";u.className="emojibar-search";F.appendChild(L);F.appendChild(V);
|
|
|
-h.appendChild(g(window.emojiProviderHeader));h.appendChild(r);h.appendChild(g("emojicustom.png"));h.appendChild(q);l.appendChild(h);l.appendChild(F);l.appendChild(u);u.addEventListener("keyup",function(){d()});l.addEventListener("mousemove",function(b){a(b,function(a){var b=a?v[a]||B[a]:null;b?(L.innerHTML=b.f.outerHTML,V.textContent=":"+a+":"):(L.textContent="",V.textContent="")})});l.addEventListener("click",function(b){a(b,function(a){a&&c()&&E&&E(a)})});return{isSupported:k,R:function(a,b){return k()?
|
|
|
-(E=b,a.appendChild(n),a.appendChild(l),u.value="",d(),u.focus(),!0):!1},search:d,close:b}}();var D,M=[];function db(){this.c=0;this.a=new ca;this.b={}}
|
|
|
-db.prototype.update=function(a){var b=Date.now();a.v&&(this.c=a.v);if(a["static"]){var c=this.a,d=a["static"],e=Date.now();if(d.users)for(var f=0,g=d.users.length;f<g;f++){var k=c.a[d.users[f].id];k||(k=c.a[d.users[f].id]=new ga(d.users[f].id));k.update(d.users[f],e)}if(d.channels)for(f=0,g=d.channels.length;f<g;f++){k=c.m[d.channels[f].id];if(!k){var k=c.m,l=d.channels[f].id;var n=d.channels[f];n=n.pv?new w(n.id,c.a[n.user]):new t(n.id);k=k[l]=n}k.update(d.channels[f],c,e)}d.emojis&&(c.l.data=d.emojis,
|
|
|
-c.l.version=e);if(void 0!==d.commands){c.i.data={};for(f in d.commands)c.i.data[f]=new aa(d.commands[f]);c.i.version=e}d.team&&(c.o||(c.o=new p(d.team.id)),c.o.update(d.team,e));c.w=Math.max(c.w,e);d.self&&(c.b=c.a[d.self.id]||null,c.b?(c.b.a||(c.b.a=new ba),c.b.a.update(d.self.prefs,e)):c.w=0);if(void 0!==d.typing)for(f in c.c={},d.typing){c.c[f]={};for(var h in d.typing[f])c.c[f][h]=e}}for(var r in this.a.m){var q=this.a.m[r];q.a===q.b&&(c=M.indexOf(q),-1!==c&&M.splice(c,1))}if(a.live){for(q in a.live)(r=
|
|
|
-this.b[q])?da(r,a.live[q],b):this.b[q]=new U(q,250,a.live[q],b);for(var u in a.live)(q=this.a.m[u])?(this.b[u].a.length&&(b=this.b[u],q.a=Math.max(q.a,b.a[b.a.length-1].s)),q.l||(eb(q,a.live[u]),G&&a.live[G.id]&&Ia())):D.c=0}a["static"]&&(ya(),a["static"].typing&&Da())};setInterval(function(){var a=D.a,b=Date.now(),c=!1,d;for(d in a.c){var e=!0,f;for(f in a.c[d])a.c[d][f]+3E3<b?(delete a.c[d][f],c=!0):e=!1;e&&(delete a.c[d],c=!0)}c&&Da()},1E3);
|
|
|
-function eb(a,b){if(a!==G||!window.hasFocus){var c=new RegExp("<@"+D.a.b.id),d=!1,e=!1,f=!1;b.forEach(function(b){if(!(parseFloat(b.ts)<=a.b)){e=!0;var g;if(!(g=a instanceof w)&&(g=b.text)&&!(g=b.text.match(c)))a:{g=D.a.b.a.a;for(var l=0,n=g.length;l<n;l++)if(-1!==b.text.indexOf(g[l])){g=!0;break a}g=!1}g&&(-1===M.indexOf(a)&&(f=!0,M.push(a)),d=!0)}});if(e){N();if(b=document.getElementById("room_"+a.id))b.classList.add("unread"),d&&b.classList.add("unreadHi");f&&!window.hasFocus&&Na()}}}
|
|
|
-function Ja(){var a=G,b=M.indexOf(a);if(a.a>a.b){var c=new XMLHttpRequest;c.open("POST","api/markread?room="+a.id+"&ts="+a.a,!0);c.send(null);a.b=a.a}0<=b&&(M.splice(b,1),N());a=document.getElementById("room_"+a.id);a.classList.remove("unread");a.classList.remove("unreadHi")}D=new db;var Ca=function(){function a(a,b){b.sort(function(){return Math.random()-.5});for(var c=0,d=20;d<l-40;d+=h)for(var e=0;e+h<=n;e+=h)f(a,b[c],d,e),c++,c===b.length&&(b.sort(function(a,b){return a.P?b.P?Math.random()-.5:-1:1}),c=0)}function b(a,d){for(var e=0,f=a.length;e<f;e++)if(void 0===a[e].P){c(a[e].src,function(c){a[e].P=c;b(a,d)});return}var g=[];a.forEach(function(a){a.P&&g.push(a.P)});d(g)}function c(a,b){var c=new XMLHttpRequest;c.responseType="blob";c.onreadystatechange=function(){if(4===
|
|
|
+function Ya(a){var b=document.createElement("li"),c=document.createElement("span"),d=document.createElement("span"),e=document.createElement("span");c.textContent=a.name;d.textContent=a.usage;e.textContent=a.a;b.appendChild(c);b.appendChild(d);b.appendChild(e);b.className="slack-command-item";c.className="slack-command-name";d.className="slack-command-usage";e.className="slack-command-desc";return b};var Qa=function(){function a(a,b){for(a=a.target;a!==h&&a&&"LI"!==a.nodeName;)a=a.parentElement;a&&"LI"===a.nodeName&&a.id&&"emojibar-"===a.id.substr(0,9)?b(a.id.substr(9)):b(null)}function b(){if(!c())return!1;C&&C(null);return!0}function c(){return h.parentElement?(h.parentElement.removeChild(n),h.parentElement.removeChild(h),!0):!1}function d(a){var b=0;a=void 0===a?u.value:a;if(l()){var c=window.searchEmojis(a);var d=e(c);for(var f in v)v[f].visible&&(v[f].visible=!1,r.removeChild(v[f].c));f=
|
|
|
+0;for(var k=d.length;f<k;f++){var h=d[f].name;var z=v[h];if(!z){z=v;var n=h,G=h;h=window.makeEmoji(c[h]);var C=document.createElement("span");C.appendChild(h);C.className="emoji-medium";h=g(G,C);z=z[n]=h}z.visible||(z.visible=!0,r.appendChild(z.c));b++}}for(f in B)B[f].visible&&(B[f].visible=!1,q.removeChild(B[f].c));d=e(E.a.l.data);f=0;for(k=d.length;f<k;f++)h=d[f].name,""!==a&&h.substr(0,a.length)!==a||"alias:"===E.a.l.data[h].substr(0,6)||(z=B[h],z||(c=B,n=z=h,h=E.a.l.data[h],G=document.createElement("span"),
|
|
|
+C=document.createElement("span"),G.className="emoji emoji-custom",G.style.backgroundImage='url("'+h+'")',C.appendChild(G),C.className="emoji-medium",h=g(n,C),z=c[z]=h),z.visible||(z.visible=!0,q.appendChild(z.c)),b++);return b}function e(a){var b=E.a.b.a.a,c=[],d;for(d in a){var e={name:d,xa:0,count:0};a[d].names&&a[d].names.forEach(function(a){e.count+=b[a]||0});c.push(e)}return c=c.sort(function(a,b){var c=b.count-a.count;return c?c:a.xa-b.xa})}function g(a,b){var c=document.createElement("li");
|
|
|
+c.appendChild(b);c.className="emojibar-list-item";c.id="emojibar-"+a;return{visible:!1,c:c}}function f(a){var b=document.createElement("img"),c=document.createElement("div");b.src=a;c.appendChild(b);c.className="emojibar-header";return c}function l(){return"searchEmojis"in window}var h=document.createElement("div"),n=document.createElement("div"),k=document.createElement("div"),r=document.createElement("ul"),q=document.createElement("ul"),u=document.createElement("input"),v={},B={},F=document.createElement("div"),
|
|
|
+G=document.createElement("span"),V=document.createElement("span"),C;n.addEventListener("click",function(a){var c=h.getBoundingClientRect();(a.screenY<c.top||a.screenY>c.bottom||a.screenX<c.left||a.screenX>c.right)&&b()});n.className="emojibar-overlay";h.className="emojibar";k.className="emojibar-emojis";F.className="emojibar-detail";G.className="emojibar-detail-img";V.className="emojibar-detail-name";r.className=q.className="emojibar-list";u.className="emojibar-search";F.appendChild(G);F.appendChild(V);
|
|
|
+k.appendChild(f(window.emojiProviderHeader));k.appendChild(r);k.appendChild(f("emojicustom.png"));k.appendChild(q);h.appendChild(k);h.appendChild(F);h.appendChild(u);u.addEventListener("keyup",function(){d()});h.addEventListener("mousemove",function(b){a(b,function(a){var b=a?v[a]||B[a]:null;b?(G.innerHTML=b.c.outerHTML,V.textContent=":"+a+":"):(G.textContent="",V.textContent="")})});h.addEventListener("click",function(b){a(b,function(a){a&&c()&&C&&C(a)})});return{isSupported:l,T:function(a,b){return l()?
|
|
|
+(C=b,a.appendChild(n),a.appendChild(h),u.value="",d(),u.focus(),!0):!1},search:d,close:b}}();var E,M=[];function db(){this.f=0;this.a=new ca;this.b={}}
|
|
|
+db.prototype.update=function(a){var b=Date.now();a.v&&(this.f=a.v);if(a["static"]){var c=this.a,d=a["static"],e=Date.now();if(d.users)for(var g=0,f=d.users.length;g<f;g++){var l=c.a[d.users[g].id];l||(l=c.a[d.users[g].id]=new ga(d.users[g].id));l.update(d.users[g],e)}if(d.channels)for(g=0,f=d.channels.length;g<f;g++){l=c.m[d.channels[g].id];if(!l){var l=c.m,h=d.channels[g].id;var n=d.channels[g];n=n.pv?new w(n.id,c.a[n.user]):new t(n.id);l=l[h]=n}l.update(d.channels[g],c,e)}d.emojis&&(c.l.data=d.emojis,
|
|
|
+c.l.version=e);if(void 0!==d.commands){c.j.data={};for(g in d.commands)c.j.data[g]=new aa(d.commands[g]);c.j.version=e}d.team&&(c.s||(c.s=new p(d.team.id)),c.s.update(d.team,e));c.w=Math.max(c.w,e);d.self&&(c.b=c.a[d.self.id]||null,c.b?(c.b.a||(c.b.a=new ba),c.b.a.update(d.self.prefs,e)):c.w=0);if(void 0!==d.typing)for(g in c.f={},d.typing){c.f[g]={};for(var k in d.typing[g])c.f[g][k]=e}}for(var r in this.a.m){var q=this.a.m[r];q.a===q.b&&(c=M.indexOf(q),-1!==c&&M.splice(c,1))}if(a.live){for(q in a.live)(r=
|
|
|
+this.b[q])?da(r,a.live[q],b):this.b[q]=new U(q,250,a.live[q],b);for(var u in a.live)(q=this.a.m[u])?(this.b[u].a.length&&(b=this.b[u],q.a=Math.max(q.a,b.a[b.a.length-1].o)),q.l||(eb(q,a.live[u]),H&&a.live[H.id]&&Ia())):E.f=0}a["static"]&&(ya(),a["static"].typing&&Da())};setInterval(function(){var a=E.a,b=Date.now(),c=!1,d;for(d in a.f){var e=!0,g;for(g in a.f[d])a.f[d][g]+3E3<b?(delete a.f[d][g],c=!0):e=!1;e&&(delete a.f[d],c=!0)}c&&Da()},1E3);
|
|
|
+function eb(a,b){if(a!==H||!window.hasFocus){var c=new RegExp("<@"+E.a.b.id),d=!1,e=!1,g=!1;b.forEach(function(b){if(!(parseFloat(b.ts)<=a.b)){e=!0;var f;if(!(f=a instanceof w)&&(f=b.text)&&!(f=b.text.match(c)))a:{f=E.a.b.a.B;for(var h=0,n=f.length;h<n;h++)if(-1!==b.text.indexOf(f[h])){f=!0;break a}f=!1}f&&(-1===M.indexOf(a)&&(g=!0,M.push(a)),d=!0)}});if(e){N();if(b=document.getElementById("room_"+a.id))b.classList.add("unread"),d&&b.classList.add("unreadHi");g&&!window.hasFocus&&Na()}}}
|
|
|
+function Ja(){var a=H,b=M.indexOf(a);if(a.a>a.b){var c=new XMLHttpRequest;c.open("POST","api/markread?room="+a.id+"&ts="+a.a,!0);c.send(null);a.b=a.a}0<=b&&(M.splice(b,1),N());a=document.getElementById("room_"+a.id);a.classList.remove("unread");a.classList.remove("unreadHi")}E=new db;var Ca=function(){function a(a,b){b.sort(function(){return Math.random()-.5});for(var c=0,d=20;d<h-40;d+=k)for(var e=0;e+k<=n;e+=k)g(a,b[c],d,e),c++,c===b.length&&(b.sort(function(a,b){return a.R?b.R?Math.random()-.5:-1:1}),c=0)}function b(a,d){for(var e=0,f=a.length;e<f;e++)if(void 0===a[e].R){c(a[e].src,function(c){a[e].R=c;b(a,d)});return}var g=[];a.forEach(function(a){a.R&&g.push(a.R)});d(g)}function c(a,b){var c=new XMLHttpRequest;c.responseType="blob";c.onreadystatechange=function(){if(4===
|
|
|
c.readyState)if(c.response){var a=new Image;a.onload=function(){var c=document.createElement("canvas");c.height=c.width=u;c=c.getContext("2d");c.drawImage(a,0,0,u,u);for(var c=c.getImageData(0,0,u,u),d=0,e=0;e<c.width*c.height*4;e+=4)c.data[e]=c.data[e+1]=c.data[e+2]=(c.data[e]+c.data[e+1]+c.data[e+2])/3,c.data[e+3]=50,d+=c.data[e];if(50>d/(c.height*c.width))for(e=0;e<c.width*c.height*4;e+=4)c.data[e]=c.data[e+1]=c.data[e+2]=255-c.data[e];b(c)};a.onerror=function(){b(null)};a.src=window.URL.createObjectURL(c.response)}else b(null)};
|
|
|
-c.open("GET",a,!0);c.send(null)}function d(){var a=k.createLinearGradient(0,0,0,n);a.addColorStop(0,"#4D394B");a.addColorStop(1,"#201820");k.fillStyle=a;k.fillRect(0,0,l,n);return k.getImageData(0,0,l,n)}function e(a,b){for(var c=(a.height-b.height)/2,d=0;d<b.height;d++)for(var e=0;e<b.width;e++){var f=b.data[4*(d*b.width+e)]/255,g=4*((d+c)*a.width+e+c);a.data[g]*=f;a.data[g+1]*=f;a.data[g+2]*=f}return a}function f(a,b,c,d){var f=Math.floor(d);a=[a.data[f*l*4+0],a.data[f*l*4+1],a.data[f*l*4+2]];k.fillStyle=
|
|
|
-"#"+(1.1*a[0]<<16|1.1*a[1]<<8|1.1*a[2]).toString(16);k.beginPath();k.moveTo(c+h/2,d+r);k.lineTo(c-r+h,d+h/2);k.lineTo(c+h/2,d-r+h);k.lineTo(c+r,d+h/2);k.closePath();k.fill();k.putImageData(e(k.getImageData(c+r,d+r,q,q),b),c+r,d+r)}var g=document.createElement("canvas"),k=g.getContext("2d"),l=g.width=250,n=g.height=290,h=(l-40)/3,r=.1*h,q=Math.floor(h-2*r),u=.5*q,v,B=[],F=!1;return function(c){if(v)c(v);else if(F)B.push(c);else{var e=d(),f=[];F=!0;B.push(c);for(var h in D.a.a)D.a.a[h].i||D.a.a[h].w||
|
|
|
-f.push({src:"api/avatar?user="+h});b(f,function(b){a(e,b);v=g.toDataURL();B.forEach(function(a){a(v)})})}}}();var T=0,G=null,P=null,R=null;function fb(a){var b=new XMLHttpRequest;b.timeout=6E4;b.onreadystatechange=function(){if(4===b.readyState)if(b.status){var c=null,d=2===Math.floor(b.status/100);if(d){T&&(T=0,Ga(!0));c=b.response;try{c=JSON.parse(c)}catch(e){c=null}}else T?(T+=Math.floor((T||5)/2),T=Math.min(60,T)):(T=5,Ga(!1));a(d,c)}else T&&(T=0,Ga(!0)),fb(a)};b.open("GET","api?v="+D.c,!0);b.send(null)}function Wa(){var a=new XMLHttpRequest;a.open("POST","api/typing?room="+G.id,!0);a.send(null)}
|
|
|
-function gb(a,b){a?(b&&D.update(b),Za()):setTimeout(Za,1E3*T)}function Za(){fb(gb)}function Sa(a){G&&document.getElementById("room_"+G.id).classList.remove("selected");document.getElementById("room_"+a.id).classList.add("selected");document.body.classList.remove("no-room-selected");G=a;Ha();G.a&&!D.b[G.id]&&(a=new XMLHttpRequest,a.open("GET","api/hist?room="+G.id,!0),a.send(null))}
|
|
|
-function Ua(a,b,c){var d=G;new FileReader;var e=new FormData,f=new XMLHttpRequest;e.append("file",b);e.append("filename",a);f.onreadystatechange=function(){4===f.readyState&&(204===f.status?c(null):c(f.statusText))};f.open("POST","api/file?room="+d.id);f.send(e)}
|
|
|
-function Va(a){if(R){var b=new XMLHttpRequest;b.open("PUT","api/msg?room="+G.id+"&ts="+R.id+"&text="+encodeURIComponent(a),!0);b.send(null);return!0}if("/"===a[0]){var c=a.indexOf(" "),b=-1===c?"":a.substr(c);return(a=D.a.i.data[a.substr(0,-1===c?void 0:c)])?(c=new XMLHttpRequest,c.open("POST","api/cmd?room="+G.id+"&cmd="+encodeURIComponent(a.name.substr(1))+"&args="+encodeURIComponent(b.trim()),!0),c.send(null),!0):!1}var b=G,c=P,d=new XMLHttpRequest;a="api/msg?room="+b.id+"&text="+encodeURIComponent(a);
|
|
|
-if(c){var e=D.a.a[c.C],f="Message";"C"===b.id[0]?f="Channel message":"D"===b.id[0]?f="Direct message":"G"===b.id[0]&&(f="Group message");a+="&attachments="+encodeURIComponent(JSON.stringify([{fallback:c.text,author_name:"<@"+e.id+"|"+e.name+">",author_icon:e.b.small,text:c.text,footer:f,ts:c.s}]))}d.open("POST",a,!0);d.send(null);return!0}function Ra(a){var b=new XMLHttpRequest;b.open("DELETE","api/msg?room="+G.id+"&ts="+a.id,!0);b.send(null)}
|
|
|
-function Ka(a,b,c){var d=new XMLHttpRequest;d.open("POST","api/reaction?room="+a+"&msg="+b+"&reaction="+encodeURIComponent(c),!0);d.send(null)};function U(a,b,c,d){C.call(this,a,b,c,d)}U.prototype=Object.create(C.prototype);U.prototype.constructor=U;U.prototype.b=function(a,b){return!0===a.isMeMessage?new W(this.id,a,b):!0===a.isNotice?new X(this.id,a,b):new Y(this.id,a,b)};
|
|
|
-var Z={B:function(a){a.F=!0;return a},K:function(a){a.f&&a.f.parentElement&&(a.f.remove(),delete a.f);return a},I:function(a){a.f?a.F&&(a.F=!1,a.G()):a.S().G();return a.f},G:function(a){var b=D.a.a[a.C];a.f.s.innerHTML=I.V(a.s);a.f.W.innerHTML=J(a.text);a.f.T.textContent=b?b.name:a.username||"?";for(var b=document.createDocumentFragment(),c=0,d=a.u.length;c<d;c++){var e=a.u[c];e&&(e=bb(e,c))&&b.appendChild(e)}a.f.u.textContent="";a.f.u.appendChild(b);b=a.b;c=document.createDocumentFragment();if(a.A)for(var f in a.A){var d=
|
|
|
-b,e=a.id,g=f,k=a.A[f];var l=La(g);"string"===typeof l&&"makeEmoji"in window&&(l=window.makeEmoji(l));if(l="string"===typeof l?null:l){for(var n=document.createElement("li"),h=document.createElement("a"),r=document.createElement("span"),q=document.createElement("span"),u=[],v=0,B=k.length;v<B;v++){var F=D.a.a[k[v]];F&&u.push(F.name)}u.sort();q.textContent=u.join(", ");r.appendChild(l);r.className="emoji-small";h.href="javascript:toggleReaction('"+d+"', '"+e+"', '"+g+"')";h.appendChild(r);h.appendChild(q);
|
|
|
-n.className="slackmsg-reaction-item";n.appendChild(h);d=n}else console.warn("Reaction id not found: "+g),d=null;d&&c.appendChild(d)}a.f.A.textContent="";a.f.A.appendChild(c);a.O&&a.f.classList.add("edited");return a},H:function(a){return a.f.cloneNode(!0)}};function W(a,b,c){x.call(this,b,c);this.b=a;this.f=Z.f;this.F=Z.F}W.prototype=Object.create(y.prototype);m=W.prototype;m.constructor=W;m.B=function(){return Z.B(this)};m.K=function(){return Z.K(this)};m.I=function(){return Z.I(this)};
|
|
|
-m.S=function(){this.f=$a(this);this.f.classList.add("slackmsg-me_message");return this};m.H=function(){return Z.H(this)};m.G=function(){Z.G(this);return this};m.update=function(a,b){y.prototype.update.call(this,a,b);this.B()};function Y(a,b,c){x.call(this,b,c);this.b=a;this.f=Z.f;this.F=Z.F}Y.prototype=Object.create(x.prototype);m=Y.prototype;m.constructor=Y;m.B=function(){return Z.B(this)};m.K=function(){return Z.K(this)};m.I=function(){return Z.I(this)};m.S=function(){this.f=$a(this);return this};
|
|
|
-m.H=function(){return Z.H(this)};m.G=function(){Z.G(this);return this};m.update=function(a,b){x.prototype.update.call(this,a,b);this.B()};function X(a,b,c){x.call(this,b,c);this.b=a;this.f=Z.f;this.a=null;this.F=Z.F}X.prototype=Object.create(A.prototype);m=X.prototype;m.constructor=X;m.B=function(){return Z.B(this)};m.K=function(){this.a&&this.a.parentElement&&(this.a.remove(),delete this.a);this.f&&delete this.f;return this};m.I=function(){Z.I(this);return this.a};m.H=function(){return this.a.cloneNode(!0)};
|
|
|
-m.S=function(){this.f=$a(this);this.a=document.createElement("span");this.f.classList.add("slackmsg-notice");this.a.className="slackmsg-notice";this.a.textContent=I.ka;return this};m.G=function(){Z.G(this);return this};m.update=function(a,b){A.prototype.update.call(this,a,b);this.B()};
|
|
|
+c.open("GET",a,!0);c.send(null)}function d(){var a=l.createLinearGradient(0,0,0,n);a.addColorStop(0,"#4D394B");a.addColorStop(1,"#201820");l.fillStyle=a;l.fillRect(0,0,h,n);return l.getImageData(0,0,h,n)}function e(a,b){for(var c=(a.height-b.height)/2,d=0;d<b.height;d++)for(var e=0;e<b.width;e++){var g=b.data[4*(d*b.width+e)]/255,f=4*((d+c)*a.width+e+c);a.data[f]*=g;a.data[f+1]*=g;a.data[f+2]*=g}return a}function g(a,b,c,d){var f=Math.floor(d);a=[a.data[f*h*4+0],a.data[f*h*4+1],a.data[f*h*4+2]];l.fillStyle=
|
|
|
+"#"+(1.1*a[0]<<16|1.1*a[1]<<8|1.1*a[2]).toString(16);l.beginPath();l.moveTo(c+k/2,d+r);l.lineTo(c-r+k,d+k/2);l.lineTo(c+k/2,d-r+k);l.lineTo(c+r,d+k/2);l.closePath();l.fill();l.putImageData(e(l.getImageData(c+r,d+r,q,q),b),c+r,d+r)}var f=document.createElement("canvas"),l=f.getContext("2d"),h=f.width=250,n=f.height=290,k=(h-40)/3,r=.1*k,q=Math.floor(k-2*r),u=.5*q,v,B=[],F=!1;return function(c){if(v)c(v);else if(F)B.push(c);else{var e=d(),g=[];F=!0;B.push(c);for(var h in E.a.a)E.a.a[h].j||E.a.a[h].w||
|
|
|
+g.push({src:"api/avatar?user="+h});b(g,function(b){a(e,b);v=f.toDataURL();B.forEach(function(a){a(v)})})}}}();var T=0,H=null,P=null,R=null;function fb(a){var b=new XMLHttpRequest;b.timeout=6E4;b.onreadystatechange=function(){if(4===b.readyState)if(b.status){var c=null,d=2===Math.floor(b.status/100);if(d){T&&(T=0,Ga(!0));c=b.response;try{c=JSON.parse(c)}catch(e){c=null}}else T?(T+=Math.floor((T||5)/2),T=Math.min(60,T)):(T=5,Ga(!1));a(d,c)}else T&&(T=0,Ga(!0)),fb(a)};b.open("GET","api?v="+E.f,!0);b.send(null)}function Wa(){var a=new XMLHttpRequest;a.open("POST","api/typing?room="+H.id,!0);a.send(null)}
|
|
|
+function gb(a,b){a?(b&&E.update(b),Za()):setTimeout(Za,1E3*T)}function Za(){fb(gb)}function Sa(a){H&&document.getElementById("room_"+H.id).classList.remove("selected");document.getElementById("room_"+a.id).classList.add("selected");document.body.classList.remove("no-room-selected");H=a;Ha();H.a&&!E.b[H.id]&&(a=new XMLHttpRequest,a.open("GET","api/hist?room="+H.id,!0),a.send(null))}
|
|
|
+function Ua(a,b,c){var d=H;new FileReader;var e=new FormData,g=new XMLHttpRequest;e.append("file",b);e.append("filename",a);g.onreadystatechange=function(){4===g.readyState&&(204===g.status?c(null):c(g.statusText))};g.open("POST","api/file?room="+d.id);g.send(e)}
|
|
|
+function Va(a){if(R){var b=new XMLHttpRequest;b.open("PUT","api/msg?room="+H.id+"&ts="+R.id+"&text="+encodeURIComponent(a),!0);b.send(null);return!0}if("/"===a[0]){var c=a.indexOf(" "),b=-1===c?"":a.substr(c);return(a=E.a.j.data[a.substr(0,-1===c?void 0:c)])?(c=new XMLHttpRequest,c.open("POST","api/cmd?room="+H.id+"&cmd="+encodeURIComponent(a.name.substr(1))+"&args="+encodeURIComponent(b.trim()),!0),c.send(null),!0):!1}var b=H,c=P,d=new XMLHttpRequest;a="api/msg?room="+b.id+"&text="+encodeURIComponent(a);
|
|
|
+if(c){var e=E.a.a[c.D],g="Message";"C"===b.id[0]?g="Channel message":"D"===b.id[0]?g="Direct message":"G"===b.id[0]&&(g="Group message");a+="&attachments="+encodeURIComponent(JSON.stringify([{fallback:c.text,author_name:"<@"+e.id+"|"+e.name+">",author_icon:e.b.small,text:c.text,footer:g,ts:c.o}]))}d.open("POST",a,!0);d.send(null);return!0}function Ra(a){var b=new XMLHttpRequest;b.open("DELETE","api/msg?room="+H.id+"&ts="+a.id,!0);b.send(null)}
|
|
|
+function Ka(a,b,c){var d=new XMLHttpRequest;d.open("POST","api/reaction?room="+a+"&msg="+b+"&reaction="+encodeURIComponent(c),!0);d.send(null)};function U(a,b,c,d){D.call(this,a,b,c,d)}U.prototype=Object.create(D.prototype);U.prototype.constructor=U;U.prototype.b=function(a,b){return!0===a.isMeMessage?new W(this.id,a,b):!0===a.isNotice?new X(this.id,a,b):new Y(this.id,a,b)};
|
|
|
+var Z={C:function(a){a.G=!0;return a},L:function(a){a.c&&a.c.parentElement&&(a.c.remove(),delete a.c);return a},K:function(a){a.c?a.G&&(a.G=!1,a.H()):a.W().H();return a.c},H:function(a){var b=E.a.a[a.D];a.c.o.innerHTML=J.Y(a.o);a.c.da.innerHTML=K(a.text);a.c.X.textContent=b?b.name:a.username||"?";for(var b=document.createDocumentFragment(),c=0,d=a.u.length;c<d;c++){var e=a.u[c];e&&(e=bb(e,c))&&b.appendChild(e)}a.c.u.textContent="";a.c.u.appendChild(b);b=a.b;c=document.createDocumentFragment();if(a.A)for(var g in a.A){var d=
|
|
|
+b,e=a.id,f=g,l=a.A[g];var h=La(f);"string"===typeof h&&"makeEmoji"in window&&(h=window.makeEmoji(h));if(h="string"===typeof h?null:h){for(var n=document.createElement("li"),k=document.createElement("a"),r=document.createElement("span"),q=document.createElement("span"),u=[],v=0,B=l.length;v<B;v++){var F=E.a.a[l[v]];F&&u.push(F.name)}u.sort();q.textContent=u.join(", ");r.appendChild(h);r.className="emoji-small";k.href="javascript:toggleReaction('"+d+"', '"+e+"', '"+f+"')";k.appendChild(r);k.appendChild(q);
|
|
|
+n.className="slackmsg-reaction-item";n.appendChild(k);d=n}else console.warn("Reaction id not found: "+f),d=null;d&&c.appendChild(d)}a.c.A.textContent="";a.c.A.appendChild(c);a.P&&a.c.classList.add("edited");return a},I:function(a){return a.c.cloneNode(!0)}};function W(a,b,c){x.call(this,b,c);this.b=a;this.c=Z.c;this.G=Z.G}W.prototype=Object.create(y.prototype);m=W.prototype;m.constructor=W;m.C=function(){return Z.C(this)};m.L=function(){return Z.L(this)};m.K=function(){return Z.K(this)};
|
|
|
+m.W=function(){this.c=$a(this);this.c.classList.add("slackmsg-me_message");return this};m.I=function(){return Z.I(this)};m.H=function(){Z.H(this);return this};m.update=function(a,b){y.prototype.update.call(this,a,b);this.C()};function Y(a,b,c){x.call(this,b,c);this.b=a;this.c=Z.c;this.G=Z.G}Y.prototype=Object.create(x.prototype);m=Y.prototype;m.constructor=Y;m.C=function(){return Z.C(this)};m.L=function(){return Z.L(this)};m.K=function(){return Z.K(this)};m.W=function(){this.c=$a(this);return this};
|
|
|
+m.I=function(){return Z.I(this)};m.H=function(){Z.H(this);return this};m.update=function(a,b){x.prototype.update.call(this,a,b);this.C()};function X(a,b,c){x.call(this,b,c);this.b=a;this.c=Z.c;this.a=null;this.G=Z.G}X.prototype=Object.create(A.prototype);m=X.prototype;m.constructor=X;m.C=function(){return Z.C(this)};m.L=function(){this.a&&this.a.parentElement&&(this.a.remove(),delete this.a);this.c&&delete this.c;return this};m.K=function(){Z.K(this);return this.a};m.I=function(){return this.a.cloneNode(!0)};
|
|
|
+m.W=function(){this.c=$a(this);this.a=document.createElement("span");this.c.classList.add("slackmsg-notice");this.a.className="slackmsg-notice";this.a.textContent=J.wa;return this};m.H=function(){Z.H(this);return this};m.update=function(a,b){A.prototype.update.call(this,a,b);this.C()};
|
|
|
})();
|