forked from Ritsu-Projects/Public-Releases
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRitsu x Emerald.0.10.0.user.js
15 lines (15 loc) · 62 KB
/
Ritsu x Emerald.0.10.0.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// ==UserScript==
// @name Ritsu x Emerald
// @version 0.10.0
// @description Custom Emerald Chat themes and fixes.
// @author Fxkleti, Atsos/Ritsu, Aqua, Strawberry.
// @icon https://static.emeraldchat.com/uploads/picture/image/9529291/Ritsu_Icon.png
// @match *://emeraldchat.com/app
// @match *://www.emeraldchat.com/app
// @namespace Emerald Bot - Ritsu Project
// @run-at document-end
// @grant GM_getValue
// @grant GM_deleteValue
// @grant unsafeWindow
// ==/UserScript==
!function(e){var o={};function t(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.m=e,t.c=o,t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,o){if(1&o&&(e=t(e)),8&o)return e;if(4&o&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var r in e)t.d(n,r,function(o){return e[o]}.bind(null,r));return n},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},t.p="",t(t.s=35)}([function(e,o){e.exports=React},function(e,o,t){"use strict";e.exports=function(e){var o=[];return o.toString=function(){return this.map((function(o){var t=function(e,o){var t=e[1]||"",n=e[3];if(!n)return t;if(o&&"function"==typeof btoa){var r=(a=n,c=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),s="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(c),"/*# ".concat(s," */")),i=n.sources.map((function(e){return"/*# sourceURL=".concat(n.sourceRoot||"").concat(e," */")}));return[t].concat(i).concat([r]).join("\n")}var a,c,s;return[t].join("\n")}(o,e);return o[2]?"@media ".concat(o[2]," {").concat(t,"}"):t})).join("")},o.i=function(e,t,n){"string"==typeof e&&(e=[[null,e,""]]);var r={};if(n)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(r[a]=!0)}for(var c=0;c<e.length;c++){var s=[].concat(e[c]);n&&r[s[0]]||(t&&(s[2]?s[2]="".concat(t," and ").concat(s[2]):s[2]=t),o.push(s))}},o}},function(e,o){e.exports=ReactDOM},function(e,o,t){"use strict";var n=t(1),r=t.n(n)()(!0);r.push([e.i,'._3B6q_5OTXi-a3CXdwPEQy-{margin:2em;text-align:center;color:#e33}._3tf_pFd0gVgIPLUPiJgMkk{height:calc(100% - 46px);overflow:auto}._3Sq5HmxyS1XyN6bIcGdQH2{padding-top:1em}._3eP0_BWRRPqybKC0gcIAwL{width:80px;height:80px}._3eP0_BWRRPqybKC0gcIAwL:after{content:" ";display:block;width:64px;height:64px;margin:8px;border-radius:50%;border:6px solid #8ac;border-color:#8ac transparent #8ac transparent;animation:_3eP0_BWRRPqybKC0gcIAwL 1.2s linear infinite}@keyframes _3eP0_BWRRPqybKC0gcIAwL{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}',"",{version:3,sources:["webpack://src/components/style.module.scss"],names:[],mappings:"AAAA,yBACE,UAAA,CACA,iBAAA,CACA,UAAA,CAGF,yBACE,wBAAA,CACA,aAAA,CAGF,yBACE,eAAA,CAIF,yBACE,UAAA,CACA,WAAA,CAEF,+BACE,WAAA,CACA,aAAA,CACA,UAAA,CACA,WAAA,CACA,UAAA,CACA,iBAAA,CACA,qBAAA,CACA,8CAAA,CACA,sDAAA,CAEF,mCACE,GACE,sBAAA,CAEF,KACE,wBAAA,CAAA",sourcesContent:['.reload-warning {\n margin: 2em;\n text-align: center;\n color: #e33;\n}\n\n.ritsu-menu-container {\n height: calc(100% - 46px);\n overflow: auto;\n}\n\n.settings-section {\n padding-top: 1em;\n}\n\n// spinner thingy\n.lds-dual-ring {\n width: 80px;\n height: 80px;\n}\n.lds-dual-ring:after {\n content: " ";\n display: block;\n width: 64px;\n height: 64px;\n margin: 8px;\n border-radius: 50%;\n border: 6px solid #8ac;\n border-color: #8ac transparent #8ac transparent;\n animation: lds-dual-ring 1.2s linear infinite;\n}\n@keyframes lds-dual-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n'],sourceRoot:""}]),r.locals={reloadWarning:"_3B6q_5OTXi-a3CXdwPEQy-",ritsuMenuContainer:"_3tf_pFd0gVgIPLUPiJgMkk",settingsSection:"_3Sq5HmxyS1XyN6bIcGdQH2",ldsDualRing:"_3eP0_BWRRPqybKC0gcIAwL"},o.a=r},function(e,o,t){var n=t(31);e.exports="string"==typeof n?n:n.toString()},,function(e,o,t){var n=t(23);e.exports="string"==typeof n?n:n.toString()},function(e,o,t){"use strict";var n,r=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},i=function(){var e={};return function(o){if(void 0===e[o]){var t=document.querySelector(o);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}e[o]=t}return e[o]}}(),a=[];function c(e){for(var o=-1,t=0;t<a.length;t++)if(a[t].identifier===e){o=t;break}return o}function s(e,o){for(var t={},n=[],r=0;r<e.length;r++){var i=e[r],s=o.base?i[0]+o.base:i[0],l=t[s]||0,u="".concat(s," ").concat(l);t[s]=l+1;var d=c(u),m={css:i[1],media:i[2],sourceMap:i[3]};-1!==d?(a[d].references++,a[d].updater(m)):a.push({identifier:u,updater:p(m,o),references:1}),n.push(u)}return n}function l(e){var o=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var r=t.nc;r&&(n.nonce=r)}if(Object.keys(n).forEach((function(e){o.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(o);else{var a=i(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(o)}return o}var u,d=(u=[],function(e,o){return u[e]=o,u.filter(Boolean).join("\n")});function m(e,o,t,n){var r=t?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=d(o,r);else{var i=document.createTextNode(r),a=e.childNodes;a[o]&&e.removeChild(a[o]),a.length?e.insertBefore(i,a[o]):e.appendChild(i)}}function f(e,o,t){var n=t.css,r=t.media,i=t.sourceMap;if(r?e.setAttribute("media",r):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var h=null,g=0;function p(e,o){var t,n,r;if(o.singleton){var i=g++;t=h||(h=l(o)),n=m.bind(null,t,i,!1),r=m.bind(null,t,i,!0)}else t=l(o),n=f.bind(null,t,o),r=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)};return n(e),function(o){if(o){if(o.css===e.css&&o.media===e.media&&o.sourceMap===e.sourceMap)return;n(e=o)}else r()}}e.exports=function(e,o){(o=o||{}).singleton||"boolean"==typeof o.singleton||(o.singleton=r());var t=s(e=e||[],o);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<t.length;n++){var r=c(t[n]);a[r].references--}for(var i=s(e,o),l=0;l<t.length;l++){var u=c(t[l]);0===a[u].references&&(a[u].updater(),a.splice(u,1))}t=i}}}},function(e,o,t){var n=t(24);e.exports="string"==typeof n?n:n.toString()},function(e,o,t){var n=t(25);e.exports="string"==typeof n?n:n.toString()},function(e,o,t){var n=t(26);e.exports="string"==typeof n?n:n.toString()},function(e,o,t){var n=t(27);e.exports="string"==typeof n?n:n.toString()},function(e,o,t){var n=t(28);e.exports="string"==typeof n?n:n.toString()},function(e,o,t){var n=t(29);e.exports="string"==typeof n?n:n.toString()},function(e,o,t){var n=t(30);e.exports="string"==typeof n?n:n.toString()},function(e,o,t){var n=t(32);e.exports="string"==typeof n?n:n.toString()},function(e,o,t){var n=t(33);e.exports="string"==typeof n?n:n.toString()},function(e,o,t){var n=t(34);e.exports="string"==typeof n?n:n.toString()},,,,,,function(e,o,t){var n=t(1)(!1);n.push([e.i,"html.adBlocker .emerald-jumbotron-message{display:none}",""]),e.exports=n},function(e,o,t){var n=t(1)(!1);n.push([e.i,".top-message{position:absolute;top:2px;font-size:1.5em;font-weight:bold;padding:6px;margin:auto;border:solid 4px #800;border-radius:8px;background-color:#f88;color:#300;cursor:pointer}",""]),e.exports=n},function(e,o,t){var n=t(1)(!1);n.push([e.i,"html.imgBlur div>img[src*=uploads]{filter:blur(7px);transition:filter 1s ease}html.imgBlur div:hover>img[src*=uploads]{filter:blur(0px)}.room-component-message-text.room-component-message-text,.notification-unit-body.notification-unit-body{overflow:visible}",""]),e.exports=n},function(e,o,t){var n=t(1)(!1);n.push([e.i,"html.showGender .room-component-message-avatar,html.showGender .navigation-notification-unit-image{border:2px solid lime;width:36px;height:36px;margin:-2px 10px -2px -2px}html.showGender .room-component-message-avatar[data-gender=m],html.showGender .navigation-notification-unit-image[data-gender=m]{border-color:blue}html.showGender .room-component-message-avatar[data-gender=f],html.showGender .navigation-notification-unit-image[data-gender=f]{border-color:#f6f}html.showGender .room-component-message-avatar{width:42px;height:42px}",""]),e.exports=n},function(e,o,t){var n=t(1)(!1);n.push([e.i,"html.hidePfp .room-component-message-left,html.hidePfp .navigation-notification-unit-image{display:none}",""]),e.exports=n},function(e,o,t){var n=t(1)(!1);n.push([e.i,".karma-tracker,.karma-delta{display:none}html.trackKarma .karma-tracker{display:inline-block;line-height:14px;height:32px;vertical-align:middle;font-size:1.3em;padding-left:1.5em;color:var(--menu-fg-color)}html.trackKarma .karma-delta{display:block;position:absolute;top:50%;left:50%;opacity:1;transform:translateX(-50%) translateY(-50%) scale(0.1);transition:all 2s ease-out;pointer-events:none}html.trackKarma .karma-delta.positive{color:green}html.trackKarma .karma-delta.negative{color:red}html.trackKarma .karma-delta.zoom{opacity:0;transform:translateX(-50%) translateY(-50%) scale(20)}html.trackKarma .notification-unit-body.down{background:#ff808080}html.trackKarma .notification-unit-body.up{background:#80ff8080}",""]),e.exports=n},function(e,o,t){var n=t(1)(!1);n.push([e.i,".user-extra{padding-left:5em}",""]),e.exports=n},function(e,o,t){var n=t(1)(!1);n.push([e.i,'.actionicon-mega:last-child{display:none}.main-logo.main-logo{height:38px}.room-component-message-picture-container{position:relative}.picture-control{display:none;position:absolute;top:0;font-size:2em;font-weight:900}.room-component-message-picture:hover+.picture-control,.picture-control:hover{display:block;cursor:pointer}.picture-button{padding:.5em;border:1px solid var(--app-fg-color);border-radius:2px;background:var(--app-bg-color);color:var(--app-fg-color)}.picture-button.block:hover{color:red}.picture-button.save:hover{color:green}.image-grid div{display:inline-block;width:6em;height:6em;margin:5px;background-size:contain;background-repeat:no-repeat;background-position:center;cursor:pointer}.image-grid div>div{width:unset;height:unset;zoom:.6}.disable-after::after{content:"";display:none}.picker-flair-select{height:3em !important;vertical-align:bottom}.navigation-dropdown-ritsu{color:#f965fec4}.main-logo-text{display:inline-block;line-height:14px;height:32px;vertical-align:middle;font-size:1.3em;padding-left:.5em}@media screen and (max-width: 640px){.main-logo-text{display:none}}body.themeChange *{transition:background-color .3s,color .3s,border-color .3s}body{overflow:hidden}span.user-flair:before{content:""}span.user-flair:after{content:""}body.tmp-message span.room-component-print:last-of-type{margin:-1em 0}.user-profile-micro.user-profile-micro{width:auto}',""]),e.exports=n},function(e,o,t){var n=t(1)(!1);n.push([e.i,":root{--ritsu-hair-color: #f965fec4;--ritsu-hair-dark-color: #b821bd}html>body{background:var(--header-alt-bg-color)}body>div>nav{background:var(--header-bg-color)}.room-component-left.room-component-left{background:var(--roomlist-bg-color)}.room-component-center.room-component-center{background:var(--chat-bg-color)}.room-component-right.room-component-right{background:var(--userlist-bg-color)}.room-component-messages{background:var(--chat-bg-color)}.room-notification.room-notification{background:var(--chat-bg-color)}.room-component-print.room-component-print{color:var(--message-fg-color)}.room-component-input{background:var(--input-bg-color)}.room-component-input-textarea.room-component-input-textarea{color:var(--input-fg-color)}.ui-button-match{background:var(--input-bg-color)}#container{background:var(--app-bg-color)}.room-component-container.room-component-container{color:var(--app-fg-color)}.dashboard-button.animated.zoomIn{background:var(--dashboard-button-bg-color)}.navigation-notification-icons.navigation-notification-icons{background:transparent}.ui-search-box{background:var(--search-bg-color);color:var(--search-fg-color)}.side-panel.side-panel{background:var(--panel-bg-color)}.actionicon-mega.actionicon-mega{color:var(--panel-fg-color)}.actionicon-mega.actionicon-mega:hover{background:var(--item-hover-bg-color)}.ui-bg.ui-bg{background:var(--dialog-overlay-bg-color)}.ui-menu.ui-menu,.notification-unit.notification-unit{background:var(--dialog-bg-color);color:var(--dialog-fg-color)}.ui-interests-bg.ui-interests-bg{background:var(--interests-bg-color) !important}.navigation-notification-unit.navigation-notification-unit:hover{background:var(--header-hover-bg-color);color:var(--header-hover-fg-color)}.navigation-notification-unit{color:var(--header-fg-color)}.navigation-dropdown-content.navigation-dropdown-content{background:var(--menu-bg-color);color:var(--menu-fg-color)}.dashboard-icon.dashboard-icon{color:var(--dashboard-icon-fg-color)}.dashboard-button.dashboard-button:hover{color:var(--dashboard-hover-fg-color);background:var(--dashboard-hover-bg-color)}.actionicon-icon.actionicon-icon{color:var(--dashboard-icon-fg-color)}.main-hamburger.main-hamburger{color:var(--header-fg-color)}.main-hamburger.main-hamburger:hover,.main-logo.main-logo:hover{background:var(--header-hover-bg-color) !important;color:var(--header-hover-fg-color)}.user-profile-menu.user-profile-menu{background:var(--dialog-bg-color)}.user-micropost-input-background.user-micropost-input-background{background:var(--dialog-input-bg-color)}.user-micropost-input.user-micropost-input{color:var(--dialog-input-fg-color)}.ui-button-micro.ui-button-micro{background:var(--dialog-button-bg-color);color:var(--dialog-button-fg-color)}.user-profile-tab.user-profile-tab,.ui-tab.ui-tab{color:var(--tab-fg-color)}.user-profile-tab-active.user-profile-tab-active,.ui-tab-active.ui-tab-active{color:var(--tab-active-fg-color)}.ui-button-mega.ui-button-mega:hover{background:var(--dialog-button-hover-bg-color);color:var(--dialog-button-hover-fg-color)}.ui-button-mega.ui-button-mega{background:var(--dialog-button-bg-color);color:var(--dialog-button-fg-color)}.ui-input.ui-input{background:var(--dialog-input-bg-color) !important}.dashboard-card-image.dashboard-card-image{border-color:var(--dashboard-icon-fg-color)}.user-comment-input-background.user-comment-input-background{background:var(--dialog-input-bg-color)}.user-comment-input.user-comment-input{color:var(--dialog-input-fg-color)}.room-component-left .room-user-label{color:var(--roomlist-title-fg-color)}.room-component-right .room-user-label{color:var(--userlist-title-fg-color)}.picture-upload-button.picture-upload-button+label{background:var(--upload-button-bg-color);color:var(--upload-button-fg-color)}.main-logo-text{color:var(--menu-fg-color)}.navigation-dropdown-ritsu{color:var(--ritsu-menu-fg-color)}.navigation-dropdown-ritsu:hover{color:var(--ritsu-menu-hover-fb-color)}.notification-menu-container-text{color:var(--dialog-fg-color)}.notification-menu-container-text span{text-shadow:#000 0 0 3px}",""]),e.exports=n},function(e,o,t){var n=t(1)(!1);n.push([e.i,":root{--header-bg-color: #100f10;--header-alt-bg-color: #232529;--header-hover-bg-color: #3d4046;--app-bg-color: black;--dialog-bg-color: #111;--dialog-overlay-bg-color: rgba(0, 0, 0, 0.93);--dialog-button-bg-color: #17191b;--dialog-button-hover-bg-color: #151515;--dialog-input-bg-color: #17191b;--dashboard-button-bg-color: #100f10;--dashboard-hover-bg-color: #33323270;--roomlist-bg-color: black;--chat-bg-color: black;--userlist-bg-color: black;--input-bg-color: #211f21;--search-bg-color: #0b0b0b;--panel-bg-color: #0c0c0c;--item-hover-bg-color: #35383e;--interests-bg-color: #2c2f35;--menu-bg-color: #0a0a0a;--upload-button-bg-color: #41444a;--header-fg-color: white;--header-hover-fg-color: var(--ritsu-hair-color);--app-fg-color: #bebfc5;--dialog-fg-color: #f1f1f2;--dialog-button-fg-color: #d5dcec;--dialog-button-hover-fg-color: var(--ritsu-hair-color);--dialog-input-fg-color: #d7dfec;--dashboard-icon-fg-color: var(--ritsu-hair-color);--dashboard-hover-fg-color: var(--ritsu-hair-color);--roomlist-title-fg-color: #99a3b4;--userlist-title-fg-color: #99a3b4;--tab-fg-color: #c2c8d6;--tab-active-fg-color: var(--ritsu-hair-color);--message-fg-color: #afbacd;--input-fg-color: #caccd0;--search-fg-color: #f0f0f1;--panel-fg-color: white;--menu-fg-color: white;--upload-button-fg-color: #b4bccc;--ritsu-menu-fg-color: var(--ritsu-hair-color);--ritsu-menu-hover-fb-color: var(--ritsu-hair-color)}",""]),e.exports=n},function(e,o,t){var n=t(1)(!1);n.push([e.i,":root{--header-bg-color: #bbb;--header-alt-bg-color: #ccc;--header-hover-bg-color: #aaa;--app-bg-color: #ddd;--dialog-bg-color: #ddd;--dialog-overlay-bg-color: rgba(0, 0, 0, 0.5);--dialog-button-bg-color: #cfdeec;--dialog-button-hover-bg-color: #f0f0f0;--dialog-input-bg-color: #cfdeec;--dashboard-button-bg-color: #f0e4f0;--dashboard-hover-bg-color: #cfcdcd70;--roomlist-bg-color: #ccc;--chat-bg-color: #ddd;--userlist-bg-color: #ccc;--input-bg-color: #fff;--search-bg-color: #f7f7f7;--panel-bg-color: #ccc;--item-hover-bg-color: #a3adc0;--interests-bg-color: #aab6ce;--menu-bg-color: #aaa;--upload-button-bg-color: #ccc;--header-fg-color: #333;--header-hover-fg-color: var(--ritsu-hair-dark-color);--app-fg-color: #333;--dialog-fg-color: #333;--dialog-button-fg-color: #000;--dialog-button-hover-fg-color: var(--ritsu-hair-dark-color);--dialog-input-fg-color: #000;--dashboard-icon-fg-color: var(--ritsu-hair-dark-color);--dashboard-hover-fg-color: var(--ritsu-hair-dark-color);--roomlist-title-fg-color: #555;--userlist-title-fg-color: #555;--tab-fg-color: #444;--tab-active-fg-color: var(--ritsu-hair-dark-color);--message-fg-color: #666;--input-fg-color: #222;--search-fg-color: #222;--panel-fg-color: #333;--menu-fg-color: #333;--upload-button-fg-color: #444;--ritsu-menu-fg-color: var(--ritsu-hair-dark-color);--ritsu-menu-hover-fb-color: var(--ritsu-hair-color)}.user-flair.user-flair,.user-extra-gender{text-shadow:1px 1px 1px #000}.actionicon-mega.actionicon-mega:hover{background:#aaa}.ui-button-text.ui-button-text:hover{color:#666}.user-profile-menu.user-profile-menu{background:#ddd;color:#333}.user-micropost-unit.user-micropost-unit{color:#333}.ritsu-menu-container li{color:#666}.ritsu-menu-container li.selected{color:#222}.ritsu-menu-container li:hover{background:#fff}",""]),e.exports=n},function(e,o,t){var n=t(1)(!1);n.push([e.i,'.lookup-button{border:0;padding:0;background:none;margin-right:.5em;margin-top:-4px}.sort-button{width:20px;height:20px;font-weight:normal;text-transform:none}.sort-button>span{padding:0;margin-top:-4px}.sort-button>div.navigation-dropdown-content{text-align:left;width:180px;top:92px}.sort-button>div.navigation-dropdown-content>div{padding:7px;font-weight:500}.sort-button>div.navigation-dropdown-content>li{display:list-item;list-style:" "}.sort-button>div.navigation-dropdown-content>li.selected{list-style:"✓"}',""]),e.exports=n},function(e,o,t){"use strict";t.r(o);var n={};t.r(n),t.d(n,"setPrefix",(function(){return m})),t.d(n,"setLogger",(function(){return f})),t.d(n,"log",(function(){return h})),t.d(n,"info",(function(){return g})),t.d(n,"warning",(function(){return p})),t.d(n,"error",(function(){return v}));var r={};t.r(r),t.d(r,"subscriptable",(function(){return b})),t.d(r,"loggingResponseHandler",(function(){return y})),t.d(r,"noopResponseHandler",(function(){return w}));var i="ritsu-emerald",a="Ritsu x Emerald",c="RxE",s="0.10.0",l="https://static.emeraldchat.com/uploads/picture/image/9529291/Ritsu_Icon.png";let u="",d=console;function m(e){u=e}function f(e){d=e}function h(e){d.log(u,e)}function g(e){d.info(u,e)}function p(e){d.warn(u,e)}function v(e){d.error(u,e)}function b(e){const o=new Set;return{subscribe:e=>{o.add(e)},unsubscribe:e=>{o.delete(e)},handler:(t,n)=>("set"===t.action&&o.forEach(e=>e(t.preference)),e(t,n))}}function y(e,o){const t=e.response;switch(t.status){case 0:return t;case 1:return"get"===e.action&&(p(`The saved value for preference '${e.preference.key}' (${JSON.stringify(t.saved)}) was invalid. Replacing it with ${JSON.stringify(t.value)}.`),o.set(e.preference,t.value)),"set"===e.action&&p(`Could not set value ${JSON.stringify(t.value)} for preference '${e.preference.key}' because it was invalid.`),t;case 2:return"get"===e.action&&(p(`The saved value for preference '${e.preference.key}' had the wrong type. Replacing it with ${JSON.stringify(t.value)}.`),o.set(e.preference,t.value)),t;case 3:return"get"===e.action&&(p(`The saved value for preference '${e.preference.key}' could not be parsed. Replacing it with ${JSON.stringify(t.value)}.`),o.set(e.preference,t.value)),t;case 4:switch(e.action){case"get":v(`Could not read preference '${e.preference.key}' because localStorage could not be accessed. Using value ${JSON.stringify(e.preference.default)}.`);break;case"set":v(`Could not save value ${JSON.stringify(e.response.value)} for preference '${e.preference.key}' because localStorage could not be accessed.`);break;default:A(e.action)}return t;default:return A(t.status)}}function w(e,o){return e.response}function A(e){throw new Error("assertUnreachable: "+e)}var k="undefined"!=typeof unsafeWindow?unsafeWindow:window;function R(e,o){return void 0===o?e:o}function C(e,o){switch(!0){case Number.isNaN(o):return"NaN";case o===1/0:return"Infinity";case o===-1/0:return"-Infinity";default:return o}}function x(e){return JSON.stringify(e,C)}const M=[function(e){return"boolean"==typeof e},function(e){return"number"==typeof e},O,function(e){return"symbol"==typeof e},E,function(e){return void 0===e}];function O(e){return"string"==typeof e}function E(e){return null===e}function N(e){return M.some(o=>o(e))}function _(e,o,t){return n=`${e.name}(${o.name})`,r=t,Object.defineProperty(r,"name",{value:n,writable:!1});var n,r}function S(e){return N(e)?e=>!1:_(S,e,o=>o instanceof e)}class P{constructor(e){if(""===e.key)throw new TypeError(`Empty preference key in this ${this.getClassName()}:\n${x(e)}`);this.key=e.key,this.default=e.default,this.label=e.label,this.description=R("",e.description),this.constraints=R([],e.constraints),this.dependencies=R([],e.dependencies),this.extras=R({},e.extras);const o=this.validate(e.default);O(o)&&this.invalidValue(e.default,o)}validate(e){const o=this.constraints;for(let t=0,n=o.length;t<n;t++){const n=o[t];if(!n.requirement(e))return n.message(e)}return{value:e}}toValid(e){return O(this.validate(e))?this.default:e}toString(){return`${this.getClassName()} '${this.key}'`}invalidValue(e,o){throw new Error(`${x(e)} is not a valid value for ${this}. Reason: ${o}`)}}class T extends P{constructor(e){const o=R(0,e.minLength),t=R(1/0,e.maxLength),n=[];if(e.multiline||n.push({requirement:e=>!e.includes("\n"),message:e=>"Line breaks are not allowed."}),o>0&&n.push({requirement:e=>e.length>=o,message:e=>`Minimum length is ${o} characters.`}),t<1/0&&n.push({requirement:e=>e.length<=t,message:e=>`Maximum length ${t} exceeded.`}),function(e,o){o.constraints=e.concat(R([],o.constraints))}(n,e),super(e),o<0)throw new Error(`Parameter 'minLength' cannot be negative, but it was ${o} in ${this}.`);this.multiline=e.multiline,this.maxLength=t,this.minLength=o}getClassName(){return"StringPreference"}toValid(e){const o=e.substring(0,this.maxLength);return super.toValid(this.multiline?o:o.replace(T.REGEX_LINE_BREAKS," "))}fromString(e){return this.validate(e)}}T.REGEX_LINE_BREAKS=/\n+/g;class U extends P{getClassName(){return"BooleanPreference"}}class j extends P{getClassName(){return"ListPreference"}}var B;!function(e){e.OK="OK",e.ABSENT="ABSENT",e.TYPE_ERROR="TYPE_ERROR",e.JSON_ERROR="JSON_ERROR",e.STORAGE_ERROR="STORAGE_ERROR",e.NUMBER_ERROR="NUMBER_ERROR"}(B||(B={}));const G=()=>localStorage;function I(e,o,t){try{const n=function(e,o,t){if(null===e)throw new DOMException;const n=e.getItem(o);if(E(n))return null;const r=JSON.parse(n);if(function e(o){for(const e of M)if(e(o))return o=>e(o);if(S(Array)(o)){const t=o;return o=>S(Array)(o)&&(!(t.length>0)||o.every(e(t[0])))}if(o.constructor===Object)return t=>![void 0,null].includes(t)&&Object.keys(o).every(n=>e(o[n])(t[n]));if(o.constructor instanceof Function)return S(o.constructor);throw new TypeError(e.name+" cannot use this object as reference because it has no constructor: "+JSON.stringify(o))}(t)(r))return r;throw new TypeError("Saved value had wrong type.")}(e(),o,t);return E(n)?{status:"ABSENT",value:t}:{status:"OK",value:n}}catch(e){return{status:S(SyntaxError)(e)?"JSON_ERROR":S(TypeError)(e)?"TYPE_ERROR":"STORAGE_ERROR",value:t}}}function K(e,o,t){try{return function(e,o,t){const n=JSON.stringify(t,(e,o)=>{if("number"==typeof o&&!Number.isFinite(o))throw new RangeError(o.toString());return o});if(null===e)throw new DOMException;e.setItem(o,n)}(e(),o,t),{status:"OK",value:t}}catch(e){return{status:S(RangeError)(e)?"NUMBER_ERROR":S(SyntaxError)(e)||S(TypeError)(e)?"JSON_ERROR":"STORAGE_ERROR",value:t}}}function L(e,o){try{return e().removeItem(o),{status:"OK",value:!0}}catch(e){return{status:"STORAGE_ERROR",value:!1}}}var V;!function(e){e[e.OK=0]="OK",e[e.INVALID_VALUE=1]="INVALID_VALUE",e[e.TYPE_ERROR=2]="TYPE_ERROR",e[e.JSON_ERROR=3]="JSON_ERROR",e[e.STORAGE_ERROR=4]="STORAGE_ERROR"}(V||(V={}));const D=(e,o)=>e.response;function F(e){return`Unknown preference:\n\n${x(e)}.`}function H(e){switch(e){case"OK":case"ABSENT":return 0;case"NUMBER_ERROR":return 1;case"TYPE_ERROR":return 2;case"JSON_ERROR":return 3;case"STORAGE_ERROR":return 4}}var J=Object.assign(Object.assign(Object.assign({title:`${a} ${s}`,themeTitle:"Choose your theme"},!1),{generalTitle:"General Settings",imagesTitle:"Image Settings",messageTitle:"Message Settings",preferences:Object.assign(Object.assign({theme:{label:"Theme",description:"Reskin the chat"}},!1),{adBlocker:{label:"Remove ads and nags"},fancyColors:{label:"Use any color for your flair"},imgControl:{label:"Overlay controls to block and favorite images"},imgProtect:{label:"Hide images from low karma accounts"},imgBlur:{label:"Blur all user images until hovered"},hidePfp:{label:"Hide profile pictures in chat"},showInfo:{label:"Show user info (karma,gender,since) on messages"},antiSpam:{label:"Auto-mute users flooding the chat"},showGender:{label:"Gender-color the outline around avatars"},trackKarma:{label:"Display Karma in header and track changes"},userSort:{label:"Sort users by..","name.asc":"Name Asc.","name.desc":"Name Desc.","age.asc":"Account age Asc.","age.desc":"Account age Desc."}}),hiddenChannels:"hidden channels",WFAF:"WFAF ⌛",privateRooms:"Private Rooms 🔒",privateRoomsPrompt:"Enter a private room key:\nOnly people with the key can enter this room.",privateRoomsWarning:"Chat history and user list is not available in unlisted rooms."}),!1);const z=matchMedia("(prefers-color-scheme: dark)").matches,W=Object.assign(Object.assign({theme:new T({key:"theme",label:J.preferences.theme.label,description:J.preferences.theme.description,default:z?"ritsu":"light",multiline:!1})},!1),{adBlocker:new U({key:"adBlocker",label:J.preferences.adBlocker.label,default:!0}),fancyColors:new U({key:"fancyColors",label:J.preferences.fancyColors.label,default:!0}),imgControl:new U({key:"imgControl",label:J.preferences.imgControl.label,default:!0}),imgProtect:new U({key:"imgProtect",label:J.preferences.imgProtect.label,default:!1}),imgBlur:new U({key:"imgBlur",label:J.preferences.imgBlur.label,default:!1}),hidePfp:new U({key:"hidePfP",label:J.preferences.hidePfp.label,default:!1}),showInfo:new U({key:"showInfo",label:J.preferences.showInfo.label,default:!0}),antiSpam:new U({key:"antiSpam",label:J.preferences.antiSpam.label,default:!0}),showGender:new U({key:"showGender",label:J.preferences.showGender.label,default:!0}),trackKarma:new U({key:"trackKarma",label:J.preferences.trackKarma.label,default:!0}),blockedHashes:new j({key:"blockedHashes",label:"blockedHashes",default:[]}),savedPictures:new j({key:"savedPictures",label:"savedPictures",default:[]}),userSort:new T({key:"userSort",label:J.preferences.userSort.label,default:"name.asc",multiline:!1})}),q=new class{constructor(e,o,t=D){this.localStoragePrefix=o,this.responseHandler=t,this.cache=new Map;const n=[],r=function e(o){return Object.values(o).reduce((o,t)=>o.concat(S(P)(t)?t:e(t.u)),[])}(e);r.forEach(e=>{const o=e.key;if(n.includes(o))throw new Error(`Duplicate preference key ${x(o)}.`);this.cache.set(e,e.default),n.push(o)}),r.forEach(e=>{e.dependencies.forEach(o=>{if(void 0===this.cache.get(o.preference))throw new Error(`Dependency error in ${e}: ${F(o.preference)}`)})})}get(e){return this.getWith(this.responseHandler,e)}set(e,o){this.setWith(this.responseHandler,e,o)}getWith(e,o){return e({action:"get",preference:o,response:this.getRaw(o)},this).value}setWith(e,o,t){e({action:"set",preference:o,response:this.setRaw(o,t)},this)}reset(e){var o;this.getFromCacheOrThrowIfUnknown(e),o=this.localStoragePrefix+e.key,L(G,o)}resetAll(){for(const e of this.cache.keys())this.reset(e)}shouldBeAvailable(e){return e.dependencies.every(e=>e.condition(this.getRaw(e.preference).value))}getRaw(e){const o=this.getFromCacheOrThrowIfUnknown(e),t=(n=this.localStoragePrefix+e.key,r=e.default,I(G,n,r));var n,r;if("OK"===t.status){const o=t.value;return O(e.validate(o))?{status:1,value:e.toValid(o),saved:o}:{status:0,value:o}}return{status:H(t.status),value:o}}setRaw(e,o){if(this.getFromCacheOrThrowIfUnknown(e),O(e.validate(o)))return{status:1,value:o};this.cache.set(e,o);const t=function(e,o){return K(G,e,o)}(this.localStoragePrefix+e.key,o);return{status:H(t.status),value:t.value}}getFromCacheOrThrowIfUnknown(e){const o=this.cache.get(e);if(void 0===o)throw new Error(F(e));return o}}(W,i+"-preference-",r.loggingResponseHandler);class X{constructor(e){this.preference=e}load(){this.set(q.get(this.preference))}save(){q.set(this.preference,this.toArray())}}var Y=t(0),Q=t.n(Y);const Z=(e,o={})=>Object.assign(document.createElement(e),o),ee=[];function oe(e){ee.push(e),Promise.resolve().then(()=>{if(!ee.length)return;const e=ee.join("\n");ee.length=0,document.head.append(Z("style",{type:"text/css",textContent:e}))})}function te(e,o,t,n=!1){const r=e[o];"function"==typeof r&&"function"==typeof t&&(e[o]=function(...e){const o=n&&t.apply(this,e);n&&!1===o||r.apply(this,e),n||t.apply(this,e)})}let ne;function re(e){clearTimeout(ne),Promise.resolve().then(()=>null===RoomClient||void 0===RoomClient?void 0:RoomClient.print_append(Q.a.createElement("div",null,e)))}function ie(e){re(e),document.body.classList.add("tmp-message"),ne=+setTimeout(()=>{null===RoomClient||void 0===RoomClient||RoomClient.print_append(),document.body.classList.remove("tmp-message")},5e3)}const ae=(e=0)=>new Promise(o=>setTimeout(o,e));var ce=t(6),se=t.n(ce);function le(){q.get(W.adBlocker)&&document.querySelectorAll('iframe:not([src*="captcha"]):not([src*="youtube"]):not([src*="about:blank"])').forEach(e=>{e.remove()})}var ue=t(7),de=t.n(ue),me=t(3),fe={insert:"head",singleton:!1},he=(de()(me.a,fe),me.a.locals||{});function ge(){return Q.a.createElement("div",{className:he.ldsDualRing})}t(8);const pe=[21550262,19422865];function ve(e,o=""){const t=e.split(o).sort(),n=t.length;return t.filter((e,o,t)=>e!==t[o-1]).map(e=>t.reduce((o,t)=>t===e?o+1:o,0)).map(e=>e/n).reduce((e,o)=>e+-o*Math.log2(o),0)}var be=t(9),ye=t.n(be);const we=new class extends X{constructor(){super(...arguments),this.store={}}has(e){return Object.prototype.hasOwnProperty.call(this.store,e)}get(){return this.store}toArray(){return Object.keys(this.store)}add(e){this.store[e]=!0,this.save()}remove(e){const o=this.has(e);return delete this.store[e],this.save(),o}set(e){this.store=Object.fromEntries(e.map(e=>[e,!0]))}}(W.blockedHashes),Ae=new class extends X{constructor(){super(...arguments),this.store=[]}has(e){return this.store.includes(e)}get(){return[...this.store]}toArray(){return this.store}add(e){this.store.push(e),this.save()}remove(e){const o=this.store.indexOf(e);return-1!==o&&(this.store.splice(o,1),this.save(),!0)}set(e){this.store=[...e]}}(W.savedPictures);const ke=function(e){const o={};return async t=>{const n="number"==typeof t?t.toString():t;return Object.prototype.hasOwnProperty.call(o,n)||(o[n]=await e(n)),o[n]}}(async e=>{const o=(new TextEncoder).encode(e),t=await crypto.subtle.digest("SHA-1",o);return Array.from(new Uint8Array(t)).map(e=>e.toString(16).padStart(2,"0")).join("")});async function Re(){var e;document.querySelectorAll(".room-component-message-picture-container").forEach(async e=>{if(q.get(W.imgControl)&&!e.querySelector(".picture-control")){const o=Z("div",{className:"picture-control"});o.append(Z("div",{className:"picture-button block material-icons",textContent:"delete_forever",onmousedown:e=>{var o,t;if(e.target instanceof HTMLElement){const n=null===(t=null===(o=e.target.parentElement)||void 0===o?void 0:o.parentElement)||void 0===t?void 0:t.firstChild;!async function(e){if(!e)return;const o=await ke(e);we.add(o),Re()}(null==n?void 0:n.src)}}})),o.append(Z("div",{className:"picture-button save material-icons",textContent:"bookmark_border",onmousedown:e=>{var o,t,n;if(e.target instanceof HTMLElement){const r=null===(t=null===(o=e.target.parentElement)||void 0===o?void 0:o.parentElement)||void 0===t?void 0:t.firstChild;(n=null==r?void 0:r.src)&&Ae.add(n)}}})),e.append(o)}if(e.firstChild instanceof HTMLImageElement){const{src:o}=e.firstChild,t=await ke(o);we.has(t)&&(e.firstChild.src="")}});const o=document.querySelector("form#picture_upload");if(!o)return;const t=o.parentElement,n=t.querySelector(".ui-menu-text");"B"===(null===(e=null==n?void 0:n.firstElementChild)||void 0===e?void 0:e.tagName)?n.style.display="none":n&&(n.style.display="");if(t.querySelector(".image-grid"))return;const r=t.querySelector(".ui-menu-buttons"),i=Z("div",{className:"image-grid"});Ae.toArray().map(async e=>{const o=await ke(e),t=Z("div",{style:`background-image: url(${encodeURI(e)}), url(${encodeURI(`https://robohash.org/${o}.png?set=set4`)})`,onmousedown:()=>{!function(e){const o=(new Date).toISOString(),t={author_id:App.user.id,created_at:o,description:null,id:955e4+~~(1e6*Math.random()),image:{thumb:{url:e},url:e},image_processing:!1,image_tmp:null,micropost_id:null,picture_album_id:null,temporary:!1,title:null,updated_at:o,url:e};PictureUploader.onUploaded(t)}(e),MenuReactMicro.close()}});t.append(Z("div",{className:"picture-button material-icons",textContent:"bookmark_remove",onmousedown:o=>{o.stopPropagation(),confirm("Are you sure you want to unbookmark this image?")&&(Ae.remove(e),t.remove())}})),i.append(t)}),t.insertBefore(i,r)}function Ce(){document.querySelectorAll('img[src*="/badges/tick.svg"]').forEach(e=>{var o;const t=e.parentElement;e.outerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 147.1 146.8">\n<path d="M140 59l-5-5c-2-2-3-3-2-6V39v-1c0-12-10-21-21-22h-11c-2 0-4 0-6-3l-7-7c-4-3-9-5-15-5-5 0-10 2-14 6-3 1-5 3-6 5-3 4-5 5-9 4h-9a25 25 0 00-21 33v1c0 2 0 3-2 5l-5 5-1 2a26 26 0 00-2 29c1 4 4 7 7 10l3 3-1 4c0 15 12 26 26 26h6c3-1 5 0 7 2 3 4 6 7 10 9a22 22 0 0023-1c4-1 8-4 10-8l6-3 6 1c15 0 26-11 26-25v-3c0-2 1-4 3-5l7-9c2-4 4-9 4-14 0-7-2-13-7-18zm-29-9l-37 55c-2 2-3 4-5 4-4 0-6-1-8-3L42 86c-3-3-4-7-1-10s7-3 10 1l13 12c2 2 3 2 4-1l31-46c3-4 6-6 11-3 4 3 3 7 1 11z" fill="#1da0f1"/>\n<path d="M110 39c-4-3-8-1-11 3L68 89c-1 2-2 2-4 0L51 77c-3-4-7-4-10-1s-2 7 1 10l20 20c1 2 3 3 7 3 2 0 3-2 5-4l37-55c2-4 3-8-1-11z" fill="#fefefe"/>\n</svg>',null===(o=null==t?void 0:t.querySelector("svg"))||void 0===o||o.classList.add("user-badge-tick")});document.querySelectorAll('img[src*="/avicons_strict/"]').forEach(e=>{e.src="https://static.emeraldchat.com/uploads/picture/image/9675465/avicons_strict.png"}),Array.from(document.images).forEach(e=>{e.onerror||(e.onerror=async()=>{const o=await ke(e.src);e.src=`https://robohash.org/${o}.png?set=set4`}),e.complete&&0===e.naturalHeight&&e.onerror("")})}function xe(){var e,o;if(!q.get(W.fancyColors))return;const t=document.querySelector('label.ui-select[for="flair-select"]');if(t&&(t.htmlFor="flair-select-old","flair-select"===(null===(e=t.firstElementChild)||void 0===e?void 0:e.id))){const e=new Event("change",{bubbles:!0}),n=t.cloneNode();n.classList.add("disable-after"),t.firstElementChild.id="flair-select-old",t.style.display="none";const r=Z("input",{id:"flair-select",className:"alt-flair-select",value:App.user.flair.color}),i=Z("input",{id:"flair-select",type:"color",className:"picker-flair-select",value:App.user.flair.color,oninput:()=>{var o;r.value=i.value,null===(o=t.firstChild)||void 0===o||o.dispatchEvent(e)}});n.append(r,i),null===(o=t.parentElement)||void 0===o||o.insertBefore(n,t.nextSibling),r.oninput=()=>{var o;i.value=r.value,null===(o=t.firstChild)||void 0===o||o.dispatchEvent(e)}}}var Me=t(10),Oe=t.n(Me);function Ee(){var e,o,t,n;const r=document.querySelector(".main-logo");if(r instanceof HTMLImageElement&&r.src!==App.user.display_picture&&(r.src=App.user.display_picture),!document.head.querySelector(`link[rel="icon"][href="${l}"]`)){document.head.querySelectorAll('link[rel="icon"]').forEach(e=>e.remove());const e=Z("link",{rel:"icon",href:l});document.head.prepend(e)}const i=`${App.user.display_name} - ${c} ${s}`;document.title!==i&&(document.title=i);if(!document.querySelector(".karma-tracker")){const o=Z("div",{className:"karma-tracker"});null===(e=null==r?void 0:r.parentElement)||void 0===e||e.insertBefore(o,null==r?void 0:r.nextSibling)}const a=document.querySelector(".main-logo-text");if(a)a.textContent!==i&&(a.textContent=i);else{const e=Z("div",{className:"main-logo-text",textContent:i});null===(o=null==r?void 0:r.parentElement)||void 0===o||o.insertBefore(e,null==r?void 0:r.nextSibling)}const u=document.querySelector(".navigation-notification-icons");if(document.fullscreenEnabled&&-1===(null===(n=null===(t=null==u?void 0:u.firstChild)||void 0===t?void 0:t.textContent)||void 0===n?void 0:n.indexOf("full"))){const e=Z("span",{className:"material-icons navigation-notification-unit",textContent:"open_in_full",onmousedown:async()=>{document.fullscreenElement?(document.exitFullscreen(),e.textContent="open_in_full"):(await document.body.requestFullscreen(),e.textContent="close_fullscreen")}}),o=Z("span");o.append(e),u.prepend(o)}}var Ne=t(11),_e=t.n(Ne);var Se=t(12),Pe=t.n(Se);let $e=null;function Te(e){if(e===$e)return;if(null!==$e){const o=e-$e,t=Z("div",{className:"karma-delta "+(o>0?"positive":"negative"),textContent:o>0?"+"+o:o});document.body.append(t),setTimeout(()=>t.classList.add("zoom"),250),setTimeout(()=>t.remove(),5e3)}$e=e;const o=e?"Karma: "+e:"",t=document.querySelector(".karma-tracker");t&&(t.textContent=o)}function Ue(){const{id:e}=App.user;e?$.ajax({type:"GET",url:"/profile_json?id="+e,dataType:"json",success:e=>{Te(e.user.karma)}}):setTimeout(Ue,500)}function je(){const{id:e}=App.user;e?(RoomChannelMembersClient instanceof Q.a.Component&&$.ajax({type:"GET",url:"channels_default",dataType:"json",success:o=>{var t,n,r;let i=!1;const a=RoomChannelSelectClient.state.text_channels.map(e=>{const t=o.text_channels.find(o=>o.channel.id===e.channel.id);return t?Object.assign(Object.assign({},e),{members:t.members}):e});if(RoomChannelSelectClient.setState({text_channels:a}),(null===(r=null===(n=null===(t=App.room)||void 0===t?void 0:t.id)||void 0===n?void 0:n.startsWith)||void 0===r?void 0:r.call(n,"channel"))&&RoomChannelMembersClient instanceof Q.a.Component){const o=+App.room.id.slice(7),t=a.find(e=>e.channel.id===o);if(t){const o=[...RoomChannelMembersClient.state.members];t.members.forEach(e=>{const t=o.findIndex(o=>o.id===e.id);t>-1?o[t]=e:o.push(e)}),RoomChannelMembersClient.setState({members:o});const n=t.members.find(o=>o.id===e);n&&(Te(n.karma),i=!0)}}i||Ue()}}),setTimeout(je,6e4)):setTimeout(je,500)}function Be(){!function(){const e=RoomChannelMembers.prototype.setState;RoomChannelMembers.prototype.setState=function(o){o&&"members"in o&&o.members.forEach(e=>{const o=this.state.members.find(o=>o.id===e.id);e.delta=o?e.karma-o.karma:0}),e.call(this,o)};const o=UserUnit.prototype.body;UserUnit.prototype.body=function(){const e=o.call(this),t=this.props.data;return t.delta<0&&(e.props.className+=" down"),t.delta>0&&(e.props.className+=" up"),e}}(),je(),oe(Pe.a)}var Ge=t(13),Ie=t.n(Ge);function Ke(){var e,o;const t=document.querySelectorAll(".room-component-message-container"),n=null===(e=null===RoomClient||void 0===RoomClient?void 0:RoomClient.state)||void 0===e?void 0:e.messages;if(null==n?void 0:n.length)for(let e=0;e<n.length;e+=1){const r=t[e],{messages:i}=n[e],a=null===(o=null==r?void 0:r.querySelector(".room-component-message-text"))||void 0===o?void 0:o.childNodes;for(;a&&a.length>i.length;)a[0].remove();a&&(1===i.length&&/^\p{Extended_Pictographic}{1,5}$/u.test(i[0])?a[0].setAttribute("style","font-size: 5em"):a[0].removeAttribute("style"))}}const Le=(()=>{let e=0;return()=>"key-"+ ++e})();Room.prototype.received=function(e){e.user.id!==App.user.id&&e.messages?(App.room.play_sound("/sfx/simple_alert.wav"),this.append(e,!0),PushNotifications.idle()&&PushNotifications.send(e.user.display_name,{icon:e.user.display_picture,body:e.messages[0]})):e.typing&&e.user.id!==App.user.id&&(this.setState({typing:e.user.display_name}),setTimeout(()=>this.stop_typing(),1e4))};var Ve=t(2),De=t.n(Ve);function Fe(){return`${a} ${s}`}const He={};function Je(e,o){He[e]||(He[e]=[]),He[e].push(o)}function ze(e,o){He[e]||(He[e]=[]);const t=He[e].indexOf(o);t>-1&&He[e].splice(t,1)}function We(e,o){He[e]||(He[e]=[]);let t=!1;const n=Object.assign(Object.assign({},o),{type:e,preventDefault(){t=!0}});return He[e].forEach(e=>e(n)),t}function qe(){var e;const o=document.evaluate("//li[text()='Emerald Gold']",document).iterateNext();q.get(W.adBlocker)?o instanceof HTMLElement&&o.remove():o&&(null===(e=null==o?void 0:o.parentElement)||void 0===e?void 0:e.firstChild)===o&&o.parentElement.append(o)}const Xe="Use Ritsu x Emerald 0.9.0 or newer to see an image instead of this placeholder.",Ye=new RegExp(`^${Xe}(.*)$`),Qe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Ze=Array.from({length:65},(e,o)=>String.fromCodePoint(o+917536)).join("");function eo(){Room.prototype.room_input=function(){return Q.a.createElement("div",{className:"room-component-input"},Q.a.createElement("textarea",{className:"room-component-input-textarea",onMouseDown:this.scroll,onKeyDown:this.input.bind(this),id:"room-input",placeholder:"Say Something..."}),Q.a.createElement("span",{onMouseDown:this.upload_picture.bind(this),className:"room-component-input-icon material-icons"},"photo_camera"))},Room.prototype.send_picture=function(e){this.append({messages:[],user:App.user,picture:e});const o=e.url.match(/^https:\/\/static.emeraldchat.com\/uploads\/picture\/(.*)$/),t=o?`${Xe}${function(e){const o=btoa(e);let t="";for(let e=0;e<o.length;e+=1){const n=Qe.indexOf(o[e]);if(-1===n)return null;t+=Ze[2*n]+Ze[2*n+1]}return t}(o[1])}`:void 0;App.room.client.speak({message:t,picture:e}),this.scroll()};const e=Room.prototype.received;Room.prototype.received=function(o){var t;const r=t=>{e.call(this,{messages:[],user:o.user,picture:{url:"https://static.emeraldchat.com/uploads/picture/"+t}})};if(null===(t=o.messages)||void 0===t?void 0:t[0]){const e=o.messages[0].match(Ye);if(e)try{return void r(function(e){let o="";for(let t=1;t<e.length;t+=2){const n=Ze.indexOf(e[t]);if(-1===n)throw new Error("bad image path");o+=Qe[(n-1)/2]}return atob(o)}(e[1]))}catch(e){n.error(e.message)}const t=o.messages[0].match(/^Image: \[([a-zA-Z0-9/=-]+)\]$/);if(t)try{return void r(atob(t[1]))}catch(e){n.error(e.message)}}e.call(this,o)}}function oo(e){const{id:o,value:t,onChange:n}=e;return Q.a.createElement("div",null,Q.a.createElement("input",{type:"checkbox",id:o,checked:t,onChange:n}),Q.a.createElement("label",{htmlFor:o},W[o].label))}function to(e){const{adBlocker:o,trackKarma:t,fancyColors:n,imgControl:r,imgProtect:i,imgBlur:a,hidePfp:c,showInfo:s,showGender:l,antiSpam:u,applySettings:d}=e;return Q.a.createElement("div",null,Q.a.createElement("div",{className:"m1 "+he.settingsSection},J.generalTitle),Q.a.createElement(oo,{id:"adBlocker",value:o,onChange:()=>d({adBlocker:!o})}),Q.a.createElement(oo,{id:"trackKarma",value:t,onChange:()=>d({trackKarma:!t})}),Q.a.createElement(oo,{id:"fancyColors",value:n,onChange:()=>d({fancyColors:!n})}),Q.a.createElement("div",{className:"m1 "+he.settingsSection},J.imagesTitle),Q.a.createElement(oo,{id:"hidePfp",value:c,onChange:()=>d({hidePfp:!c})}),Q.a.createElement(oo,{id:"imgControl",value:r,onChange:()=>d({imgControl:!r})}),Q.a.createElement(oo,{id:"imgProtect",value:i,onChange:()=>d({imgProtect:!i})}),Q.a.createElement(oo,{id:"imgBlur",value:a,onChange:()=>d({imgBlur:!a})}),Q.a.createElement("div",{className:"m1 "+he.settingsSection},J.messageTitle),Q.a.createElement(oo,{id:"antiSpam",value:u,onChange:()=>d({antiSpam:!u})}),Q.a.createElement(oo,{id:"showGender",value:l,onChange:()=>d({showGender:!l})}),Q.a.createElement(oo,{id:"showInfo",value:s,onChange:()=>d({showInfo:!s})}))}var no=t(14),ro=t.n(no),io=t(4),ao=t.n(io),co=t(15),so=t.n(co),lo=t(16),uo=t.n(lo);const mo=["default","ritsu","light"];function fo(){const e=q.get(W.theme);let o=document.head.querySelector(".custom-theme");o||(document.head.append(Z("style",{className:"custom-theme",type:"text/css"})),o=document.head.querySelector(".custom-theme"));const t=[ro.a];switch(e){case"default":default:break;case"ritsu":t.push(ao.a,so.a);break;case"light":t.push(ao.a,uo.a)}o.textContent=t.join("\n")}function ho(e){const{theme:o,applyTheme:t}=e;return Q.a.createElement("div",null,Q.a.createElement("div",{className:"m1 "+he.settingsSection},J.themeTitle),mo.map(e=>Q.a.createElement("div",null,Q.a.createElement("input",{type:"radio",id:e,name:"theme",value:e,checked:o===e,onChange:()=>t(e)}),Q.a.createElement("label",{htmlFor:e},e[0].toUpperCase()+e.slice(1)))))}class go extends Q.a.Component{constructor(){super({}),this.applySettings=e=>{const{settings:o}=this.state,t=Object.assign(Object.assign({},o),e);Object.keys(e).forEach(o=>q.set(W[o],e[o])),bo(),this.setState({settings:t,needsReload:!0})},this.applyTheme=e=>{q.set(W.theme,e),document.body.classList.add("themeChange"),fo(),this.setState({theme:e}),setTimeout(()=>document.body.classList.remove("themeChange"),1e3)},this.h=e=>{0},this.state=Object.assign(Object.assign({},vo()),{needsReload:!1})}render(){const{theme:e,settings:o,g:t,needsReload:n}=this.state;return Q.a.createElement("div",null,Q.a.createElement(to,Object.assign({},o,{applySettings:this.applySettings})),Q.a.createElement(ho,{theme:e,applyTheme:this.applyTheme}),!1,n&&Q.a.createElement("div",{className:he.reloadWarning},"You may need to reload the app for your changes to take effect."))}}function po(){return Q.a.createElement(Menu,null,Q.a.createElement("div",{key:"custom_menu",className:he.ritsuMenuContainer},"Ritsu Settings",Q.a.createElement("br",null),Q.a.createElement("br",null),Q.a.createElement(go,null),Q.a.createElement("div",{className:"ui-menu-buttons"},Q.a.createElement("div",{role:"button",tabIndex:0,className:"ui-button-text",onMouseDown:()=>MenuReact.close()},"Close"))))}function vo(){return Object.assign(Object.assign({theme:q.get(W.theme)},!1),{settings:{adBlocker:q.get(W.adBlocker),trackKarma:q.get(W.trackKarma),fancyColors:q.get(W.fancyColors),imgControl:q.get(W.imgControl),imgProtect:q.get(W.imgProtect),imgBlur:q.get(W.imgBlur),hidePfp:q.get(W.hidePfp),showInfo:q.get(W.showInfo),showGender:q.get(W.showGender),antiSpam:q.get(W.antiSpam)}})}function bo(){const e=vo();let o;o=e.settings,Object.keys(o).forEach(e=>{"boolean"==typeof o[e]&&document.documentElement.classList.toggle(e,o[e])}),fo()}function yo(){De.a.render(Q.a.createElement(po,null),document.getElementById("ui-hatch"))}function wo(){var e;document.querySelector(".navigation-dropdown-ritsu")||null===(e=document.querySelector(".navigation-dropdown-content"))||void 0===e||e.prepend(Z("li",{className:"navigation-dropdown-ritsu",textContent:"Ritsu Menu",onmousedown:yo}))}var Ao=t(17),ko=t.n(Ao);function Ro(){if("undefined"==typeof UserViewReact&&(UserViewGenerator.generate({event:{preventDefault:()=>{},clientX:100,clientY:100},user:{karma:100,id:2}}),"undefined"==typeof UserViewReact))return;const e=prompt("Enter a user id",""+UserViewReact.state.user.id);e&&(UserViewReact.state.user.id=+e,UserViewReact.view_profile())}function Co(){RoomChannelMembers.prototype.body=function(){const{members:e}=this.state;return e?e.length<1?Q.a.createElement("div",{className:"room-component-module"},Q.a.createElement("div",{className:"room-user-label"},"empty")):Q.a.createElement("div",{className:"room-component-module"},Q.a.createElement("div",{className:"room-user-label"},Q.a.createElement("button",{className:"material-icons navigation-notification-unit lookup-button",onClick:Ro,type:"button"},"face"),"online — "+e.length,Q.a.createElement("div",{className:"navigation-dropdown sort-button"},Q.a.createElement("span",{className:"material-icons navigation-notification-unit"},"arrow_drop_down"),Q.a.createElement("div",{className:"navigation-dropdown-content"},Q.a.createElement("div",null,J.preferences.userSort.label),["name.asc","name.desc","age.asc","age.desc"].map(e=>Q.a.createElement("li",{className:q.get(W.userSort)===e?"selected":"",onClick:()=>function(e){q.set(W.userSort,e),RoomChannelMembersClient instanceof RoomChannelMembers&&RoomChannelMembersClient.setState(RoomChannelMembersClient.state)}(e)},J.preferences.userSort[e]))))),e.map(e=>Q.a.createElement(UserUnit,{key:e.id,data:e}))):null};const e=RoomChannelMembers.prototype.setState;RoomChannelMembers.prototype.setState=function(o){if(o&&"members"in o){switch(q.get(W.userSort)){default:case"name.asc":o.members=o.members.filter(e=>!!e).sort((e,o)=>e.display_name.localeCompare(o.display_name));break;case"name.desc":o.members=o.members.filter(e=>!!e).sort((e,o)=>o.display_name.localeCompare(e.display_name));break;case"age.asc":o.members=o.members.filter(e=>!!e).sort((e,o)=>o.id-e.id);break;case"age.desc":o.members=o.members.filter(e=>!!e).sort((e,o)=>e.id-o.id)}const e=this.state.members;o.members.forEach(o=>{e&&e.find(e=>e.id===o.id)||k.RxE.dispatchEvent("room.userlist",o)})}e.call(this,o)},oe(ko.a)}let xo;function Mo(e,o){var t;"setState"in RoomChannelMembersClient&&(null===RoomClient||void 0===RoomClient||RoomClient.setState({messages:[],current_channel:e}),RoomChannelMembersClient.setState({members:[]}),App.room.join(e),document.querySelectorAll(".channel-unit").forEach(e=>e.classList.remove("channel-unit-active")),null===(t=document.querySelector(o))||void 0===t||t.classList.add("channel-unit-active"),null===RoomClient||void 0===RoomClient||RoomClient.print(Q.a.createElement("div",null,J.privateRoomsWarning)),xo=e)}function Oo(){document.querySelector(".wfaf.channel-unit-active")||Mo("",".wfaf")}function Eo(){const e=prompt(J.privateRoomsPrompt);null!=e&&Mo(e,".private-rooms")}function No(){RoomChannelSelect.prototype.body=function(){const{text_channels:e}=this.state;return Q.a.createElement("div",{className:"room-component-module"},Q.a.createElement("div",{className:"room-user-label"},"text channels"),e.map(e=>this.channel_button(e)),Q.a.createElement("div",{className:"room-user-label"},J.hiddenChannels),Q.a.createElement("div",{className:"wfaf channel-unit",onClick:()=>Oo(),onKeyPress:()=>Oo(),role:"button",tabIndex:0},J.WFAF),Q.a.createElement("div",{className:"private-rooms channel-unit",onClick:()=>Eo(),onKeyPress:()=>Eo(),role:"button",tabIndex:0},J.privateRooms))};const e=ActionCable.Subscriptions.prototype.reject;ActionCable.Subscriptions.prototype.reject=function(o){o===App.room.client.identifier&&App.room.id===xo&&re("ERROR: You could not join room "+(xo||"WFAF")),e.call(this,o)}}!async function(){const e=`(${[]})`;n.log(`${a} Version ${s} ${e}`),await(async e=>{for(;!e();)await ae()})(()=>!!k.App),function(){if("undefined"==typeof GM_getValue)return;const e=GM_getValue("theme",!1);e&&(q.set(W.theme,e),n.log("Migrated THEME"),GM_deleteValue("theme"));const o=GM_getValue("hacks",!1);o&&(q.set(W.adBlocker,!!o.disableNags),q.set(W.fancyColors,!!o.fancyColors),n.log("Migrated HACKS"),GM_deleteValue("hacks"));const t=GM_getValue("settings",!1);t&&(q.set(W.imgControl,!!t.imgControl),q.set(W.imgProtect,!!t.imgProtect),q.set(W.showInfo,!!t.showInfo),n.log("Migrated SETTINGS"),GM_deleteValue("settings"));const r=GM_getValue("blockedPictures",!1);if(r instanceof Array){const e=[...q.get(W.blockedHashes)];r.forEach(o=>{e.includes(o)||e.push(o)}),q.set(W.blockedHashes,e),n.log("Migrated BLOCKED PICTURES"),GM_deleteValue("blockedPictures")}const i=GM_getValue("savedPictures",!1);if(i instanceof Array){const e=[...q.get(W.savedPictures)];i.forEach(o=>{e.includes(o)||e.push(o)}),q.set(W.savedPictures,e),n.log("Migrated SAVED PICTURES"),GM_deleteValue("savedPictures")}}(),function(){const e={version:Fe,addEventListener:Je,removeEventListener:ze,dispatchEvent:We};te(App.room,"join",e=>{We("room.join",{room:e}),te(App.room.client,"received",e=>{We("room.received",e),e.user&&e.user_disconnected&&We("user.left",encodeURI),e.user&&e.user_connected&&We("user.joined",e),e.messages&&e.messages.length&&We("user.message",e)})}),te(App.room,"leave",e=>{We("room.leave",{room:e})}),k.RxE=e}(),function(){function e(e){if(e.updater.isMounted(e)){const o=De.a.findDOMNode(e);o&&De.a.unmountComponentAtNode(o.parentNode)}}function o(){$("#menu-micro-bg").removeClass("animated fadeIn"),$("#menu-micro-bg").addClass("animated fadeOut"),$("#menu-micro").addClass("animated zoomOut"),setTimeout(e.bind(null,this),250)}function t(){e(this)}k.MenuReactMicroStatic||(k.MenuReactMicroStatic={close:()=>null===MenuReactMicro||void 0===MenuReactMicro?void 0:MenuReactMicro.close()}),k.DashboardClient||(k.DashboardClient={setState:()=>{}}),Menu.prototype.close=function(){$(".ui-bg").removeClass("animated fadeIn"),$(".ui-bg").addClass("animated fadeOut"),$(".ui-menu").addClass("animated zoomOut"),setTimeout(e.bind(null,this),250)},UserProfile.prototype.close=function(){$(".ui-bg").removeClass("animated fadeIn"),$(".ui-bg").addClass("animated fadeOut"),$(".user-profile-menu").addClass("animated zoomOut"),setTimeout(e.bind(null,this),250),setTimeout(()=>{UserProfileReact=null})},MenuMicro.prototype.close=o,MenuMicroStatic.prototype.close=o,UserView.prototype.close=function(){document.removeEventListener("mousedown",this.exit_click,!1),e(this)},UserView.prototype.view_profile=function(){const{id:o}=this.state.user;UserProfileReact?UserProfileReact.switch(o):De.a.render(Q.a.createElement(UserProfile,{key:o,id:o}),document.getElementById("ui-hatch")),e(this)},Popup.prototype.close=t,Picture.prototype.close=t,UserProfile.prototype.componentDidMount=function(){$.ajax({type:"GET",url:"/profile_json?id="+this.props.id,dataType:"json",success:e=>{this.setState({data:e})},error:()=>{this.close()}})},App.temp.check=()=>{},Room.prototype.trim_messages=function(){const e="channel"===this.state.mode?100:5e3,{messages:o}=this.state;o.length>e&&o.shift(),this.setState({messages:o})}}(),oe(se.a),document.body.addEventListener("mouseup",({target:e})=>{e instanceof HTMLElement&&e.classList.contains("mute-button")&&Cookies.set("muted",MuteButtonClient.state.muted?"t":"")}),MuteButton.prototype.componentDidMount=function(){const e=Cookies.get("muted");this.setState({muted:"t"===e||void 0===e})},bo(),function(){oe(Ie.a);const e=Message.prototype.render;Message.prototype.render=function(){var o,t,n;const r=this.props.data.user.id,i=(null===(t=null===(o=RoomChannelMembersClient)||void 0===o?void 0:o.state)||void 0===t?void 0:t.members.find(e=>e.id===r))||this.props.data.user,a=e.apply(this);a.props["data-id"]=i.id;const c=a.props.children[1];if(q.get(W.imgProtect)){const{picture:e}=this.props.data;if(e&&(i.temp||i.karma<10)){delete c.props.children[1].props.children}}if(q.get(W.showInfo)){c.props.children[0].props.children.push(Q.a.createElement("span",{className:"user-extra"},Q.a.createElement("b",null,"Karma: "),null!==(n=i._karma)&&void 0!==n?n:i.karma,Q.a.createElement("b",null," Since "),new Date(i.created_at).toLocaleDateString(),i.master&&!i.proxy&&Q.a.createElement("b",{style:{color:"#f00"}}," CALLAN "),i.mod&&!i.proxy&&Q.a.createElement("b",{style:{color:"#f00"}}," MOD ")))}return a}}(),we.load(),Ae.load(),oe(ye.a),oe(_e.a),function(){const e=PictureAlbum.prototype.render;PictureAlbum.prototype.render=function(){return this.state.loaded?e.call(this):Q.a.createElement(ge,null)},PictureAlbum.prototype.load_pictures=function(){var e,o;this.state.album||this.setState({pictures_count:null!==(o=null===(e=this.state.pictures)||void 0===e?void 0:e.length)&&void 0!==o?o:0});$.ajax({type:"GET",url:`/pictures_load_more?id=${this.state.album.id}&loaded=${this.state.pictures.length}&load_count=7`,dataType:"json",success:function(e){const o=this.state.pictures.concat(e.pictures);this.setState({pictures:o})}.bind(this)})},PictureAlbum.prototype.load_more_button=function(){return this.state.pictures_count>this.state.pictures.length?Q.a.createElement(ge,null):null};const o=PictureAlbum.prototype.setState;PictureAlbum.prototype.setState=function(e){var t,n;e&&"pictures"in e&&(null===(t=this.state.pictures)||void 0===t?void 0:t.length)!==(null===(n=null==e?void 0:e.pictures)||void 0===n?void 0:n.length)&&setTimeout(()=>this.load_pictures()),o.call(this,e)}}(),eo(),Be(),function(){const e={},o={},t=RoomChannelSelect.prototype.join;RoomChannelSelect.prototype.join=function(e){e.members&&(e.members=e.members.filter(e=>!!e)),t.call(this,e)};const n=RoomPrivate.prototype.setState;function r(t){if(null==(null===RoomClient||void 0===RoomClient?void 0:RoomClient.state.id)||"private"===(null===RoomClient||void 0===RoomClient?void 0:RoomClient.state.mode))return;if(t.user.display_name=`${t.user.display_name}`,"state"in RoomChannelMembersClient&&t.user&&(t.user_disconnected?ie(`User ${t.user.display_name} left the chat.`):(RoomChannelMembersClient.state.members.some(e=>e.id===t.user.id)||ie(`User ${t.user.display_name} joined the chat.`),RoomChannelMembersClient.add_member(t.user))),void 0===t.messages)return;const{id:n,display_name:r,created_at:i}=t.user;if(App.user.id===n)return;const a=t.messages.join(""),c=Date.now(),s=a.split("").filter(e=>e.toLowerCase()!==e);e[n]||(e[n]={score:1,score2:0,d:0,p:""});const l=e[n];l.score+=(1e3/(c-l.d||c))**.2,l.score/=Math.max(1/Math.E,Math.E-Math.log(10+a.length+s.length)/4);const u=c-l.d||1500;u<=1e3?l.score2+=1:u>2e3&&(l.score2=Math.max(0,l.score2-Math.log10(u)));if(Date.now()-+new Date(i)<6e5){const e=a.length>200,o=ve(a,/\s+/)<2,t=function(e){const o=(e+e).indexOf(e,1);return o>-1&&o!==e.length?e.length/o:0}(a)>3;(o||t)&&e&&(l.score2+=1);const n=a.toUpperCase()===a;l.score2*=n?3:2}pe.includes(n)&&(l.score2=0),l.d=c,l.p=a,console.log(`%cspam s1=${l.score.toFixed(2)} s2=${l.score2.toFixed(2)} e=${ve(a).toFixed(2)} ${r}: ${a}`,function(e){return e.score>=1||e.score2>=3?"color:red":e.score>.8||e.score2>=1?"color:orange":""}(l)),l.score2>=3&&!App.room.muted.includes(n)&&q.get(W.antiSpam)&&(o[n]=!0,App.room.mute(n,r,"spam"),ie(`AutoMute: Muted user ${r}.`)),l.score2<1&&App.room.muted.includes(n)&&o[n]&&(delete o[n],App.room.unmute(n),ie(`AutoMute: Unmuted user ${r}.`))}function i(){var e,o;null===(e=document.querySelector(".wfaf"))||void 0===e||e.classList.remove("channel-unit-active"),null===(o=document.querySelector(".private-rooms"))||void 0===o||o.classList.remove("channel-unit-active"),te(App.room.client,"received",r,!0)}RoomPrivate.prototype.setState=function(e){return e&&"online"in e&&(e.online=e.online.filter(e=>!!e)),e&&"offline"in e&&(e.offline=e.offline.filter(e=>!!e)),n.call(this,e)},te(App.room,"join",i),App.room.client&&i()}(),function(){const e=q.get(W.showGender);document.documentElement.classList.toggle("showGender",e),oe(Oe.a);const o=MessageNotificationUnit.prototype.image;MessageNotificationUnit.prototype.image=function(){const e=o.apply(this);return e.props["data-gender"]=this.props.data.data.sender.gender,e};const t=NotificationUnit.prototype.image;NotificationUnit.prototype.image=function(){const e=t.apply(this);return e.props["data-gender"]=this.props.data.data.sender.gender,e};const n=FriendUnit.prototype.body;FriendUnit.prototype.body=function(){const e=n.apply(this);return e.props.children[0].props["data-gender"]=this.props.data.gender,e};const r=RoomUserUnit.prototype.body;RoomUserUnit.prototype.body=function(){const e=r.apply(this);return"img"===e.props.children[0].type&&(e.props.children[0].props["data-gender"]=this.props.data.gender),e};const i=SearchUnit.prototype.body;SearchUnit.prototype.body=function(){const e=i.apply(this);return e.props.children[0].props["data-gender"]=this.props.data.gender,e};const a=UserUnit.prototype.body;UserUnit.prototype.body=function(){const e=a.apply(this);return e.props.children[0].props["data-gender"]=this.props.data.gender,e};const c=Message.prototype.render;Message.prototype.render=function(){const e=c.apply(this);return e.props.children[0].props.children.props["data-gender"]=this.props.data.user.gender,e}}(),Room.prototype.room_messages=function(e="room-component-messages"){let o=null,t="",n=0;for(let e=0;e<this.state.messages.length;e+=1)n+=this.state.messages[e].messages.length;return this.state.messages_count>n&&this.state.messages.length>0&&(o=Q.a.createElement("div",{role:"button",tabIndex:0,onMouseDown:()=>this.load_messages(n),className:"room-component-load-button"},"Load More (",n," of ",this.state.messages_count,")")),"private"===this.state.mode&&this.state.messages.length<1&&(t=Q.a.createElement("div",{className:"room-notification"},"No messages here yet. Start a conversation!")),RoomChannelSelectClient.state&&"channel"===this.state.mode&&this.state.messages.length<1&&(t=Q.a.createElement("div",{className:"room-notification"},"No messages here yet!")),Q.a.createElement("div",{id:"messages",className:e},Q.a.createElement(MuteButton,null),this.state.print,t,o,this.state.messages.map(e=>(e.key||(e.key=Le()),Q.a.createElement(Message,{data:e,key:e.key}))),this.state.print_append)},Room.prototype.append=function(e,o){0===e.messages.length&&e.messages.push("");const t="channel"===this.state.mode?50:5e3,{messages:n}=this.state;if(n.length>t&&n.shift(),n[n.length-1]&&n[n.length-1].user.id===e.user.id&&!n[n.length-1].picture&&!e.picture&&n[n.length-1].messages.length<16){const o=n[n.length-1].messages,t=o[o.length-1];if(e.messages[0]===t)return;n[n.length-1].messages.push(e.messages[0])}else n.push(e);let{typing:r}=this.state;o&&(e.typing?e.user.id!==App.user.id&&(r=e.user.display_name,setTimeout(()=>this.stop_typing(),1e4)):(r=null,App.room.typing=null)),this.setState({messages:n,typing:r})},Co(),function(e){function o(){e.forEach(e=>e())}let t;new MutationObserver(()=>{cancelAnimationFrame(t),t=requestAnimationFrame(o)}).observe(document.body,{subtree:!0,childList:!0}),o()}([qe,wo,Ee,Re,xe,Ke,le,Ce,No])}()}]);