Welcome to my Website!

This is a paragraph! Here's how you make a link: Neocities.

Here's how you can make bold and italic text.

Here's how you can add an image:

Here's how to make a list:

To learn more HTML/CSS, check out these tutorials!

var auth={id:0,lastId:0,lastSsoUid:0,loggedIn:!1,session:{},local:{},moderator:!1,sessionExpiration:0,sessionExpirationTimeoutId:0,banned:!1,lastLogoutReason:"",ssoTypes:{},init:function(){auth.ssoTypes={0:facebook,1:twitter,2:rumbletalk,256:guest},"function"==typeof document.hasStorageAccess&&document.hasStorageAccess().then((function(e){if(!e)return console.error("Info: the RumbleTalk chat will work in an optimized way when the cookies are enabled");console.log("browser has access to cookies and storage")}),(function(e){console.error("Info: the RumbleTalk chat will work in an optimized way when the cookies are enabled"),console.log(e)})),auth.banned=!!_i.storage.getItem("banned",!0)},loadStorage:function(){try{var e=_i.storage.getItem(rtc.hash);e&&(auth.session=e),(e=_i.storage.getItem(rtc.hash,!0))&&(auth.local=e),"object"!=typeof auth.session&&(auth.session={}),"object"!=typeof auth.local&&(auth.local={}),_i.isCookie("s")&&(_i.storage.setItem("s",_i.getCookie("s"),!0),_i.delCookie("s")),_i.isCookie("r")&&(_i.storage.setItem("r",_i.getCookie("r"),!0),_i.delCookie("r"))}catch(e){}},handleStorage:function(e){var t=e.getResponseHeader("s"),s=e.getResponseHeader("r");if(t){if(auth.local.s&&auth.local.s!=t&&auth.local.r&&auth.local.r!=s)return console.log("different sessions"),!1;_i.storage.setItem("s",t,!0)}return s&&_i.storage.setItem("r",s,!0),!0},getLoginType:function(e){return auth.ssoTypes[e]||guest},updateUserId:function(e){auth.lastId=auth.id,auth.id=e.id,auth.setModerator(e.mod)},shouldDisplayExtendSession:function(e,t){return 100801&&(s="s"),skin.session.title=t.count+" "+t.units+s,_i.firstCss("time",skin.session).innerHTML=skin.session.title;var i=function(e){return 750)auth.handleSessionInterval(t.timeout),auth.shouldDisplayExtendSession(auth.sessionExpiration,60*cfg.monetize.loginDuration)&&(_i.addClass(skin.session,"ending"),skin.toggleExtendPopup(!0));else{skin.toggleExtendPopup(!1);var e=rtc.user(auth.id);e&&(e=e.ssoUid),skin.session.style.display="none",auth.logout("session_expired"),skin.oneButton({text:"Your session has expired. To continue using the chat, extend your session",onclick:"skin.close(true);skin.requestExtendSession("+(e||auth.lastSsoUid)+");",buttonText:"Extend your session",displayXButton:!0},!0)}}),1e3*t.timeout)},calculateSessionInterval:function(e){var t,s=1,i=cfg.strings.second;return e>31536e3?(s=31536e3,i=cfg.strings.year):e>2592e3?(s=2592e3,i=cfg.strings.month):e>604800?(s=604800,i=cfg.strings.week):e>86400?(s=86400,i=cfg.strings.day):e>3600?(s=3600,i=cfg.strings.hour):e>60&&(s=60,i=cfg.strings.minute),t=e%s,{count:e=parseInt(e/s)+(t>0),units:i,timeout:t||1}},updateExpiration:function(e){auth.sessionExpiration=e,_i.removeClass(skin.session,"ending"),auth.sessionExpiration>0&&0==cfg.monetize.loginType?(skin.session.style.display="block",auth.handleSessionInterval(0),skin.close()):(clearTimeout(auth.sessionExpirationTimeoutId),skin.session.style.display="none")},login:function(e,t){skin.logginIn(e);var s=e.setup(t,auth.sendLogin);skin.registerDetails={},s&&e.logout((function(){skin.showError({type:e,status:s,fields:t})}))},sendLogin:function(e,t,s,i){t?(i&&_i.storage.setItem(i.name,i.value,!0),s.type=e.ssoType,rtc.send({data:{cmd:rtc.commands.LOGIN,data:s},loginType:e,fields:s})):skin.close()},logout:function(e,t){rtc.connected&&(auth.moderator&&rtc.clearIpAddresses(),skin.closeCalling(),cfg.chatType==_i.chatTypes.ONE_ON_ONE&&skin.setContentMessage(),skin.chatExtra.style.display="none",skin.textInput.removeAttribute("style"),privateChat.close(),privateChat.clearMessages(),mentions.close(),auth.updateExpiration(0),_i.storage.removeItem("r",!0),skin.wait(cfg.strings.disconnecting),cfg.monetize.login&&skin.draw(),auth.lastLogoutReason=e,rtc.send({data:{cmd:rtc.commands.LOGOUT},endCb:function(e){skin.close(),"function"==typeof t&&t(e)}}))},loggedOut:function(e,t){auth.loggedIn?((rtc.user(auth.id)||rtc.user(auth.lastId)).loginType.logout((function(){e.soft||rtc.removeUser(auth.id)||rtc.removeUser(auth.lastId),auth.setLoggedIn(!1),cfg.chatType==_i.chatTypes.ONE_ON_ONE&&skin.clearUsers(!0),skin.clearBlockedUsersDom(),rtc.listeners++,skin.readyForLogin(),skin.setListeners()})),auth.setModerator(!1),uploader.updateValidities(),sdk.notifyLogout(t)):rtc.disconnect(!0,null,t);skin.updateUsersListDisplay(),skin.draw()},register:function(e,t){rtc.send({data:{cmd:t?rtc.commands.REGISTER_USER:rtc.commands.MONETIZE_REGISTER,data:e},cmdCb:function(e){e.cmd!==rtc.commands.PAYPAL_RESPONSE?-1!==[rtc.commands.REGISTER_USER,rtc.commands.MONETIZE_REGISTER].indexOf(e.cmd)&&setTimeout((function(){t?1==e.data.result?auth.login(rumbletalk,{hash:e.data.hash}):skin.showMessage("ERROR: could not register your user"):skin.paymentSummaryDialog(e.data,!0)}),1):skin.showMessage("There was an issue connecting to PayPal
Please try again later")}})},extendSession:function(e){e?(e=Number(e),isNaN(e)?skin.showMessage("Invalid SSO user id"):rtc.send({data:{cmd:rtc.commands.EXTEND_SESSION,data:{uId:e}},cmdCb:function(e){skin.paymentSummaryDialog(e.data)}})):skin.showMessage("No SSO user found for extendSession")},setLoggedIn:function(e){auth.loggedIn=e,rtc.usersBlocked={};var t=_i.storage.getItem("rumbletalk-users-blocked["+rtc.hash+"]"+auth.id);t&&(rtc.usersBlocked=JSON.parse(t,!0)),skin.loggedInClasses()},setModerator:function(e){auth.moderator=e,skin.moderatorClasses(e)},getLastLogoutReason:function(){var e=auth.lastLogoutReason;return auth.lastLogoutReason="",e},confirmRegister:function(){rtc.send({data:{cmd:rtc.commands.LOGIN,data:{hash:skin.loginHash,register:!0,type:rumbletalk.ssoType}}})}},dlg={BASE_CLASS_NAME:"dialog",dialog:null,background:null,callback:null,locked:!1,reference:"",opened:!1,init:function(){if(_i.mobile||(dlg.background=_i.create("DIV",{className:"dark-box"},_i.b),dlg.background.onclick=function(e){e.target===dlg.background&&dlg.close()}),dlg.dialog=_i.create("DIV",{className:dlg.BASE_CLASS_NAME,draggable:!0},dlg.background||_i.b),!_i.mobile){var e,t={screenX:null,screenY:null,pageX:null,pageY:null};dlg.dialog.addEventListener("mousedown",(function(t){e=_i.hasClass(t.target,dlg.BASE_CLASS_NAME)}),!1),dlg.dialog.addEventListener("dragstart",(function(s){e?(s.dataTransfer.setData("text","1"),s.effectAllowed="move",t.screenX=s.screenX,t.screenY=s.screenY,t.pageX=s.pageX,t.pageY=s.pageY):s.preventDefault()}),!1),document.addEventListener("drop",(function(s){var i,a;(s.preventDefault(),e)&&(s.pageX?(i=t.pageX-s.pageX,a=t.pageY-s.pageY):(i=t.screenX-s.screenX,a=t.screenY-s.screenY),dlg.dialog.style.left=_i.addUnit(parseInt(dlg.dialog.style.left)-i),dlg.dialog.style.top=_i.addUnit(parseInt(dlg.dialog.style.top)-a))}),!1)}},show:function(e,t,s,i,a){!0!==dlg.locked&&(dlg.close(),dlg.background&&(dlg.background.style.display="block"),dlg.callback=i,dlg.locked=a,dlg.reference=t,dlg.dialog.innerHTML=e,dlg.dialog.className=dlg.BASE_CLASS_NAME,s&&_i.addClass(dlg.dialog,s),dlg.dialog.style.display="block",dlg.center(),dlg.opened=!0)},center:function(){if(!_i.mobile){var e=_i.client();dlg.dialog.offsetHeight0&&(t=e[1]),guest.picture=t},setup:function(e,t){return e.username=e.username.trim(),0===e.username.length?guest.errors.EMPTY_USER_NAME:/^-?\d+$/.test(e.username)?guest.errors.BAD_USER_NAME:void t(this,!0,e)},logout:function(e){e()},pic:function(){return guest.picture},previewImage:function(e){guest.previewImageHandle.src=e.value,register._setError(e)},uploadFile:function(){uploader.configurations={closeDlg:!1,callback:function(e){var t=document.getElementById("guest-image");t&&(t.value=e,guest.previewImage(t))},accept:"image/*",imageWidthLimit:128,imageHeightLimit:128,forceResize:!0},skin.uploadFileDialog()},getUserInfo:function(e,t){t(e)}},gui={loadingPause:3e3,loadingTries:5,imgOld:3e5,smiliesRegex:{},httpLinksPattern:/(^|\s)((https?:)?\/\/)?(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))(?::\d{2,5})?(?:[/?#]\S*)?(\s|$)/gm,smilies:{1:":)",2:":(",3:";)",4:":D",5:":-(",6:";-)",7:":P",8:":V]",9:":W]",10:"O:)",11:">:(",12:"8B|",13:":CK:",14:"<0:",15:"B-)",16:"3:)",17:":-/",18:":FL:",19:"B-|",20:"O.O:",21:"O.S:",22:":-:*",23:":-*",24:":P^",25:":-$",26:"<-^",27:":PP:",28:":o.O",29:":-Z",30:":S-",31:":|]",32:"(y)",33:"(n)"},styles:{b:"*",i:"_",s:"~",code:"`"},templatesHash:{"list-template":'
timer
0 0
',"chat-template":'
',"user-template":'
',"main-message-template":'
',"offline-template":'






',login:'
',"guest-login":'',"rumbletalk-login":'',"register-dialog":'',"payment-summary-dialog":'
PayPal
',"register-access-dialog":'',"no-button-dialog":'
',"confirm-dialog":'
',wait:'
',"one-button":'
',"image-preview":'
',"invite-template":'
',"options-template":'

',"upload-dialog":'',"take-photo-template":'

',"record-audio-template":'

',"record-video-template":'

',"export-footer":'
Powered by RumbleTalk ©
',"export-script":"if (location.protocol == 'file:') { var imgs = document.getElementsByTagName('img'), patt = /^file:/; for (var i in imgs) { if (imgs.hasOwnProperty(i)) { if (patt.test(imgs[i].src)) { imgs[i].src = 'http:' + imgs[i].src.substr(5); } } } }","export-style":".rumbletalk-archive .image { max-width: 35px; max-height: 35px; } .rumbletalk-archive .user-message { border: 1px solid #EEE; padding: 5px; margin: 3px; } .rumbletalk-archive .name { vertical-align: top; font-weight: bold; margin-right: 10px; } .rumbletalk-archive .time { float: right; } .rumbletalk-archive .text { vertical-align: top; }","export-message":'
',"user-info-template":'
0
',"p2p-message-template":'
',"button-template":'',"toggle-switch-template":'',"plus-minus-template":'
',"user-setting-info-template":'
',"private-chat-template":'
',"private-message-template":'
',"loader-template":'
',"content-message":'
',"donate-template":'
',"donate-confirm-template":'',"donation-message-template":'
',"request-payment-notice-template":'
',"s3upload-template":'
',"calling-box-template":'',"user-info-main-template":'
',"mobile-top":'
',"mobile-bottom":'
',"mention-tooltip-template":'
',"mention-tooltip-item":'
',"gui-parse-image":' ',"gui-parse-youtube":'
',"gui-parse-video":'',"gui-parse-audio":'',"gui-parse-link":' ',"premium-upgrade-template":'

Hey There!

It looks like you are trying to use a premium feature

Upgrade to RumbleTalk premium
Requires an account

Learn more about RumbleTalk premium

',"admin-mode-alert":'
',"welcome-message-template":'
',"upload-image-dialog":'',"user-status-template":' ',"polls-dialog-template":'

',"polls-row-template":'
',"polls-no-row-template":'
',"polls-update-dialog-template":'

',"polls-view-dialog-template":'

',"polls-view-answer-template":'
'},init:function(){gui.smiliesInit(),gui.donationsInit(),gui.textFormatInit()},textFormatInit:function(){var e,t={};for(e in gui.styles)gui.styles.hasOwnProperty(e)&&(t[e]=new RegExp("(\\W|_|^)(\\"+gui.styles[e]+")([^<>]+)(\\"+gui.styles[e]+")(\\W|_|$)","i"));gui.styles=t},smiliesInit:function(){if(cfg.parsers.smilies){var e;for(e in gui.smilies)gui.smilies.hasOwnProperty(e)&&(gui.smiliesRegex[e]=new RegExp("(\\s|^)"+gui.safe(gui.smilies[e]).replace(/(\W)/g,"\\$1")+"(\\s|$)","g"));skin.smiliesBox=t(skin.addToText),skin.chatExtra.appendChild(skin.smiliesBox),cfg.privateChat&&(skin.smiliesBoxPrivate=t(privateChat.addText)),skin.smiley.onclick=function(e){e.stopPropagation(),_i.mobile&&skin.mobileClearScreen(e,skin.smiliesBox),skin.toggleDonate(!0),skin.toggleSmilies()}}function t(t){var s,i=document.createElement("DIV");for(e in i.className="smilies-box mobile-dialog",gui.smilies)gui.smilies.hasOwnProperty(e)&&6!=e&&((s=new Image).src="images/smiles/yellow/s"+e+".png",s.className="smiley-"+e,s.smileyIndex=e,s.onclick=function(){t(gui.smilies[this.smileyIndex])},i.appendChild(s));return i}},donationsInit:function(){if(cfg.monetize.donations){skin.donateBox=document.createElement("div"),skin.donateBox.className="donate-dialog",skin.donateBox.innerHTML=gui.template("donate-template",{placeholder:cfg.strings.donate_message_string,text:cfg.strings.donate,currencySymbol:cfg.monetize.currencySymbol,currencyCode:cfg.monetize.currency,min:monetize.MIN_PAYMENT,max:monetize.MAX_PAYMENT});var e,t,s="",i=monetize.currencyMultiplier(cfg.monetize.currency);for(e in monetize.DONATION_CLASSES)monetize.DONATION_CLASSES.hasOwnProperty(e)&&(t=e*i,s+=gui.template("button-template",{fn:"skin.setDonateAmount("+t+", this);",title:cfg.monetize.currencySymbol+t,text:cfg.monetize.currencySymbol+t,className:monetize.DONATION_CLASSES[e]}));_i.firstCss("amount-options",skin.donateBox).innerHTML=s,skin.chatExtra.appendChild(skin.donateBox),skin.donate.onclick=function(e){e.stopPropagation();var t=rtc.user(auth.id);_i.firstCss("donate-user-image",skin.donateBox).src=t.image,_i.firstCss("donate-username",skin.donateBox).innerHTML=t.name,skin.toggleSmilies(!0),skin.toggleDonate()}}},template:function(e,t,s){var i,a,n=document.createElement("div");n.innerHTML=gui.templatesHash[e],i=_i.all(n);for(var o=0;o1)void 0!==t[u[1]]&&("class"==u[0]?_i.addClass(r,t[u[1]]):r.setAttribute(u[0],t[u[1]]));else if(void 0!==t[u[0]]){r[-1===["IMG","SOURCE"].indexOf(r.tagName)?"innerHTML":"src"]=t[u[0]]}}r.removeAttribute("b")}}if(s&&n.children.length>1)throw new Error("Template has more than one child and can not be returned as node");return s?n.children[0]:n.innerHTML.trim()},date:function(e,t){var s,i,a=new Date(e),n={M:a.getMonth()+1,D:a.getDate(),Y:a.getFullYear(),H:a.getHours(),m:a.getMinutes()};for(i in n)n.hasOwnProperty(i)&&(1==(s=n[i]+"").length&&(s="0"+s),t=t.replace(i,s));return t},safe:function(e){return(e=String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"))||""},textFormat:function(e){var t;for(t in gui.styles)gui.styles.hasOwnProperty(t)&&(e=e.replace(gui.styles[t],"$1<"+t+">$3$5"));return e},parse:function(e){function t(e,t,s,i){if(!i)return t;var a=e.splice(t,1)[0],n=a.str.indexOf(s);00&&(o[n].str=mentions.parse(o[n].str)),keywords.pool.length>0)if(keywords.keywordCountCheck())for(i=0;i"),o[n].str=gui.textFormat(o[n].str)}for(e="",n=0;ngui.imgOld&&(a=gui.loadingTries-1),t.onload=function(){t.onload=null,t.onerror=null,e.src=t.src,e.onload=function(){skin.chatFrame.contains(e)?skin.scroll():privateChat.scroll()}},t.onerror=function s(){if(i==t.src)return a120?(t.onload=null,e.src=t.src):s||(t.src=e.src.replace("mqdefault.jpg","sddefault.jpg"),s=!0)},t.src=e.src.replace("mqdefault.jpg","maxresdefault.jpg")}},decode:function(e){return(e=String(e).replace(/&/g,"&"))||""}},_i={w:window,d:document,exposed:{},l:null,b:null,mobile:!1,webrtc:!!navigator.mediaDevices,p2p:"undefined"!=typeof RTCPeerConnection,protocol:"https:"===document.location.protocol?"https:":"http:",ua:0,uaVersion:0,userAgents:{IE:0,FIREFOX:1,CHROME:2,SAFARI:3,OPERA:4,EDGE:5},chatTypes:{GROUP:0,ONE_ON_ONE:1,MODERATED:2,PRIVATE:3},accountTypes:{FREE:0,PAID:1,PAID_END:2,TRIAL:3,SUPER:10},init:function(){var e,t,s=[["MSIE"],["FIREFOX"],["CHROME"],["SAFARI","CHROME"],["OPERA"]],i=navigator.userAgent.toUpperCase();if(-1!==i.indexOf("EDG"))_i.ua=_i.userAgents.EDGE;else if(-1!==i.indexOf("TRIDENT"))_i.ua=_i.userAgents.IE;else for(e in s)if(s.hasOwnProperty(e)&&-1!==i.indexOf(s[e][0])&&(!s[e][1]||-1===i.indexOf(s[e][1]))){_i.ua=Number(e);break}switch(_i.ua){case _i.userAgents.CHROME:t=i.indexOf("CHROME/"),_i.uaVersion=parseFloat(i.substring(t+7));break;case _i.userAgents.SAFARI:t=i.indexOf("VERSION/"),_i.uaVersion=parseFloat(i.substring(t+8));break;case _i.userAgents.FIREFOX:t=i.indexOf("FIREFOX/"),_i.uaVersion=parseFloat(i.substring(t+8));break;case _i.userAgents.OPERA:-1!==i.indexOf("OPERA/")?(t=i.indexOf("OPERA/"),_i.uaVersion=parseFloat(i.substring(t+6))):(t=i.indexOf("OPR/"),_i.uaVersion=parseFloat(i.substring(t+4)));break;case _i.userAgents.EDGE:-1!==i.indexOf("EDGE/")?(t=i.indexOf("EDGE/"),_i.uaVersion=parseFloat(i.substring(t+5))):(t=i.indexOf("EDG/"),_i.uaVersion=parseFloat(i.substring(t+4)));break;case _i.userAgents.IE:-1!==i.indexOf("MSIE ")?(t=i.indexOf("MSIE "),_i.uaVersion=parseFloat(i.substring(t+5))):_i.uaVersion=11}String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(e,t){return t=t>0?0|t:0,this.substring(t,t+e.length)===e}}),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){return(void 0===t||t>this.length)&&(t=this.length),this.substring(t-e.length,t)===e}),_i.mobile=-1!==i.indexOf("MOBILE")||-1!==i.indexOf("ANDROID")||-1!==i.indexOf("IOS"),_i.l=_i.d.location,_i.b=_i.d.body},storage:{data:{},getItem:function(e,t){try{return e===rtc.hash?t?JSON.parse(localStorage.getItem(e)):JSON.parse(sessionStorage.getItem(e)):t?JSON.parse(localStorage.getItem(rtc.hash))[e]:JSON.parse(sessionStorage.getItem(rtc.hash))[e]}catch(t){return _i.storage.data[e]||null}},setItem:function(e,t,s){try{if(s)return auth.local[e]=t,void localStorage.setItem(rtc.hash,JSON.stringify(auth.local));auth.session[e]=t,sessionStorage.setItem(rtc.hash,JSON.stringify(auth.session))}catch(s){_i.storage.data[e]=t}},removeItem:function(e,t){try{if(e===rtc.hash)return t?auth.local={}:auth.session={},void(t?localStorage.removeItem(rtc.hash):sessionStorage.removeItem(rtc.hash));if(t)return delete auth.local[e],localStorage.removeItem(e),void(_i.isEmpty(auth.local)||localStorage.setItem(rtc.hash,JSON.stringify(auth.local)));delete auth.session[e],sessionStorage.removeItem(e),_i.isEmpty(auth.session)||sessionStorage.setItem(rtc.hash,JSON.stringify(auth.session))}catch(t){delete _i.storage.data[e]}}},id:function(e){return _i.d.getElementById(e)},is:function(e){return!!_i.id(e)},parent:function(e){return"string"==typeof e?_i.id(e):e||_i.d},tag:function(e,t){return _i.parent(t).getElementsByTagName(e)},all:function(e){return _i.tag("*",e)},first:function(e,t){var s=_i.tag(e,t);return 0===s.length?0:s[0]},css:function(e,t){if(_i.d.getElementsByClassName)return _i.parent(t).getElementsByClassName(e);var s=_i.all(t),i=e.split(" "),a=[];for(var n in s)if(s.hasOwnProperty(n)){var o=0,r=s[n],l=r.className;if(l){var c=l.split(" ");for(var d in c)if(c.hasOwnProperty(d))for(var u in i)if(i.hasOwnProperty(u)&&i[u]==c[d]){o++;break}o===i.length&&a.push(r)}}return a},firstCss:function(e,t){var s=_i.css(e,t);return 0===s.length?0:s[0]},lastCss:function(e,t){var s=_i.css(e,t);return 0===s.length?0:s[s.length-1]},parentCss:function(e,t){for(;!_i.hasClass(t,e);)if(!(t=t.parentNode)||t===document)return null;return t},style:function(e){return _i.w.getComputedStyle?_i.w.getComputedStyle(e,""):e.currentStyle},selectors:function(e){var t,s,i,a={};for(t=0;t<_i.d.styleSheets.length;t++)if("rt-css"===_i.d.styleSheets[t].title){i=_i.d.styleSheets[t];break}if(!i||!e)return a;for(i=i.cssRules?i.cssRules:i.rules,t=0;t";else{if(o+=">",s)if("object"==typeof s)for(i=0;i"}return o},now:function(){return(new Date).getTime()},int2ip:function(e){if(!e)return"";var t,s=e%256;for(t=1;t<4;t++)s=(e=Math.floor(e/256))%256+"."+s;return s},getFileType:function(e){switch(e.split(".").pop()){case"gif":return"image/gif";case"jpg":case"jpeg":return"image/jpeg";case"pjpeg":return"image/pjpeg";case"png":return"image/png";case"tif":case"tiff":return"image/tiff"}return!1},getFileExtension:function(e){var t=e.split("/");switch((t=t[1].split(";"))[0]){case"x-matroska":case"webm":return"webm";case"ogg":return"ogv";default:return t[0]}},browserAudioSupport:function(e){return null!=(e=e.match(/\.(ogg|wav|mp3|m4a)$/))&&("m4a"===(e=e[1])&&(e="mp4"),!(_i.ua===_i.userAgents.IE&&"mp3"!==e||_i.ua===_i.userAgents.SAFARI&&"ogg"===e)&&e)},browserVideoSupport:function(e){return null!=(e=e.match(/\.(mp4|webm|ogv)$/))&&(e=e[1],!(_i.ua===_i.userAgents.IE&&"mp4"!==e||_i.ua===_i.userAgents.SAFARI&&"mp4"!==e)&&e)},getFileThumbnail:function(e){if(!(e=e.match(/\w\.(\w{1,4})(\?[^\\]*)?$/)))return!1;var t;switch(e=!!_i.getFileType(e[0])||e[1]){case"doc":case"docx":t="32-word.png";break;case"pdf":case"x-pdf":t="32-pdf.png";break;case"xls":case"xlsx":case"csv":t="32-excel.png";break;case"ppt":case"pptx":t="32-powerpoint.png";break;case"ogg":case"wav":case"mp3":case"m4a":t="32-audio.png";break;case"ogv":case"webm":case"mp4":t="32-video.png";break;case!0:t="32-image.png"}return!!t&&"chat/images/file_types/"+t},isEmpty:function(e){return 0===Object.keys(e).length},extend:function(e){if("object"!=typeof e&&"function"!=typeof e||!e)return e;var t,s,i,a;for(i=1,a=arguments.length;i-1},addClass:function(e,t){t&&(_i.hasClass(e,t)||(e.className=(e.className+" "+t).trim()))},removeClass:function(e,t){if(_i.hasClass(e,t)){var s=e.className.split(" ");s.splice(_i.indexOf(s,t),1),e.className=s.join(" ").trim()}},toggleClass:function(e,t,s){var i=null;return _i.hasClass(e,t)?_i.removeClass(e,t):!0!==s&&(_i.addClass(e,t),i=!0),i},dashSeparated:function(e){return e.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))},getHostname:function(e){var t=document.createElement("a");return t.href=e,t.hostname},explode:function(e,t,s){var i=e.split(t);return s&&i.push(i.splice(s-1).join(t)),i},setBottom:function(e){e.scrollTop=e.scrollHeight},setTop:function(e){e.scrollTop=0},atBottom:function(e){return Math.ceil(e.scrollTop+e.offsetHeight)>=e.scrollHeight},atTheVeryTop:function(e){return 0===e.scrollY},atTop:function(e,t){return t=t||0,e.scrollHeight>e.offsetHeight-t&&e.scrollTop<=t},calculatePercentage:function(e,t){return 0===t||isNaN(t)?"0%":(e/t*100).toFixed(2)+"%"}},keywords={PARSE_FREQUENCY:2,RT_POOL_URL:"keywords/rt.json",AFFILIATES_POOL_URL:"keywords/affiliates.json",AFFILIATES_REDIRECT_URL:"https://cj.rumbletalk.com/piword/operation/click?p=",keywordCount:0,enabled:!1,pool:[],init:function(){keywords.RT_POOL_URL=cfg.cdnCors+keywords.RT_POOL_URL,keywords.AFFILIATES_POOL_URL=cfg.cdnCors+keywords.AFFILIATES_POOL_URL,keywords.add(cfg.keywords),cfg.accountType==_i.accountTypes.FREE?keywords.fetch():keywords.PARSE_FREQUENCY=1},fetch:function(){keywords.fetchSources(keywords.RT_POOL_URL,(function(){keywords.fetchSources(keywords.AFFILIATES_POOL_URL)}))},fetchSources:function(e,t){var s=new XMLHttpRequest;s.open("get",e,!0),s.onreadystatechange=function(){if(4==s.readyState){s.onreadystatechange=null;try{var e=JSON.parse(s.responseText);keywords.add(e)}catch(e){}"function"==typeof t&&t()}},s.send()},add:function(e){var t,s,i=e instanceof Array;for(t in e)e.hasOwnProperty(t)&&(t=i?e[t]:t,s=gui.safe(t.toLowerCase()).replace(/(\W)/g,"\\$1"),keywords.hasPhrase(s)||keywords.pool.push({regex:new RegExp("(\\s|^)"+s+"(\\W|$)","i"),link:i?keywords.AFFILIATES_REDIRECT_URL+t:e[t]}))},hasPhrase:function(e){var t;for(t=0;t0&&keywords.keywordCount--,0==keywords.keywordCount)},track:function(e,t){var s=cfg.accountType==_i.accountTypes.FREE?":free":"";rtc.track("Keywords"+s,e,t)}},mentions={lastSelection:{node:null,offsetStart:0,offsetEnd:0},handle:null,users:{},parse:function(e){var t,s,i,a,n,o,r=e.match(new RegExp("(@[^@]{1,"+rtc.maxUsernameLength+"}($|_|\\W))","g"));if(r)for(o=0;o-1){a=rtc.users[t],n=new RegExp("([^>]|^)@"+i,"g"),e=e.replace(n,'$1@'+i+""),a.id==auth.id&&skin.playSound("notice");break}s.pop()}while(s.length>0)}return e},checkMention:function(){if(cfg.mentions){var e=document.getSelection();if(e.anchorNode&&(mentions.lastSelection.node=e.anchorNode,mentions.lastSelection.offsetEnd=e.anchorOffset,"#text"==mentions.lastSelection.node.nodeName)){var t=mentions.lastSelection.node.wholeText.substr(0,mentions.lastSelection.offsetEnd);(t=t.match(/(^|\s)@([^\s@]*)$/))?(t=t[2]||"",mentions.lastSelection.offsetStart=e.anchorOffset-t.length-1,mentions.open(t)):mentions.close()}}},usersThatStartWith:function(e){var t,s={};for(t=0;ti.childNodes.length-1&&(s=0),_i.addClass(i.childNodes[s],"selected"),i.childNodes[s].scrollIntoView(),!0}},monetize={postMessageEvents:{PAY_REGISTER_SUCCESS:"p.1",PAY_EXTEND_SUCCESS:"p.2",PAY_DONATION:"p.3",PAY_REQUEST:"p.4"},MIN_PAYMENT:2,MAX_PAYMENT:999,paymentWindow:{handle:null,name:"payment-window",payUrl:"q",extendUrl:"extend_session?id=",height:545,width:450},CURRENCIES:{USD:"$",EUR:"€",GBP:"£",ILS:"₪"},DONATION_CLASSES:{2:"donation-basic",5:"donation-novice",20:"donation-expert",50:"donation-master",100:"donation-grand-master"},adjustCurrencyParameters:function(){var e=monetize.currencyMultiplier(cfg.monetize.currency);cfg.monetize.minimum*=e,cfg.monetize.processingFee.constant*=e,cfg.monetize.currencySymbol=monetize.formatCurrency(cfg.monetize.currency),monetize.MIN_PAYMENT*=e,monetize.MAX_PAYMENT*=e},isMonetizeMessage:function(e){return e&&"p."===e.substring(0,2)},handlePostMessage:function(e){if(monetize.isValidDomain(_i.getHostname(e.origin))){switch(e.data.type){case monetize.postMessageEvents.PAY_REGISTER_SUCCESS:monetize.handleRegisterPaymentSuccess();break;case monetize.postMessageEvents.PAY_EXTEND_SUCCESS:monetize.handleExtendPaymentSuccess(e.data.expiration);break;case monetize.postMessageEvents.PAY_DONATION:"donate-confirm-template"===dlg.reference&&dlg.close();break;case monetize.postMessageEvents.PAY_REQUEST:privateChat.removePaymentRequest()}monetize.paymentWindow.handle&&!monetize.paymentWindow.handle.closed&&monetize.paymentWindow.handle.close()}else e.source.postMessage("STOP",e.origin)},handleRegisterPaymentSuccess:function(){skin.loginHash?auth.login(rumbletalk,{hash:skin.loginHash}):skin.loginParamsDialog(rumbletalk)},handleExtendPaymentSuccess:function(e){auth.loggedIn?auth.updateExpiration(e):monetize.handleRegisterPaymentSuccess()},continueToPayPal:function(e){var t,s;!monetize.paymentWindow.handle||monetize.paymentWindow.handle.closed?monetize.paymentWindow.handle=window.open(e,monetize.paymentWindow.name,(window.outerWidth?(t=Math.round((window.outerWidth-monetize.paymentWindow.width)/2)+window.screenX,s=Math.round((window.outerHeight-monetize.paymentWindow.height)/2)+window.screenY):window.screen.width&&(t=Math.round((window.screen.width-monetize.paymentWindow.width)/2),s=Math.round((window.screen.height-monetize.paymentWindow.height)/2)),"width="+monetize.paymentWindow.width+",height="+monetize.paymentWindow.height+",left="+t+",top="+s)):monetize.paymentWindow.handle.focus()},isValidDomain:function(e){return e.endsWith(cfg.serverDomain)},formatCurrency:function(e){return monetize.CURRENCIES[e]||"[MISSING CURRENCY]"},currencyMultiplier:function(e){switch(e){case"ILS":return 4;default:return 1}},isValidMonetizeAmount:function(e,t){if(isNaN(e))return!1;var s=monetize.currencyMultiplier(t);return 2*s<=e&&e<=999*s},calculateFee:function(e){var t=e*cfg.monetize.processingFee.percent/100+cfg.monetize.processingFee.constant;return t1}}catch(e){p2p.supportCameraSwap=!1}p2p.supportCameraSwap||_i.remove(_i.firstCss("calling-box-swap-camera",skin.callingOptions))},applyAction:function(e,t,s){var i;if(_i.p2p){if(p2p.remoteId&&p2p.remoteId!=e&&p2p.connection)return i=new Error("different user trying to contact while in progress with a different user"),console.log(i.stack),void p2p.decline(e,p2p.responseMessages.BUSY);switch(t){case"call":if(p2p.busy)return i=new Error("The remote user has sent an additional call request"),void console.log(i.stack);var a;p2p.remoteId=e,p2p.remoteMode=s.mode,a=_i.mobile?"full":skin.usersListOpened&&!skin.isSmall?"side":"mini",skin.callingDialog(e,a);break;case"sdp":if(!p2p.connection)return i=new Error("Sending SDP while no connection is active"),console.log(i.stack),void(p2p.busy||p2p.calling||skin.closeCalling());p2p.remoteMode=s.mode,skin.drawCalling(),p2p.parseSDP(e,s.sdp);break;case"candidates":console.log("processing ice candidates"),p2p.hasAnswer?p2p.processIceCandidates(s):p2p.waitingIceCandidates=s,p2p.connected=!0,skin.drawCalling("full"),skin.callTextSet();break;case"decline":skin.noAnswer(e,s.reasonId),rtc.sendP2PAction(e,"declined-success",{});break;case"declined-success":if(!p2p.remoteId&&!p2p.remoteMode)return;skin.closeCalling();break;default:i=new Error("Invalid action supplied: "+t),console.log(i.stack)}}else p2p.decline(e,p2p.responseMessages.BROWSER_INVALID)},callRequest:function(e,t){if(p2p.busy){var s=new Error(cfg.strings.request_call_when_busy);return skin.showMessage(s.message),void console.log(s.stack)}var i=rtc.user(e);void 0!==i.p2p?!1!==i.p2p&&(rtc.track("P2P",rtc.hash,"call-"+t),skin.setSelectedUser(),p2p.busy=!0,p2p.calling=!0,p2p.remoteId=e,p2p.mode=t,skin.wait(cfg.strings.connecting),navigator.mediaDevices.getUserMedia(p2p.buildConstraints(t)).then(p2p.handleMedia).catch(p2p.handleMediaError)):p2p.userP2PSupport(i,t)},answer:function(e){if(p2p.busy){var t=new Error("Trying to answer when busy");return console.log(t.stack),!1}rtc.track("P2P",rtc.hash,"answer-"+e),p2p.busy=!0,p2p.mode=e,navigator.mediaDevices.getUserMedia(p2p.buildConstraints(e)).then(p2p.handleMedia).catch(p2p.handleMediaError)},handleMedia:function(e){dlg.close(),p2p.selfStream=e,skin.callVideo.muted=!0,setSrcObject(e,skin.callVideo),skin.localVideoHandle=skin.callVideo,cfg.p2p.video&&skin.callingToggleCamera(skin.callingOptions.querySelector(".calling-box-camera"),"video"==p2p.mode),skin.callingToggleMic(skin.callingOptions.querySelector(".calling-box-mic"),!0),"audio"===p2p.mode&&(p2p.audioOnly=!0),p2p.initPeerConnection(p2p.remoteId,e,!p2p.calling),p2p.calling?(skin.callingDialog(p2p.remoteId,"full"),p2p.sendCall(p2p.remoteId,p2p.mode)):skin.drawCalling("full")},handleMediaError:function(e){console.log(e),p2p.connected&&p2p.decline(p2p.remoteId,p2p.connected?p2p.responseMessages.HANGUP:p2p.calling?p2p.responseMessages.MISSED:p2p.responseMessages.BUSY),skin.closeCalling(),9===e.code?skin.showMessage(cfg.strings.p2p_not_secure):skin.showMessage("Oops. Something went wrong. Please try again later.")},initPeerConnection:function(e,t,s){if(!p2p.connection){var i;if(p2p.connection=new RTCPeerConnection(p2p.configuration),p2p.connection.onicecandidate=function(t){t.candidate&&(clearTimeout(i),p2p.sdpSent||(t.candidate?i=setTimeout((function(){p2p.sdpSent=!0,p2p.sendSDP(e,{sdp:p2p.connection.localDescription,mode:p2p.mode})}),1e3):(console.log("P2P finished fetching candidates"),p2p.sendSDP(e,{sdp:p2p.connection.localDescription,mode:p2p.mode}),console.log("total",JSON.stringify(p2p.connection.localDescription).length))))},"function"==typeof p2p.connection.addTrack){var a,n=!0;p2p.connection.ontrack=function(e){console.log("got stream"),e.streams&&e.streams[0]&&(p2p.remoteStream=null,p2p.remoteStream=e.streams[0],skin.drawCalling(),n?(skin.switchVideo(),n=!1):(clearTimeout(a),a=setTimeout((function(){var e;e=skin.localVideoHandle===skin.callVideo?skin.callVideoMini:skin.callVideo,setSrcObject(null,e),setSrcObject(p2p.remoteStream,e)}),1e3)),skin.callTextSet())}}else p2p.connection.onaddstream=function(e){console.log("on add stream: got stream"),p2p.remoteStream=e.stream,skin.drawCalling(),skin.switchVideo(),skin.callTextSet()};p2p.connection.oniceconnectionstatechange=function(){p2p.connection&&(console.log("change ice connection state: ",p2p.connection.iceConnectionState),"connected"==p2p.connection.iceConnectionState&&(p2p.connected=!0,skin.drawCalling(),rtc.track("P2P",rtc.hash,"connected-"+p2p.mode)))},s&&(p2p.connection.onnegotiationneeded=function(){console.log("negotiationneeded started"),p2p.connection.createOffer().then((function(e){return p2p.connection.setLocalDescription(e)})).then((function(){p2p.connected&&p2p.sendSDP(p2p.remoteId,{sdp:p2p.connection.localDescription,mode:p2p.mode})}))}),"function"==typeof p2p.connection.addTrack?(p2p.selfStream.getTracks().forEach((function(e){console.log("track",e),p2p.connection.addTrack(e,p2p.selfStream)})),p2p.connection.addTransceiver("video")):p2p.connection.addStream(t)}},processIceCandidates:function(e){e.forEach((function(e){p2p.connection.addIceCandidate(new RTCIceCandidate(e)).catch((function(e){console.log(e)}))}))},parseSDP:function(e,t){if("offer"==t.type)p2p.connection.setRemoteDescription(t).then((function(){return p2p.connection.createAnswer()})).then((function(e){return p2p.connection.setLocalDescription(e)})).then((function(){p2p.connected&&setTimeout((function(){p2p.sendSDP(e,{sdp:p2p.connection.localDescription,mode:p2p.mode})}),1e3)}));else if("answer"==t.type)console.log("received an answer"),p2p.connection.setRemoteDescription(t).catch((function(e){console.log(e)}));else{var s=new Error("Unsupported SDP type:",t.type);console.log(s.stack,t)}sfx.stopRing()},userP2PSupport:function(e,t){e.p2p=!0,p2p.callRequest(e.id,t)},sendSDP:function(e,t){rtc.sendP2PAction(e,"sdp",t)},sendCall:function(e,t){rtc.sendP2PAction(e,"call",{mode:t})},decline:function(e,t){rtc.sendP2PAction(e,"decline",{reasonId:t})},stop:function(){p2p.connection&&(p2p.connection.close(),p2p.connection=null),p2p.mode="",p2p.remoteId=0,p2p.remoteMode="",p2p.selfStream&&(webrtc.stopTracks(p2p.selfStream),p2p.selfStream=null),p2p.remoteStream=null,p2p.busy=!1,p2p.calling=!1,p2p.connected=!1,p2p.hasAnswer=!1,p2p.waitingIceCandidates=[],p2p.audioOnly=!1,p2p.sdpSent=!1},parseDeclineText:function(e,t){var s,i=rtc.user(e);if(!i)return!1;switch(t){case p2p.responseMessages.ERROR:console.log("ERROR"),s="p2p_call";break;case p2p.responseMessages.BUSY:console.log("BUSY"),s="p2p_missed_they";break;case p2p.responseMessages.HANGUP:console.log("HANGUP"),s="p2p_call";break;case p2p.responseMessages.MISSED:console.log("MISSED"),s="p2p_missed_you"}return cfg.strings[s].replace("{{caller}}",i.name)},messageIdToString:function(e,t){var s,i=rtc.user(e);if(!i)return!1;switch(t){case p2p.responseMessages.ERROR:console.log("ERROR"),s="p2p_error";break;case p2p.responseMessages.BUSY:console.log("BUSY"),s="p2p_busy";break;case p2p.responseMessages.HANGUP:console.log("HANGUP"),s="p2p_ended";break;case p2p.responseMessages.MISSED:console.log("MISSED"),s="p2p_ended";break;case p2p.responseMessages.BROWSER_INVALID:console.log("BROWSER_INVALID"),s="p2p_browser_invalid"}return cfg.strings[s].replace("{{caller}}",i.name)},swapCamera:function(){p2p.connection&&(p2p.facingMode="user"===p2p.facingMode?"environment":"user",navigator.mediaDevices.getUserMedia(p2p.buildConstraints("video")).then((function(e){if(p2p.connection){webrtc.stopTracks(p2p.selfStream),p2p.selfStream=e,setSrcObject(e,skin.localVideoHandle),"user"===p2p.facingMode?_i.removeClass(skin.localVideoHandle,"back-facing-camera"):_i.mobile&&_i.addClass(skin.localVideoHandle,"back-facing-camera"),skin.localVideoHandle.play();var t=e.getVideoTracks()[0];p2p.connection.getSenders().find((function(e){return e.track.kind===t.kind})).replaceTrack(t)}})).catch(p2p.handleMediaError))},audioToVideoCall:function(e){p2p.connection&&navigator.mediaDevices.getUserMedia(p2p.buildConstraints("video")).then((function(t){if(p2p.connection){var s=t.getVideoTracks()[0];p2p.selfStream.addTrack(s),skin.localVideoHandle.muted=!0,setSrcObject(null,skin.localVideoHandle),setSrcObject(p2p.selfStream,skin.localVideoHandle),p2p.connection.addTrack(s,p2p.selfStream),p2p.mode="video",p2p.audioOnly=!1,_i.removeClass(e,"disabled"),"user"===p2p.facingMode?_i.removeClass(skin.localVideoHandle,"back-facing-camera"):_i.mobile&&_i.addClass(skin.localVideoHandle,"back-facing-camera"),skin.localVideoHandle.play(),skin.drawCalling(),p2p.sdpSent=!1,p2p.calling&&p2p.connection.createOffer().then((function(e){return console.log("new offer",e),p2p.connection.setLocalDescription(e)})).then((function(){p2p.sendSDP(p2p.remoteId,{sdp:p2p.connection.localDescription,mode:p2p.mode})}))}})).catch(p2p.handleMediaError)},buildConstraints:function(e){return{audio:!0,video:"audio"!==e&&{facingMode:p2p.facingMode}}}},polls={model:null,records:null,totalCount:0,currentPage:1,hasActive:1,RECORDS_LIMIT:10,PAGE_LIMIT:7,STATUS:{EDIT:"Edit",ACTIVE:"Active",PUBLISHED:"Published",DELETED:"Deleted"},ACTIONS:{SEND:"send",RESET:"reset",PUBLISH:"publish",DELETE:"delete"},init:function(){polls.model={id:0,question:null,answer1:null,answer2:null,answer3:null,answer4:null,answer1count:0,answer2count:0,answer3count:0,answer4count:0,createDate:null,lastSentDate:null,publishedDate:null,dateDeleted:null}},resetForm:function(){polls.init(),_i.id("question").value="",_i.id("answer1").value="",_i.id("answer2").value="",_i.id("answer3").value="",_i.id("answer4").value=""},validate:function(){var e=[];return null!==polls.model.answer2&&0!==polls.model.answer2.trim().length||e.push("Answer 2 is required"),null!==polls.model.answer1&&0!==polls.model.answer1.trim().length||e.push("Answer 1 is required"),null!==polls.model.question&&0!==polls.model.question.trim().length||e.push("Question is required"),e},get:function(e){polls.totalCount=e.count,polls.records=e.polls,polls.hasActive=e.hasActivePolls,polls.display()},range:function(e,t){return Array.from(Array(t-e+1),(function(t,s){return s+e}))},getPageList:function(){var e=Math.ceil(polls.totalCount/polls.RECORDS_LIMIT),t=polls.PAGE_LIMIT<9?1:2,s=polls.PAGE_LIMIT-2*t-3>>1,i=polls.PAGE_LIMIT-2*t-2>>1;return e<=polls.PAGE_LIMIT?polls.range(1,e):polls.currentPage<=polls.PAGE_LIMIT-t-1-i?polls.range(1,polls.PAGE_LIMIT-t-1).concat(0,polls.range(e-t+1,e)):polls.currentPage>=e-t-1-i?polls.range(1,t).concat(0,polls.range(e-t-1-i-s,e)):polls.range(1,t).concat(0,polls.range(polls.currentPage-s,polls.currentPage+i),0,polls.range(e-t+1,e))},storeVote:function(e,t){var s=_i.storage.getItem("pollVotes",!0);s?e in s?s[e].push(t):s[e]=[t]:(s={})[e]=[t],_i.storage.setItem("pollVotes",s,!0)},hasDuplicateVote:function(e,t){var s=_i.storage.getItem("pollVotes",!0);return!!s&&(e in s&&s[e].indexOf(t)>-1)},deletePollInCache:function(e){var t=_i.storage.getItem("pollVotes",!0);t&&e in t&&(delete t[e],_i.storage.setItem("pollVotes",t,!0))},display:function(){var e="";polls.totalCount>0?polls.records.forEach((function(t){var s="";switch(t.status){case polls.STATUS.EDIT:s=gui.date(t.createDate,cfg.strings.date);break;case polls.STATUS.ACTIVE:s=gui.date(t.lastSentDate,cfg.strings.date);break;case polls.STATUS.PUBLISHED:s=gui.date(t.publishedDate,cfg.strings.date);break;case polls.STATUS.DELETED:s=gui.date(t.dateDeleted,cfg.strings.date)}var i={questionText:t.question,deletedClass:t.status===polls.STATUS.DELETED?"is-deleted":"",createDateText:gui.date(t.createDate,cfg.strings.date),className:t.status.toLowerCase(),viewFn:t.status===polls.STATUS.EDIT?"skin.editPollDialog('"+JSON.stringify(t)+"')":"skin.viewPollDialog('"+JSON.stringify(t)+"', false, false)",statusText:t.status,tooltipText:s,isNotDeleted:t.status!==polls.STATUS.DELETED,deleteText:cfg.strings.delete,deletePollFn:"skin.pollsDelete("+t.id+")"};e+=gui.template("polls-row-template",i)})):e=gui.template("polls-no-row-template",{text:cfg.strings.polls_no_records}),skin.showDialog("polls-dialog-template",{header:cfg.strings.polls_list,polls:e,hasPage:polls.totalCount>polls.RECORDS_LIMIT,createNewPollFn:"skin.createPollDialog()",createNewPollText:cfg.strings.polls_create_new,loaderText:cfg.strings.loading}),polls.buildPagination(),rtc.track("Polls","Opened",rtc.hash)},buildPagination:function(){var e=Math.ceil(polls.totalCount/polls.RECORDS_LIMIT);if(!(0===polls.totalCount||polls.totalCount<=polls.RECORDS_LIMIT||polls.currentPage<1||polls.currentPage>polls.totalPages)){[].slice.call(_i.css("polls-pagination-buttons")).slice(1,-1).forEach((function(e){e.parentNode.removeChild(e)}));var t=_i.lastCss("polls-pagination"),s=_i.id("polls-pagination-next");polls.getPageList().forEach((function(e){var i=_i.create("button",{},t,s);i.textContent=e||"...",i.disabled=!e||e===polls.currentPage,_i.addClass(i,"polls-pagination-buttons"),_i.addClass(i,e&&e!==polls.currentPage?"":" active"),e&&i.addEventListener("click",(function(){skin.pollsPaginate(e)}),!1)})),_i.id("polls-pagination-prev").disabled=1===polls.currentPage,_i.id("polls-pagination-next").disabled=polls.currentPage===e}},paginateLoaded:function(e){polls.records=e.data.polls,polls.totalCount=e.data.count,polls.buildPagination();var t="";polls.records.forEach((function(e){var s="";switch(e.status){case polls.STATUS.EDIT:s=gui.date(e.createDate,cfg.strings.date);break;case polls.STATUS.ACTIVE:s=gui.date(e.lastSentDate,cfg.strings.date);break;case polls.STATUS.PUBLISHED:s=gui.date(e.publishedDate,cfg.strings.date);break;case polls.STATUS.DELETED:s=gui.date(e.dateDeleted,cfg.strings.date)}var i={questionText:e.question,deletedClass:e.status===polls.STATUS.DELETED?"is-deleted":"",createDateText:gui.date(e.createDate,cfg.strings.date),className:e.status.toLowerCase(),viewFn:e.status===polls.STATUS.EDIT?"skin.editPollDialog('"+JSON.stringify(e)+"')":"skin.viewPollDialog('"+JSON.stringify(e)+"', false, false)",statusText:e.status,tooltipText:s,deletePollFn:"skin.pollsDelete("+e.id+")"};t+=gui.template("polls-row-template",i)})),_i.id("polls-table").innerHTML=t;var s=_i.id("polls-dialog-content");_i.removeClass(s,"hidden"),_i.addClass(s,"block");var i=_i.id("polls-dialog-loader");_i.removeClass(i,"flex"),_i.addClass(i,"hidden")}},privateChat={domHandle:null,paymentRequestHandle:null,userId:0,logs:{},messageTypes:{SYSTEM:-1,OWN:0,REMOTE:1,PAYMENT_REQUEST_SENT:2,PAYMENT_REQUEST_RECEIVED:3,PAYMENT_REQUEST_PAID:4},scrollHandle:0,pause:!1,position:0,lastPrivateMessageIds:[],ownMessages:{},PRIVATE_CACHE_SIZE:40,coordinates:{x:10,y:0},dimension:{width:0,height:0},newLineCount:0,TEXT_FIELD_BASE_HEIGHT:40,TEXT_FIELD_HEIGHT_INCREMENTS:16,resizers:{minimumWidth:450,minimumHeight:300,originalWidth:0,originalHeight:0,originalX:0,originalY:0,originalMouseX:0,originalMouseY:0},isFullScreen:!1,messageTimeout:null,messageInterval:null,init:function(){if(privateChat.domHandle=_i.id("user-info"),privateChat.logs=_i.storage.getItem("rumbletalk-private-message-logs")||{},!_i.mobile){var e,t={screenX:null,screenY:null,pageX:null,pageY:null};privateChat.domHandle.addEventListener("mousedown",(function(t){_i.hasClass(t.target,"resizer")||privateChat.isFullScreen||(e="user-info"===t.target.id)}),!1),privateChat.domHandle.addEventListener("dragstart",(function(s){e?(s.dataTransfer.setData("text","1"),t.screenX=s.screenX,t.screenY=s.screenY,t.pageX=s.pageX,t.pageY=s.pageY):s.preventDefault()}),!1),document.addEventListener("dragover",(function(e){e.preventDefault()}),!1),document.addEventListener("drop",(function(s){var i,a;(s.preventDefault(),e)&&(s.pageX&&_i.ua!==_i.userAgents.SAFARI?(i=t.pageX-s.pageX,a=t.pageY-s.pageY):(i=t.screenX-s.screenX,a=t.screenY-s.screenY),privateChat.coordinates.x=parseInt(privateChat.domHandle.style.left)-i,privateChat.coordinates.y=parseInt(privateChat.domHandle.style.top)-a,privateChat.domHandle.style.left=_i.addUnit(privateChat.coordinates.x),privateChat.domHandle.style.top=_i.addUnit(privateChat.coordinates.y),e=null)}),!1)}},checkDuplicates:function(e,t,s){if(s){if(-1!==privateChat.lastPrivateMessageIds.indexOf(s))return!1;privateChat.lastPrivateMessageIds.push(s),privateChat.lastPrivateMessageIds.length>=privateChat.PRIVATE_CACHE_SIZE&&privateChat.lastPrivateMessageIds.shift(),s==privateChat.position+1&&privateChat.position++}if(t){if(!privateChat.logs[e])return!0;if(privateChat.logs[e].log.some((function(e){return e.id==t})))return!1}return!0},close:function(e){skin.smiliesBoxPrivate&&skin.smiliesBoxPrivate.parentNode&&skin.smiliesBoxPrivate.parentNode.removeChild(skin.smiliesBoxPrivate),clearInterval(privateChat.scrollHandle),_i.removeClass(privateChat.domHandle,"active"),_i.firstCss("content",privateChat.domHandle).innerHTML="",privateChat.userId=0,e||skin.focus(),skin.setSelectedUser(),privateChat.adjustTextField(0)},buildDom:function(e,t){var s,i=_i.extend({loginTypeName:e.loginType.name},e),a=privateChat.shouldDisplayChatLog(e.id);if(t=t||{buttons:[],texts:[]},i.name=gui.safe(i.name),i.login_type=cfg.strings.login_type,i.back=cfg.strings.back,i.image||(i.image=e.loginType.pic(e)),i.imagePreview="skin.displayUserImage("+e.id+")",_i.mobile&&(i.mobileFn="skin.closeUserDetails();"),skin.close(),e.id!=auth.id&&auth.loggedIn){auth.moderator&&(t.texts.unshift({label:"IP",text:_i.int2ip(e.ip),className:"ip-text"}),rtc.usersOffline[e.id]||(t.buttons.unshift({fn:cfg.accountType===_i.accountTypes.FREE?"skin.upgradeDialog();":"skin.disconnectUser("+e.id+", rtc.commands.KICK);",text:cfg.strings.disconnect,className:"private-chat-block kick-user"}),cfg.monetize.paymentRequest&&(i.amountText=cfg.strings.amount,i.cancelText=cfg.strings.cancel,i.requestText=cfg.strings.request_payment,i.totalAmountText=cfg.strings.request_payment_fee,i.paymentHeader=gui.safe(cfg.strings.request_payment_header.replace("{{name}}",e.name)),i.currencySymbol=cfg.monetize.currencySymbol,i.currencyCode=cfg.monetize.currency),i.displayRequestPayment=cfg.monetize.paymentRequest),e.banned?t.texts.unshift({label:cfg.strings.ban_status,text:cfg.strings.banned,className:"ban-status"}):t.buttons.unshift({fn:cfg.accountType===_i.accountTypes.FREE?"skin.upgradeDialog();":"skin.disconnectUser("+e.id+", rtc.commands.BLOCK);",text:cfg.strings.ban_ip,className:"private-chat-block ban-user"})),e.moderator||t.buttons.unshift({fn:"skin.blockUser("+e.id+", this);",text:cfg.strings[rtc.usersBlocked[e.id]?"unignore":"ignore"],title:cfg.strings[rtc.usersBlocked[e.id]?"unignore_description":"ignore_description"],className:"private-chat-block block-user"});var n=_i.id("user"+e.id),o=n&&n.classList.contains("away");if(cfg.privateChat&&a){var r=privateChat.buttonsLocation(rtc.usersOffline[e.id]);r.placeholderText=cfg.strings.private_chat_placeholder,r.textSend=cfg.strings.send,r.textAdd=cfg.strings.add,r.textEmoji=cfg.strings.emoji,o&&(r.inputDisabled=!0,r.away=!0),i.messagesLog=gui.template("private-chat-template",r),(1===cfg.menuSettings.exportTranscript||2===cfg.menuSettings.exportTranscript&&auth.moderator)&&t.buttons.unshift({fn:"skin.exportArchive("+e.id+")",text:cfg.strings.export_transcript,title:cfg.strings.export_transcript_title,className:"private-export"})}_i.p2p&&!rtc.usersOffline[e.id]&&(uploader.validities.video||uploader.validities.audio)&&_i.extend(i,{disabled:cfg.accountType===_i.accountTypes.FREE?!auth.moderator||void 0:!!o||void 0,displayVideo:uploader.validities.video&&a,textCallVideo:cfg.strings.call_video,videoCall:cfg.accountType===_i.accountTypes.FREE?auth.moderator?"skin.upgradeDialog();":void 0:"skin.videoCallRequest("+e.id+");",displayAudio:uploader.validities.audio&&a,textCallAudio:cfg.strings.call_audio,audioCall:cfg.accountType===_i.accountTypes.FREE?auth.moderator?"skin.upgradeDialog();":void 0:"skin.audioCallRequest("+e.id+");"})}if(i.textSettings=cfg.strings.settings,i.textRequestPayment=cfg.strings.request_payment,i.userSettingsItems="",cfg.chatType!=_i.chatTypes.ONE_ON_ONE||auth.moderator||t.buttons.unshift({fn:"skin.logout();",text:cfg.strings.logout,className:"one-on-one-logout"}),auth.id==e.id&&e.loginType==rumbletalk){var l=cfg.profileUrl+"access";t.buttons.unshift({fn:"window.open('"+l+"');",text:cfg.strings.profile,className:"profile-page-link open-in-new"})}for(s=0;s0?privateChat.dimension.width:i.outerWidth<600?i.outerWidth:600,s=i.outerWidth<610?0:privateChat.coordinates.x,skin.usersListOpened||(s+=privateChat.coordinates.x?0:50,t-=50)),o.width=_i.addUnit(t),o[n]=_i.addUnit(s),t<420?_i.addClass(privateChat.domHandle,"compact"):_i.removeClass(privateChat.domHandle,"compact"),a.outerHeight<230?(o.height=a.outerHeight,o.top=0):skin.isPrivateChat()?(o.height=i.outerHeight,o.top=p.top):(o.height=privateChat.dimension.height>0?privateChat.dimension.height:a.outerHeight<400?a.outerHeight:400,o.top=privateChat.coordinates.y||(a.outerHeight-o.height)/2),o.height=_i.addUnit(o.height),o.top=_i.addUnit(o.top),privateChat.isFullScreen||_i.set(privateChat.domHandle,{style:o}));if(r&&l&&(privateChat.adjustTextField(),e&&(_i.setBottom(r),_i.events([{obj:r,name:"scroll",cb:privateChat.scrollBar}]),privateChat.scrollHandle=setInterval(privateChat.scroll,100))),d){var m=_i.outerDims(_i.lastCss("login-type",privateChat.domHandle)),f=_i.outerDims(_i.lastCss("user-settings-back-button",privateChat.domHandle));d.style.height=_i.addUnit(_i.height(c)-m.outerHeight-f.outerHeight)}_i.set(c,{style:g}),_i.set(u,{style:g})},open:function(e){var t=skin.findUserDiv(e),s=rtc.user(e)||rtc.usersOffline[e];privateChat.toggleSmilies(!0),skin.toggleDonate(!0),privateChat.userId!==s.id?(privateChat.setScroll(!1),skin.wait(cfg.strings.downloading_user_info),privateChat.userId=s.id,t||!auth.moderator?(skin.setSelectedUser(t),s.loginType.getUserInfo(s,privateChat.buildDom)):rtc.getOfflineUserInfo(s,privateChat.buildDom),rtc.track("User Info","Opened",rtc.hash)):privateChat.close()},sendMessage:function(e){if(!privateChat.messageTimeout){var t=_i.lastCss("private-chat-text",privateChat.domHandle);if(rtc.usersBlocked[privateChat.userId]&&privateChat.alertPrivateSend(),(e=(e||t.innerText).trim()).length>rtc.MAX_MESSAGE_LENGTH)skin.showMessage(cfg.strings.message_too_long.replace("{{maxlength}}",rtc.MAX_MESSAGE_LENGTH));else if(t.innerHTML="",t.focus(),e){var s=privateChat.addMessageLog({type:privateChat.messageTypes.OWN,text:e,time:_i.now()},privateChat.userId);s.tempId=_i.now(),privateChat.ownMessages[s.tempId]={handle:privateChat.appendMessageDom(s,auth.id),data:s},skin.updateUserPosition(privateChat.userId),rtc.sendPrivateMessage(privateChat.userId,s.tempId,e),rtc.track("Private Chat","Message Sent",rtc.hash),privateChat.adjustTextField(0),privateChat.scroll(),cfg.sendLimitPrivate&&cfg.sendLimit>0&&!auth.moderator&&skin.handleSendMessageLimit(!0)}}},updateOwn:function(e){if(privateChat.ownMessages[e.tempId]){var t=privateChat.ownMessages[e.tempId];delete privateChat.ownMessages[e.tempId],t.data.id=e.id,t.data.time=e.timestamp,t.data.position=e.position,e.position==privateChat.position+1&&privateChat.position++,privateChat.updateSessionStorage(),t.handle.id="pm_"+e.id;var s=_i.firstCss("delete-private-message",t.handle);s&&s.setAttribute("onclick","privateChat.deleteMessage("+e.id+");")}},alertPrivateSend:function(){var e,t=_i.lastCss("private-chat-text",privateChat.domHandle),s=0;e=setInterval((function(){s++,_i.toggleClass(t,"block-warning"),s>9&&(clearInterval(e),_i.removeClass(t,"block-warning"))}),100)},scroll:function(){if(privateChat.domHandle){var e=_i.lastCss("private-chat-log",privateChat.domHandle);!e||privateChat.pause||_i.atBottom(e)||_i.setBottom(e)}},scrollBar:function(e){privateChat.setScroll(!_i.atBottom(e.target))},setScroll:function(e){privateChat.pause=e},buttonsLocation:function(e){var t=_i.mobile?40:30,s=cfg.dir?"left":"right",i=uploader.validities.upload?_i.mobile?2*t:t+5:_i.mobile?t:5,a=_i.mobile?t:5,n={displayUpload:uploader.validities.upload?s+": "+a+"px;":"display: none;",displaySmiley:cfg.parsers.smilies?s+": "+i+"px;":"display: none;"};if(!e){var o=(_i.mobile?t:0)+(!!uploader.validities.upload+!!cfg.parsers.smilies)*t;o>0&&(n.inputStyle=cfg.dir?"padding-left: ":"padding-right: ",n.inputStyle+=o+"px;")}return n.displaySend=_i.mobile,n},shouldDisplayChatLog:function(e){if(e==auth.id)return!1;if(0===cfg.privateChatAccess)return!1;if(1===cfg.privateChatAccess)return!0;if(privateChat.logs[e]&&privateChat.logs[e].log.length>0)return!0;if(2===cfg.privateChatAccess)return auth.moderator;var t=rtc.user(e)||rtc.usersOffline[e];return auth.moderator||t&&t.moderator},addMessageLog:function(e,t,s){return privateChat.logs[t]||(privateChat.logs[t]={fetched:!1,log:[]}),e.position=Number(e.position||0),e.id=Number(e.id||0),e.type=Number(e.type),s?privateChat.logs[t].log.unshift(e):privateChat.logs[t].log.push(e),privateChat.updateSessionStorage(),e},updateSessionStorage:function(){_i.storage.setItem("rumbletalk-private-message-logs",JSON.stringify(privateChat.logs))},clearMessages:function(){privateChat.logs={},privateChat.lastPrivateMessageIds=[];var e=_i.lastCss("private-chat-log",privateChat.domHandle);e&&(e.innerHTML=""),_i.storage.removeItem("rumbletalk-private-message-logs")},loadMessages:function(e){privateChat.logs[e].log.forEach((function(t){privateChat.appendMessageDom(t,e)}))},findMessage:function(e,t){var s;for(s=0;s0){var s=_i.lastCss("private-placeholder",privateChat.domHandle);"none"!==s.style.display&&(s.style.display="none")}}},inputKeyDown:function(e){auth.loggedIn&&("Enter"!==e.key||e.shiftKey||_i.mobile||(e.preventDefault(),e.target.innerText.trim().length>0&&(privateChat.sendMessage(),e.target.focus())))},addText:function(e){if(auth.loggedIn){var t=_i.lastCss("private-chat-text",privateChat.domHandle);t.childNodes.length>=2&&"BR"===t.childNodes[t.childNodes.length-1].nodeName&&"BR"===t.childNodes[t.childNodes.length-2].nodeName&&t.removeChild(t.lastChild),t.innerText+=" "+e+" ",t.focus()}},toggleSmilies:function(e){skin.smiliesBoxPrivate&&_i.toggleClass(skin.smiliesBoxPrivate,"active",e)},switchView:function(e){if(privateChat.domHandle){var t,s=_i.css("private-chat-view",privateChat.domHandle);for(t=0;tprivateChat.resizers.minimumWidth&&(e.style.width=s+"px",e.style.left=privateChat.resizers.originalX+(t.pageX-privateChat.resizers.originalMouseX)+"px",privateChat.dimension.width=s,privateChat.coordinates.x=privateChat.resizers.originalX+(t.pageX-privateChat.resizers.originalMouseX)),i>privateChat.resizers.minimumHeight&&(e.style.height=i+"px",e.style.top=privateChat.resizers.originalY+(t.pageY-privateChat.resizers.originalMouseY)+"px",privateChat.dimension.height=i),privateChat.redraw()}})),t("resizer-top-right",(function(t){if(!privateChat.isFullScreen){var s=privateChat.resizers.originalWidth+(t.pageX-privateChat.resizers.originalMouseX),i=privateChat.resizers.originalHeight-(t.pageY-privateChat.resizers.originalMouseY);s>privateChat.resizers.minimumWidth&&(e.style.width=s+"px",privateChat.dimension.width=s),i>privateChat.resizers.minimumHeight&&(e.style.height=i+"px",e.style.top=privateChat.resizers.originalY+(t.pageY-privateChat.resizers.originalMouseY)+"px",privateChat.dimension.height=i),privateChat.redraw()}})),t("resizer-bottom-left",(function(t){if(!privateChat.isFullScreen){var s=privateChat.resizers.originalHeight+(t.pageY-privateChat.resizers.originalMouseY),i=privateChat.resizers.originalWidth-(t.pageX-privateChat.resizers.originalMouseX);s>privateChat.resizers.minimumHeight&&(e.style.height=s+"px",privateChat.dimension.height=s),i>privateChat.resizers.minimumWidth&&(e.style.width=i+"px",e.style.left=privateChat.resizers.originalX+(t.pageX-privateChat.resizers.originalMouseX)+"px",privateChat.dimension.width=i,privateChat.coordinates.x=privateChat.resizers.originalX+(t.pageX-privateChat.resizers.originalMouseX)),privateChat.redraw()}})),t("resizer-bottom-right",(function(t){if(!privateChat.isFullScreen){var s=privateChat.resizers.originalWidth+(t.pageX-privateChat.resizers.originalMouseX),i=privateChat.resizers.originalHeight+(t.pageY-privateChat.resizers.originalMouseY);s>privateChat.resizers.minimumWidth&&(e.style.width=s+"px",privateChat.dimension.width=s),i>privateChat.resizers.minimumHeight&&(e.style.height=i+"px",privateChat.dimension.height=i),privateChat.redraw()}})),t("resizer-top",(function(t){if(!privateChat.isFullScreen){var s=privateChat.resizers.originalHeight-(t.pageY-privateChat.resizers.originalMouseY);s>privateChat.resizers.minimumHeight&&(e.style.height=s+"px",e.style.top=privateChat.resizers.originalY+(t.pageY-privateChat.resizers.originalMouseY)+"px",privateChat.dimension.height=s),privateChat.redraw()}})),t("resizer-bottom",(function(t){if(!privateChat.isFullScreen){var s=privateChat.resizers.originalHeight+(t.pageY-privateChat.resizers.originalMouseY);s>privateChat.resizers.minimumHeight&&(e.style.height=s+"px",privateChat.dimension.height=s),privateChat.redraw()}})),t("resizer-left",(function(t){if(!privateChat.isFullScreen){var s=privateChat.resizers.originalWidth-(t.pageX-privateChat.resizers.originalMouseX);s>privateChat.resizers.minimumWidth&&(e.style.width=s+"px",e.style.left=privateChat.resizers.originalX+(t.pageX-privateChat.resizers.originalMouseX)+"px",privateChat.dimension.width=s,privateChat.coordinates.x=privateChat.resizers.originalX+(t.pageX-privateChat.resizers.originalMouseX)),privateChat.redraw()}})),t("resizer-right",(function(t){if(!privateChat.isFullScreen){var s=privateChat.resizers.originalWidth+(t.pageX-privateChat.resizers.originalMouseX);s>privateChat.resizers.minimumWidth&&(e.style.width=s+"px",privateChat.dimension.width=s),privateChat.redraw()}}))},redraw:function(e){var t=_i.outerDims(skin.chatFrame),s=_i.outerDims(_i.b),i=cfg.dir?"right":"left",a={},n=_i.lastCss("private-chat-log",privateChat.domHandle),o=_i.lastCss("private-chat-text-cover",privateChat.domHandle),r=_i.lastCss("user-settings",privateChat.domHandle),l=_i.lastCss("user-settings-items",privateChat.domHandle),c=privateChat.dimension.width>0?privateChat.dimension.width:t.outerWidth<600?t.outerWidth:600;if(a.width=_i.addUnit(c),c<420?_i.addClass(privateChat.domHandle,"compact"):_i.removeClass(privateChat.domHandle,"compact"),a.height=privateChat.dimension.height>0?privateChat.dimension.height:s.outerHeight<400?s.outerHeight:400,a.height=_i.addUnit(a.height),e)if(privateChat.isFullScreen)privateChat.domHandle.removeAttribute("style");else{var d=t.outerWidth<610?0:privateChat.coordinates.x;skin.usersListOpened||(d+=privateChat.coordinates.x?0:50,c-=50),a.width=_i.addUnit(c),a.height=privateChat.dimension.height>0?privateChat.dimension.height:s.outerHeight<400?s.outerHeight:400,a.top=privateChat.coordinates.y||(s.outerHeight-a.height)/2,a.top=_i.addUnit(a.top),a[i]=_i.addUnit(d),a.bottom=null,a.right=null,a.height=_i.addUnit(a.height),_i.set(privateChat.domHandle,{style:a})}if(n&&o&&privateChat.adjustTextField(),l){var u=_i.outerDims(_i.lastCss("login-type",privateChat.domHandle)),g=_i.outerDims(_i.lastCss("user-settings-back-button",privateChat.domHandle));l.style.height=_i.addUnit(_i.height(r)-u.outerHeight-g.outerHeight)}},adjustTextField:function(e){if(privateChat.userId){"number"==typeof e&&(privateChat.newLineCount=e);var t=_i.lastCss("private-chat-text-cover",privateChat.domHandle);if(t){var s=_i.lastCss("private-chat-log",privateChat.domHandle),i=_i.height(privateChat.domHandle)-s.parentNode.offsetTop,a=privateChat.TEXT_FIELD_BASE_HEIGHT+privateChat.TEXT_FIELD_HEIGHT_INCREMENTS*privateChat.newLineCount,n=_i.lastCss("private-chat-text",t);i<2*a&&(a=parseInt(i/2)),n.style.height=_i.addUnit(a),s.style.height=_i.addUnit(i-_i.outerDims(t).outerHeight)}}},fullscreen:function(){privateChat.isFullScreen=!privateChat.isFullScreen,privateChat.isFullScreen?_i.addClass(privateChat.domHandle,"is-fullscreen"):_i.removeClass(privateChat.domHandle,"is-fullscreen"),privateChat.redraw(!0)},updatePaymentRequestFee:function(e){var t=_i.id("request-fee");t&&(e=Number(e)||0,t.innerHTML=monetize.calculateFee(e))},imageDragEnter:function(e){e.stopPropagation(),e.preventDefault(),_i.addClass(_i.id("private-chat-log"),"droparea")},imageDragLeave:function(e){e.stopPropagation(),e.preventDefault(),_i.removeClass(_i.id("private-chat-log"),"droparea")}},register={id:"register",errors:{EMPTY_USER_NAME:"register.1",BAD_USER_NAME:"register.2",USER_NAME_IN_USE:"register.3",EMPTY_PASSWORD:"register.4",INVALID_PASSWORD:"register.5",BAD_EMAIL:"register.6",IMAGE_TOO_LARGE:"register.7",IMAGE_UPLOADING:"register.8",INVALID_URL:"register.9"},PASSWORD_REGEX:/^[^,]{6,50}$/,previewImageHandle:null,init:function(){},enter:function(e,t){"Enter"===e.key&&skin.register(t)},previewImage:function(e){register.previewImageHandle.src=e.value,register._setError(e)},validate:function(e,t){var s=!1;0===e.username.value.length?(register._setError(e.username,"EMPTY_USER_NAME"),s=!0):register.validateUsername(e.username.value)?0==e.usernameValid.value&&(register._setError(e.usernameValid,"USER_NAME_IN_USE"),s=!0):(register._setError(e.username,"BAD_USER_NAME"),s=!0),0==e.password.value.length?(register._setError(e.password,"EMPTY_PASSWORD"),s=!0):register.validatePassword(e.password.value)||(register._setError(e.password,"INVALID_PASSWORD"),s=!0),register.validateEmail(e.email.value)||(register._setError(e.email,"BAD_EMAIL"),s=!0),uploader.busy&&(register._setError(e.image,"IMAGE_UPLOADING"),s=!0),s||t()},validateUsernameDom:function(e){register._clickedOnButton(e)||(e.target.value=e.target.value.trim(),0!=e.target.value.length&&(register.validateUsername(e.target.value)?rtc.validateUsernameAvailability(e.target.value,(function(t){var s=_i.firstCss("valid-username",e.target.parentNode);t.free?(s.value=1,register._setError(e.target)):(s.value=0,register._setError(e.target,"USER_NAME_IN_USE"))})):register._setError(e.target,"BAD_USER_NAME")))},validateUsername:function(e){return e&&!/(^(-?\d+)$)|,/.test(e)},validatePasswordDom:function(e){register._clickedOnButton(e)||0!=e.target.value.length&®ister._setError(e.target,register.validatePassword(e.target.value)?null:"INVALID_PASSWORD")},validatePassword:function(e){return register.PASSWORD_REGEX.test(e)},validateEmailDom:function(e){register._clickedOnButton(e)||(e.target.value=e.target.value.trim(),0!=e.target.value.length&®ister._setError(e.target,register.validateEmail(e.target.value)?null:"BAD_EMAIL"))},validateEmail:function(e){return/^([\w!#$%&'\*\+\-\/=\?\^`{\|}~]+\.)*[\w!#$%&'\*\+\-\/=\?\^`{\|}~]+@((((([a-z0-9][a-z0-9\-]{0,62}[a-z0-9])|[a-z0-9])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(:\d{1,5})?)$/i.test(e)},validateImageDom:function(e){if(!register._clickedOnButton(e)&&(e.target.value=e.target.value.trim(),0!=e.target.value.length))if(register.validateUrl(e.target.value)){var t=new Image;t.onload=function(){register._setError(e.target)},t.onerror=function(){register._setError(e.target,"INVALID_URL")},t.src=e.target.value}else register._setError(e.target,"INVALID_URL")},validateUrl:function(e){return/(https?:)?\/\/(www\.)?[-\w@:%.\+~#=]{2,256}\.[a-z]{2,6}\b([-\w@:%\+.~#?&/=]*)/i.test(e)},uploadFile:function(){uploader.configurations={closeDlg:!1,callback:function(e){var t=document.getElementById("register-image");t&&(t.value=e,register.previewImage(t))},accept:"image/*",imageWidthLimit:128,imageHeightLimit:128,forceResize:!0},skin.uploadFileDialog()},_setError:function(e,t){setTimeout((function(){_i.firstCss("error-label",e.parentNode).innerHTML=t?skin.errors[register.errors[t]]:""}),10)},_clickedOnButton:function(e){return e.relatedTarget&&"BUTTON"===e.relatedTarget.nodeName}},rtc={serverStart:0,mq:[],users:[],maxUsernameLength:0,usersOffline:{},usersBlocked:{},messagesLog:[],usersPrivateMessages:0,archiveId:-1,connectionDone:!1,connected:!1,busy:!1,hash:"",adminMode:!1,listeners:0,reconnects:0,reconnected:!1,reconnectedHandle:0,FLOOD_RECONNECT_DELAY:5e3,RECONNECTED_DELTA:5e3,chatPos:0,approvedPos:0,releaseInterval:0,lastCommand:0,MAX_RECONNECTS:100,MAX_RECONNECTS_SHORT:5,RECONNECTS_DELAY:1e4,RECONNECTS_SHORT_DELAY:2e3,MAX_MESSAGE_LENGTH:2e3,POSITIONS_HEADER:"RumbleTalk-Positions",s3bucket:"rumbletalk-images-upload",commands:{DONATION:1,REQUEST_PAYMENT:2,REQUEST_PAYMENT_PAID:3,DELETE_PM:6,LOGIN:7,PRIVATE_MESSAGE:8,PRIVATE_MESSAGE_OWN:9,GLOBAL_MESSAGE:10,LOAD_ARCHIVE:11,PAYPAL_RESPONSE:12,PRE_APPROVED_MESSAGE:13,APPROVE_MESSAGE:14,UPDATE_OWN:15,DELETE_APPROVED_MESSAGE:16,CLEAR_ALL_MESSAGES:17,RELOAD_CLIENT:18,ADMIN_MODE:19,FETCH_PRIVATE_MESSAGES:20,CHECK_USERNAME:21,LOGOUT_LISTENER:22,P2P:23,DELETE_MESSAGES:24,KICK:25,BLOCK:26,LISTENER_TO_USER:27,NEW_LISTENER:28,USERS_LIST:29,GET_USER_INFO:30,LOGOUT:31,UPDATE_USERS_IP:32,REGISTER_USER:33,MONETIZE_REGISTER:34,EXTEND_SESSION:35,SYSTEM_MESSAGE:36,UPDATE_USER_ID:37,USER_TO_LISTENER:38,GET_MESSAGES:39,USER_STATUS:40,POLLS_GET:41,POLLS_CREATE:42,POLLS_UPDATE:43,POLLS_ACTION:44,POLLS_DISPLAY:45,POLLS_VOTE:46,POLLS_PUBLISH:47},statuses:{OK:200,ACCESS_DENIED:400,ADMIN_PASSWORD:401,PAYMENT_REQUIRED:402,INVALID_CREDENTIALS:403,USER_NAME_IN_USE:409,CHAT_CLOSED:410,SPEAKERS_QUOTA_EXCEEDED:429,LISTENERS_QUOTA_EXCEEDED:430,KICKED:431,BAD_WORDS:432,FLOOD:433,BANNED:434,NOT_REGISTERED_ROOM:435,DISCONNECTED:0},pollsAction:{SEND:"send",RESET:"reset",PUBLISH:"publish",DELETE:"delete"},userStatuses:{},init:function(){_i.init(),rtc.hash=_i.l.pathname.substr(1,_i.l.pathname.length-2);var e=new XMLHttpRequest;e.open("GET","https://"+rtc.s3bucket+".s3.amazonaws.com/"+rtc.hash+"/configuration/cfg.json"),e.onreadystatechange=function(){if(4===e.readyState){try{window.cfg=JSON.parse(e.responseText)}catch(e){console.error("Failed to load cfg.json file")}_i.is("init-loader")&&_i.remove("init-loader"),_i.addClass(document.documentElement,cfg.dir?"rtl":"ltr"),auth.init(),_i.events([{name:"beforeunload",cb:rtc.beforeClosing},{name:"orientationchange",cb:function(){setTimeout(skin.draw,100)}}]),rtc.userStatuses={ONLINE:{text:cfg.strings.online,value:1},AWAY:{text:cfg.strings.away,value:2},BUSY:{text:cfg.strings.busy,value:3}},skin.setOneOnOne(cfg.chatType===_i.chatTypes.ONE_ON_ONE),uploader.updateValidities(),window.dataLayer=[],window.gtag=function(){dataLayer.push(arguments)},_i.load("https://www.googletagmanager.com/gtag/js?id=UA-20104634-3"),gtag("js",new Date),gtag("config","UA-20104634-3"),cfg.menuSettings.exportTranscript>0&&_i.load("chat/js/FileSaver.min.js"),_i.webrtc&&(_i.load("chat/js/RecordRTC.5.6.2.min.js"),_i.ua===_i.userAgents.EDGE&&_i.load("https://webrtc.github.io/adapter/adapter-latest.js")),keywords.init(),skin.buildCustomizedCss(_i.mobile?cfg.mobileCss:cfg.css),skin.init(),_i.mobile&&(_i.id("photo").onclick=function(){uploader.configurations={closeDlg:!0,callback:skin.messageFullPost,imageWidthLimit:800,imageHeightLimit:600},skin.takePhotoDialog()},skin.callingBox.addEventListener("touchmove",(function(e){e.preventDefault()})),setInterval(skin.checkDims,100),document.addEventListener("click",skin.mobileClearScreen,!1),cfg.inviteFriends?_i.id("top-bar-left").onclick=function(e){var t=_i.id("invite-dialog");e.stopPropagation(),skin.mobileClearScreen(e,t),_i.toggleClass(t,"active")}:_i.remove(_i.id("top-bar-left")),skin.listHandle.onclick=function(e){e.stopPropagation(),skin.mobileClearScreen(e,skin.listFrame),skin.toggleListDisplay(!skin.usersListOpened)},_i.webrtc&&!skin.isPrivateChat()||(_i.remove("photo"),_i.id("users").style.width="50%",_i.id("uploadMobile").style.width="50%"),cfg.upload&&!skin.isPrivateChat()||(_i.remove("photo"),_i.remove("uploadMobile"),_i.id("users").style.width="100%"),skin.sound||_i.addClass(_i.firstCss("sound-li"),"inactive"),skin.privatePopup||_i.addClass(_i.firstCss("toggle-private"),"inactive")),(cfg.logins.facebook||cfg.inviteFriends)&&facebook.init(),twitter.init(),guest.init(),rumbletalk.init(),net.init()?(polls.init(),auth.loadStorage(),rtc.connect((function(){rtc.connectionDone=!0,skin.draw(),skin.welcomeMessage(),skin.initializeSendLimit(!1),setInterval(sdk.handleStorageRequests,1e3)}))):skin.showMessage(cfg.strings.invalid_browser)}},e.send()},beforeClosing:function(){p2p.stop(),net.close()},reconnect:function(){dlg.close(!0),skin.wait(cfg.strings.connecting),setTimeout(rtc.connect,rtc.FLOOD_RECONNECT_DELAY)},connect:function(e){rtc.reconnects=0,dlg.close(!0),skin.wait(cfg.strings.connecting),_i.storage.removeItem("d",!1);var t={delay:0,data:{cmd:rtc.commands.USERS_LIST},endCb:e};rtc.send(t)},disconnect:function(e,t,s){if(clearInterval(rtc.releaseInterval),net.close(),auth.loggedIn&&s){var i=rtc.user(auth.id)||rtc.user(auth.lastId);0!==i.loginType.ssoType&&1!==i.loginType.ssoType||i.loginType.logout(),sdk.notifyLogout(s)}rtc.users=[],rtc.mq=[],rtc.archiveId=-1,auth.setLoggedIn(!1),rtc.connected=!1,rtc.busy=!1,auth.id=0,rtc.listeners=0,rtc.chatPos=0,rtc.approvedPos=0,privateChat.position=0,rtc.lastCommand=0,rtc.releaseInterval=0,skin.lastArchivedUser=0,skin.lastMsgIds=[],auth.setModerator(!1),skin.closeCalling(),skin.chatExtra.style.display="none",e&&(skin.ownMessages=[]),privateChat.clearMessages(),_i.storage.removeItem(rtc.hash),_i.storage.removeItem(rtc.hash,!0),skin.clearUsers(),skin.setListeners(),skin.readyForLogin(),!t&&cfg.allowListeners||skin.disconnected(t)},releaseSend:function(){-1!==_i.indexOf([0,1,4],net.s.readyState)&&rtc.busy&&rtc.mq.length>0&&rtc.releasableCommand(rtc.lastCommand)&&(rtc.lastCommand=0,rtc.busy=!1,rtc.sendQ())},releasableCommand:function(e){return-1!==[rtc.commands.DELETE_PM,rtc.commands.P2P,rtc.commands.DELETE_MESSAGES,rtc.commands.KICK,rtc.commands.BLOCK,rtc.commands.GET_MESSAGES].indexOf(e)},delaySend:function(e,t){net.send(e,t)},send:function(e){if(rtc.busy)return rtc.connected||e.delay||(e.delay=1500),void rtc.mq.push(e);rtc.lastCommand=e.data.cmd,e.data=JSON.stringify(e.data),rtc.busy=!0;var t=rtc.chatPos+","+privateChat.position;cfg.chatType==_i.chatTypes.MODERATED&&auth.moderator&&(t+=","+rtc.approvedPos);var s={"Cache-Control":"no-store","Content-Type":"application/json; charset=utf-8"};if(s[rtc.POSITIONS_HEADER]=t,auth.local.s||rtc.lastCommand==rtc.commands.USERS_LIST&&auth.local.r||_i.storage.getItem(rtc.hash,!0)&&_i.storage.getItem(rtc.hash,!0).s||auth.local[twitter.storageName]||auth.local[facebook.storage]){var i,a=[];for(i in auth.session)if(auth.session.hasOwnProperty(i)){if("rumbletalk-private-message-logs"===i)continue;a.push(i+"="+auth.session[i])}for(i in auth.local)auth.local.hasOwnProperty(i)&&a.push(i+"="+auth.local[i]);s.Sookie=a.join(";")}e.cb=rtc.netHandler,e.headers=s,rtc.delaySend(e,e.delay||200)},sendQ:function(){var e;e=rtc.mq.length>0?rtc.mq.shift():{data:{cmd:rtc.commands.GET_MESSAGES}},rtc.send(e)},resend:function(e,t){rtc.delaySend(e,t)},commandAffectsConnection:function(e){var t=[rtc.commands.CHECK_USERNAME,rtc.commands.EXTEND_SESSION,rtc.commands.MONETIZE_REGISTER,rtc.commands.REGISTER_USER];return-1===_i.indexOf(t,e)||cfg.allowListeners},netHandler:function(e,t){if(4==e.readyState){var s,i,a=e.responseText,n=0,o=!0,r=e.getResponseHeader(rtc.POSITIONS_HEADER)||"",l=e.status==rtc.statuses.OK&&0==a.length?rtc.statuses.DISCONNECTED:e.status;if(auth.handleStorage(e)){if(a)try{a=JSON.parse(a)}catch(e){return void console.log("Invalid JSON in rtc.netHandler:",a)}switch(l){case rtc.statuses.OK:if(t.loginType===twitter&&twitter.clearStorage(),t.cmdCb)t.cmdCb(a,t);else if(a instanceof Array)for(s=0;s1&&(rtc.chatPos=Number(r[0]),privateChat.position=Number(r[1]),auth.moderator&&cfg.chatType==_i.chatTypes.MODERATED&&(rtc.approvedPos=Number(r[2]))),!rtc.connected&&rtc.commandAffectsConnection(a.cmd)&&(rtc.connected=!0,rtc.releaseInterval=setInterval(rtc.releaseSend,1e3),skin.connected(),auth.loggedIn||skin.readyForLogin(),skin.checkWaitingForModerator(),skin.checkWaitingForOtherUsers(),_i.storage.getItem("s",!0)||console.log("WARNING: storage are disabled"));break;case rtc.statuses.BANNED:i="abuse_banned";case rtc.statuses.ACCESS_DENIED:i=i||"access_denied";case rtc.statuses.KICKED:i=i||"abuse_kicked";case rtc.statuses.FLOOD:i=i||"abuse_flood",_i.storage.removeItem("r",!0),rtc.connected?rtc.disconnect(!0,l,auth.getLastLogoutReason()||i):skin.mustLogin(),l==rtc.statuses.BANNED&&(auth.moderator||(_i.storage.setItem("banned",!0,!0),auth.banned=!0));break;case rtc.statuses.BAD_WORDS:skin.showMessage(cfg.strings.bad_words,"bad-words");break;case rtc.statuses.INVALID_CREDENTIALS:if(rtc.lastCommand==rtc.commands.USERS_LIST)return rtc.busy=!1,_i.storage.removeItem("r",!0),void rtc.send({data:{cmd:rtc.commands.USERS_LIST}});t.loginType===twitter&&twitter.clearStorage(),skin.showError({type:t.loginType,status:rtc.statuses.INVALID_CREDENTIALS,fields:t.fields});break;case rtc.statuses.USER_NAME_IN_USE:skin.showError({type:t.loginType,status:rtc.statuses.USER_NAME_IN_USE,fields:t.fields});break;case rtc.statuses.ADMIN_PASSWORD:t.loginType===twitter&&(twitter.process=!1),_i.storage.removeItem("r",!0),skin.showError({type:rumbletalk,status:rtc.statuses.ADMIN_PASSWORD,fields:t.fields,realType:t.loginType});break;case rtc.statuses.SPEAKERS_QUOTA_EXCEEDED:rtc.connected&&rtc.disconnect(!1,!1,!!auth.loggedIn&&"quota_exceeded"),skin.quota(rtc.statuses.SPEAKERS_QUOTA_EXCEEDED);break;case rtc.statuses.LISTENERS_QUOTA_EXCEEDED:rtc.connected&&rtc.disconnect(!1),skin.quota(rtc.statuses.LISTENERS_QUOTA_EXCEEDED);break;case rtc.statuses.CHAT_CLOSED:rtc.disconnect(!0,null,"chat_closed"),skin.close(!0),skin.closed();break;case rtc.statuses.PAYMENT_REQUIRED:skin.paymentSummaryDialog(a,!0);break;case rtc.statuses.NOT_REGISTERED_ROOM:skin.loginHash=a.hash,skin.confirmRegisterDialog();break;default:if(o=!1,rtc.MAX_RECONNECTS<=++rtc.reconnects){rtc.disconnect(!1,null,"network_issue"),skin.cannotConnect();break}rtc.connected&&(rtc.connected=!1,clearInterval(rtc.releaseInterval),rtc.releaseInterval=0),rtc.resend(t,rtc.MAX_RECONNECTS_SHORT<=rtc.reconnects?rtc.RECONNECTS_DELAY:rtc.RECONNECTS_SHORT_DELAY),n=1}o&&(rtc.reconnects>0&&rtc.reconnectingGrace(),rtc.reconnects=0),rtc.busy=n,"function"==typeof t.endCb&&t.endCb(),rtc.connected&&rtc.sendQ()}else rtc.disconnect(!0,rtc.statuses.DISCONNECTED,"different_sessions")}},reconnectingGrace:function(){rtc.reconnected=!0,clearTimeout(rtc.reconnectedHandle),rtc.reconnectedHandle=setTimeout((function(){rtc.reconnected=!1,rtc.reconnectedHandle=0}),rtc.RECONNECTED_DELTA)},userIndex:function(e,t,s){var i;for(i=0;i0)break;if(!(rtc.users[t].name.localeCompare(e.name)<0))break}}return rtc.users.splice(t,0,e),t},addUser:function(e,t,s,i,a,n,o,r){var l={id:e,name:t,image:s,ip:i,ssoUid:a,loginType:n,moderator:o,privateMsg:0,status:r},c=rtc.positionUser(l);l.image||(l.image=n.pic(l)),rtc.maxUsernameLength-1&&(rtc.usersOffline[e]=rtc.users.splice(t,1)[0],rtc.usersOffline[e].name.length==rtc.maxUsernameLength&&rtc.updateMaxUsernameLength(),skin.removeUser(rtc.usersOffline[e]),e!=auth.id&&e!=auth.lastId&&skin.systemMessage(rtc.usersOffline[e].name+cfg.strings.left,"userLeft"),!0)},updateMaxUsernameLength:function(){var e;for(rtc.maxUsernameLength=0,e=0;e0&&(rtc.listeners--,skin.setListeners());break;case rtc.commands.P2P:skin.p2pAction(e.data);break;case rtc.commands.DELETE_MESSAGES:skin.deleteMessages(e.data.ids);break;case rtc.commands.LISTENER_TO_USER:rtc.connected&&rtc.listeners>0&&(rtc.listeners--,skin.setListeners()),rtc.parseUser(e.data),skin.checkWaitingForModerator(),skin.checkWaitingForOtherUsers();break;case rtc.commands.NEW_LISTENER:rtc.listeners++,skin.setListeners();break;case rtc.commands.LOGOUT:e.data.soft||(auth.id==e.data.id?rtc.disconnect(!0,!1,auth.getLastLogoutReason()):rtc.removeUser(e.data.id));break;case rtc.commands.UPDATE_USERS_IP:rtc.updateUsersIp(e.data);break;case rtc.commands.EXTEND_SESSION:auth.updateExpiration(e.data.exp);break;case rtc.commands.SYSTEM_MESSAGE:skin.systemMessageAPI(e.data);break;case rtc.commands.UPDATE_USER_ID:auth.updateUserId(e.data);break;case rtc.commands.USER_TO_LISTENER:auth.id==e.data.id||auth.lastId==e.data.id?auth.loggedOut(e.data,auth.getLastLogoutReason()):(rtc.listeners++,skin.setListeners(),rtc.removeUser(e.data.id),skin.checkWaitingForModerator(),skin.checkWaitingForOtherUsers());break;case rtc.commands.USERS_LIST:rtc.usersList(e.data);break;case rtc.commands.USER_STATUS:rtc.userStatus(e.data);break;case rtc.commands.POLLS_GET:polls.get(e.data);break;case rtc.commands.POLLS_ACTION:skin.close(!0);var l=e.data.action===polls.ACTIONS.DELETE,c=e.data.action===polls.ACTIONS.RESET;if(!e.data.status&&l){skin.showMessage(cfg.strings.polls_delete_failed);break}if(!e.data.status&&c){skin.showMessage(cfg.strings.polls_reset_failed);break}if((l||c)&&polls.deletePollInCache(e.data.id),e.data.fromAdmin)return;skin.pollsDialog();break;case rtc.commands.POLLS_DISPLAY:skin.viewPollDialog(JSON.stringify(e.data),!0,!1);break;case rtc.commands.POLLS_VOTE:if(e.data.err_msg)return void skin.showMessage(cfg.strings.polls_vote_fail);polls.storeVote(e.data.id,e.data.vote),skin.showMessage(cfg.strings.polls_vote_success);break;case rtc.commands.POLLS_PUBLISH:skin.viewPollDialog(JSON.stringify(e.data),!1,!0)}},getPaymentLink:function(e,t,s){rtc.send({data:{cmd:rtc.commands.DONATION,data:{message:t,amount:s}},cmdCb:function(t){if(t.cmd!=rtc.commands.DONATION)return console.log("invalid paypal response:",t),void skin.close();setTimeout((function(){e(t.data.link)}),1)}})},sendPaymentRequest:function(e,t,s,i){auth.moderator&&auth.id!=e&&!auth.banned&&rtc.send({data:{cmd:rtc.commands.REQUEST_PAYMENT,data:{toUserId:e,amount:t,currency:s}},cmdCb:i})},deletePrivateMessages:function(e,t){rtc.send({data:{cmd:rtc.commands.DELETE_PM,data:{uid:e,ids:t}}})},sendMessage:function(e){auth.banned||rtc.adminMode&&!auth.moderator||rtc.send({data:{cmd:rtc.commands.GLOBAL_MESSAGE,data:{text:e}}})},sendPrivateMessage:function(e,t,s){auth.banned||rtc.send({data:{cmd:rtc.commands.PRIVATE_MESSAGE,data:{uid:e,tempId:t,text:s}}})},approveMessage:function(e,t){rtc.send({data:{cmd:rtc.commands.APPROVE_MESSAGE,data:{pos:e,uId:auth.id,status:t}}})},setAdminMode:function(){rtc.send({data:{cmd:rtc.commands.ADMIN_MODE,data:{mute:rtc.adminMode}}})},userStatus:function(e){rtc.user(e.userId)&&(rtc.user(e.userId).status=e.status,skin.updateUserStatusDom(e.userId,e.status))},updateUserStatus:function(e){skin.updateUserStatusDom(auth.id,e),rtc.send({data:{cmd:rtc.commands.USER_STATUS,data:{userId:auth.id,status:e}}})},sendPollsGet:function(e){var t={cmd:rtc.commands.POLLS_GET};if(e)return t.data={id:e},void rtc.send({data:t,cmdCb:polls.paginateLoaded});t.data={id:(polls.currentPage-1)*polls.RECORDS_LIMIT},rtc.send({data:t})},sendPollSave:function(e){var t=0===polls.model.id,s=t?rtc.commands.POLLS_CREATE:rtc.commands.POLLS_UPDATE,i={question:polls.model.question,answer1:polls.model.answer1,answer2:polls.model.answer2,answer3:polls.model.answer3,answer4:polls.model.answer4};e&&(i.send=!0),t||(i.id=polls.model.id),rtc.send({data:{cmd:s,data:i},cmdCb:function(){t?rtc.pollsCreate(e):rtc.pollsUpdate(e)}})},pollsCreate:function(e){_i.id("btn-polls-cancel").disabled=!1,_i.id("btn-polls-send").disabled=!1,_i.id("btn-polls-save").disabled=!1,(e?_i.id("btn-polls-send"):_i.id("btn-polls-save")).innerHTML=e?cfg.strings.polls_send:cfg.strings.polls_save,polls.resetForm();var t=_i.create("div",{className:"alert alert-success",innerHTML:"Success! Poll created"},_i.id("polls-update-dialog"),_i.id("polls-update-form"));setTimeout((function(){t.style.opacity="0",t.style.display="none",_i.remove(t)}),3e3)},pollsUpdate:function(e){_i.id("btn-polls-cancel").disabled=!1,_i.id("btn-polls-delete").disabled=!1,_i.id("btn-polls-send").disabled=!1,_i.id("btn-polls-save").disabled=!1,(e?_i.id("btn-polls-send"):_i.id("btn-polls-save")).innerHTML=e?cfg.strings.polls_send:cfg.strings.polls_save;var t=_i.create("div",{className:"alert alert-success",innerHTML:"Success! Poll updated"},_i.id("polls-update-dialog"),_i.id("polls-update-form"));setTimeout((function(){t.style.opacity="0",t.style.display="none",_i.remove(t)}),3e3)},sendPollsAction:function(e,t){t===polls.ACTIONS.DELETE&&(skin.close(!0),skin.wait(cfg.strings.deleting)),rtc.send({data:{cmd:rtc.commands.POLLS_ACTION,data:{id:e,action:t}}})},sendPollsVote:function(e,t){rtc.send({data:{cmd:rtc.commands.POLLS_VOTE,data:{id:e,vote:t}}})}},rumbletalk={id:"rumbletalk",isSSO:!0,ssoType:2,name:"Username",errors:{EMPTY_USER_NAME:"rumbletalk.1",EMPTY_PASSWORD:"rumbletalk.2",BAD_USER_NAME:"rumbletalk.3"},init:function(){rumbletalk.name=cfg.strings.rumbletalk},setup:function(e,t){if(!e.hash)return e.username=e.username.trim(),e.username&&0!=e.username.length?/^-?\d+$/.test(e.username)?rumbletalk.errors.BAD_USER_NAME:e.password&&0!=e.password.length?void t(rumbletalk,!0,e):rumbletalk.errors.EMPTY_PASSWORD:rumbletalk.errors.EMPTY_USER_NAME;t(rumbletalk,!0,e)},logout:function(e){e()},pic:function(e){return e.image||guest.pic()},getUserInfo:function(e,t){"string"==typeof e.description?rumbletalk.gotUserInfo(e,t):rtc.getUserInfo(e,(function(s){auth.moderator&&(e.ip=s.data.ip,e.banned=s.data.ban),e.description=rumbletalk.parseDescription(s.data.desc),rumbletalk.gotUserInfo(e,t)}))},gotUserInfo:function(e,t){e.description?t(e,{buttons:[],texts:[{label:cfg.strings.description,text:e.description}]}):t(e)},parseDescription:function(e){return"string"!=typeof e?"":e=(e=gui.safe(e)).replace(/(^|[^\\](\\\\)*)(\\n)/g,(function(e,t){return t+"
"})).replace(/\\\\/g,"\\")}},sdk={postMessageEvents:{LOGOUT_CB:"pm.1",LOGOUT_CB_RECEIVED:"pm.2",LOGIN:"pm.3",LOGIN_SUCCESS:"pm.4",LOGIN_ALREADY_LOGGED_IN:"pm.5",LOGOUT:"pm.6",OPEN_PRIVATE_CHAT:"pm.7"},logoutCallbackTarget:{source:null,origin:""},isSDKMessage:function(e){return e&&"pm."==e.substring(0,3)},handleEventRequests:function(e){if(sdk.isValidDomain(_i.getHostname(e.origin)))switch(e.data.type){case sdk.postMessageEvents.LOGIN:sdk.handleSDKLogin(e);break;case sdk.postMessageEvents.LOGOUT:sdk.handleSDKLogout(e);break;case sdk.postMessageEvents.LOGOUT_CB:sdk.handleSDKLogoutCB(e);break;case sdk.postMessageEvents.OPEN_PRIVATE_CHAT:sdk.handleOpenPrivateChat(e)}else e.source.postMessage("STOP",e.origin)},handleSDKLoginLegacy:function(e){if(!auth.loggedIn&&!_i.storage.getItem("r",!0)&&sdk.isValidDomain(_i.getHostname(e.origin))){var t=e.data.substr(6);t={username:(t=t.split(","))[0],password:t[1]},dlg.close(!0),auth.login(t.password?rumbletalk:guest,t)}e.source.postMessage("RTloginSuccess",e.origin)},handleSDKLogin:function(e){var t;if(e.data.forceLogin||!auth.loggedIn&&!_i.storage.getItem("r",!0)){var s={username:e.data.username,password:e.data.password};function i(){dlg.close(!0),skin.login(s.password?rumbletalk:guest,s)}e.data.image&&!s.password&&(s.image=e.data.image),dlg.close(!0),auth.loggedIn||_i.storage.getItem("r",!0)?rtc.user(auth.id).name!==s.name&&auth.logout("sdk_request",i):i(),t=sdk.postMessageEvents.LOGIN_SUCCESS}else t=sdk.postMessageEvents.LOGIN_ALREADY_LOGGED_IN;e.source.postMessage({type:t,hash:rtc.hash},e.origin)},handleSDKLogout:function(e){rtc.connectionDone||setTimeout((function(){sdk.handleSDKLogout(e)}),1e3),auth.loggedIn||_i.storage.getItem("r",!0)?e.data.userId&&e.data.userId!=auth.id?console.log("invalid user id supplied"):e.data.username&&e.data.username!==rtc.user(auth.id).name?console.log("invalid user name supplied"):auth.logout("sdk_request"):console.log("user is not logged in")},handleSDKLogoutCB:function(e){sdk.logoutCallbackTarget={source:e.source,origin:e.origin},e.source.postMessage({type:sdk.postMessageEvents.LOGOUT_CB_RECEIVED,hash:rtc.hash},e.origin)},handleOpenPrivateChat:function(e){var t;if(e.data.userId)t=rtc.user(e.data.userId);else{if(!e.data.username)return;t=rtc.users[rtc.userIndex("name",e.data.username,!0)]}t?(privateChat.open(t.id),e.source.postMessage({type:sdk.postMessageEvents.OPEN_PRIVATE_CHAT,hash:rtc.hash,result:"success"},e.origin)):e.source.postMessage({type:sdk.postMessageEvents.OPEN_PRIVATE_CHAT,hash:rtc.hash,result:"user not found"},e.origin)},notifyLogout:function(e){sdk.logoutCallbackTarget.source&&sdk.logoutCallbackTarget.source.postMessage({type:sdk.postMessageEvents.LOGOUT_CB,hash:rtc.hash,reason:e||"unknown"},sdk.logoutCallbackTarget.origin)},handleStorageRequests:function(){var e,t=_i.storageItems(["rt_tmp_username","rt_tmp_password","rt_sdk_request"],!0);if(t.rt_sdk_request){_i.storage.removeItem("rt_sdk_request",!0);try{e=JSON.parse(t.rt_sdk_request)}catch(e){console.log(e)}if(!sdk.isValidDomain(e.hostname))return;switch(e.username&&(e.name=e.username,delete e.username),e.type){case sdk.postMessageEvents.LOGIN:sdk.handleStorageLogin(e);break;case sdk.postMessageEvents.LOGOUT:sdk.handleStorageLogout(e)}}t.rt_tmp_username&&(_i.storage.removeItem("rt_tmp_username",!0),_i.storage.removeItem("rt_tmp_password",!0),e={name:decodeURIComponent(t.rt_tmp_username).replace("+"," ")},0!=t.rt_tmp_password&&(e.password=decodeURIComponent(t.rt_tmp_password).replace("+"," ")),sdk.handleStorageLogin(e))},handleStorageLogin:function(e){if(!_i.storage.getItem("r",!0)&&!auth.loggedIn){var t={username:e.name,password:e.password};dlg.close(!0),skin.login(e.password?rumbletalk:guest,t)}},handleStorageLogout:function(e){auth.loggedIn?e.userId&&e.userId!=auth.id?console.log("user id check failed"):e.username&&e.username!=rtc.user(auth.id).name?console.log("username check failed"):auth.logout("sdk_request"):console.log("user is not logged in")},handleCookieLogin:function(e){if(!_i.isCookie("r")&&!auth.loggedIn){var t={username:e.name,password:e.password};dlg.close(!0),skin.login(e.password?rumbletalk:guest,t)}},handleCookieLogout:function(e){auth.loggedIn?e.userId&&e.userId!=auth.id?console.log("user id check failed"):e.username&&e.username!=rtc.user(auth.id).name?console.log("username check failed"):auth.logout("sdk_request"):console.log("user is not logged in")},isValidDomain:function(e){if(0==cfg.domains.length)return!0;if("string"!=typeof e)return!1;var t;for(t=0;t':'',_i.create("DIV",{innerHTML:s},_i.b),sfx.wait()}},wait:function(){if(sfx.player=_i.id("_player"),sfx.player&&sfx.player._createSound)for(var e in sfx.ready=!0,sfx.src)sfx.src.hasOwnProperty(e)&&(sfx.player._createSound(e,!1),sfx.player._load(e,sfx.src[e],!1,!1));else setTimeout((function(){sfx.wait()}),100)},play:function(e){if(sfx.src[e]&&!sfx.ringing)if(sfx.html5){var t=sfx.src[e].play();void 0!==t&&t.catch((function(e){}))}else sfx.ready&&sfx.player._start(e,0,0)},ring:function(e){if(!sfx.ringing){sfx.ringing=!0;var t,s=_i.now();sfx.ringInterval=setInterval((function(){_i.now()-s>=sfx.ringDuration?(sfx.stopRing(),"function"==typeof e&&e()):sfx.hasRinging&&void 0!==(t=sfx.player.play())&&t.catch((function(e){}))}),1e3*sfx.player.duration+sfx.ringPause)}},stopRing:function(){clearInterval(sfx.ringInterval),sfx.ringInterval=0,sfx.ringing&&(sfx.player.pause(),sfx.ringing=!1)}},skin={errors:{},list:null,listFrame:null,listHandle:null,searchBar:null,chat:null,chatFrame:null,content:null,textCover:null,textInput:null,newLineCount:0,TEXT_FIELD_BASE_HEIGHT:40,TEXT_FIELD_HEIGHT_INCREMENTS:16,chatExtra:null,smiley:null,smiliesBox:null,donateBox:null,upload:null,send:null,donate:null,callingBox:null,callingAnswerButtons:null,callingOptions:null,callText:null,callVideo:null,callVideoMini:null,localVideoHandle:null,info:null,listeners:null,speakers:null,session:null,options:null,mobileDims:null,lastUserId:0,lastMsgIds:[],lastMsgTime:0,otherUsersLastMsgTime:0,lastMsg:null,archivePos:null,lastArchivedUser:0,lastArchivedMsgTime:0,lastArchivedMsg:null,loadingArchiveInterval:null,pause:!1,sound:!0,privatePopup:!0,toolbar:null,invited:!1,ownMessages:[],loginType:null,lastCallDialogSize:"side",noAnswerTimeout:0,registerDetails:{},loginHash:"",usersListOpened:!0,isSmall:!1,SMALL_SCREEN:480,MIN_USERS_LIST_WIDTH:180,MESSAGES_INTERVAL:3e4,imageBlob:null,messageTimeout:null,messageInterval:null,init:function(){var e;for(e in skin.sound=!_i.storage.getItem("settings.sound")||JSON.parse(_i.storage.getItem("settings.sound")),skin.privatePopup=!_i.storage.getItem("settings.privatePopup")||JSON.parse(_i.storage.getItem("settings.privatePopup")),skin.rebuildHtml(),privateChat.init(),skin.isSmall=_i.mobile||_i.client().width<=skin.SMALL_SCREEN,skin.toggleListDisplay(!skin.isSmall),_i.userAgents)_i.userAgents.hasOwnProperty(e)&&_i.userAgents[e]===_i.ua&&_i.addClass(_i.b,"is"+e);var t=_i.selectors(["#text-cover"]);t&&t["#text-cover"]&&t["#text-cover"].style.height&&(skin.TEXT_FIELD_BASE_HEIGHT=parseInt(t["#text-cover"].style.height),skin.TEXT_FIELD_HEIGHT_INCREMENTS=1.2*parseInt(_i.style(skin.textCover).getPropertyValue("font-size"))),skin.session.onclick=function(){skin.toggleExtendPopup(!0)},_i.firstCss("timer",skin.session).onclick=function(){skin.usersListOpened||(skin.toggleListDisplay(!0),skin.toggleExtendPopup(!0))},skin.updateUsersListDisplay(),monetize.adjustCurrencyParameters(),sfx.init(cfg.sounds),uploader.init(),gui.init(),_i.mobile||(cfg.inviteFriends||_i.remove(_i.id("invite-button")),skin.listHandle.onclick=function(){skin.toggleListDisplay(!skin.usersListOpened)}),cfg.inviteFriends&&_i.addClass(_i.id("search-button"),"invite-enabled"),skin.usersMessagesCount.onclick=function(){skin.list.scrollTop=0},skin.textCover.onclick=function(){auth.loggedIn||skin.loginDialog()},skin.isPrivateChat()&&(skin.chatFrame.onclick=function(){auth.loggedIn||skin.loginDialog()}),skin.textInput.onfocus=function(){skin.toggleSmilies(!0),skin.toggleDonate(!0),auth.loggedIn&&!privateChat.userId?mentions.checkMention():skin.textInput.blur()},skin.textInput.onblur=skin.preventSingleBr,skin.textInput.onkeydown=function(e){auth.loggedIn&&(mentions.handleKeys(e)||"Enter"!==e.key||e.shiftKey||_i.mobile||(e.preventDefault(),e.target.innerText.trim().length>0&&(skin.messageFullPost(e.target.innerText),skin.focus())))},skin.textInput.onkeyup=function(e){if(auth.loggedIn){var t=e.target.innerText.substr(0,e.target.innerText.length-1).match(/\n/g);(t=(t||[]).length)!=skin.newLineCount&&skin.adjustTextField(t),e.target.innerText.length>0&&"none"!==skin.textPlaceholder.style.display&&(skin.textPlaceholder.style.display="none"),mentions.checkMention()}},skin.send.onclick=function(){auth.loggedIn&&0!=skin.textInput.innerText.trim().length&&(skin.messageFullPost(skin.textInput.innerText),skin.focus())},skin.textInput.addEventListener("paste",skin.textOrImagePaste,!1),uploader.validities.upload&&(skin.chatFrame.addEventListener("dragenter",skin.imageDragEnter,!1),skin.chatFrame.addEventListener("dragleave",skin.imageDragLeave,!1),skin.chatFrame.addEventListener("drop",skin.imageDrop,!1)),skin.errors[guest.errors.EMPTY_USER_NAME]=cfg.strings.empty_user_name,skin.errors[guest.errors.BAD_USER_NAME]=cfg.strings.bad_user_name,skin.errors[rumbletalk.errors.EMPTY_USER_NAME]=cfg.strings.empty_user_name,skin.errors[rumbletalk.errors.BAD_USER_NAME]=cfg.strings.bad_user_name,skin.errors[rumbletalk.errors.EMPTY_PASSWORD]=cfg.strings.empty_password,skin.errors[rtc.statuses.USER_NAME_IN_USE]=cfg.strings.user_name_in_use,skin.errors[rtc.statuses.INVALID_CREDENTIALS]=cfg.strings.invalid_credentials,skin.errors[rtc.statuses.ADMIN_PASSWORD]=cfg.strings.admin_password,skin.errors[rtc.statuses.SPEAKERS_QUOTA_EXCEEDED]=cfg.strings.quota_exceeded,skin.errors[rtc.statuses.LISTENERS_QUOTA_EXCEEDED]=cfg.strings.quota_exceeded,skin.errors[rtc.statuses.ACCESS_DENIED]=cfg.strings.disconnected,skin.errors[rtc.statuses.KICKED]=cfg.strings.kicked,skin.errors[rtc.statuses.BANNED]=cfg.strings.kicked,skin.errors[rtc.statuses.BAD_WORDS]=cfg.strings.bad_words,skin.errors[rtc.statuses.FLOOD]=cfg.strings.flood,skin.errors[register.errors.EMPTY_USER_NAME]=cfg.strings.empty_user_name,skin.errors[register.errors.BAD_USER_NAME]=cfg.strings.bad_user_name,skin.errors[register.errors.USER_NAME_IN_USE]=cfg.strings.user_name_in_use,skin.errors[register.errors.EMPTY_PASSWORD]=cfg.strings.empty_password,skin.errors[register.errors.INVALID_PASSWORD]=cfg.strings.invalid_password,skin.errors[register.errors.BAD_EMAIL]=cfg.strings.bad_email,skin.errors[register.errors.IMAGE_TOO_LARGE]=cfg.strings.image_too_large,skin.errors[register.errors.IMAGE_UPLOADING]=cfg.strings.image_uploading,skin.errors[register.errors.INVALID_URL]=cfg.strings.invalid_url,dlg.init(),document.onkeydown=function(e){if((cfg.chatType!==_i.chatTypes.ONE_ON_ONE||auth.moderator)&&"Escape"===e.key){if(dlg.opened)return void skin.close();if(privateChat.userId>0)return void privateChat.close();skin.toggleSmilies(!0),skin.toggleDonate(!0),mentions.close()}},skin.redraw(),_i.events([{obj:skin.chat,name:"scroll",cb:skin.scrollBar},{name:"resize",cb:skin.redraw},{name:"message",cb:skin.messageEvent}]),skin.initP2P(),setInterval(skin.scroll,100),window.addEventListener("beforeunload",(function(e){var t=e||window.event;if(rtc.mq.length>0||skin.ownMessages.length>0||Object.keys(privateChat.ownMessages).length>0)if(_i.userAgents.IE||_i.userAgents.CHROME)t.returnValue="You still have messages being sent, are you sure you want to leave this page?";else{if(!_i.userAgents.FIREFOX)return _i.userAgents.SAFARI||(t.preventDefault(),t.returnValue="You still have messages being sent, are you sure you want to leave this page?"),"You still have messages being sent, are you sure you want to leave this page?";t.preventDefault()}}))},buildCustomizedCss:function(e){if(e){var t=document.createElement("style");t.title="rt-css",t.appendChild(document.createTextNode(e)),document.head.appendChild(t)}},rebuildHtml:function(){_i.b.appendChild(gui.template("s3upload-template",{s3Bucket:"https://"+cfg.s3.bucket+".s3.amazonaws.com/",s3Key:cfg.s3.key},!0)),_i.b.appendChild(gui.template("calling-box-template",{answerVideo:cfg.strings.answer_video,answerAudio:cfg.strings.answer_audio,decline:cfg.strings.decline,swapCameras:cfg.strings.swap_cameras,minimize:cfg.strings.minimize,micToggle:cfg.strings.mic_toggle,cameraToggle:cfg.strings.camera_toggle,displayVideo:cfg.p2p.video,displayAudio:cfg.p2p.audio},!0)),_i.b.appendChild(gui.template("list-template",{invite:cfg.strings.invite,searchTitle:cfg.strings.search_placeholder,closeSearchTitle:cfg.strings.cancel,showSearch:!0,placeholderSearch:cfg.strings.search_placeholder,speakers:cfg.strings.speakers,listeners:cfg.strings.listeners,pause:cfg.strings.pause,options:cfg.strings.options,logout:cfg.strings.logout},!0)),_i.b.appendChild(gui.template("chat-template",{adminMode:cfg.strings.admin_mode,adminModeHover:cfg.strings.admin_mode_hover,typeMessage:cfg.strings.type_message,emoji:cfg.strings.emoji,donate:cfg.strings.donate,add:cfg.strings.add,send:cfg.strings.send},!0)),_i.b.appendChild(gui.template("user-info-main-template",null,!0)),_i.mobile&&(_i.b.appendChild(gui.template("mobile-top",{invite:cfg.strings.invite,options:cfg.strings.options,facebook:cfg.strings.facebook,twitter:cfg.strings.twitter},!0)),_i.b.appendChild(gui.template("mobile-bottom",{users:cfg.strings.users,takePhoto:cfg.strings.take_photo,add:cfg.strings.add},!0))),skin.list=_i.id("list"),skin.chat=_i.id("chat"),skin.content=_i.id("content"),skin.info=_i.id("info"),skin.options=_i.id("options"),skin.listeners=_i.id("listeners"),skin.speakers=_i.id("speakers"),skin.session=_i.id("session"),skin.textCover=_i.id("text-cover"),skin.textInput=_i.id("text-input"),skin.textPlaceholder=_i.id("text-placeholder"),skin.chatExtra=_i.id("chat-extra"),skin.donate=_i.id("donate"),skin.smiley=_i.id("smiley"),skin.callingBox=_i.id("calling-box"),skin.callText=_i.id("calling-box-status"),skin.callVideo=_i.id("calling-box-video"),skin.callVideoMini=_i.id("calling-box-video-mini"),skin.callingAnswerButtons=_i.id("calling-box-answer-buttons"),skin.callingOptions=_i.id("calling-box-options"),skin.usersMessagesCount=_i.id("users-messages-count"),skin.chatFrame=_i.id("chat-frame"),skin.listFrame=_i.id("list-frame"),skin.upload=_i.mobile?_i.id("uploadMobile"):_i.id("upload"),skin.listHandle=_i.mobile?_i.id("users"):_i.id("list-handle"),skin.send=_i.id("send"),skin.searchBar=_i.id("search-bar"),skin.searchInput=_i.id("search-input")},updateUsersListDisplay:function(){cfg.userslist?cfg.userslistAdmin&&(_i.addClass(_i.b,"list-hide-admin"),skin.toggleListDisplay(!1)):(_i.addClass(_i.b,"list-hide"),skin.toggleListDisplay(!1))},toggleListDisplay:function(e){if(e)skin.usersListOpened=!0,_i.addClass(_i.b,"list-opened"),_i.removeClass(_i.b,"list-closed"),_i.mobile&&skin.searchInput.focus();else if(skin.usersListOpened=!1,_i.addClass(_i.b,"list-closed"),_i.removeClass(_i.b,"list-opened"),_i.mobile&&cfg.chatType!==_i.chatTypes.ONE_ON_ONE){skin.searchInput.value="";var t=new Event("keyup");skin.searchInput.dispatchEvent(t)}skin.draw()},redraw:function(){skin.isSmall=_i.mobile||_i.client().width<=skin.SMALL_SCREEN,dlg.center(),skin.draw()},draw:function(){var e,t=_i.client(),s=!(!uploader.validities.upload&&!_i.mobile)+!!cfg.parsers.smilies+!!cfg.monetize.donations,i=_i.width(_i.b);skin.isSmall?_i.addClass(_i.b,"small-screen"):_i.removeClass(_i.b,"small-screen"),e=skin.usersListOpened?skin.options.offsetHeight+skin.info.offsetHeight+skin.session.offsetHeight:skin.session.offsetHeight,_i.b.style.height=_i.addUnit(t.height),skin.listFrame.style.height=_i.addUnit(_i.height(_i.b)),skin.list.style.height=_i.addUnit(_i.height(skin.listFrame)-e-_i.id("top-buttons").offsetHeight-(_i.mobile?skin.searchBar.offsetHeight:0)),!_i.mobile&&skin.usersListOpened&&i*cfg.usersWidth/100rtc.MAX_MESSAGE_LENGTH?skin.showMessage(cfg.strings.message_too_long.replace("{{maxlength}}",rtc.MAX_MESSAGE_LENGTH)):(skin.textInput.innerText="",skin.focus(),skin.message({pos:0,uid:auth.id,ts:_i.now()/1e3,text:e,own:!0}),rtc.sendMessage(e),skin.adjustTextField(0),rtc.track("Messages","Sent",rtc.hash),cfg.sendLimit>0&&!auth.moderator&&skin.handleSendMessageLimit(!1)))},sendPrivateMessage:function(){privateChat.sendMessage()},focus:function(){if(auth.loggedIn&&!_i.mobile){var e=document.createRange();e.selectNodeContents(skin.textInput),e.collapse(!1);var t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e))}},clearUsers:function(e){var t;if(e)for(t=0;t0&&skin.updateUsersPrivateMessagesCounter(-1),privateChat.userId===e.id&&(privateChat.close(!0),privateChat.open(e.id))},showDialog:function(e,t,s,i,a){dlg.show(gui.template(e,t),e,i,s,a)},showMessage:function(e,t){skin.oneButton({text:e,onclick:"skin.close();",buttonText:cfg.strings.ok,className:t})},wait:function(e,t,s){skin.showDialog("wait",{text:e},s,t)},disconnected:function(e){privateChat.close(),skin.textInput.blur(),skin.clearUsers(),skin.clear(),skin.oneButton({text:skin.errors[e||rtc.statuses.ACCESS_DENIED],onclick:-1==[rtc.statuses.FLOOD,rtc.statuses.KICKED,rtc.statuses.BANNED].indexOf(e)?"rtc.connect();":"rtc.reconnect();",buttonText:cfg.strings.reconnect},!0)},oneButton:function(e,t){skin.showDialog("one-button",e,null,null,t)},confirmDialog:function(e,t,s){skin.showDialog("confirm-dialog",e,t,null,s)},cannotConnect:function(){skin.oneButton({text:cfg.strings.cannot_connect,onclick:"rtc.connect();",buttonText:cfg.strings.try_again})},close:function(e){dlg.close(e),0==privateChat.userId&&-1===[_i.userAgents.CHROME,_i.userAgents.IE].indexOf(_i.ua)&&skin.focus()},readyForLogin:function(){dlg.close(),skin.textInput.blur(),skin.textInput.setAttribute("contenteditable","false"),skin.textInput.innerText=cfg.forceSDKLogin?" ":cfg.strings.click_to_join,skin.lastMsg=0,skin.lastUserId=0,skin.adjustTextField(0),cfg.allowListeners||skin.loginDialog()},mustLogin:function(){skin.readyForLogin(),cfg.forceSDKLogin?skin.showDialog("no-button-dialog",{text:cfg.strings.force_sdk_login},null,"force-sdk-login",!0):-1!==[_i.userAgents.CHROME,_i.userAgents.IE].indexOf(_i.ua)?skin.loginDialog():skin.focus()},logginIn:function(e){skin.wait(cfg.strings.login_in,"login-loading login-loading-"+e.name)},getDurationUnit:function(e){return e%525600==0?{unit:cfg.strings.years,divider:525600}:e%43200==0?{unit:cfg.strings.months,divider:43200}:e%10080==0?{unit:cfg.strings.weeks,divider:10080}:e%1440==0?{unit:cfg.strings.days,divider:1440}:e%60==0?{unit:cfg.strings.hours,divider:60}:{unit:cfg.strings.minutes,divider:1}},paymentTitle:function(){var e=skin.getDurationUnit(cfg.monetize.loginDuration);return 1==cfg.monetize.loginType?e.unit==cfg.strings.months?cfg.strings.subscription_monthly:cfg.strings.subscription_yearly:cfg.strings.join_chat_monetize.replace("{{count}}",cfg.monetize.loginDuration/e.divider).replace("{{units}}",e.unit)},loginDialog:function(){cfg.forceSDKLogin||(cfg.monetize.login?skin.registerDialog(!0):skin.showDialog("login",{title:cfg.strings.login_using,displayGuest:cfg.logins.guest,guest:cfg.strings.guest,guestTitle:cfg.strings.login_guest,displayRumbletalk:cfg.logins.rumbletalk,rumbletalk:cfg.strings.user_name,rumbletalkTitle:cfg.strings.login_rumbletalk,displayFacebook:cfg.logins.facebook,facebook:cfg.strings.facebook,facebookTitle:cfg.strings.login_facebook,displayTwitter:cfg.logins.twitter,twitter:cfg.strings.twitter,twitterTitle:cfg.strings.login_twitter,displayRegister:cfg.logins.register,register:cfg.strings.register_button,registerTitle:cfg.strings.register_description}))},loginParamsDialog:function(e,t){var s,i,a=e.id+"-login",n={username:cfg.strings.user_name,password:cfg.strings.password,backText:cfg.strings.back,loginText:cfg.strings.login,forgotPassword:cfg.strings.forgotPassword,resetPassword:t,textAddAvatar:cfg.accountType==_i.accountTypes.FREE?cfg.strings.paid_plans_only:cfg.strings.add_avatar};return gui.templatesHash[a]?(e===guest&&(n.previewSrc=skin.registerDetails.image||guest.pic(),n.onEnter="skin.enter(event, guest)",n.textImageUrl=cfg.strings.image_url,cfg.accountType==_i.accountTypes.FREE&&(n.uploadClass="not-allowed"),n.displayAvatar=cfg.guestAvatar),e===rumbletalk&&skin.loginType===twitter?skin.showDialog(a,n,twitter.logout):skin.showDialog(a,n),e===guest?(skin.loginType=null,i="guest-username",guest.previewImageHandle=_i.firstCss("image-preview",dlg.dialog),guest.previewImageHandle.onerror=function(){guest.previewImageHandle.src=guest.pic()},dlg.callback=function(){return guest.previewImageHandle=null,!0}):i=t?"rumbletalk-password":"rumbletalk-username",(s=document.getElementById(i))&&s.focus()):auth.login(e),!1},getDialogFields:function(){var e,t=_i.tag("input",dlg.dialog),s={};for(e in t)if(t.hasOwnProperty(e))switch(t[e].name){case"username":s.username=t[e].value;break;case"password":s.password=t[e].value;break;case"image":register.validateUrl(t[e].value)&&(s.image=t[e].value)}return s},enter:function(e,t){"Enter"===e.key&&skin.login(t)},setDialogFields:function(e){if(e){var t,s=_i.tag("input",dlg.dialog);for(t in s)s.hasOwnProperty(t)&&"username"==s[t].name&&(s[t].value=e.username)}},showError:function(e){e.type&&cfg.logins[guest.id]?(skin.loginType=e.realType&&e.realType!==guest?e.realType:e.type,skin.loginParamsDialog(e.type,e.status===rtc.statuses.ADMIN_PASSWORD||e.status===rtc.statuses.INVALID_CREDENTIALS),skin.setDialogFields(e.fields),_i.firstCss("error-label",dlg.dialog).innerHTML=skin.errors[e.status]):skin.oneButton({text:skin.errors[e.status],onclick:"skin.loginDialog();",buttonText:cfg.strings.back})},connected:function(){skin.toolbarMessage(),skin.close()},login:function(e,t){null!=skin.loginType&&(e===rumbletalk&&skin.loginType===twitter&&(twitter.process=!0),e=skin.loginType,skin.loginType=null),auth.login(e,t||skin.getDialogFields())},parseAndSaveRegisterFields:function(e){var t,s=["firstName","lastName","username","email","password","image","description"],i={};for(t=0;t0?gui.safe(cfg.offlineMessage).replace(/\n/g,"
"):cfg.strings.chat_closed;rtc.track("Offline","Offline Message Shown",rtc.hash),skin.showDialog("offline-template",{text:e,displayForm:cfg.offlineShowForm,labelEmail:cfg.strings.email,labelName:cfg.strings.name,labelMessage:cfg.strings.message,buttonText:cfg.strings.send},null,"",!0)},quota:function(e){skin.oneButton({text:skin.errors[e],onclick:"skin.loginDialog();",buttonText:cfg.strings.ok})},playSound:function(e){rtc.connected&&skin.sound&&sfx.play(e)},deleteMessages:function(e,t){var s,i=[],a=!(e instanceof Array),n=t?"apr_":"msg_";if(a){if(!(e=_i.parentCss("main-message-container",e)))return;i.push(Number(e.id.substr(4)));var o=_i.css("message-text",e);for(s=0;s1?(_i.remove(l[0]),r.id=l[0].id,l[0].removeAttribute("id"),_i.addClass(l[0],"first")):_i.remove(r)}}catch(e){}},updateOwnMessage:function(e){var t=skin.ownMessages.shift();if(t){t.log.position=e.pos,t.div.id=e.pending?"apr_"+e.pos:"msg_"+e.pos;var s=_i.parentCss("main-message-container",t.div),i=_i.firstCss("delete-message",s);_i.hasClass(t.div,"main-message-container")&&i&&!i.dataset.deleteSet&&(i.setAttribute("onclick","skin.deleteMessages(this);"),i.dataset.deleteSet="1")}},messageClasses:function(e,t,s){var i=[];return t&&i.push("own-message"),e&&i.push("admin"),s&&i.push("pending"),i.length>0?i.join(" "):void 0},message:function(e){if(cfg.chatType!=_i.chatTypes.ONE_ON_ONE){var t,s,i=rtc.getUserOfMessage(e),a=skin.userColor(i),n=e.pending?"apr_"+e.pos:"msg_"+e.pos;if(_i.id(n))console.log("prevented duplicate:",e);else if(!rtc.usersBlocked[i.id]){if(skin.playSound("message"),e.time=1e3*e.ts,auth.id!=i.id&&(skin.otherUsersLastMsgTime=e.time),skin.lastMsgTime+skin.MESSAGES_INTERVAL0?"skin.showUserInfo("+i.id+");":null,classNames:skin.messageClasses(i.moderator,auth.id==i.id,e.pending),delClick:cfg.accountType==_i.accountTypes.FREE?"skin.upgradeDialog();":"skin.deleteMessages(this);",pending:e.pending,approveFn:"skin.approveMessage("+e.pos+", true, this);",approveTitle:cfg.strings.approve_message_title,disapproveFn:"skin.approveMessage("+e.pos+", false, this);",disapproveTitle:cfg.strings.disapprove_message_title},e.own||(s.id=n),skin.lastUserId=i.id,skin.lastMsgTime=e.time,t=gui.template("main-message-template",s,!0),skin.content.appendChild(t),skin.lastMsg=_i.firstCss("message-bubble",t);var o={color:a};if(!e.pending){var r=skin.messageBg();r=null==r?"transparent":r,o.backgroundColor=r}_i.set(skin.lastMsg,{style:o})}else s={innerHTML:gui.parse(e.text),className:"message-text",style:{color:a}},e.own||(s.id=n),t=_i.create("div",s,skin.lastMsg);if(skin.scroll(),!e.pending){var l=rtc.addToMessagesLog(e,i,!1);e.own&&skin.ownMessages.push({div:t,log:l})}}}},archivedMessage:function(e){var t,s=skin.content.childNodes[0],i=rtc.getUserOfMessage(e),a=skin.userColor(i),n="msg_"+e.pos;if(e.time=1e3*e.ts,_i.id(n))console.log("prevented duplicate:",e);else if(!rtc.usersBlocked[i.id])if(!skin.archivePos&&s&&(skin.archivePos=_i.firstCss("message-text",s)),rtc.addToMessagesLog(e,i,!0),skin.lastArchivedUser!=i.id||skin.lastArchivedMsgTime-skin.MESSAGES_INTERVAL>e.time){t={id:n,image:i.image,name:gui.safe(i.name)+":",date:gui.date(e.time,cfg.strings.date),text:gui.parse(e.text),del:cfg.strings.delete_this_message,uid:i.id,userDetails:i.id>0?"skin.showUserInfo("+i.id+");":null,classNames:skin.messageClasses(i.moderator,auth.id==i.id),delClick:"skin.deleteMessages(this);"},skin.lastArchivedUser=i.id,skin.lastArchivedMsgTime=e.time;var o=gui.template("main-message-template",t,!0);skin.content.insertBefore(o,s),skin.lastArchivedMsg=_i.firstCss("message-bubble",o);var r=skin.messageBg();r=null==r?"transparent":r,_i.set(skin.lastArchivedMsg,{style:{color:a,backgroundColor:r}})}else{var l=_i.firstCss("first",skin.lastArchivedMsg);_i.removeClass(l,"first"),l.id=skin.lastArchivedMsg.parentNode.id,skin.lastArchivedMsg.parentNode.id=n,_i.create("div",{innerHTML:gui.parse(e.text),className:"message-text first",style:{color:a}},skin.lastArchivedMsg,_i.firstCss("message-text",skin.lastArchivedMsg))}},archiveDone:function(e){e||dlg.close(),skin.archivePos&&(e||skin.archivePos.scrollIntoView(!1),skin.archivePos=null)},systemMessage:function(e,t,s,i){(s||cfg.systemMessages&&cfg.chatType!=_i.chatTypes.ONE_ON_ONE)&&(skin.playSound(t),skin.lastUserId=0,skin.lastMsg=0,rtc.connected&&!rtc.reconnected&&(_i.create("DIV",{innerHTML:i?e:gui.safe(e),className:"system-message-text "+_i.dashSeparated(t)},skin.content),skin.scroll()))},systemMessageAPI:function(e){if(cfg.chatType!=_i.chatTypes.ONE_ON_ONE){var t={id:0,name:e.name||"System",image:e.img||guest.pic()};e.time=_i.now()-1e3*parseInt(e.time),skin.playSound("message"),skin.lastUserId=0,skin.lastMsg=0;var s=gui.template("main-message-template",{id:"msg_"+e.pos,del:cfg.strings.delete_this_message,classNames:"system-message-api",image:t.image,name:gui.safe(t.name)+":",date:gui.date(e.time,cfg.strings.date),text:gui.parse(e.text),delClick:"skin.deleteMessages(this);"},!0);skin.content.appendChild(s),rtc.addToMessagesLog(e,t,!1),skin.scroll()}},scroll:function(){window.cfg.messagesFromBottom||skin.pause||_i.atBottom(skin.chat)?!window.cfg.messagesFromBottom||skin.pause||_i.atTheVeryTop(skin.chat)||_i.setTop(skin.chat):_i.setBottom(skin.chat)},scrollBar:function(e){"object"!=typeof e&&(e=event),window.cfg.messagesFromBottom?skin.setScroll(!_i.atTop(skin.chat)):skin.setScroll(!_i.atBottom(skin.chat)),_i.atTop(skin.chat,30)&&-1!=rtc.archiveId&&!skin.loadingArchiveInterval&&(skin.loadingArchiveInterval=setTimeout(dlg.close,5e3),skin.wait(cfg.strings.loading_archive,"loading-archive",(function(){clearTimeout(skin.loadingArchiveInterval),skin.loadingArchiveInterval=null})),rtc.loadArchive(),rtc.track("Archive","Load",rtc.hash),_i.cancel(e))},setScroll:function(e){var t=_i.id("pause");skin.pause=e,skin.pause?_i.addClass(t,"paused"):_i.removeClass(t,"paused"),t.title=e?cfg.strings.scroll:cfg.strings.pause},clear:function(){rtc.messagesLog=[],rtc.archiveId=-1,skin.content.innerHTML="",skin.lastUserId=0,skin.lastMsg=0,skin.focus()},popup:function(){window.open(cfg.websiteUrl+"client/chat.php?"+rtc.hash,"__rtcPopup","top=0,left=0,width="+Math.round(screen.width/1.5)+",height="+Math.round(screen.height/1.5)+",toolbars=0,menus=0,location=0,resizable=1"),rtc.track("Popup","Opened",rtc.hash)},toggleSound:function(){skin.sound=!skin.sound,_i.storage.setItem("settings.sound",skin.sound)},togglePrivate:function(){skin.privatePopup=!skin.privatePopup,_i.storage.setItem("settings.privatePopup",skin.privatePopup)},getLink:function(){var e;return _i.l.hash&&(e=_i.l.hash.substr(1)),/^(https?:)?\/\//i.test(e)||(e=_i.d.referrer?_i.d.referrer:_i.l.href),"//"==e.substr(0,2)?_i.l.protocol+e:e},disconnectUser:function(e,t){dlg.close(),rtc.disconnectUser(e,t)},blockUser:function(e,t){auth.id!=e&&(rtc.usersBlocked[e]?delete rtc.usersBlocked[e]:rtc.usersBlocked[e]=!0,_i.storage.setItem("rumbletalk-users-blocked["+rtc.hash+"]"+auth.id,JSON.stringify(rtc.usersBlocked)),skin.updateBlockedUserDom(e),privateChat.userId==e&&t&&(t.title=cfg.strings[rtc.usersBlocked[e]?"unignore_description":"ignore_description"],t.innerHTML=cfg.strings[rtc.usersBlocked[e]?"unignore":"ignore"]))},updateBlockedUserDom:function(e){var t=document.getElementById("user"+e);t&&(rtc.usersBlocked[e]?_i.addClass(t,"blocked"):_i.removeClass(t,"blocked"))},clearBlockedUsersDom:function(){var e;for(e=0;e0?skin.usersMessagesCount.style.display="inline-block":skin.usersMessagesCount.style.display="",skin.usersMessagesCount.innerHTML=rtc.usersPrivateMessages},updateUserPosition:function(e){var t,s,i=skin.findUserDiv(e);if(i&&(i=i.parentNode,t=rtc.users.splice(rtc.userIndex("id",e),1)))if((t=t[0]).hadPrivateMsg=!0,s=rtc.positionUser(t),skin.list.removeChild(i),rtc.users[s+1]){var a=skin.findUserDiv(rtc.users[s+1].id);skin.list.insertBefore(i,a.parentNode)}else skin.list.appendChild(i)},updateMessageCounter:function(e,t){var s=rtc.user(e);if(s){var i=skin.findUserDiv(e);if(i){var a=_i.lastCss("private-message-count",i);t?(s.privateMsg||skin.updateUsersPrivateMessagesCounter(1),s.privateMsg++,a.innerHTML=s.privateMsg,a.style.display="block"):(s.privateMsg>0&&skin.updateUsersPrivateMessagesCounter(-1),s.privateMsg=0,a.style.display="")}}},privateEnter:function(e){return privateChat.inputKeyUp(e)},sendOfflineMessage:function(){var e=_i.tag("input",dlg.dialog),t={omEmail:e[0],omName:e[1],omMessage:_i.tag("textarea",dlg.dialog)[0]};if(!/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/.test(t.omEmail.value))return t.omEmail.style.border="2px solid #ff0000",void t.omEmail.focus();_i.load(cfg.websiteUrl+"client/offline_message.php?hash="+encodeURIComponent(rtc.hash)+"&email="+encodeURIComponent(t.omEmail.value)+"&name="+encodeURIComponent(t.omName.value)+"&message="+encodeURIComponent(t.omMessage.value)),dlg.close(!0),skin.showDialog("no-button-dialog",{text:cfg.strings.offline_message_thank_you},null,"offline-message-dialog",!0),rtc.track("Offline","Offline Lead Sent",rtc.hash)},takePhotoDialog:function(){if(!auth.loggedIn||uploader.busy||!uploader.validities.upload||cfg.accountType==_i.accountTypes.FREE)return!1;webrtc.takePhotoInit()},takePhoto:function(){webrtc.takePhoto()},uploadPhoto:function(){uploader.uploadPhoto()},previewPhoto:function(e){e?(dlg.dialog.querySelector(".take-photo-buttons").style.display="block",dlg.dialog.querySelector(".send-photo-buttons").style.display="none",webrtc.players.photoCanvas.style.display="none",webrtc.players.photoPlayer.style.display="block"):(dlg.dialog.querySelector(".take-photo-buttons").style.display="none",dlg.dialog.querySelector(".send-photo-buttons").style.display="block",webrtc.players.photoCanvas.style.display="block",webrtc.players.photoPlayer.style.display="none",webrtc.takePhoto())},recordAudioDialog:function(){if(!auth.loggedIn||uploader.busy||!uploader.validities.upload||cfg.accountType==_i.accountTypes.FREE)return!1;webrtc.recordAudioInit()},recordAudioStart:function(e){webrtc.recordAudioStart(e)},recordAudioStop:function(e){webrtc.recordAudioStop(e)},uploadAudio:function(){uploader.uploadAudio()},recordVideoDialog:function(){if(uploader.busy||!uploader.validities.upload||cfg.accountType==_i.accountTypes.FREE)return!1;webrtc.recordVideoInit()},recordVideoStart:function(e){webrtc.recordVideoStart(e)},recordVideoStop:function(e){webrtc.recordVideoStop(e)},uploadVideo:function(){uploader.uploadVideo()},uploadFileDialog:function(){return uploader.busy||!uploader.validities.upload||cfg.accountType==_i.accountTypes.FREE||(uploader.file.accept=uploader.configurations.accept||"",uploader.file.click()),!1},privateUploadDialog:function(){uploader.busy||(uploader.configurations={closeDlg:!0,callback:privateChat.sendMessage,imageWidthLimit:1920,imageHeightLimit:1080},skin.uploadDialog(!1))},uploadDialog:function(e){uploader.global=e,_i.mobile?skin.uploadFileDialog():skin.showDialog("upload-dialog",{classNames:cfg.accountType==_i.accountTypes.FREE||uploader.busy?"upload-disable":"",upgradeLink:cfg.websiteUrl+"upgrade/?hash="+rtc.hash,displayPlan:cfg.accountType==_i.accountTypes.FREE,webRTCSupport:_i.webrtc,webRTCSupportAudio:_i.webrtc,webRTCSupportVideo:_i.webrtc&&(_i.ua==_i.userAgents.EDGE&&_i.uaVersion>20||_i.ua!=_i.userAgents.EDGE&&_i.ua!=_i.userAgents.SAFARI),paid_plans_only:cfg.strings.paid_plans_only,add_file:cfg.strings.add_file,take_photo:cfg.strings.take_photo,record_audio:cfg.strings.record_audio,record_video:cfg.strings.record_video})},initP2P:function(){p2p.init(),skin.callVideo.onplaying=skin.drawCalling,skin.callVideoMini.onplaying=skin.drawCalling,skin.callVideoMini.onclick=skin.switchVideo},switchVideo:function(){var e;skin.localVideoHandle===skin.callVideo?(skin.localVideoHandle=skin.callVideoMini,e=skin.callVideo):(skin.localVideoHandle=skin.callVideo,e=skin.callVideoMini),skin.localVideoHandle.muted=!0,setSrcObject(p2p.selfStream,skin.localVideoHandle),"environment"==p2p.facingMode?_i.addClass(skin.localVideoHandle,"back-facing-camera"):_i.removeClass(skin.localVideoHandle,"back-facing-camera"),_i.removeClass(e,"back-facing-camera"),"video"==p2p.mode?skin.localVideoHandle.play():skin.localVideoHandle.pause(),setSrcObject(p2p.remoteStream,e),e.muted=!1,e.play()},audioCallRequest:function(e){privateChat.togglePrivateMenu(!0),p2p.callRequest(e,"audio")},videoCallRequest:function(e){privateChat.togglePrivateMenu(!0),p2p.callRequest(e,"video")},fontChange:function(e){var t,s,i=[skin.chat,skin.list,skin.textCover,privateChat.domHandle,dlg.dialog],a=Number(e+"2");for(s=0;s\n",l=document.title,c=e?privateChat.logs[e].log:rtc.messagesLog;if(0!=c.length){for(e&&(a=rtc.user(auth.id),n=rtc.user(e)||rtc.usersOffline[e],o={name:"System",id:"system"},l=n.name),rtc.track("Export",rtc.hash),r+='
\n',s=0;s\n",r+='\n