"use strict";(function(){ var p;function r(a){this.id=a;this.version=0}r.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.P=a.category}function ba(){this.a={};this.C=[]} ba.prototype.update=function(a,b){this.a=JSON.parse(a.emoji_use);a.highlight_words?this.C=(a.highlight_words||"").split(",").filter(function(a){return""!==a.trim()}):a.highlights&&(this.C=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.A=0}"undefined"!==typeof module&&(module.K.Ia=ca,module.K.Ja=r,module.K.La=aa);function t(a){this.id=a;this.G=!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.A=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.G=a.is_starred);if(a.members&&(this.j={},a.members))for(var d=0,e=a.members.length;dthis.f;)this.a.shift();return e||0}; function fa(a){for(var b=D.b[G.id],c=0,d=b.a.length;c=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})}z.prototype=Object.create(y.prototype);z.prototype.constructor=z;A.prototype=Object.create(y.prototype);A.prototype.constructor=A;"undefined"!==typeof module&&(module.K={Na:y,Ma:z,Oa:A,Ra:C});function H(a){this.id=a;this.b={small:"",Fa:""};this.m={};this.l=this.a=null;this.version=0}H.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.A=a.isBot);a.profile&&(this.b.small=a.profile.icon_small,this.b.Fa=a.profile.icon_large);this.version=Math.max(this.version,b)}; "undefined"!==typeof module&&(module.K.Ka=H);var I={},J;function ga(){if(!c){for(var a=0,b=navigator.languages.length;ab.getTime()?a.toLocaleTimeString():a.getTime()>c.getTime()? "hier, "+a.toLocaleTimeString():a.toLocaleString()},c:{fileUploadCancel:"Annuler",neterror:"Impossible de se connecter au chat !"}};I.en={Ha:"Unknown member",Ga:"Unknown channel",xa:"New message",wa:"Network",R:"(edited)",ya:"(only visible to you)",G:"Starred",m:"Channels",Aa:"Direct messages",ok:"Ok",va:"Cancel",ba: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.h=a}function b(b,c,d){this.N=c;this.g=null;this.i=[];this.a=d||"";this.X="<"===this.a;this.ea="*"===this.a;this.ja="_"===this.a;this.Y="~"===this.a||"-"===this.a;this.f=">"===this.a||">"===this.a;this.l=":"===this.a;this.fa="`"===this.a;this.ta="```"===this.a;this.ga="\n"===this.a;this.ia=void 0!==d&&-1!==m.C.indexOf(d);this.h=b;this.Z=null;this.b=this.ga||this.ia?c+d.length-1:!1;this.ia&&(this.g=new a(this),this.i.push(this.g),this.g.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||g;for(var c=0,l=a.i.length;c"===h[a])return!0;var b=c(h[a-1]);if(!this.f&&h.substr(a,this.a.length)===this.a){if(!b&&(this.ea||this.ja||this.Y))return!1;if(this.g&&this.qa())return this.g.ua();if(this.Ba())return!0}return"\n"===h[a]&&this.f?!0:!1};b.prototype.Ba=function(){for(var a=this;a;){for(var c=0,d=a.i.length;c"===h[b])return h[b]}if(-1!==["`","\n"].indexOf(h[b])||-1!==["*","~","-","_"].indexOf(h[b])&& (d||-1!=="*~-_<&".split("").indexOf(h[b+1]))||-1!==[":"].indexOf(h[b])&&d||-1!==["<"].indexOf(h[b]))return h[b];d=0;for(e=m.C.length;d=a&&(this.b=!1);this.i.forEach(function(c){c instanceof b&&c.s(a)})};a.prototype.innerHTML=function(){var a;if(this.h.ca()){for(a=this.h;a&&!a.l;)a=a.h;if(a){var b=a.a+this.text+a.a;return(a=m.S(b))?a:b}return(a=m.S(this.text))?a:this.text}return this.h.A()?this.text.replace(/\n/g,"
"):m.W(this.text)};a.prototype.outerHTML=function(){var a="span",b=[],c="";if(this.h.A()){b.push("codeblock");var d=this.innerHTML()}else this.h.ma()?(b.push("code"),d=this.innerHTML()): (this.h.X?(d=m.U(this.text),a="a",c=' href="'+d.link+'"',d.Ta&&(c+=' target="_blank"'),d=m.W(d.text)):d=this.innerHTML(),this.h.la()&&b.push("bold"),this.h.oa()&&b.push("italic"),this.h.pa()&&b.push("strike"),this.h.ca()&&b.push("emoji"),this.h.na()&&b.push("highlight"));return"<"+a+c+(b.length?' class="'+b.join(" ")+'"':"")+">"+d+""};b.prototype.outerHTML=function(){var a="";this.f&&(a+='');this.ga&&(a+="
");this.i.forEach(function(b){a+=b.outerHTML()});this.f&&(a+= "
");return a};b.prototype.sa=function(a){this.f&&!this.b&&this.ka(a);this.i.forEach(function(c){c instanceof b&&c.sa(a)})};return function(c,n){n||(n={});m.C=n.C||[];m.S=n.S||f;m.W=n.W||f;m.U=n.U||k;h=c;g=new b(this,0);n=0;c=h.length;do{for(;na.b&&(b.classList.add("unread"),0<=N.indexOf(a)&&b.classList.add("unreadHi"));b&&(a.G?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.s?(b.className="slack-context-room slack-group",b.dataset.count=Object.keys(a.j||{}).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<=N.indexOf(a)&&b.classList.add("unreadHi")),b&&(a.G?c.push(b):a.s?e.push(b):d.push(b))});c.length&&a.appendChild(Aa(J.G));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)});f.length&&a.appendChild(Aa(J.Aa));f.forEach(function(b){a.appendChild(b)});document.getElementById("chanList").textContent="";document.getElementById("chanList").appendChild(a);Ba();O();Ca(function(a){document.getElementById("slackCtx").style.backgroundImage= "url("+a+")"})}function Da(){var a=D.a.f,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.f;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.f=0);document.getElementById("whoistyping").appendChild(b)}}function Ga(a){a?document.body.classList.remove("no-network"):document.body.classList.add("no-network");O()} function Ha(){var a=G.name||(G.f?G.f.name:void 0);if(!a){var b=[];G.j.forEach(function(a){b.push(a.name)});a=b.join(", ")}document.getElementById("currentRoomTitle").textContent=a;Ia();P();document.getElementById("fileUploadContainer").classList.add("hidden");Ja();Q&&(Q=null,R());S&&(S=null,R());Ea()} function R(){if(Q){document.body.classList.add("replyingTo");var a=document.getElementById("replyToContainer"),b=document.createElement("a");b.addEventListener("click",function(){Q=null;R()});b.className="replyto-close";b.textContent="x";a.textContent="";a.appendChild(b);a.appendChild(Q.J())}else document.body.classList.remove("replyingTo"),document.getElementById("replyToContainer").textContent="";P()} function T(){if(S){document.body.classList.add("replyingTo");var a=document.getElementById("replyToContainer"),b=document.createElement("a");b.addEventListener("click",function(){S=null;T()});b.className="replyto-close";b.textContent="x";a.textContent="";a.appendChild(b);a.appendChild(S.J());document.getElementById("msgInput").value=S.text}else document.body.classList.remove("replyingTo"),document.getElementById("replyToContainer").textContent="";P()} window.toggleReaction=function(a,b,c){var d=D.b[a];if(d){a:{for(var e=0,f=d.a.length;ed.b&&a++}a&&(b="("+a+") - ");Ma(0,a)}D.a.s&&(b+=D.a.s.name);document.title=b} function Na(){if("Notification"in window)if("granted"===Notification.permission){var a=Date.now();if(xa+3E4Math.abs(d-b.o)&&!(b instanceof z)?e.classList.add("slackmsg-same-ts"):d=b.o:(d=b.o,g=!0);(!c||c.o<=G.b)&&b.o>G.b?h.classList.add("slackmsg-first-unread"):h.classList.remove("slackmsg-first-unread");if(b instanceof z)e=c=null,d=0,a.appendChild(h),f=null;else{if(g||!f){var g=D.a.a[b.F],k=b.username,l=document.createElement("div"), n=document.createElement("div"),q=document.createElement("span");l.O=document.createElement("img");l.O.className="slackmsg-author-img";q.className="slackmsg-author-name";g?(q.textContent=g.name,l.O.src=g.b.small):(q.textContent=k||"?",l.O.src="");n.appendChild(l.O);n.appendChild(q);n.className="slackmsg-author";l.className="slackmsg-authorGroup";l.appendChild(n);l.content=document.createElement("div");l.content.className="slackmsg-author-messages";l.appendChild(l.content);f=l;wa.push(f);a.appendChild(f)}c= b;e=h;f.content.appendChild(h)}}});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,k=e.dataset.actionIndex;d&&void 0!==f&&void 0!==k&&(d=parseFloat(d.split("_")[1]),(c=fa(d))&&c.u[f]&&c.u[f].actions&&c.u[f].actions[k]&&Pa(c,c.u[f], c.u[f].actions[k]))}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")?(S&&(S=null,T()),Q!==c&&(Q=c,R())):c&&e.classList.contains("slackmsg-hover-reaction")?Qa.V(document.body,function(a){a&&Ka(G.id,c.id,a)}):c&&e.classList.contains("slackmsg-hover-edit")?(Q&&(Q=null,R()),S!==c&&(S=c,T())):c&&e.classList.contains("slackmsg-hover-remove")&&(Q&&(Q=null,R()),S&&(S=null,T()),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}),k=a.F,h=new FormData,g=new XMLHttpRequest;h.append("payload",d);h.append("service_id",k);g.open("POST","api/attachmentAction");g.send(h)}var e=G.id;c.confirm?va(ua(new ha(c.confirm.title,c.confirm.text),c.confirm.ok_text,c.confirm.dismiss_text),d).V():d()} function P(){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.s&&Sa(a.s)}function Ta(){var a=document.getElementById("chatWindow").getBoundingClientRect().top;wa.forEach(function(b){var c=b.O,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(){ga();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="",Q&&(Q=null,R()),S&&(S=null,R()),document.getElementById("slashList").textContent="");P();return!1});window.addEventListener("blur",function(){window.hasFocus= !1});window.addEventListener("focus",function(){window.hasFocus=!0;xa=0;G&&Ja();P()});document.getElementById("chatWindow").addEventListener("scroll",Ta);var a=0;document.getElementById("msgInput").addEventListener("input",function(){if(G){var b=Date.now();a+3E3"+c.outerHTML+ "":a.style.backgroundImage='url("smile.svg")';(c=window.makeEmoji("paperclip"))?document.getElementById("attachFile").innerHTML=""+c.outerHTML+"":document.getElementById("attachFile").style.backgroundImage='url("public/paperclip.svg")';a.addEventListener("click",function(){Qa.V(document.body,function(a){a&&(document.getElementById("msgInput").value+=":"+a+":");P()})})}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.B=document.createElement("ul");c.o=document.createElement("div");c.ha=document.createElement("div");c.aa=document.createElement("span");c.id=b+"_"+a.id;c.className="slackmsg-item";c.o.className="slackmsg-ts";c.ha.className="slackmsg-msg";c.aa.className="slackmsg-author-name";e.className="slackmsg-hover";f.className= "slackmsg-hover-reply";e.appendChild(f);if("makeEmoji"in window){var k=document.createElement("li"),h=window.makeEmoji("arrow_heading_down"),g=window.makeEmoji("smile"),m=window.makeEmoji("pencil2"),b=window.makeEmoji("x");k.className="slackmsg-hover-reaction";g?(k.classList.add("emoji-small"),k.appendChild(g)):k.style.backgroundImage='url("smile.svg")';h?(f.classList.add("emoji-small"),f.appendChild(h)):f.style.backgroundImage='url("repl.svg")';e.appendChild(k);a.F===D.a.b.id&&(a=document.createElement("li"), a.className="slackmsg-hover-edit",m?a.classList.add("emoji-small"):a.style.backgroundImage='url("edit.svg")',a.appendChild(m),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.F===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.aa);d.appendChild(c.ha);d.appendChild(c.o);d.appendChild(c.u);b=document.createElement("div");b.innerHTML=J.R;b.className="slackmsg-edited";d.appendChild(b);d.appendChild(c.B);d.className="slackmsg-content";c.u.className="slackmsg-attachments";c.B.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,c){var d=document.createElement("li"),e=document.createElement("div"),f=document.createElement("div"),k=document.createElement("a"),h=document.createElement("div"),g=document.createElement("img"),m=document.createElement("a"),l=document.createElement("div"),n=document.createElement("div"),q=document.createElement("div"),u=document.createElement("img"),w=document.createElement("div");d.className="slackmsg-attachment";e.style.borderColor=ab(b.color||"");e.className="slackmsg-attachment-block"; f.className="slackmsg-attachment-pretext";b.pretext?f.innerHTML=a.w(b.pretext):f.classList.add("hidden");k.target="_blank";b.title?(k.innerHTML=a.w(b.title),b.title_link&&(k.href=b.title_link),k.className="slackmsg-attachment-title"):k.className="hidden slackmsg-attachment-title";m.target="_blank";h.className="slackmsg-author";b.author_name&&(m.innerHTML=a.w(b.author_name),m.href=b.author_link||"",m.className="slackmsg-author-name",g.className="slackmsg-author-img",b.author_icon&&(g.src=b.author_icon, h.appendChild(g)),h.appendChild(m));q.className="slackmsg-attachment-thumb";b.thumb_url?(g=document.createElement("img"),g.src=b.thumb_url,q.appendChild(g),e.classList.add("has-thumb"),b.video_html&&(q.dataset.video=b.video_html)):q.classList.add("hidden");l.className="slackmsg-attachment-content";g=a.w(b.text||"");n.className="slackmsg-attachment-text";g&&""!=g?n.innerHTML=g:n.classList.add("hidden");u.className="slackmsg-attachment-img";b.image_url?u.src=b.image_url:u.classList.add("hidden");w.className= "slackmsg-attachment-footer";b.footer&&(g=document.createElement("span"),g.className="slackmsg-attachment-footer-text",g.innerHTML=a.w(b.footer),b.footer_icon&&(m=document.createElement("img"),m.src=b.footer_icon,m.className="slackmsg-attachment-footer-icon",w.appendChild(m)),w.appendChild(g));b.ts&&(g=document.createElement("span"),g.className="slackmsg-ts",g.innerHTML=J.ba(b.ts),w.appendChild(g));l.appendChild(q);l.appendChild(n);e.appendChild(k);e.appendChild(h);e.appendChild(l);e.appendChild(u); if(b.fields&&b.fields.length){var x=document.createElement("ul");e.appendChild(x);x.className="slackmsg-attachment-fields";b.fields.forEach(function(b){var c=b.title||"",d=b.value||"";b=!!b["short"];var e=document.createElement("li"),f=document.createElement("div"),h=document.createElement("div");e.className="field";b||e.classList.add("field-long");f.className="field-title";f.textContent=c;h.className="field-text";h.innerHTML=a.w(d);e.appendChild(f);e.appendChild(h);e&&x.appendChild(e)})}if(b.actions&& b.actions.length)for(k=document.createElement("ul"),k.className="slackmsg-attachment-actions "+qa,e.appendChild(k),h=0,l=b.actions.length;hc.bottom||a.screenXc.right)&&b()});m.className="emojibar-overlay";g.className="emojibar";l.className="emojibar-emojis";F.className="emojibar-detail";E.className="emojibar-detail-img";L.className="emojibar-detail-name";n.className=q.className="emojibar-list";u.className="emojibar-search";F.appendChild(E);F.appendChild(L); l.appendChild(k(window.emojiProviderHeader));l.appendChild(n);l.appendChild(k("emojicustom.png"));l.appendChild(q);g.appendChild(l);g.appendChild(F);g.appendChild(u);u.addEventListener("keyup",function(){d()});g.addEventListener("mousemove",function(b){a(b,function(a){var b=a?w[a]||x[a]:null;b?(E.innerHTML=b.c.outerHTML,L.textContent=":"+a+":"):(E.textContent="",L.textContent="")})});g.addEventListener("click",function(b){a(b,function(a){a&&c()&&B&&B(a)})});return{isSupported:h,V:function(a,b){return h()? (B=b,a.appendChild(m),a.appendChild(g),u.value="",d(),u.focus(),!0):!1},search:d,close:b}}();var D,N=[];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 f=0,k=d.users.length;fa.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&&(N.splice(b,1),O());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;dd/(c.height*c.width))for(e=0;e",author_icon:e.b.small,text:c.text,footer:f,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="+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 V(a,b,c,d){C.call(this,a,b,c,d)}V.prototype=Object.create(C.prototype);V.prototype.constructor=V;V.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=function(){function a(a){return K(a,{Sa:["fromage"],S:function(a){":"===a[0]&&":"===a[a.length-1]&&(a=a.substr(1,a.length-2));if(a=La(a)){var b=document.createElement("span");b.className="emoji-small";b.appendChild(a);return b.outerHTML}return null},U:b})}function b(a){var b=a.indexOf("|");if(-1===b)var c=a;else{c=a.substr(0,b);var f=a.substr(b+1)}return{link:c,text:f||c,Ea:"@"===c[0]?!0:"#"===c[0]?!0:!1}}return{D:function(a){a.H=!0;return a},M:function(a){a.c&&a.c.parentElement&&(a.c.remove(), delete a.c);return a},L:function(a){a.c?a.H&&(a.H=!1,a.I()):a.$().I();return a.c},I:function(b){var c=D.a.a[b.F];b.c.o.innerHTML=J.ba(b.o);b.c.ha.innerHTML=a(b.text);b.c.aa.textContent=c?c.name:b.username||"?";for(var c=document.createDocumentFragment(),e=0,f=b.u.length;e