diff --git a/.gitignore b/.gitignore index 4b3cd9e7..5009eea5 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,3 @@ etc/log4perl.conf etc/mime.types etc/nginx.conf var/www/public/index.html - diff --git a/lib/Lacuna/RPC/Chat.pm b/lib/Lacuna/RPC/Chat.pm index a11f25b3..f5e46bfc 100644 --- a/lib/Lacuna/RPC/Chat.pm +++ b/lib/Lacuna/RPC/Chat.pm @@ -20,8 +20,9 @@ sub init_chat { secret => $firebase_config->{auth}{secret}, # debug => \1, data => { - id => $empire->id, - chat_admin => $empire->chat_admin ? \1 : \0, + uid => $empire->id, + isModerator => $empire->chat_admin ? \1 : \0, + isStaff => $empire->is_admin ? \1 : \0, } # data => $data, ); @@ -77,7 +78,8 @@ sub init_chat { gravatar_url => $gravatar_url, chat_name => $chat_name, chat_auth => $chat_auth->create_token, - chat_admin => $empire->chat_admin ? \1 : \0, + isStaff => $empire->is_admin ? \1 : \0, + isModerator => $empire->chat_admin ? \1 : \0, }; if ($empire->alliance_id) { $ret->{private_room} = { diff --git a/lib/Lacuna/RPC/Empire.pm b/lib/Lacuna/RPC/Empire.pm index 6a3b9d81..9e6239b1 100644 --- a/lib/Lacuna/RPC/Empire.pm +++ b/lib/Lacuna/RPC/Empire.pm @@ -89,8 +89,9 @@ sub login { my $auth_code = Firebase::Auth->new( secret => $firebase_config->{auth}{secret}, data => { - id => $empire->id, - chat_admin => $empire->chat_admin ? \1 : \0, + uid => $empire->id, + isModerator => $empire->chat_admin ? \1 : \0, + isStaff => $empire->is_admin ? \1 : \0, } # data => $data, )->create_token; diff --git a/var/www/public/chiselchat/chiselchat.min.css b/var/www/public/chiselchat/chiselchat.min.css index 997cd391..8c06da3e 100644 --- a/var/www/public/chiselchat/chiselchat.min.css +++ b/var/www/public/chiselchat/chiselchat.min.css @@ -1 +1 @@ -@charset "UTF-8";#chiselchat{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;font-size:12px;z-index:2000000000;position:relative}#chiselchat-tab-list{position:fixed;bottom:0;right:0;width:100%;height:20px;border:0;list-style-type:none;margin:0;padding:0;z-index:2000000001}#chiselchat-tab-list li{display:inline;width:120px;background-color:#0099f2;margin-right:5px;padding:3px;float:right;border:1px solid #0099f2;height:20px;position:relative;overflow:hidden;white-space:nowrap;-webkit-border-top-right-radius:2px;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-webkit-border-top-left-radius:2px;-moz-border-radius-topright:2px;-moz-border-radius-bottomright:0;-moz-border-radius-bottomleft:0;-moz-border-radius-topleft:2px;border-top-right-radius:2px;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:2px;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}#chiselchat-tab-list li a{text-decoration:none;color:#111;width:100%;display:block}#chiselchat-tab-list li:hover{background-color:#fc0}#chiselchat-tab-list li a:hover{color:#000}#chiselchat-tab-list li#chiselchat-presence-tab{width:55px}#chiselchat-tab-list li#chiselchat-room-tab{margin:0;width:55px}#chiselchat-tab-list li .chiselchat-new-count{background-color:#fc0;color:#000;font-size:80%;font-weight:bold;display:inline-block;padding:1px 3px 1px 3px;position:absolute;right:3px;top:3px}#chiselchat-tab-list li .chiselchat-new-count.chiselchat-new-count-alert{background-color:#f00;color:#fff}#chiselchat-tab-list li.active{background-color:#fff;font-weight:bold;border:1px solid #fff}#chiselchat-tab-list li.active a{color:#000}#chiselchat-tab-list li.active .chiselchat-new-count{display:none}#chiselchat-tab-content{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;z-index:2000000001}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-title{color:#111;background-color:#0099f2;margin:0;display:block;padding:5px;height:13px;font-weight:bold;z-index:1000001;overflow:hidden;-webkit-border-top-right-radius:3px;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-webkit-border-top-left-radius:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:0;-moz-border-radius-bottomleft:0;-moz-border-radius-topleft:3px;border-top-right-radius:3px;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:3px;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-pane-controls{position:absolute;top:2px;right:5px}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-pane-controls a{color:#000;text-decoration:none;font-size:110%;display:inline-block;vertical-align:top;padding-left:5px}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-toggle-sound{padding-top:2px}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-toggle-pane-size{font-size:130%;padding-top:5px}#chiselchat-tab-content .chiselchat-tab-pane{position:fixed;bottom:25px;right:5px;background-color:#fff;width:50%;height:50%;display:none;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}#chiselchat-tab-content .chiselchat-tab-pane.active{display:block}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-tab-pane-menu{width:35%;overflow-y:auto;overflow-x:hidden;float:right;color:#000;height:80%}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-tab-pane-menu a{color:#000}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history{z-index:1000000;width:65%;overflow-y:scroll;overflow-x:hidden;float:left;height:80%}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-message{margin:5px;margin-top:13px;padding:0;color:#000}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-avatar{margin-right:5px;width:30px;height:30px;float:left;text-align:center}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-avatar img{width:100%;height:100%;margin-bottom:2px}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-user a{font-size:90%;text-decoration:none;color:#014986}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-timestamp{color:#000;font-size:60%;display:inline}#chiselchat-tab-content .chiselchat-tab-pane span.chiselchat-controls{display:inline}#chiselchat-user-search span.chiselchat-controls a,#chiselchat-tab-content .chiselchat-tab-pane span.chiselchat-controls a,#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-message .chiselchat-message-content span.chiselchat-controls a{font-size:80%;padding:1px;color:#aaa;margin-left:10px;text-decoration:none}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-message-content{margin-top:3px;margin-left:30px;padding-right:10px;font-size:110%}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-user .chiselchat-guest{color:#000}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-user .chiselchat-moderator{font-weight:bold;color:#ff9b00}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-user .chiselchat-staff{font-weight:bold;color:#f00}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-say{z-index:100000001;width:100%;height:50px;position:absolute;bottom:0;left:0}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-say textarea{margin:0;font-family:inherit;overflow:auto;vertical-align:top;color:#000;border:5px solid #fff;background-color:#eee;width:100%;padding:1px;height:100%;font-size:110%;max-width:100%;font-family:sans-serif;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;box-sizing:border-box}#chiselchat #chiselchat-presence-pane,#chiselchat #chiselchat-room-pane{position:fixed;bottom:25px;right:5px;background-color:#fff;color:#000;width:140px;height:50%;display:none;overflow:hidden}#chiselchat .chiselchat-tab-pane .chiselchat-scrollable-list{overflow-y:auto;overflow-x:hidden;height:80%}#chiselchat #chiselchat-room-pane #chiselchat-room-list,#chiselchat #chiselchat-presence-pane #chiselchat-user-search{padding-left:5px}#chiselchat #chiselchat-room-pane #chiselchat-room-list li,#chiselchat #chiselchat-presence-pane #chiselchat-user-search li{padding-bottom:5px}#chiselchat #chiselchat-presence-pane .chiselchat-user-list-item,#chiselchat #chiselchat-room-pane .chiselchat-room-list-item{color:#000;text-decoration:none}#chiselchat #chiselchat-presence-pane.active,#chiselchat #chiselchat-room-pane.active{display:block}#chiselchat-tab-content .chiselchat-tab-pane.active.fullscreen,#chiselchat-tab-content #chiselchat-presence-pane.active.fullscreen,#chiselchat-tab-content #chiselchat-room-pane.active.fullscreen{width:99%;height:96%}#chiselchat-tab-content .chiselchat-tab-pane.fullscreen .chiselchat-tab-pane-menu{width:25%}#chiselchat-tab-content .chiselchat-tab-pane.fullscreen .chiselchat-history{width:75%}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-message .chiselchat-message-content a{color:#014986}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-message-activity{text-align:center;font-style:italic;color:#000}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-message-activity .chiselchat-avatar,#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-message-activity .chiselchat-timestamp,#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-message-activity .chiselchat-user .chiselchat-controls{display:none}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-message-activity .chiselchat-user,#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-message-activity .chiselchat-message-content{display:inline;padding:0;margin:0}div.chiselchat-alert,.chiselchat-alert .alert{z-index:2000000002;color:#000;background-color:#fff;font-family:sans-serif}.chiselchat-alert hr{border-top-color:#000}.chiselchat-alert .alert-link{color:#014986}@media(max-width:960px){div.chiselchat-alert,.chiselchat-alert .alert{width:50%}#chiselchat-tab-content .chiselchat-tab-pane.active,#chiselchat-tab-content #chiselchat-presence-pane.active,#chiselchat-tab-content #chiselchat-room-pane.active{bottom:35px;width:98%;height:94%}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-toggle-pane-size{display:none}#chiselchat-tab-list{height:30px}#chiselchat-tab-list li{height:30px;width:110px;font-size:150%}#chiselchat-tab-list li#chiselchat-presence-tab,#chiselchat-tab-list li#chiselchat-room-tab{width:18px}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-tab-pane-menu{display:none}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history{width:100%;float:none;height:100%}}@font-face{font-family:'Glyphicons Halflings';src:url('//netdna.bootstrapcdn.com/bootstrap/3.0.3/fonts/glyphicons-halflings-regular.eot');src:url('//netdna.bootstrapcdn.com/bootstrap/3.0.3/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('//netdna.bootstrapcdn.com/bootstrap/3.0.3/fonts/glyphicons-halflings-regular.woff') format('woff'),url('//netdna.bootstrapcdn.com/bootstrap/3.0.3/fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('//netdna.bootstrapcdn.com/bootstrap/3.0.3/fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg')}.chiselchat-glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';-webkit-font-smoothing:antialiased;font-style:normal;font-weight:normal;line-height:1;-moz-osx-font-smoothing:grayscale}.chiselchat-glyphicon:empty{width:1em}.chiselchat-glyphicon-asterisk:before{content:"\2a"}.chiselchat-glyphicon-plus:before{content:"\2b"}.chiselchat-glyphicon-euro:before{content:"\20ac"}.chiselchat-glyphicon-minus:before{content:"\2212"}.chiselchat-glyphicon-cloud:before{content:"\2601"}.chiselchat-glyphicon-envelope:before{content:"\2709"}.chiselchat-glyphicon-pencil:before{content:"\270f"}.chiselchat-glyphicon-glass:before{content:"\e001"}.chiselchat-glyphicon-music:before{content:"\e002"}.chiselchat-glyphicon-search:before{content:"\e003"}.chiselchat-glyphicon-heart:before{content:"\e005"}.chiselchat-glyphicon-star:before{content:"\e006"}.chiselchat-glyphicon-star-empty:before{content:"\e007"}.chiselchat-glyphicon-user:before{content:"\e008"}.chiselchat-glyphicon-film:before{content:"\e009"}.chiselchat-glyphicon-th-large:before{content:"\e010"}.chiselchat-glyphicon-th:before{content:"\e011"}.chiselchat-glyphicon-th-list:before{content:"\e012"}.chiselchat-glyphicon-ok:before{content:"\e013"}.chiselchat-glyphicon-remove:before{content:"\e014"}.chiselchat-glyphicon-zoom-in:before{content:"\e015"}.chiselchat-glyphicon-zoom-out:before{content:"\e016"}.chiselchat-glyphicon-off:before{content:"\e017"}.chiselchat-glyphicon-signal:before{content:"\e018"}.chiselchat-glyphicon-cog:before{content:"\e019"}.chiselchat-glyphicon-trash:before{content:"\e020"}.chiselchat-glyphicon-home:before{content:"\e021"}.chiselchat-glyphicon-file:before{content:"\e022"}.chiselchat-glyphicon-time:before{content:"\e023"}.chiselchat-glyphicon-road:before{content:"\e024"}.chiselchat-glyphicon-download-alt:before{content:"\e025"}.chiselchat-glyphicon-download:before{content:"\e026"}.chiselchat-glyphicon-upload:before{content:"\e027"}.chiselchat-glyphicon-inbox:before{content:"\e028"}.chiselchat-glyphicon-play-circle:before{content:"\e029"}.chiselchat-glyphicon-repeat:before{content:"\e030"}.chiselchat-glyphicon-refresh:before{content:"\e031"}.chiselchat-glyphicon-list-alt:before{content:"\e032"}.chiselchat-glyphicon-lock:before{content:"\e033"}.chiselchat-glyphicon-flag:before{content:"\e034"}.chiselchat-glyphicon-headphones:before{content:"\e035"}.chiselchat-glyphicon-volume-off:before{content:"\e036"}.chiselchat-glyphicon-volume-down:before{content:"\e037"}.chiselchat-glyphicon-volume-up:before{content:"\e038"}.chiselchat-glyphicon-qrcode:before{content:"\e039"}.chiselchat-glyphicon-barcode:before{content:"\e040"}.chiselchat-glyphicon-tag:before{content:"\e041"}.chiselchat-glyphicon-tags:before{content:"\e042"}.chiselchat-glyphicon-book:before{content:"\e043"}.chiselchat-glyphicon-bookmark:before{content:"\e044"}.chiselchat-glyphicon-print:before{content:"\e045"}.chiselchat-glyphicon-camera:before{content:"\e046"}.chiselchat-glyphicon-font:before{content:"\e047"}.chiselchat-glyphicon-bold:before{content:"\e048"}.chiselchat-glyphicon-italic:before{content:"\e049"}.chiselchat-glyphicon-text-height:before{content:"\e050"}.chiselchat-glyphicon-text-width:before{content:"\e051"}.chiselchat-glyphicon-align-left:before{content:"\e052"}.chiselchat-glyphicon-align-center:before{content:"\e053"}.chiselchat-glyphicon-align-right:before{content:"\e054"}.chiselchat-glyphicon-align-justify:before{content:"\e055"}.chiselchat-glyphicon-list:before{content:"\e056"}.chiselchat-glyphicon-indent-left:before{content:"\e057"}.chiselchat-glyphicon-indent-right:before{content:"\e058"}.chiselchat-glyphicon-facetime-video:before{content:"\e059"}.chiselchat-glyphicon-picture:before{content:"\e060"}.chiselchat-glyphicon-map-marker:before{content:"\e062"}.chiselchat-glyphicon-adjust:before{content:"\e063"}.chiselchat-glyphicon-tint:before{content:"\e064"}.chiselchat-glyphicon-edit:before{content:"\e065"}.chiselchat-glyphicon-share:before{content:"\e066"}.chiselchat-glyphicon-check:before{content:"\e067"}.chiselchat-glyphicon-move:before{content:"\e068"}.chiselchat-glyphicon-step-backward:before{content:"\e069"}.chiselchat-glyphicon-fast-backward:before{content:"\e070"}.chiselchat-glyphicon-backward:before{content:"\e071"}.chiselchat-glyphicon-play:before{content:"\e072"}.chiselchat-glyphicon-pause:before{content:"\e073"}.chiselchat-glyphicon-stop:before{content:"\e074"}.chiselchat-glyphicon-forward:before{content:"\e075"}.chiselchat-glyphicon-fast-forward:before{content:"\e076"}.chiselchat-glyphicon-step-forward:before{content:"\e077"}.chiselchat-glyphicon-eject:before{content:"\e078"}.chiselchat-glyphicon-chevron-left:before{content:"\e079"}.chiselchat-glyphicon-chevron-right:before{content:"\e080"}.chiselchat-glyphicon-plus-sign:before{content:"\e081"}.chiselchat-glyphicon-minus-sign:before{content:"\e082"}.chiselchat-glyphicon-remove-sign:before{content:"\e083"}.chiselchat-glyphicon-ok-sign:before{content:"\e084"}.chiselchat-glyphicon-question-sign:before{content:"\e085"}.chiselchat-glyphicon-info-sign:before{content:"\e086"}.chiselchat-glyphicon-screenshot:before{content:"\e087"}.chiselchat-glyphicon-remove-circle:before{content:"\e088"}.chiselchat-glyphicon-ok-circle:before{content:"\e089"}.chiselchat-glyphicon-ban-circle:before{content:"\e090"}.chiselchat-glyphicon-arrow-left:before{content:"\e091"}.chiselchat-glyphicon-arrow-right:before{content:"\e092"}.chiselchat-glyphicon-arrow-up:before{content:"\e093"}.chiselchat-glyphicon-arrow-down:before{content:"\e094"}.chiselchat-glyphicon-share-alt:before{content:"\e095"}.chiselchat-glyphicon-resize-full:before{content:"\e096"}.chiselchat-glyphicon-resize-small:before{content:"\e097"}.chiselchat-glyphicon-exclamation-sign:before{content:"\e101"}.chiselchat-glyphicon-gift:before{content:"\e102"}.chiselchat-glyphicon-leaf:before{content:"\e103"}.chiselchat-glyphicon-fire:before{content:"\e104"}.chiselchat-glyphicon-eye-open:before{content:"\e105"}.chiselchat-glyphicon-eye-close:before{content:"\e106"}.chiselchat-glyphicon-warning-sign:before{content:"\e107"}.chiselchat-glyphicon-plane:before{content:"\e108"}.chiselchat-glyphicon-calendar:before{content:"\e109"}.chiselchat-glyphicon-random:before{content:"\e110"}.chiselchat-glyphicon-comment:before{content:"\e111"}.chiselchat-glyphicon-magnet:before{content:"\e112"}.chiselchat-glyphicon-chevron-up:before{content:"\e113"}.chiselchat-glyphicon-chevron-down:before{content:"\e114"}.chiselchat-glyphicon-retweet:before{content:"\e115"}.chiselchat-glyphicon-shopping-cart:before{content:"\e116"}.chiselchat-glyphicon-folder-close:before{content:"\e117"}.chiselchat-glyphicon-folder-open:before{content:"\e118"}.chiselchat-glyphicon-resize-vertical:before{content:"\e119"}.chiselchat-glyphicon-resize-horizontal:before{content:"\e120"}.chiselchat-glyphicon-hdd:before{content:"\e121"}.chiselchat-glyphicon-bullhorn:before{content:"\e122"}.chiselchat-glyphicon-bell:before{content:"\e123"}.chiselchat-glyphicon-certificate:before{content:"\e124"}.chiselchat-glyphicon-thumbs-up:before{content:"\e125"}.chiselchat-glyphicon-thumbs-down:before{content:"\e126"}.chiselchat-glyphicon-hand-right:before{content:"\e127"}.chiselchat-glyphicon-hand-left:before{content:"\e128"}.chiselchat-glyphicon-hand-up:before{content:"\e129"}.chiselchat-glyphicon-hand-down:before{content:"\e130"}.chiselchat-glyphicon-circle-arrow-right:before{content:"\e131"}.chiselchat-glyphicon-circle-arrow-left:before{content:"\e132"}.chiselchat-glyphicon-circle-arrow-up:before{content:"\e133"}.chiselchat-glyphicon-circle-arrow-down:before{content:"\e134"}.chiselchat-glyphicon-globe:before{content:"\e135"}.chiselchat-glyphicon-wrench:before{content:"\e136"}.chiselchat-glyphicon-tasks:before{content:"\e137"}.chiselchat-glyphicon-filter:before{content:"\e138"}.chiselchat-glyphicon-briefcase:before{content:"\e139"}.chiselchat-glyphicon-fullscreen:before{content:"\e140"}.chiselchat-glyphicon-dashboard:before{content:"\e141"}.chiselchat-glyphicon-paperclip:before{content:"\e142"}.chiselchat-glyphicon-heart-empty:before{content:"\e143"}.chiselchat-glyphicon-link:before{content:"\e144"}.chiselchat-glyphicon-phone:before{content:"\e145"}.chiselchat-glyphicon-pushpin:before{content:"\e146"}.chiselchat-glyphicon-usd:before{content:"\e148"}.chiselchat-glyphicon-gbp:before{content:"\e149"}.chiselchat-glyphicon-sort:before{content:"\e150"}.chiselchat-glyphicon-sort-by-alphabet:before{content:"\e151"}.chiselchat-glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.chiselchat-glyphicon-sort-by-order:before{content:"\e153"}.chiselchat-glyphicon-sort-by-order-alt:before{content:"\e154"}.chiselchat-glyphicon-sort-by-attributes:before{content:"\e155"}.chiselchat-glyphicon-sort-by-attributes-alt:before{content:"\e156"}.chiselchat-glyphicon-unchecked:before{content:"\e157"}.chiselchat-glyphicon-expand:before{content:"\e158"}.chiselchat-glyphicon-collapse-down:before{content:"\e159"}.chiselchat-glyphicon-collapse-up:before{content:"\e160"}.chiselchat-glyphicon-log-in:before{content:"\e161"}.chiselchat-glyphicon-flash:before{content:"\e162"}.chiselchat-glyphicon-log-out:before{content:"\e163"}.chiselchat-glyphicon-new-window:before{content:"\e164"}.chiselchat-glyphicon-record:before{content:"\e165"}.chiselchat-glyphicon-save:before{content:"\e166"}.chiselchat-glyphicon-open:before{content:"\e167"}.chiselchat-glyphicon-saved:before{content:"\e168"}.chiselchat-glyphicon-import:before{content:"\e169"}.chiselchat-glyphicon-export:before{content:"\e170"}.chiselchat-glyphicon-send:before{content:"\e171"}.chiselchat-glyphicon-floppy-disk:before{content:"\e172"}.chiselchat-glyphicon-floppy-saved:before{content:"\e173"}.chiselchat-glyphicon-floppy-remove:before{content:"\e174"}.chiselchat-glyphicon-floppy-save:before{content:"\e175"}.chiselchat-glyphicon-floppy-open:before{content:"\e176"}.chiselchat-glyphicon-credit-card:before{content:"\e177"}.chiselchat-glyphicon-transfer:before{content:"\e178"}.chiselchat-glyphicon-cutlery:before{content:"\e179"}.chiselchat-glyphicon-header:before{content:"\e180"}.chiselchat-glyphicon-compressed:before{content:"\e181"}.chiselchat-glyphicon-earphone:before{content:"\e182"}.chiselchat-glyphicon-phone-alt:before{content:"\e183"}.chiselchat-glyphicon-tower:before{content:"\e184"}.chiselchat-glyphicon-stats:before{content:"\e185"}.chiselchat-glyphicon-sd-video:before{content:"\e186"}.chiselchat-glyphicon-hd-video:before{content:"\e187"}.chiselchat-glyphicon-subtitles:before{content:"\e188"}.chiselchat-glyphicon-sound-stereo:before{content:"\e189"}.chiselchat-glyphicon-sound-dolby:before{content:"\e190"}.chiselchat-glyphicon-sound-5-1:before{content:"\e191"}.chiselchat-glyphicon-sound-6-1:before{content:"\e192"}.chiselchat-glyphicon-sound-7-1:before{content:"\e193"}.chiselchat-glyphicon-copyright-mark:before{content:"\e194"}.chiselchat-glyphicon-registration-mark:before{content:"\e195"}.chiselchat-glyphicon-cloud-download:before{content:"\e197"}.chiselchat-glyphicon-cloud-upload:before{content:"\e198"}.chiselchat-glyphicon-tree-conifer:before{content:"\e199"}.chiselchat-glyphicon-tree-deciduous:before{content:"\e200"} \ No newline at end of file +@charset "UTF-8";#chiselchat{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;font-size:12px;z-index:2000000000;position:relative}#chiselchat-tab-list{position:fixed;bottom:0;right:0;width:100%;height:20px;border:0;list-style-type:none;margin:0;padding:0;z-index:2000000001}#chiselchat-tab-list li{display:inline;width:120px;background-color:#0099f2;margin-right:5px;padding:3px;float:right;border:1px solid #0099f2;height:20px;position:relative;overflow:hidden;white-space:nowrap;-webkit-border-top-right-radius:2px;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-webkit-border-top-left-radius:2px;-moz-border-radius-topright:2px;-moz-border-radius-bottomright:0;-moz-border-radius-bottomleft:0;-moz-border-radius-topleft:2px;border-top-right-radius:2px;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:2px;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}#chiselchat-tab-list li a{text-decoration:none;color:#111;width:100%;display:block}#chiselchat-tab-list li:hover{background-color:#fc0}#chiselchat-tab-list li a:hover{color:#000}#chiselchat-tab-list li#chiselchat-presence-tab{width:55px}#chiselchat-tab-list li#chiselchat-room-tab{margin:0;width:55px}#chiselchat-tab-list li .chiselchat-new-count{background-color:#fc0;color:#000;font-size:80%;font-weight:bold;display:inline-block;padding:1px 3px 1px 3px;position:absolute;right:3px;top:3px}#chiselchat-tab-list li .chiselchat-new-count.chiselchat-new-count-alert{background-color:#f00;color:#fff}#chiselchat-tab-list li.active{background-color:#fff;font-weight:bold;border:1px solid #fff}#chiselchat-tab-list li.active a{color:#000}#chiselchat-tab-list li.active .chiselchat-new-count{display:none}#chiselchat-tab-content{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;z-index:2000000001}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-title{color:#111;background-color:#0099f2;margin:0;display:block;padding:5px;height:13px;font-weight:bold;z-index:1000001;overflow:hidden;-webkit-border-top-right-radius:3px;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-webkit-border-top-left-radius:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:0;-moz-border-radius-bottomleft:0;-moz-border-radius-topleft:3px;border-top-right-radius:3px;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:3px;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-pane-controls{position:absolute;top:2px;right:5px}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-pane-controls a{color:#000;text-decoration:none;font-size:110%;display:inline-block;vertical-align:top;padding-left:5px}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-toggle-pane-size{font-size:130%;padding-top:5px}#chiselchat-tab-content .chiselchat-tab-pane{position:fixed;bottom:25px;right:5px;background-color:#fff;width:50%;height:50%;display:none;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}#chiselchat-tab-content .chiselchat-tab-pane.active{display:block}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-tab-pane-menu{width:35%;overflow-y:auto;overflow-x:hidden;float:right;color:#000;height:80%}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-tab-pane-menu a{color:#000}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history{z-index:1000000;width:65%;overflow-y:scroll;overflow-x:hidden;float:left;height:80%}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-message{margin:5px;margin-top:13px;padding:0;color:#000}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-avatar{margin-right:5px;width:30px;height:30px;float:left;text-align:center}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-avatar img{width:100%;height:100%;margin-bottom:2px}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-user a{font-size:90%;text-decoration:none;color:#014986}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-timestamp{color:#000;font-size:60%;display:inline}#chiselchat-tab-content .chiselchat-tab-pane span.chiselchat-controls{display:inline}#chiselchat-user-search span.chiselchat-controls a,#chiselchat-tab-content .chiselchat-tab-pane span.chiselchat-controls a,#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-message .chiselchat-message-content span.chiselchat-controls a{font-size:80%;padding:1px;color:#aaa;margin-left:10px;text-decoration:none}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-message-content{margin-top:3px;margin-left:30px;padding-right:10px;font-size:110%}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-user .chiselchat-guest{color:#000}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-user .chiselchat-moderator{font-weight:bold;color:#ff9b00}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-user .chiselchat-staff{font-weight:bold;color:#f00}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-say{z-index:100000001;width:100%;height:50px;position:absolute;bottom:0;left:0}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-say textarea{margin:0;font-family:inherit;overflow:auto;vertical-align:top;color:#000;border:5px solid #fff;background-color:#eee;width:100%;padding:1px;height:100%;font-size:110%;max-width:100%;font-family:sans-serif;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;box-sizing:border-box}#chiselchat #chiselchat-presence-pane,#chiselchat #chiselchat-room-pane{position:fixed;bottom:25px;right:5px;background-color:#fff;color:#000;width:140px;height:50%;display:none;overflow:hidden}#chiselchat .chiselchat-tab-pane .chiselchat-scrollable-list{overflow-y:auto;overflow-x:hidden;height:80%}#chiselchat #chiselchat-room-pane #chiselchat-room-list,#chiselchat #chiselchat-presence-pane #chiselchat-user-search{padding-left:5px}#chiselchat #chiselchat-room-pane #chiselchat-room-list li,#chiselchat #chiselchat-presence-pane #chiselchat-user-search li{padding-bottom:5px}#chiselchat #chiselchat-presence-pane .chiselchat-user-list-item,#chiselchat #chiselchat-room-pane .chiselchat-room-list-item{color:#000;text-decoration:none}#chiselchat #chiselchat-presence-pane.active,#chiselchat #chiselchat-room-pane.active{display:block}#chiselchat-tab-content .chiselchat-tab-pane.active.fullscreen,#chiselchat-tab-content #chiselchat-presence-pane.active.fullscreen,#chiselchat-tab-content #chiselchat-room-pane.active.fullscreen{width:99%;height:96%}#chiselchat-tab-content .chiselchat-tab-pane.fullscreen .chiselchat-tab-pane-menu{width:25%}#chiselchat-tab-content .chiselchat-tab-pane.fullscreen .chiselchat-history{width:75%}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-message .chiselchat-message-content a{color:#014986}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-message-activity{text-align:center;font-style:italic;color:#000}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-message-activity .chiselchat-avatar,#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-message-activity .chiselchat-timestamp,#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-message-activity .chiselchat-user .chiselchat-controls{display:none}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-message-activity .chiselchat-user,#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history .chiselchat-message-activity .chiselchat-message-content{display:inline;padding:0;margin:0}div.chiselchat-alert,.chiselchat-alert .alert{z-index:2000000002;color:#000;background-color:#fff;font-family:sans-serif}.chiselchat-alert hr{border-top-color:#000}.chiselchat-alert .alert-link{color:#014986}@media(max-width:960px){div.chiselchat-alert,.chiselchat-alert .alert{width:50%}#chiselchat-tab-content .chiselchat-tab-pane.active,#chiselchat-tab-content #chiselchat-presence-pane.active,#chiselchat-tab-content #chiselchat-room-pane.active{bottom:35px;width:98%;height:94%}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-toggle-pane-size{display:none}#chiselchat-tab-list{height:30px}#chiselchat-tab-list li{height:30px;width:110px;font-size:150%}#chiselchat-tab-list li#chiselchat-presence-tab,#chiselchat-tab-list li#chiselchat-room-tab{width:18px}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-tab-pane-menu{display:none}#chiselchat-tab-content .chiselchat-tab-pane .chiselchat-history{width:100%;float:none;height:100%}}@font-face{font-family:'Glyphicons Halflings';src:url('//netdna.bootstrapcdn.com/bootstrap/3.0.3/fonts/glyphicons-halflings-regular.eot');src:url('//netdna.bootstrapcdn.com/bootstrap/3.0.3/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('//netdna.bootstrapcdn.com/bootstrap/3.0.3/fonts/glyphicons-halflings-regular.woff') format('woff'),url('//netdna.bootstrapcdn.com/bootstrap/3.0.3/fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('//netdna.bootstrapcdn.com/bootstrap/3.0.3/fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg')}.chiselchat-glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';-webkit-font-smoothing:antialiased;font-style:normal;font-weight:normal;line-height:1;-moz-osx-font-smoothing:grayscale}.chiselchat-glyphicon:empty{width:1em}.chiselchat-glyphicon-asterisk:before{content:"\2a"}.chiselchat-glyphicon-plus:before{content:"\2b"}.chiselchat-glyphicon-euro:before{content:"\20ac"}.chiselchat-glyphicon-minus:before{content:"\2212"}.chiselchat-glyphicon-cloud:before{content:"\2601"}.chiselchat-glyphicon-envelope:before{content:"\2709"}.chiselchat-glyphicon-pencil:before{content:"\270f"}.chiselchat-glyphicon-glass:before{content:"\e001"}.chiselchat-glyphicon-music:before{content:"\e002"}.chiselchat-glyphicon-search:before{content:"\e003"}.chiselchat-glyphicon-heart:before{content:"\e005"}.chiselchat-glyphicon-star:before{content:"\e006"}.chiselchat-glyphicon-star-empty:before{content:"\e007"}.chiselchat-glyphicon-user:before{content:"\e008"}.chiselchat-glyphicon-film:before{content:"\e009"}.chiselchat-glyphicon-th-large:before{content:"\e010"}.chiselchat-glyphicon-th:before{content:"\e011"}.chiselchat-glyphicon-th-list:before{content:"\e012"}.chiselchat-glyphicon-ok:before{content:"\e013"}.chiselchat-glyphicon-remove:before{content:"\e014"}.chiselchat-glyphicon-zoom-in:before{content:"\e015"}.chiselchat-glyphicon-zoom-out:before{content:"\e016"}.chiselchat-glyphicon-off:before{content:"\e017"}.chiselchat-glyphicon-signal:before{content:"\e018"}.chiselchat-glyphicon-cog:before{content:"\e019"}.chiselchat-glyphicon-trash:before{content:"\e020"}.chiselchat-glyphicon-home:before{content:"\e021"}.chiselchat-glyphicon-file:before{content:"\e022"}.chiselchat-glyphicon-time:before{content:"\e023"}.chiselchat-glyphicon-road:before{content:"\e024"}.chiselchat-glyphicon-download-alt:before{content:"\e025"}.chiselchat-glyphicon-download:before{content:"\e026"}.chiselchat-glyphicon-upload:before{content:"\e027"}.chiselchat-glyphicon-inbox:before{content:"\e028"}.chiselchat-glyphicon-play-circle:before{content:"\e029"}.chiselchat-glyphicon-repeat:before{content:"\e030"}.chiselchat-glyphicon-refresh:before{content:"\e031"}.chiselchat-glyphicon-list-alt:before{content:"\e032"}.chiselchat-glyphicon-lock:before{content:"\e033"}.chiselchat-glyphicon-flag:before{content:"\e034"}.chiselchat-glyphicon-headphones:before{content:"\e035"}.chiselchat-glyphicon-volume-off:before{content:"\e036"}.chiselchat-glyphicon-volume-down:before{content:"\e037"}.chiselchat-glyphicon-volume-up:before{content:"\e038"}.chiselchat-glyphicon-qrcode:before{content:"\e039"}.chiselchat-glyphicon-barcode:before{content:"\e040"}.chiselchat-glyphicon-tag:before{content:"\e041"}.chiselchat-glyphicon-tags:before{content:"\e042"}.chiselchat-glyphicon-book:before{content:"\e043"}.chiselchat-glyphicon-bookmark:before{content:"\e044"}.chiselchat-glyphicon-print:before{content:"\e045"}.chiselchat-glyphicon-camera:before{content:"\e046"}.chiselchat-glyphicon-font:before{content:"\e047"}.chiselchat-glyphicon-bold:before{content:"\e048"}.chiselchat-glyphicon-italic:before{content:"\e049"}.chiselchat-glyphicon-text-height:before{content:"\e050"}.chiselchat-glyphicon-text-width:before{content:"\e051"}.chiselchat-glyphicon-align-left:before{content:"\e052"}.chiselchat-glyphicon-align-center:before{content:"\e053"}.chiselchat-glyphicon-align-right:before{content:"\e054"}.chiselchat-glyphicon-align-justify:before{content:"\e055"}.chiselchat-glyphicon-list:before{content:"\e056"}.chiselchat-glyphicon-indent-left:before{content:"\e057"}.chiselchat-glyphicon-indent-right:before{content:"\e058"}.chiselchat-glyphicon-facetime-video:before{content:"\e059"}.chiselchat-glyphicon-picture:before{content:"\e060"}.chiselchat-glyphicon-map-marker:before{content:"\e062"}.chiselchat-glyphicon-adjust:before{content:"\e063"}.chiselchat-glyphicon-tint:before{content:"\e064"}.chiselchat-glyphicon-edit:before{content:"\e065"}.chiselchat-glyphicon-share:before{content:"\e066"}.chiselchat-glyphicon-check:before{content:"\e067"}.chiselchat-glyphicon-move:before{content:"\e068"}.chiselchat-glyphicon-step-backward:before{content:"\e069"}.chiselchat-glyphicon-fast-backward:before{content:"\e070"}.chiselchat-glyphicon-backward:before{content:"\e071"}.chiselchat-glyphicon-play:before{content:"\e072"}.chiselchat-glyphicon-pause:before{content:"\e073"}.chiselchat-glyphicon-stop:before{content:"\e074"}.chiselchat-glyphicon-forward:before{content:"\e075"}.chiselchat-glyphicon-fast-forward:before{content:"\e076"}.chiselchat-glyphicon-step-forward:before{content:"\e077"}.chiselchat-glyphicon-eject:before{content:"\e078"}.chiselchat-glyphicon-chevron-left:before{content:"\e079"}.chiselchat-glyphicon-chevron-right:before{content:"\e080"}.chiselchat-glyphicon-plus-sign:before{content:"\e081"}.chiselchat-glyphicon-minus-sign:before{content:"\e082"}.chiselchat-glyphicon-remove-sign:before{content:"\e083"}.chiselchat-glyphicon-ok-sign:before{content:"\e084"}.chiselchat-glyphicon-question-sign:before{content:"\e085"}.chiselchat-glyphicon-info-sign:before{content:"\e086"}.chiselchat-glyphicon-screenshot:before{content:"\e087"}.chiselchat-glyphicon-remove-circle:before{content:"\e088"}.chiselchat-glyphicon-ok-circle:before{content:"\e089"}.chiselchat-glyphicon-ban-circle:before{content:"\e090"}.chiselchat-glyphicon-arrow-left:before{content:"\e091"}.chiselchat-glyphicon-arrow-right:before{content:"\e092"}.chiselchat-glyphicon-arrow-up:before{content:"\e093"}.chiselchat-glyphicon-arrow-down:before{content:"\e094"}.chiselchat-glyphicon-share-alt:before{content:"\e095"}.chiselchat-glyphicon-resize-full:before{content:"\e096"}.chiselchat-glyphicon-resize-small:before{content:"\e097"}.chiselchat-glyphicon-exclamation-sign:before{content:"\e101"}.chiselchat-glyphicon-gift:before{content:"\e102"}.chiselchat-glyphicon-leaf:before{content:"\e103"}.chiselchat-glyphicon-fire:before{content:"\e104"}.chiselchat-glyphicon-eye-open:before{content:"\e105"}.chiselchat-glyphicon-eye-close:before{content:"\e106"}.chiselchat-glyphicon-warning-sign:before{content:"\e107"}.chiselchat-glyphicon-plane:before{content:"\e108"}.chiselchat-glyphicon-calendar:before{content:"\e109"}.chiselchat-glyphicon-random:before{content:"\e110"}.chiselchat-glyphicon-comment:before{content:"\e111"}.chiselchat-glyphicon-magnet:before{content:"\e112"}.chiselchat-glyphicon-chevron-up:before{content:"\e113"}.chiselchat-glyphicon-chevron-down:before{content:"\e114"}.chiselchat-glyphicon-retweet:before{content:"\e115"}.chiselchat-glyphicon-shopping-cart:before{content:"\e116"}.chiselchat-glyphicon-folder-close:before{content:"\e117"}.chiselchat-glyphicon-folder-open:before{content:"\e118"}.chiselchat-glyphicon-resize-vertical:before{content:"\e119"}.chiselchat-glyphicon-resize-horizontal:before{content:"\e120"}.chiselchat-glyphicon-hdd:before{content:"\e121"}.chiselchat-glyphicon-bullhorn:before{content:"\e122"}.chiselchat-glyphicon-bell:before{content:"\e123"}.chiselchat-glyphicon-certificate:before{content:"\e124"}.chiselchat-glyphicon-thumbs-up:before{content:"\e125"}.chiselchat-glyphicon-thumbs-down:before{content:"\e126"}.chiselchat-glyphicon-hand-right:before{content:"\e127"}.chiselchat-glyphicon-hand-left:before{content:"\e128"}.chiselchat-glyphicon-hand-up:before{content:"\e129"}.chiselchat-glyphicon-hand-down:before{content:"\e130"}.chiselchat-glyphicon-circle-arrow-right:before{content:"\e131"}.chiselchat-glyphicon-circle-arrow-left:before{content:"\e132"}.chiselchat-glyphicon-circle-arrow-up:before{content:"\e133"}.chiselchat-glyphicon-circle-arrow-down:before{content:"\e134"}.chiselchat-glyphicon-globe:before{content:"\e135"}.chiselchat-glyphicon-wrench:before{content:"\e136"}.chiselchat-glyphicon-tasks:before{content:"\e137"}.chiselchat-glyphicon-filter:before{content:"\e138"}.chiselchat-glyphicon-briefcase:before{content:"\e139"}.chiselchat-glyphicon-fullscreen:before{content:"\e140"}.chiselchat-glyphicon-dashboard:before{content:"\e141"}.chiselchat-glyphicon-paperclip:before{content:"\e142"}.chiselchat-glyphicon-heart-empty:before{content:"\e143"}.chiselchat-glyphicon-link:before{content:"\e144"}.chiselchat-glyphicon-phone:before{content:"\e145"}.chiselchat-glyphicon-pushpin:before{content:"\e146"}.chiselchat-glyphicon-usd:before{content:"\e148"}.chiselchat-glyphicon-gbp:before{content:"\e149"}.chiselchat-glyphicon-sort:before{content:"\e150"}.chiselchat-glyphicon-sort-by-alphabet:before{content:"\e151"}.chiselchat-glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.chiselchat-glyphicon-sort-by-order:before{content:"\e153"}.chiselchat-glyphicon-sort-by-order-alt:before{content:"\e154"}.chiselchat-glyphicon-sort-by-attributes:before{content:"\e155"}.chiselchat-glyphicon-sort-by-attributes-alt:before{content:"\e156"}.chiselchat-glyphicon-unchecked:before{content:"\e157"}.chiselchat-glyphicon-expand:before{content:"\e158"}.chiselchat-glyphicon-collapse-down:before{content:"\e159"}.chiselchat-glyphicon-collapse-up:before{content:"\e160"}.chiselchat-glyphicon-log-in:before{content:"\e161"}.chiselchat-glyphicon-flash:before{content:"\e162"}.chiselchat-glyphicon-log-out:before{content:"\e163"}.chiselchat-glyphicon-new-window:before{content:"\e164"}.chiselchat-glyphicon-record:before{content:"\e165"}.chiselchat-glyphicon-save:before{content:"\e166"}.chiselchat-glyphicon-open:before{content:"\e167"}.chiselchat-glyphicon-saved:before{content:"\e168"}.chiselchat-glyphicon-import:before{content:"\e169"}.chiselchat-glyphicon-export:before{content:"\e170"}.chiselchat-glyphicon-send:before{content:"\e171"}.chiselchat-glyphicon-floppy-disk:before{content:"\e172"}.chiselchat-glyphicon-floppy-saved:before{content:"\e173"}.chiselchat-glyphicon-floppy-remove:before{content:"\e174"}.chiselchat-glyphicon-floppy-save:before{content:"\e175"}.chiselchat-glyphicon-floppy-open:before{content:"\e176"}.chiselchat-glyphicon-credit-card:before{content:"\e177"}.chiselchat-glyphicon-transfer:before{content:"\e178"}.chiselchat-glyphicon-cutlery:before{content:"\e179"}.chiselchat-glyphicon-header:before{content:"\e180"}.chiselchat-glyphicon-compressed:before{content:"\e181"}.chiselchat-glyphicon-earphone:before{content:"\e182"}.chiselchat-glyphicon-phone-alt:before{content:"\e183"}.chiselchat-glyphicon-tower:before{content:"\e184"}.chiselchat-glyphicon-stats:before{content:"\e185"}.chiselchat-glyphicon-sd-video:before{content:"\e186"}.chiselchat-glyphicon-hd-video:before{content:"\e187"}.chiselchat-glyphicon-subtitles:before{content:"\e188"}.chiselchat-glyphicon-sound-stereo:before{content:"\e189"}.chiselchat-glyphicon-sound-dolby:before{content:"\e190"}.chiselchat-glyphicon-sound-5-1:before{content:"\e191"}.chiselchat-glyphicon-sound-6-1:before{content:"\e192"}.chiselchat-glyphicon-sound-7-1:before{content:"\e193"}.chiselchat-glyphicon-copyright-mark:before{content:"\e194"}.chiselchat-glyphicon-registration-mark:before{content:"\e195"}.chiselchat-glyphicon-cloud-download:before{content:"\e197"}.chiselchat-glyphicon-cloud-upload:before{content:"\e198"}.chiselchat-glyphicon-tree-conifer:before{content:"\e199"}.chiselchat-glyphicon-tree-deciduous:before{content:"\e200"} diff --git a/var/www/public/chiselchat/chiselchat.min.js b/var/www/public/chiselchat/chiselchat.min.js index 6c967d01..71f97dd5 100644 --- a/var/www/public/chiselchat/chiselchat.min.js +++ b/var/www/public/chiselchat/chiselchat.min.js @@ -1,2 +1,2 @@ -(function(){var e=this,t=e._,a={},n=Array.prototype,i=Object.prototype,s=Function.prototype,r=n.push,o=n.slice,c=n.concat,l=i.toString,u=i.hasOwnProperty,h=n.forEach,d=n.map,f=n.reduce,m=n.reduceRight,p=n.filter,v=n.every,_=n.some,g=n.indexOf,y=n.lastIndexOf,b=Array.isArray,R=Object.keys,C=s.bind,I=function(e){return e instanceof I?e:this instanceof I?(this._wrapped=e,void 0):new I(e)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=I),exports._=I):e._=I,I.VERSION="1.4.4";var M=I.each=I.forEach=function(e,t,n){if(null!=e)if(h&&e.forEach===h)e.forEach(t,n);else if(e.length===+e.length){for(var i=0,s=e.length;s>i;i++)if(t.call(n,e[i],i,e)===a)return}else for(var r in e)if(I.has(e,r)&&t.call(n,e[r],r,e)===a)return};I.map=I.collect=function(e,t,a){var n=[];return null==e?n:d&&e.map===d?e.map(t,a):(M(e,function(e,i,s){n[n.length]=t.call(a,e,i,s)}),n)};var w="Reduce of empty array with no initial value";I.reduce=I.foldl=I.inject=function(e,t,a,n){var i=arguments.length>2;if(null==e&&(e=[]),f&&e.reduce===f)return n&&(t=I.bind(t,n)),i?e.reduce(t,a):e.reduce(t);if(M(e,function(e,s,r){i?a=t.call(n,a,e,s,r):(a=e,i=!0)}),!i)throw new TypeError(w);return a},I.reduceRight=I.foldr=function(e,t,a,n){var i=arguments.length>2;if(null==e&&(e=[]),m&&e.reduceRight===m)return n&&(t=I.bind(t,n)),i?e.reduceRight(t,a):e.reduceRight(t);var s=e.length;if(s!==+s){var r=I.keys(e);s=r.length}if(M(e,function(o,c,l){c=r?r[--s]:--s,i?a=t.call(n,a,e[c],c,l):(a=e[c],i=!0)}),!i)throw new TypeError(w);return a},I.find=I.detect=function(e,t,a){var n;return U(e,function(e,i,s){return t.call(a,e,i,s)?(n=e,!0):void 0}),n},I.filter=I.select=function(e,t,a){var n=[];return null==e?n:p&&e.filter===p?e.filter(t,a):(M(e,function(e,i,s){t.call(a,e,i,s)&&(n[n.length]=e)}),n)},I.reject=function(e,t,a){return I.filter(e,function(e,n,i){return!t.call(a,e,n,i)},a)},I.every=I.all=function(e,t,n){t||(t=I.identity);var i=!0;return null==e?i:v&&e.every===v?e.every(t,n):(M(e,function(e,s,r){return(i=i&&t.call(n,e,s,r))?void 0:a}),!!i)};var U=I.some=I.any=function(e,t,n){t||(t=I.identity);var i=!1;return null==e?i:_&&e.some===_?e.some(t,n):(M(e,function(e,s,r){return i||(i=t.call(n,e,s,r))?a:void 0}),!!i)};I.contains=I.include=function(e,t){return null==e?!1:g&&e.indexOf===g?-1!=e.indexOf(t):U(e,function(e){return e===t})},I.invoke=function(e,t){var a=o.call(arguments,2),n=I.isFunction(t);return I.map(e,function(e){return(n?t:e[t]).apply(e,a)})},I.pluck=function(e,t){return I.map(e,function(e){return e[t]})},I.where=function(e,t,a){return I.isEmpty(t)?a?null:[]:I[a?"find":"filter"](e,function(e){for(var a in t)if(t[a]!==e[a])return!1;return!0})},I.findWhere=function(e,t){return I.where(e,t,!0)},I.max=function(e,t,a){if(!t&&I.isArray(e)&&e[0]===+e[0]&&65535>e.length)return Math.max.apply(Math,e);if(!t&&I.isEmpty(e))return-1/0;var n={computed:-1/0,value:-1/0};return M(e,function(e,i,s){var r=t?t.call(a,e,i,s):e;r>=n.computed&&(n={value:e,computed:r})}),n.value},I.min=function(e,t,a){if(!t&&I.isArray(e)&&e[0]===+e[0]&&65535>e.length)return Math.min.apply(Math,e);if(!t&&I.isEmpty(e))return 1/0;var n={computed:1/0,value:1/0};return M(e,function(e,i,s){var r=t?t.call(a,e,i,s):e;n.computed>r&&(n={value:e,computed:r})}),n.value},I.shuffle=function(e){var t,a=0,n=[];return M(e,function(e){t=I.random(a++),n[a-1]=n[t],n[t]=e}),n};var x=function(e){return I.isFunction(e)?e:function(t){return t[e]}};I.sortBy=function(e,t,a){var n=x(t);return I.pluck(I.map(e,function(e,t,i){return{value:e,index:t,criteria:n.call(a,e,t,i)}}).sort(function(e,t){var a=e.criteria,n=t.criteria;if(a!==n){if(a>n||void 0===a)return 1;if(n>a||void 0===n)return-1}return e.indexs;){var o=s+r>>>1;i>a.call(n,e[o])?s=o+1:r=o}return s},I.toArray=function(e){return e?I.isArray(e)?o.call(e):e.length===+e.length?I.map(e,I.identity):I.values(e):[]},I.size=function(e){return null==e?0:e.length===+e.length?e.length:I.keys(e).length},I.first=I.head=I.take=function(e,t,a){return null==e?void 0:null==t||a?e[0]:o.call(e,0,t)},I.initial=function(e,t,a){return o.call(e,0,e.length-(null==t||a?1:t))},I.last=function(e,t,a){return null==e?void 0:null==t||a?e[e.length-1]:o.call(e,Math.max(e.length-t,0))},I.rest=I.tail=I.drop=function(e,t,a){return o.call(e,null==t||a?1:t)},I.compact=function(e){return I.filter(e,I.identity)};var j=function(e,t,a){return M(e,function(e){I.isArray(e)?t?r.apply(a,e):j(e,t,a):a.push(e)}),a};I.flatten=function(e,t){return j(e,t,[])},I.without=function(e){return I.difference(e,o.call(arguments,1))},I.uniq=I.unique=function(e,t,a,n){I.isFunction(t)&&(n=a,a=t,t=!1);var i=a?I.map(e,a,n):e,s=[],r=[];return M(i,function(a,n){(t?n&&r[r.length-1]===a:I.contains(r,a))||(r.push(a),s.push(e[n]))}),s},I.union=function(){return I.uniq(c.apply(n,arguments))},I.intersection=function(e){var t=o.call(arguments,1);return I.filter(I.uniq(e),function(e){return I.every(t,function(t){return I.indexOf(t,e)>=0})})},I.difference=function(e){var t=c.apply(n,o.call(arguments,1));return I.filter(e,function(e){return!I.contains(t,e)})},I.zip=function(){for(var e=o.call(arguments),t=I.max(I.pluck(e,"length")),a=Array(t),n=0;t>n;n++)a[n]=I.pluck(e,""+n);return a},I.object=function(e,t){if(null==e)return{};for(var a={},n=0,i=e.length;i>n;n++)t?a[e[n]]=t[n]:a[e[n][0]]=e[n][1];return a},I.indexOf=function(e,t,a){if(null==e)return-1;var n=0,i=e.length;if(a){if("number"!=typeof a)return n=I.sortedIndex(e,t),e[n]===t?n:-1;n=0>a?Math.max(0,i+a):a}if(g&&e.indexOf===g)return e.indexOf(t,a);for(;i>n;n++)if(e[n]===t)return n;return-1},I.lastIndexOf=function(e,t,a){if(null==e)return-1;var n=null!=a;if(y&&e.lastIndexOf===y)return n?e.lastIndexOf(t,a):e.lastIndexOf(t);for(var i=n?a:e.length;i--;)if(e[i]===t)return i;return-1},I.range=function(e,t,a){1>=arguments.length&&(t=e||0,e=0),a=arguments[2]||1;for(var n=Math.max(Math.ceil((t-e)/a),0),i=0,s=Array(n);n>i;)s[i++]=e,e+=a;return s},I.bind=function(e,t){if(e.bind===C&&C)return C.apply(e,o.call(arguments,1));var a=o.call(arguments,2);return function(){return e.apply(t,a.concat(o.call(arguments)))}},I.partial=function(e){var t=o.call(arguments,1);return function(){return e.apply(this,t.concat(o.call(arguments)))}},I.bindAll=function(e){var t=o.call(arguments,1);return 0===t.length&&(t=I.functions(e)),M(t,function(t){e[t]=I.bind(e[t],e)}),e},I.memoize=function(e,t){var a={};return t||(t=I.identity),function(){var n=t.apply(this,arguments);return I.has(a,n)?a[n]:a[n]=e.apply(this,arguments)}},I.delay=function(e,t){var a=o.call(arguments,2);return setTimeout(function(){return e.apply(null,a)},t)},I.defer=function(e){return I.delay.apply(I,[e,1].concat(o.call(arguments,1)))},I.throttle=function(e,t){var a,n,i,s,r=0,o=function(){r=new Date,i=null,s=e.apply(a,n)};return function(){var c=new Date,l=t-(c-r);return a=this,n=arguments,0>=l?(clearTimeout(i),i=null,r=c,s=e.apply(a,n)):i||(i=setTimeout(o,l)),s}},I.debounce=function(e,t,a){var n,i;return function(){var s=this,r=arguments,o=function(){n=null,a||(i=e.apply(s,r))},c=a&&!n;return clearTimeout(n),n=setTimeout(o,t),c&&(i=e.apply(s,r)),i}},I.once=function(e){var t,a=!1;return function(){return a?t:(a=!0,t=e.apply(this,arguments),e=null,t)}},I.wrap=function(e,t){return function(){var a=[e];return r.apply(a,arguments),t.apply(this,a)}},I.compose=function(){var e=arguments;return function(){for(var t=arguments,a=e.length-1;a>=0;a--)t=[e[a].apply(this,t)];return t[0]}},I.after=function(e,t){return 0>=e?t():function(){return 1>--e?t.apply(this,arguments):void 0}},I.keys=R||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var a in e)I.has(e,a)&&(t[t.length]=a);return t},I.values=function(e){var t=[];for(var a in e)I.has(e,a)&&t.push(e[a]);return t},I.pairs=function(e){var t=[];for(var a in e)I.has(e,a)&&t.push([a,e[a]]);return t},I.invert=function(e){var t={};for(var a in e)I.has(e,a)&&(t[e[a]]=a);return t},I.functions=I.methods=function(e){var t=[];for(var a in e)I.isFunction(e[a])&&t.push(a);return t.sort()},I.extend=function(e){return M(o.call(arguments,1),function(t){if(t)for(var a in t)e[a]=t[a]}),e},I.pick=function(e){var t={},a=c.apply(n,o.call(arguments,1));return M(a,function(a){a in e&&(t[a]=e[a])}),t},I.omit=function(e){var t={},a=c.apply(n,o.call(arguments,1));for(var i in e)I.contains(a,i)||(t[i]=e[i]);return t},I.defaults=function(e){return M(o.call(arguments,1),function(t){if(t)for(var a in t)null==e[a]&&(e[a]=t[a])}),e},I.clone=function(e){return I.isObject(e)?I.isArray(e)?e.slice():I.extend({},e):e},I.tap=function(e,t){return t(e),e};var k=function(e,t,a,n){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;e instanceof I&&(e=e._wrapped),t instanceof I&&(t=t._wrapped);var i=l.call(e);if(i!=l.call(t))return!1;switch(i){case"[object String]":return e==t+"";case"[object Number]":return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if("object"!=typeof e||"object"!=typeof t)return!1;for(var s=a.length;s--;)if(a[s]==e)return n[s]==t;a.push(e),n.push(t);var r=0,o=!0;if("[object Array]"==i){if(r=e.length,o=r==t.length)for(;r--&&(o=k(e[r],t[r],a,n)););}else{var c=e.constructor,u=t.constructor;if(c!==u&&!(I.isFunction(c)&&c instanceof c&&I.isFunction(u)&&u instanceof u))return!1;for(var h in e)if(I.has(e,h)&&(r++,!(o=I.has(t,h)&&k(e[h],t[h],a,n))))break;if(o){for(h in t)if(I.has(t,h)&&!r--)break;o=!r}}return a.pop(),n.pop(),o};I.isEqual=function(e,t){return k(e,t,[],[])},I.isEmpty=function(e){if(null==e)return!0;if(I.isArray(e)||I.isString(e))return 0===e.length;for(var t in e)if(I.has(e,t))return!1;return!0},I.isElement=function(e){return!(!e||1!==e.nodeType)},I.isArray=b||function(e){return"[object Array]"==l.call(e)},I.isObject=function(e){return e===Object(e)},M(["Arguments","Function","String","Number","Date","RegExp"],function(e){I["is"+e]=function(t){return l.call(t)=="[object "+e+"]"}}),I.isArguments(arguments)||(I.isArguments=function(e){return!(!e||!I.has(e,"callee"))}),true&&(I.isFunction=function(e){return"function"==typeof e}),I.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},I.isNaN=function(e){return I.isNumber(e)&&e!=+e},I.isBoolean=function(e){return e===!0||e===!1||"[object Boolean]"==l.call(e)},I.isNull=function(e){return null===e},I.isUndefined=function(e){return void 0===e},I.has=function(e,t){return u.call(e,t)},I.noConflict=function(){return e._=t,this},I.identity=function(e){return e},I.times=function(e,t,a){for(var n=Array(e),i=0;e>i;i++)n[i]=t.call(a,i);return n},I.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))};var S={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};S.unescape=I.invert(S.escape);var N={escape:RegExp("["+I.keys(S.escape).join("")+"]","g"),unescape:RegExp("("+I.keys(S.unescape).join("|")+")","g")};I.each(["escape","unescape"],function(e){I[e]=function(t){return null==t?"":(""+t).replace(N[e],function(t){return S[e][t]})}}),I.result=function(e,t){if(null==e)return null;var a=e[t];return I.isFunction(a)?a.call(e):a},I.mixin=function(e){M(I.functions(e),function(t){var a=I[t]=e[t];I.prototype[t]=function(){var e=[this._wrapped];return r.apply(e,arguments),F.call(this,a.apply(I,e))}})};var E=0;I.uniqueId=function(e){var t=++E+"";return e?e+t:t},I.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var A=/(.)^/,D={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},L=/\\|'|\r|\n|\t|\u2028|\u2029/g;I.template=function(e,t,a){var n;a=I.defaults({},a,I.templateSettings);var i=RegExp([(a.escape||A).source,(a.interpolate||A).source,(a.evaluate||A).source].join("|")+"|$","g"),s=0,r="__p+='";e.replace(i,function(t,a,n,i,o){return r+=e.slice(s,o).replace(L,function(e){return"\\"+D[e]}),a&&(r+="'+\n((__t=("+a+"))==null?'':_.escape(__t))+\n'"),n&&(r+="'+\n((__t=("+n+"))==null?'':__t)+\n'"),i&&(r+="';\n"+i+"\n__p+='"),s=o+t.length,t}),r+="';\n",a.variable||(r="with(obj||{}){\n"+r+"}\n"),r="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+r+"return __p;\n";try{n=Function(a.variable||"obj","_",r)}catch(o){throw o.source=r,o}if(t)return n(t,I);var c=function(e){return n.call(this,e,I)};return c.source="function("+(a.variable||"obj")+"){\n"+r+"}",c},I.chain=function(e){return I(e).chain()};var F=function(e){return this._chain?I(e).chain():e};I.mixin(I),M(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=n[e];I.prototype[e]=function(){var a=this._wrapped;return t.apply(a,arguments),"shift"!=e&&"splice"!=e||0!==a.length||delete a[0],F.call(this,a)}}),M(["concat","join","slice"],function(e){var t=n[e];I.prototype[e]=function(){return F.call(this,t.apply(this._wrapped,arguments))}}),I.extend(I.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this),this.ChiselchatDefaultTemplates=this.ChiselchatDefaultTemplates||{},this.ChiselchatDefaultTemplates["templates/layout-full.html"]=function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+="
\n\n\n
\n
\n
\nPeople\n\n_\n▀\n\n
\n
\n\n
\n
\n
\n
\n
\nRooms\n\n_\n▀\n\n
\n
\n\n
\n
    \n
    \n
    \n
    \n
    ";return __p},this.ChiselchatDefaultTemplates["templates/layout-popout.html"]=function(obj){obj||(obj={});var __p="";with(_.escape,obj)__p+="
    \n
    \n\n
    \n
    \n
    ";return __p},this.ChiselchatDefaultTemplates["templates/message.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(Array.prototype.join,obj)__p+="
    \n
    \n\n
    "+__e(localtime)+"
    \n
    \n
    "+__e(name)+"\n \n\n",disableActions||(__p+="\nPM\nMute\n",userIsModerator&&(__p+="\nWarn\nBan (hour)\nBan (day)\n"),__p+="\n"),__p+="\n\n
    \n
    \n"+(null==(__t=message)?"":__t)+"\n",userIsModerator&&(__p+="\n ×\n"),__p+="\n
    \n
    ";return __p},this.ChiselchatDefaultTemplates["templates/room-list-item.html"]=function(obj){obj||(obj={});var __p="",__e=_.escape;with(Array.prototype.join,obj)__p+="
  • \n"+__e(name)+"\n","official"!=type&&(__p+="\n",userIsModerator&&(__p+="\n×\n"),__p+="\n"),__p+="\n
  • ";return __p},this.ChiselchatDefaultTemplates["templates/room-user-list-item.html"]=function(obj){obj||(obj={});var __p="",__e=_.escape;with(Array.prototype.join,obj)__p+="
  • \n\n"+__e(name)+"\n\n",disableActions||(__p+="\n\n",__p+=isMuted?"Unmute":"Mute",__p+="\nPM\n\n"),__p+="\n
  • ";return __p},this.ChiselchatDefaultTemplates["templates/room-user-search-list-item.html"]=function(obj){obj||(obj={});var __p="",__e=_.escape;with(Array.prototype.join,obj)__p+="
  • \n\n",__p+=disableActions?"\n"+__e(name)+"\n":"\n"+__e(name)+"\n+\n",__p+="\n\n
  • ";return __p},this.ChiselchatDefaultTemplates["templates/tab-content.html"]=function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+="
    \n
    \n'+__e(name)+"\n\n\n_\n▀\n×\n\n
    \n
    \n
    \n\n
      \nInvite\n\n
      \n
        \n
        \n
        \n
        \n
        \n\n
        \n
        ";return __p},this.ChiselchatDefaultTemplates["templates/tab-menu-item.html"]=function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+="
      • \n"+__e(name)+" 0\n
      • ";return __p},this.ChiselchatDefaultTemplates["templates/user-search-list-item.html"]=function(obj){obj||(obj={});var __p="",__e=_.escape;with(Array.prototype.join,obj)__p+="
      • \n",__p+=disableActions?"\n"+__e(name)+"\n":"\n"+__e(name)+"\nPM\n",__p+="\n\n
      • ";return __p},function(){Function.prototype.bind||(Function.prototype.bind=function(e){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),a=this,n=function(){},i=function(){return a.apply(this instanceof n&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};return n.prototype=this.prototype,i.prototype=new n,i}),Object.keys=Object.keys||function(e){var t=[];for(var a in e)e.hasOwnProperty(a)&&t.push(a);return t}}(),function(e){function t(e,t){this._firebase=e,this._user=null,this._userId=null,this._userName=null,this._avatarUri="",this._profileUri="",this._isModerator=!1,this._isStaff=!1,this._isGuest=!1,this._sessionId=null,this._events={},this._rooms={},this._presenceBits={},this._userRef=null,this._messageRef=this._firebase.child("room-messages"),this._roomRef=this._firebase.child("room-metadata"),this._privateRoomRef=this._firebase.child("room-private-metadata"),this._moderatorsRef=this._firebase.child("moderators"),this._suspensionsRef=this._firebase.child("suspensions"),this._usersOnlineRef=this._firebase.child("user-names-online"),this._guestNameList=["Arnold","Burton","Cal","Caroline","Peabody","Pubert","Gomez","Morticia","Wednesday","Uncle Fester","Pugsly","Greggory","Greg","Bruce","Jean Claude","Herobrine","Cake","Lilith","Penelope","Rhiannon","Medusa","Sally","Barry","Elmer","Gretel","Chris","David","Donald","Dude","Dudette","Ernest","Esther","Fern","Gertrude","Gus","Hazel","Isobel","Kevin","Malcolm","Neville","Oscar","Paul","Quentin","Rupert","Simon","Thom","Vern","Wally","Trudy","Bertha","Abernathy","Adolf","Attila","Kurt","Helen","Marv","Magda","Hansel","Mort","Gunther","Dreshawn","Percy","Shaneekwa","Ronald","Tyquasia","Tallulah","Margot","Ennis","Roscoe","Heloise","Eunice","Cecil","Bueford","Eustace","Baxter","Tiara","Garland","Judy","Cooter","Daisy","Cletus","Crystal","Martha","Jesse","Bo","Luke","Martha","Jefferson","Martha","Albert","Beauregard","Al","Peggy","Bud","Kelly","Igor","Boris","Natasha","Moose","Squirrel","Fannie","Chuck","Dennis","Hamish","Angus","Tate","Mildred","Waldo","Stewart","Horace","Jean Luc","William","Beverly","Data","Geordi","Worf","Deanna","James","Spock","Leonard","Pavel","Hickaru","Nyota","Wesley","Laren","Miles","Keiko","Montgomery","Christine","Janice"],this._options=t||{},this._chatter_cache={},this._options.numMaxMessages=this._options.numMaxMessages||50}var a=this,n=a.Chiselchat;t.noConflict=function(){return a.Chiselchat=n,t},a.Chiselchat=t,t.prototype={_loadUserMetadata:function(e){var t=this;this._userRef.transaction(function(e){var a={id:t._userId,name:t._userName,avatarUri:t._avatarUri,profileUri:t._profileUri,isModerator:t._isModerator,isStaff:t._isStaff,isGuest:t._isGuest};return e&&(e.rooms&&(a.rooms=e.rooms),e.sessions&&(a.sessions=e.sessions),e.muted&&(a.muted=e.muted)),a.isGuest&&(e&&""!==e.name&&void 0!==e.name?(t._userName=e.name,a.name=e.name,console.log("using existing guest name "+a.name)):(a.name="Guest "+t._guestNameList[Math.floor(Math.random()*t._guestNameList.length)],t._userName=a.name,console.log("setting guest name to "+a.name))),a},function(n,i,s){n?console.warn(n):(t._user=s.val(),t._chatter_cache[t._user.id]=t._user,t._moderatorsRef.child(t._userId).once("value",function(n){t._isModerator=!!n.val(),a.setTimeout(e,0)}))},!1)},_setupDataEvents:function(){this._firebase.root().child(".info/connected").on("value",function(e){if(e.val()===!0)for(var t=0;this._presenceBits>t;t++){var a=this._presenceBits[t],n=this._firebase.root().child(a.ref);n.onDisconnect().set(a.offlineValue),n.set(a.onlineValue)}},this);var e=this._userRef.child("sessions").push();this._sessionId=e.name(),this._queuePresenceOperation(e,!0,null);var t=this._usersOnlineRef.child(this._userName.toLowerCase()),a=t.child(this._sessionId);this._queuePresenceOperation(a,{id:this._userId,name:this._userName},null),this._userRef.on("value",this._onUpdateUser,this),this._userRef.child("invites").on("child_added",this._onChiselchatInvite,this),this._userRef.child("notifications").on("child_added",this._onNotification,this);var n=this;this._roomRef.on("child_removed",function(e){n.leaveRoom(e.name())}),this._roomRef.startAt(Date.now()).on("child_added",function(e){this._onCreateRoom(e)},this),n._roomRef.on("child_changed",function(e){n._invokeEventCallbacks("room-changed",e.val())})},_addEventCallback:function(e,t){this._events[e]=this._events[e]||[],this._events[e].push(t)},_getEventCallbacks:function(e){return this._events.hasOwnProperty(e)?this._events[e]:[]},_invokeEventCallbacks:function(e){var t=[],a=this._getEventCallbacks(e);Array.prototype.push.apply(t,arguments),t=t.slice(1);for(var n=0;a.length>n;n+=1)a[n].apply(null,t)},_queuePresenceOperation:function(e,t,a){e.onDisconnect().set(a),e.set(t),this._presenceBits[""+e]={ref:e,onlineValue:t,offlineValue:a}},_removePresenceOperation:function(t,a){var n=new e(t);n.onDisconnect().cancel(),n.set(a),delete this._presenceBits[t]},_onUpdateUser:function(e){this._user=e.val(),this._invokeEventCallbacks("user-update",this._user)},_onCreateRoom:function(e){var t=e.val();this._invokeEventCallbacks("room-create",t)},_onAuthRequired:function(){this._invokeEventCallbacks("auth-required")},_onEnterRoom:function(e){this._invokeEventCallbacks("room-enter",e)},_onNewMessage:function(e,t){var a=t.val();a.id=t.name(),this._invokeEventCallbacks("message-add",e,a)},_onRemoveMessage:function(e,t){var a=t.name();this._invokeEventCallbacks("message-remove",e,a)},_onLeaveRoom:function(e){this._invokeEventCallbacks("room-exit",e)},_onNotification:function(e){var t=e.val();t.read?e.ref().remove():(e.ref().child("read").set(!0),this._invokeEventCallbacks("notification",t))},_onChiselchatInvite:function(e){var t=this,a=e.val();a.status||(a.id=a.id||e.name(),t.getRoom(a.roomId,function(e){a.toRoomName=e.name,t._invokeEventCallbacks("room-invite",a)}))},_onChiselchatInviteResponse:function(e){var t=e.val();t.id=t.id||e.name(),this._invokeEventCallbacks("room-invite-response",t)}},t.prototype.setUser=function(e,t){var n=this;n._firebase.root().child(".info/authenticated").on("value",function(i){i.val()===!0&&(n._firebase.root().child(".info/authenticated").off(),n._userId=e.userId,n._userName=e.userName,n._isModerator=e.isModerator,n._avatarUri=e.avatarUri,n._profileUri=e.profileUri,n._isGuest=e.isGuest,n._isStaff=e.isStaff,n._isModerator===!0&&(n._moderatorsRef.child(n._userId).set(!0),n._moderatorsRef.child(n._userId).onDisconnect().remove()),n._userRef=n._firebase.child("users").child(n._userId),n._loadUserMetadata(function(){a.setTimeout(function(){n._setupDataEvents(),t(n._user)},0)}))})},t.prototype.unsetUser=function(){var e=this;e._userRef.child("rooms").once("value",function(t){var a=t.val();for(var n in a)e.leaveRoom(a[n].id);e._firebase.root().child(".info/connected").off(),e._userRef.child("invites").off(),e._userRef.child("notifications").off(),e._userRef.off(),e._firebase.root().child(".info/authenticated").off(),e._user=null,e._userId=null,e._userName=null,e._isModerator=!1,e._isGuest=!0,e._avatarUri=null,e._profileUri=null,e._sessionId=null,e._userRef=null})},t.prototype.lookupUser=function(e,t){var a=this;e in a._chatter_cache?t(this._chatter_cache[e]):a._firebase.child("users").child(e).once("value",function(n){var i=n.val();a._chatter_cache[e]=i,t(i)})},t.prototype.resumeSession=function(){this._userRef.child("rooms").once("value",function(e){var t=e.val();for(var a in t)this.enterRoom(t[a].id)},function(){},this),this._roomRef.once("value",function(e){var t=e.val();for(var a in t)"official"==t[a].type&&this.enterRoom(a)},function(){},this)},t.prototype.on=function(e,t){this._addEventCallback(e,t)},t.prototype.createRoom=function(t,a,n){var i=this,s=this._roomRef.push(),r={id:s.name(),name:t,type:a||"public",createdByUserId:this._userId,".priority":e.ServerValue.TIMESTAMP};"private"===a&&(r.authorizedUsers={},r.authorizedUsers[this._userId]=!0),s.set(r,function(e){e||i.enterRoom(s.name()),n&&n(s.name())})},t.prototype.enterRoom=function(e){var t=this;t.getRoom(e,function(a){var n=a.name;if(e&&n&&!t._rooms[e]){if(t._rooms[e]=!0,t._user){t._userRef.child("rooms").child(e).set({id:e,name:n,active:!0});var i=t._firebase.child("room-users").child(e).child(t._userId).child(t._sessionId);t._queuePresenceOperation(i,{id:t._userId,name:t._userName},null)}t._onEnterRoom({id:e,name:n}),t._roomRef.child(e).once("value",function(){t._messageRef.child(e).limit(t._options.numMaxMessages).on("child_added",function(a){t._onNewMessage(e,a)},function(){t.leaveRoom(e)},t),t._messageRef.child(e).limit(t._options.numMaxMessages).on("child_removed",function(a){t._onRemoveMessage(e,a)},function(){},t)},function(){},t)}})},t.prototype.leaveRoom=function(e){var t=this,a=t._firebase.child("room-users").child(e);if(t._messageRef.child(e).off(),t._user){var n=a.child(t._userId).child(t._sessionId);t._removePresenceOperation(""+n,null),t._userRef.child("rooms").child(e).remove()}delete t._rooms[e],t._onLeaveRoom(e)},t.prototype.removeRoom=function(e){var t=this;t.leaveRoom(e),t._firebase.child("users").once("value",function(a){var n=a.val();for(var i in n)t._firebase.child("users").child(i).child(e).remove()}),t._messageRef.child(e).remove(),t._firebase.child("room-users").child(e).remove(),t._roomRef.child(e).remove()},t.prototype.sendMessage=function(t,a,n,i){var s,r=this,o={userId:r._userId,name:r._userName,timestamp:e.ServerValue.TIMESTAMP,message:a,type:n||"default"}; -return r._user?(s=r._messageRef.child(t).push(),s.setWithPriority(o,e.ServerValue.TIMESTAMP,i),void 0):(r._onAuthRequired(),i&&i(Error("Not authenticated or user not set!")),void 0)},t.prototype.deleteMessage=function(e,t,a){var n=this;n._messageRef.child(e).child(t).remove(a)},t.prototype.toggleUserMute=function(e,t){var a=this;return a._user?(a._firebase.child("users").child(e).once("value",function(n){n.val().isModerator?t(Error("Cannot mute a moderator.")):a._userRef.child("muted").child(e).transaction(function(e){return e?null:!0},t)}),void 0):(a._onAuthRequired(),t&&t(Error("Not authenticated or user not set!")),void 0)},t.prototype.sendSuperuserNotification=function(t,a,n,i){var s=this,r=s._firebase.child("users").child(t).child("notifications");r.push({fromUserId:s._userId,timestamp:e.ServerValue.TIMESTAMP,notificationType:a,data:n||{}},i)},t.prototype.warnUser=function(e){var t=this;t.sendSuperuserNotification(e,"warning")},t.prototype.suspendUser=function(e,t,a){var n=this,i=(new Date).getTime()+1e3*t;n._suspensionsRef.child(e).set(i,function(t){return t&&a?a(t):(n.sendSuperuserNotification(e,"suspension",{suspendedUntil:i}),a(null))})},t.prototype.inviteUser=function(e,t){var a=this,n=function(){var n=a._firebase.child("users").child(e).child("invites").push();n.set({id:n.name(),fromUserId:a._userId,fromUserName:a._userName,roomId:t}),n.on("value",a._onChiselchatInviteResponse,function(){},a)};return a._user?(a.getRoom(t,function(i){if("private"===i.type){var s=a._roomRef.child(t).child("authorizedUsers");s.child(e).set(!0,function(e){e||n()})}else n()}),void 0):(a._onAuthRequired(),void 0)},t.prototype.acceptInvite=function(e,t){var a=this;a._userRef.child("invites").child(e).once("value",function(n){var i=n.val();return null===i&&t?t(Error("acceptInvite("+e+"): invalid invite id")):(a.enterRoom(i.roomId),a._userRef.child("invites").child(e).update({status:"accepted",toUserName:a._userName},t(i)),void 0)},a)},t.prototype.declineInvite=function(e,t){var a=this,n={status:"declined",toUserName:a._userName};a._userRef.child("invites").child(e).update(n,t)},t.prototype.getRoomList=function(e){var t=this;t._roomRef.once("value",function(t){e(t.val())})},t.prototype.getUserNameById=function(e,t){var a=this;a._firebase.child("users").child(e+"/name").once("value",t)},t.prototype.getUsersByRoom=function(){var e=this,t=arguments[0],n=e._firebase.child("room-users").child(t),i=arguments[arguments.length-1],s=null;arguments.length>2&&(s=arguments[1]),n=s?n.limit(s):n,n.once("value",function(e){var t=e.val()||{},n={};for(var s in t)for(var r in t[s]){n[s]=t[s][r];break}a.setTimeout(function(){i(n)},0)})},t.prototype.getUsersByPrefix=function(e,t,n,i,s){var r=this._usersOnlineRef,o=e.toLowerCase();r=t?r.startAt(null,t):n?r.endAt(null,n):o?r.startAt(null,o):r.startAt(),r=i?r.limit(i):r,r.once("value",function(t){var n=t.val()||{},i={};for(var r in n){var c,l,u=n[r];for(var h in u){c=u[h].name,l=u[h].id;break}e.length>0&&0!==c.toLowerCase().indexOf(o)||(i[c]={name:c,id:l})}a.setTimeout(function(){s(i)},0)})},t.prototype.getRoom=function(e,t){this._roomRef.child(e).once("value",function(e){t(e.val())})},t.prototype.userIsModerator=function(){return this._isModerator},t.prototype.userIsStaff=function(){return this._isStaff}}(Firebase),function(e,t){function a(e){var t=document.cookie.indexOf(e+"="),a=t+e.length+1;if(!t&&e!=document.cookie.substring(0,e.length))return null;if(-1==t)return null;var n=document.cookie.indexOf(";",a);return-1==n&&(n=document.cookie.length),unescape(document.cookie.substring(a,n))}function n(e,t,a,n,i,s){var r=new Date;r.setTime(r.getTime()),a&&(a=24*60*60*1e3*a);var o=new Date(r.getTime()+a);document.cookie=e+"="+escape(t)+(a?";expires="+o.toGMTString():"")+(n?";path="+n:"")+(i?";domain="+i:"")+(s?";secure":"")}function i(t,n,i){if(!t)throw Error("ChiselchatUI: Missing required argument `firebaseRef`");if(!n)throw Error("ChiselchatUI: Missing required argument `el`");i=i||{},this._options=i,this._el=n,this._user=null,this._chat=new Chiselchat(t,i),this._roomQueue=[],this.autoFocusTab=!1,this.fullScreenTab=!1,this.playSounds="true"===a("chiselchat-playSounds")?!0:!1,this.displayNewMessageCount=!1,this.commands=[],this.maxLengthUsername=15,this.maxLengthUsernameDisplay=15,this.maxLengthRoomName=16,this.maxLengthMessage=1e3,this.maxUserSearchResults=100,this.messageHistoryScrollHeight=80,this.urlPattern=/\b(?:https?|ftp):\/\/[a-z0-9-+&@#\/%?=~_|!:,.;]*[a-z0-9-+&@#\/%=~_|]/gim,this.pseudoUrlPattern=/(^|[^\/])(www\.[\S]+(\b|$))/gim,this._renderLayout(),this.$wrapper=e("#chiselchat"),this.$roomList=e("#chiselchat-room-list"),this.$tabList=e("#chiselchat-tab-list"),this.$tabContent=e("#chiselchat-tab-content"),this.$messages={},this.$rateLimit={limitCount:10,limitInterval:1e4,limitWaitTime:3e4,history:{}},this._bindUIEvents(),this._bindDataEvents(),this._initCommands()}var s,r=document.title;t.flashTitle=function(e){function a(){document.title=document.title==r?e:r,6e4>n&&(n+=100,s=setTimeout(a,n))}t.cancelFlashTitle();var n=100;document.hasFocus()||a()};var o=function(){clearTimeout(s),document.title=r};if(t.cancelFlashTitle=o,e(t).focus(o),!e||170>parseInt(e().jquery.replace(/\./g,""),10))throw Error("jQuery 1.7 or later required!");var c=this,l=c.ChiselchatUI;if(c.ChiselchatUI=i,!self.ChiselchatDefaultTemplates)throw Error("Unable to find chat templates!");i.noConflict=function(){return c.ChiselchatUI=l,i},i.prototype={_initCommands:function(){self=this,self.addCommand({match:/^\/help$/,func:function(e,t){var a="";for(var n in t.commands)(!t.commands[n].moderatorOnly||t._chat.userIsModerator())&&(a+="

        "+t.commands[n].name+" - "+t.commands[n].help+"

        ");t.info(a,"Chat Help"),e.type="command"},name:"/help",help:"Display this message."}),self.addCommand({match:/^\/me\s/,func:function(e){e.content=e.content.replace(/^\/me/,""),e.type="activity"},name:"/me ",help:"Your name will appear followed by any text you write."}),self.addCommand({match:/^\/whoami$/,func:function(e,t){var a='You are "'+t._user.name+'", ';a+=t._user.isStaff?"a staffer.":t._user.isModerator?"a moderator.":t._user.isGuest?"an anonymous guest user.":"a normal user.",t.info(a,"Who Am I?"),e.type="command"},name:"/whoami",help:"Display your name."}),self.addCommand({match:/^\/leave$/,func:function(e,t){t._chat.leaveRoom(e.roomId),e.type="command"},name:"/leave",help:"Leave the current room."}),self.addCommand({match:/^\/topic\s/,func:function(e,t){var a=e.content.replace(/^\/topic\s+/,"");if(e.content.match(/\w+/)){var n=t._chat._roomRef.child(e.roomId);n.transaction(function(i){"official"==i.type?t.error("Cannot modify the topic of an official room."):(n.child("name").set(a),t._chat.sendMessage(e.roomId,'changed the topic to "'+a+'".',"activity"))})}e.type="command"},name:"/topic ",help:"Change the name of the room.",moderatorOnly:!0})},_bindUIEvents:function(){this._bindForRoomList(),this._bindForUserRoomList(),this._bindForUserSearch(),this._bindForUserMuting(),this._bindForChatInvites(),this._bindForRoomListing(),this._bindForRoomNotification(),this._setupTabs(),this._bindTextInputFieldLimits()},_bindDataEvents:function(){this._chat.on("user-update",this._onUpdateUser.bind(this)),this._chat.on("room-enter",this._onEnterRoom.bind(this)),this._chat.on("room-create",this._onCreateRoom.bind(this)),this._chat.on("room-changed",this._onRoomChanged.bind(this)),this._chat.on("room-exit",this._onLeaveRoom.bind(this)),this._chat.on("message-add",this._onNewMessage.bind(this)),this._chat.on("message-remove",this._onRemoveMessage.bind(this)),this._chat.on("room-invite",this._onChatInvite.bind(this)),this._chat.on("room-invite-response",this._onChatInviteResponse.bind(this)),this._chat.on("notification",this._onNotification.bind(this))},_renderLayout:function(){var t=ChiselchatDefaultTemplates["templates/layout-full.html"];e(this._el).html(t({maxLengthUsername:this.maxLengthUsername,maxLengthRoomName:this.maxLengthRoomName,isModerator:this._chat.userIsModerator(),isStaff:this._chat.userIsStaff()}))},_onUpdateUser:function(t){this._user=t;var a=this._user.muted||{};e('[data-event="chiselchat-user-mute-toggle"]').each(function(){var t=e(this).closest("[data-user-id]").data("user-id");e(this).toggleClass("chiselchat-muted",!!a[t])});for(var n in a)e('.message[data-user-id="'+n+'"]').fadeOut()},_onEnterRoom:function(e){this.attachTab(e.id,e.name)},_onRoomChanged:function(t){e('#chiselchat-tab-list li[data-room-id="'+t.id+'"] a .chiselchat-tab-text').html(t.name),e('[data-room-id="'+t.id+'"] .chiselchat-title-text').html(t.name)},_onCreateRoom:function(e){self=this,"public"==e.type&&self.info('A new public chatroom called "'+e.name+'" has been created.',"New Public Room")},_onLeaveRoom:function(e){this.removeTab(e),this._roomQueue.length>0&&this._chat.enterRoom(this._roomQueue.shift(e))},_onNewMessage:function(t,a){var n=a.userId,i=this;this._user&&this._user.muted&&this._user.muted[n]||(i.showMessage(t,a),this._chat.lookupUser(n,function(t){var n=e('div[data-message-id="'+a.id+'"]');t.profileUri&&(n.find(".chiselchat-avatar > a").attr("href",t.profileUri),n.find(".chiselchat-user > a").attr("href",t.profileUri)),t.avatarUri&&n.find(".chiselchat-avatar img").attr("src",t.avatarUri),t.isGuest&&n.find(".chiselchat-user > a").addClass("chiselchat-guest"),t.isModerator&&n.find(".chiselchat-user > a").addClass("chiselchat-moderator"),t.isStaff&&n.find(".chiselchat-user > a").addClass("chiselchat-staff")}))},_onRemoveMessage:function(e,t){this.removeMessage(e,t)},_onChatInvite:function(e){var t=this;t.confirm(e.fromUserName+" invited you to join "+e.toRoomName,"Invitation",function(){return t._chat.acceptInvite(e.id,function(e){e instanceof Error||t.focusTab(e.roomId)}),!1},function(){return t._chat.declineInvite(e.id),!1})},_onChatInviteResponse:function(t){if(t.status){var a=this;t.status&&"accepted"===t.status?(a.success(t.toUserName+" accepted your invite.","Invitation Accepted"),this._chat.getRoom(t.roomId,function(n){var i=e('#chiselchat-tab-list li[data-room-id="'+t.roomId+'"]');i.length||(a.autoFocusTab=!0,a.attachTab(t.roomId,n.name))})):a.error(t.toUserName+" declined your invite.","Invitation Declined")}},_onNotification:function(e){if("warning"===e.notificationType)this.warn("You are being warned for inappropriate messaging. Further violation may result in temporary or permanent ban of service.");else if("suspension"===e.notificationType){var t=e.data.suspendedUntil,a=Math.round((t-(new Date).getTime())/1e3),n="";if(a>0){if(a>7200){var i=Math.floor(a/3600);n=i+" hours, ",a-=3600*i}n+=Math.floor(a/60)+" minutes",this.error("A moderator has suspended you for violating site rules. You cannot send messages for another "+n+".","Suspended")}}}},i.prototype.setUser=function(e){var a=this;e.userName===void 0&&(e.userName=""),e.isModerator===void 0&&(e.isModerator=!1),e.isStaff===void 0&&(e.isStaff=!1),e.isGuest===void 0&&(e.isGuest=!0),e.avatarUri===void 0&&(e.avatarUri=""),e.profileUri===void 0&&(e.profileUri=""),a._chat.setUser(e,function(e){a._user=e,a._chat.userIsModerator()&&a._bindSuperuserUIEvents(),t.setTimeout(function(){a.displayNewMessageCount=!0},1e3),a._chat.resumeSession()})},i.prototype.unsetUser=function(){var e=this;e._chat.unsetUser(),e._user=null,e._roomQueue=[],e.displayNewMessageCount=!1},i.prototype.on=function(e,t){this._chat.on(e,t)},i.prototype._bindSuperuserUIEvents=function(){var t=this,a=function(){var t=e(this),a=t.closest("[data-message-id]").data("message-id"),n=e('[data-message-id="'+a+'"]').closest("[data-user-id]").data("user-id"),i=e('[data-message-id="'+a+'"]').closest("[data-room-id]").data("room-id");return{messageId:a,userId:n,roomId:i}};e(document).delegate('[data-event="chiselchat-user-warn"]',"click",function(e){var n=a.call(this,e);t._chat.warnUser(n.userId),t._chat.getUserNameById(n.userId,function(e){t._chat.sendMessage(n.roomId,"warned "+e.val()+".","activity")})}),e(document).delegate('[data-event="chiselchat-user-suspend-hour"]',"click",function(e){var n=a.call(this,e);t._chat.suspendUser(n.userId,3600),t._chat.getUserNameById(n.userId,function(e){t._chat.sendMessage(n.roomId,"suspended "+e.val()+" for 1 hour.","activity")})}),e(document).delegate('[data-event="chiselchat-user-suspend-day"]',"click",function(e){var n=a.call(this,e);t._chat.suspendUser(n.userId,86400),t._chat.getUserNameById(n.userId,function(e){t._chat.sendMessage(n.roomId,"suspended "+e.val()+" for 1 day.","activity")})}),e(document).delegate('[data-event="chiselchat-message-delete"]',"click",function(e){var n=a.call(this,e);t._chat.deleteMessage(n.roomId,n.messageId)})},i.prototype._bindForRoomList=function(){var t=this;e("#chiselchat-room-tab").bind("click",function(){var a=(e(this),ChiselchatDefaultTemplates["templates/room-list-item.html"]),n=function(){var a=e(this).parent(),n=a.data("room-id"),i=a.data("room-name");return t.$messages[n]?t.focusTab(n):(t.autoFocusTab=!0,t._chat.enterRoom(n,i)),!1};deleteRoom=function(){var a=e(this).closest("li"),n=a.data("room-id");t._chat.removeRoom(n),a.remove()},t._chat.getRoomList(function(i){t.$roomList.empty();for(var s in i){var r=i[s];if("private"!=r.type){r.isRoomOpen=!!t.$messages[r.id],r.userIsModerator=t._chat.userIsModerator();var o=e(a(r));o.children(".chiselchat-room-list-item").bind("click",n),o.children(".chiselchat-delete-room").bind("click",deleteRoom),t.$roomList.append(o.toggle(!0))}}})})},i.prototype._bindForUserRoomList=function(){var t=this;e(document).delegate('[data-event="chiselchat-user-room-list-btn"]',"click",function(a){a.stopPropagation();var n=e(this),i=n.closest("[data-room-id]").data("room-id"),s=ChiselchatDefaultTemplates["templates/room-user-list-item.html"],r=n.data("target"),o=e("#"+r);o.empty(),t._chat.getUsersByRoom(i,function(a){for(var n in a)user=a[n],user.disableActions=!t._user||user.id===t._user.id,user.nameTrimmed=t.trimWithEllipsis(user.name,t.maxLengthUsernameDisplay),user.isMuted=t._user&&t._user.muted&&t._user.muted[user.id],o.append(e(s(user)));t.sortListLexicographically("#"+r)})})},i.prototype._bindForUserSearch=function(){var t=this,a=function(t){var a=e(this),i=a.data("target"),s=a.data("controls"),r=a.data("template"),o=a.val()||a.data("prefix")||"",c=a.data("startAt")||null,l=a.data("endAt")||null;t.preventDefault(),n(i,r,s,o,c,l)},n=function(a,n,i,s,r,o){var c=e("#"+a),l=ChiselchatDefaultTemplates[n];t._chat.getUsersByPrefix(s,r,o,t.maxUserSearchResults,function(e){var a,n,i,s=0;c.empty();for(a in e){var r=e[a];if(r.disableActions=!t._user||r.id===t._user.id,s+=1,c.append(l(r)),1===s)n=r.name.toLowerCase();else if(s>=t.maxUserSearchResults){i=r.name.toLowerCase();break}}})};e(document).delegate('[data-event="chiselchat-user-search"]',"keyup",a),e(document).delegate('[data-event="chiselchat-user-search"]',"click",a),e(document).delegate("#chiselchat-user-search-form","submit",a),e(document).delegate("#chiselchat-presence-tab","click",function(t){t.stopPropagation();var a=e("#chiselchat-user-search-form").find("input");a.focus(),a.trigger(jQuery.Event("keyup"))})},i.prototype._bindForUserMuting=function(){var t=this;e(document).delegate('[data-event="chiselchat-user-mute-toggle"]',"click",function(a){var n=e(this),i=n.closest("[data-user-id]").data("user-id"),s=n.closest("[data-user-name]").data("user-name"),r=n.hasClass("chiselchat-muted");a.preventDefault(),t._chat.toggleUserMute(i,function(e){e?t.error(e.message):r?(t.success(s+" has been unmuted.","User Unmuted"),n.html("Mute")):(t.error(s+" has been muted.","User Muted"),n.html("Unmute"))})})},i.prototype._bindForChatInvites=function(){var t=this,a=function(){var a=e(this),n=a.closest("[data-user-id]").data("user-id"),i=a.closest("[data-room-id]").data("room-id"),s=a.closest("[data-user-name]").data("user-name");return t._chat.getRoom(i,function(e){t._chat.inviteUser(n,i,e.name),t.info(s+" invited.")}),!1},n=function(){var a=e(this),n=a.closest("[data-user-id]").data("user-id"),i=a.closest("[data-user-name]").data("user-name");if(n&&i){var s="Private Chat";t.autoFocusTab=!0,t._chat.createRoom(s,"private",function(e){t._chat.inviteUser(n,e,s),t.info(i+" invited.")})}return!1};e(document).delegate('[data-event="chiselchat-user-chat"]',"click",n),e(document).delegate('[data-event="chiselchat-user-invite"]',"click",a)},i.prototype._bindForRoomNotification=function(){var t=this,a=function(){var a=e(this),n=a.data("room-id"),i=a.data("room-name");return t.autoFocusTab=!0,t._chat.enterRoom(n,i),!1};e(document).delegate('[data-event="chiselchat-room-notification"]',"click",a)},i.prototype._bindForRoomListing=function(){var t=this;e("#chiselchat-create-room").bind("submit",function(){var a=e("#chiselchat-input-room-name").val();return e("#chiselchat-input-room-name").val(""),a.length?(t.autoFocusTab=!0,t._chat.createRoom(a)):t.error("Room name must be specified."),!1})},i.prototype._setupTabs=function(){var a=this,i=function(t){t.parent("li").removeClass("active"),e("#chiselchat-tab-content .chiselchat-tab-pane").removeClass("active"),a.resetNewMessageCount(t.parent("li").attr("data-room-id"))},s=function(t){var n,i,s=t,o=s.closest("ul"),c=s.attr("data-target"),l=o.find(".active:last a")[0];c||(c=s.attr("href"),c=c&&c.replace(/.*(?=#[^\s]*$)/,"")),a.resetNewMessageCount(e(l).parent("li").attr("data-room-id")),s.parent("li").hasClass("active")||(i=e.Event("show",{relatedTarget:l}),s.trigger(i),i.isDefaultPrevented()||(n=e(c),r(s.parent("li"),o),r(n,n.parent(),function(){s.trigger({type:"shown",relatedTarget:l})}),n.find(".chiselchat-history").css("height",n.height()-a.messageHistoryScrollHeight+"px")))},r=function(e,t,n){var i=t.find("> .active");i.removeClass("active").removeClass("fullscreen"),e.addClass("active"),a.fullScreenTab&&e.addClass("fullscreen"),n&&n()};e(document).delegate('[chisel-toggle="tab"]',"click",function(t){t.preventDefault();var a=e(this);a.parent("li").hasClass("active")?i(a):s(a)}),e(document).delegate('[data-event="chiselchat-minimize-pane"]',"click",function(){var t=e(this).closest("[data-room-id]").data("room-id");return i(e('#chiselchat-tab-list li[data-room-id="'+t+'"] a, #chiselchat-room-tab a, #chiselchat-presence-tab a')),!1}),e(document).delegate('[data-event="chiselchat-close-tab"]',"click",function(){var t=e(this).closest("[data-room-id]").data("room-id");return a._chat.leaveRoom(t),!1}),e(document).delegate('[data-event="chiselchat-toggle-pane-size"]',"click",function(){return a.fullScreenTab?(a.fullScreenTab=!1,e(this).closest(".chiselchat-tab-pane").removeClass("fullscreen")):(e(this).closest(".chiselchat-tab-pane").addClass("fullscreen"),a.fullScreenTab=!0),e(t).trigger("resize"),!1}),e(document).delegate('[data-event="chiselchat-toggle-sound"]',"click",function(){var t=e(".chiselchat-sound-control");return a.playSounds?(a.playSounds=!1,n("chiselchat-playSounds",!1,30),t.removeClass("chiselchat-glyphicon-volume-up"),t.addClass("chiselchat-glyphicon-volume-off")):(a.playSounds=!0,n("chiselchat-playSounds",!0,30),t.addClass("chiselchat-glyphicon-volume-up"),t.removeClass("chiselchat-glyphicon-volume-off")),!1})},i.prototype._bindTextInputFieldLimits=function(){e("body").delegate('input[data-provide="limit"], textarea[data-provide="limit"]',"keyup",function(){var t=e(this),a=e(t.data("counter")),n=t.attr("maxlength"),i=t.val().length;a.html(Math.max(0,n-i))})},i.prototype.confirm=function(e,t,a,n){new PNotify({title:t||"Confirmation Needed",text:e,addclass:"chiselchat-alert",type:"info",icon:"chiselchat-glyphicon chiselchat-glyphicon-question-sign",hide:!1,confirm:{confirm:!0},buttons:{closer:!1,sticker:!1},history:{history:!1}}).get().on("pnotify.confirm",function(){a()}).on("pnotify.cancel",function(){n()})},i.prototype.warn=function(e,t){new PNotify({addclass:"chiselchat-alert",title:t||"Warning",text:e,icon:"chiselchat-glyphicon chiselchat-glyphicon-exclamation-sign",opacity:.95,history:!1,sticker:!1})},i.prototype.info=function(e,t){new PNotify({addclass:"chiselchat-alert",type:"info",title:t||"Info",text:e,icon:"chiselchat-glyphicon chiselchat-glyphicon-info-sign",opacity:.95,history:!1,sticker:!1})},i.prototype.error=function(e,t){new PNotify({addclass:"chiselchat-alert",type:"error",title:t||"Error",text:e,icon:"chiselchat-glyphicon chiselchat-glyphicon-warning-sign",opacity:.95,history:!1,sticker:!1})},i.prototype.success=function(e,t){new PNotify({addclass:"chiselchat-alert",type:"success",title:t||"Success",text:e,icon:"chiselchat-glyphicon chiselchat-glyphicon-ok-sign",opacity:.95,history:!1,sticker:!1})},i.prototype.addCommand=function(e){self=this,self.commands.push(e)},i.prototype.executeCommands=function(e){var t=this;for(var a in t.commands){var n=t.commands[a];if(e.content.match(n.match)){if(n.moderatorOnly&&!t._chat.userIsModerator())continue;n.func(e,t)}}},i.prototype.resetNewMessageCount=function(e){t.cancelFlashTitle();var a=this.$tabList.find("[data-room-id="+e+"]").find("a");if(a.length){var n=a.first().children(".chiselchat-new-count");n.html("0"),n.removeClass("chiselchat-new-count-alert")}},i.prototype.toggleInputs=function(t){e("#chiselchat-tab-content textarea").each(function(){var a=e(this);t?e(this).val(""):e(this).val("You have exceeded the message limit, please wait before sending."),a.prop("disabled",!t)}),e("#chiselchat-input-name").prop("disabled",!t)},i.prototype.attachTab=function(a,n){var i=this;if(this.$messages[a])return this.focusTab(a),void 0;var s={id:a,name:n},r=ChiselchatDefaultTemplates["templates/tab-content.html"],o=e(r(s));this.$tabContent.prepend(o);var c=e("#chiselchat-messages"+a);this.$messages[a]=c;var l=o.find("textarea").first();l.bind("keydown",function(e){var t={content:i.trimWithEllipsis(l.val(),i.maxLengthMessage),type:"default",roomId:a};if(13===e.which&&""!==t.content){if(e.shiftKey){var n=this.value;if("number"==typeof this.selectionStart&&"number"==typeof this.selectionEnd){var s=this.selectionStart;this.value=n.slice(0,s)+"\n"+n.slice(this.selectionEnd),this.selectionStart=this.selectionEnd=s+1}else if(document.selection&&document.selection.createRange){this.focus();var r=document.selection.createRange();r.text="\r\n",r.collapse(!1),r.select()}}else l.val(""),i.executeCommands(t),("activity"==t.type||"default"==t.type)&&i._chat.sendMessage(t.roomId,t.content,t.type,function(e){e&&i.error("You are not allowed to post messages right now.")});return!1}});var u=ChiselchatDefaultTemplates["templates/tab-menu-item.html"],h=e(u(s));this.$tabList.append(h),c.css("height",o.height()-i.messageHistoryScrollHeight+"px"),e(t).resize(function(){c.css("height",o.height()-i.messageHistoryScrollHeight+"px"),c.scrollTop(c[0].scrollHeight)}),h.bind("shown",function(){c.scrollTop(c[0].scrollHeight)}),e("#chiselchat-btn-room-user-list-"+a).bind("click",function(){return i.sortListLexicographically("#chiselchat-room-user-list-"+a),!1}),i.autoFocusTab?(this.focusTab(a),i.autoFocusTab=!1):i.resetNewMessageCount(a),this.playSounds?e(".chiselchat-sound-control").addClass("chiselchat-glyphicon-volume-up"):e(".chiselchat-sound-control").addClass("chiselchat-glyphicon-volume-off")},i.prototype.focusTab=function(e){var t=this;if(t.$messages[e]){var a=t.$tabList.find("[data-room-id="+e+"]").find("a");a.length&&(a.first().trigger("click"),t.resetNewMessageCount(e))}},i.prototype.removeTab=function(e){delete this.$messages[e],this.$tabContent.find("[data-room-id="+e+"]").remove();var t=this.$tabList.find("[data-room-id="+e+"]"),a=t.hasClass("active");t.remove(),a&&this.$tabList.find("[chisel-toggle=tab]").first().trigger("click")},i.prototype.showMessage=function(a,n){var i=this,s={id:n.id,localtime:i.formatTime(n.timestamp),message:n.message||"",userId:n.userId,name:n.name,type:n.type||"default",isSelfMessage:i._user&&n.userId==i._user.id,disableActions:!i._user||n.userId==i._user.id,userIsModerator:i._chat.userIsModerator(),avatarUri:"",profileUri:""};s.message=_.map(s.message.split(" "),function(e){return i.urlPattern.test(e)||i.pseudoUrlPattern.test(e)?i.linkify(encodeURI(e)):_.escape(e)}).join(" "),s.message=i.trimWithEllipsis(s.message,i.maxLengthMessage),s.message=s.message.replace(/\n/g,"
        ");var r=ChiselchatDefaultTemplates["templates/message.html"],o=e(r(s)),c=i.$messages[a];if(c){var l=!1;c.scrollTop()/(c[0].scrollHeight-c[0].offsetHeight)>=.95?l=!0:c[0].scrollHeight<=c.height()&&(l=!0),c.append(o);var u=this.$tabList.find("[data-room-id="+a+"]").find("a");if(u.length&&i.displayNewMessageCount){var h=u.first().children(".chiselchat-new-count");h.html(parseInt(h.html(),10)+1),this.pulse(h,"chiselchat-new-count-alert",{pulses:5,duration:300}),t.flashTitle("New Chat Message!"),this.playNewMessageSound()}l&&c.scrollTop(c[0].scrollHeight)}},i.prototype.removeMessage=function(t,a){e('.chiselchat-message[data-message-id="'+a+'"]').remove()},i.prototype.sortListLexicographically=function(t){e(t).children("li").sort(function(t,a){var n=e(t).text().toUpperCase(),i=e(a).text().toUpperCase();return i>n?-1:n>i?1:0}).appendTo(t)},i.prototype.trimWithEllipsis=function(e,t){return e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),t&&t>=e.length?e:e.substring(0,t)+"..."},i.prototype.formatTime=function(e){var t=e?new Date(e):new Date,a=t.getHours()||12,n=""+t.getMinutes(),i=t.getHours()>=12?"pm":"am";return a=a>12?a-12:a,n=2>n.length?"0"+n:n,""+a+":"+n+i},i.prototype.linkify=function(e){var t=this;return e.replace(t.urlPattern,'$&').replace(t.pseudoUrlPattern,'$1$2')},i.prototype.playNewMessageSound=function(){this.playSounds&&document.getElementById("chiselchat-new-message-sound").play()},i.prototype.pulse=function(a,n,i,s){var r={pulses:1,interval:0,returnDelay:0,duration:500},o="destroy"===n;return"function"==typeof i&&(s=i,i={}),i=e.extend({},r,i),0>i.interval&&(i.interval=0),0>i.returnDelay&&(i.returnDelay=0),0>i.duration&&(i.duration=500),-1>i.pulses&&(i.pulses=1),"function"!=typeof s&&(s=function(){}),a.each(function(){function a(){if(void 0!==r.data("pulse")&&!r.data("pulse").stop){if(i.pulses>-1&&++l>i.pulses)return s.apply(r);r.removeClass(n),t.setTimeout(h.complete,h.duration)}}var r=e(this),c=r.data("pulse")||{};c.stop=o,r.data("pulse",c);var l=0,u=e.extend({},i);u.duration=i.duration/2,u.complete=function(){t.setTimeout(a,i.interval)};var h=e.extend({},i);h.duration=i.duration/2,h.complete=function(){t.setTimeout(function(){r.addClass(n),t.setTimeout(u.complete,u.duration)},i.returnDelay)},a()})}}(jQuery,window,document); \ No newline at end of file +(function(){var e=this,t=e._,a={},n=Array.prototype,i=Object.prototype,s=Function.prototype,r=n.push,o=n.slice,c=n.concat,l=i.toString,u=i.hasOwnProperty,h=n.forEach,d=n.map,f=n.reduce,m=n.reduceRight,p=n.filter,v=n.every,_=n.some,g=n.indexOf,y=n.lastIndexOf,b=Array.isArray,R=Object.keys,C=s.bind,I=function(e){return e instanceof I?e:this instanceof I?(this._wrapped=e,void 0):new I(e)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=I),exports._=I):e._=I,I.VERSION="1.4.4";var M=I.each=I.forEach=function(e,t,n){if(null!=e)if(h&&e.forEach===h)e.forEach(t,n);else if(e.length===+e.length){for(var i=0,s=e.length;s>i;i++)if(t.call(n,e[i],i,e)===a)return}else for(var r in e)if(I.has(e,r)&&t.call(n,e[r],r,e)===a)return};I.map=I.collect=function(e,t,a){var n=[];return null==e?n:d&&e.map===d?e.map(t,a):(M(e,function(e,i,s){n[n.length]=t.call(a,e,i,s)}),n)};var w="Reduce of empty array with no initial value";I.reduce=I.foldl=I.inject=function(e,t,a,n){var i=arguments.length>2;if(null==e&&(e=[]),f&&e.reduce===f)return n&&(t=I.bind(t,n)),i?e.reduce(t,a):e.reduce(t);if(M(e,function(e,s,r){i?a=t.call(n,a,e,s,r):(a=e,i=!0)}),!i)throw new TypeError(w);return a},I.reduceRight=I.foldr=function(e,t,a,n){var i=arguments.length>2;if(null==e&&(e=[]),m&&e.reduceRight===m)return n&&(t=I.bind(t,n)),i?e.reduceRight(t,a):e.reduceRight(t);var s=e.length;if(s!==+s){var r=I.keys(e);s=r.length}if(M(e,function(o,c,l){c=r?r[--s]:--s,i?a=t.call(n,a,e[c],c,l):(a=e[c],i=!0)}),!i)throw new TypeError(w);return a},I.find=I.detect=function(e,t,a){var n;return U(e,function(e,i,s){return t.call(a,e,i,s)?(n=e,!0):void 0}),n},I.filter=I.select=function(e,t,a){var n=[];return null==e?n:p&&e.filter===p?e.filter(t,a):(M(e,function(e,i,s){t.call(a,e,i,s)&&(n[n.length]=e)}),n)},I.reject=function(e,t,a){return I.filter(e,function(e,n,i){return!t.call(a,e,n,i)},a)},I.every=I.all=function(e,t,n){t||(t=I.identity);var i=!0;return null==e?i:v&&e.every===v?e.every(t,n):(M(e,function(e,s,r){return(i=i&&t.call(n,e,s,r))?void 0:a}),!!i)};var U=I.some=I.any=function(e,t,n){t||(t=I.identity);var i=!1;return null==e?i:_&&e.some===_?e.some(t,n):(M(e,function(e,s,r){return i||(i=t.call(n,e,s,r))?a:void 0}),!!i)};I.contains=I.include=function(e,t){return null==e?!1:g&&e.indexOf===g?-1!=e.indexOf(t):U(e,function(e){return e===t})},I.invoke=function(e,t){var a=o.call(arguments,2),n=I.isFunction(t);return I.map(e,function(e){return(n?t:e[t]).apply(e,a)})},I.pluck=function(e,t){return I.map(e,function(e){return e[t]})},I.where=function(e,t,a){return I.isEmpty(t)?a?null:[]:I[a?"find":"filter"](e,function(e){for(var a in t)if(t[a]!==e[a])return!1;return!0})},I.findWhere=function(e,t){return I.where(e,t,!0)},I.max=function(e,t,a){if(!t&&I.isArray(e)&&e[0]===+e[0]&&65535>e.length)return Math.max.apply(Math,e);if(!t&&I.isEmpty(e))return-1/0;var n={computed:-1/0,value:-1/0};return M(e,function(e,i,s){var r=t?t.call(a,e,i,s):e;r>=n.computed&&(n={value:e,computed:r})}),n.value},I.min=function(e,t,a){if(!t&&I.isArray(e)&&e[0]===+e[0]&&65535>e.length)return Math.min.apply(Math,e);if(!t&&I.isEmpty(e))return 1/0;var n={computed:1/0,value:1/0};return M(e,function(e,i,s){var r=t?t.call(a,e,i,s):e;n.computed>r&&(n={value:e,computed:r})}),n.value},I.shuffle=function(e){var t,a=0,n=[];return M(e,function(e){t=I.random(a++),n[a-1]=n[t],n[t]=e}),n};var x=function(e){return I.isFunction(e)?e:function(t){return t[e]}};I.sortBy=function(e,t,a){var n=x(t);return I.pluck(I.map(e,function(e,t,i){return{value:e,index:t,criteria:n.call(a,e,t,i)}}).sort(function(e,t){var a=e.criteria,n=t.criteria;if(a!==n){if(a>n||void 0===a)return 1;if(n>a||void 0===n)return-1}return e.indexs;){var o=s+r>>>1;i>a.call(n,e[o])?s=o+1:r=o}return s},I.toArray=function(e){return e?I.isArray(e)?o.call(e):e.length===+e.length?I.map(e,I.identity):I.values(e):[]},I.size=function(e){return null==e?0:e.length===+e.length?e.length:I.keys(e).length},I.first=I.head=I.take=function(e,t,a){return null==e?void 0:null==t||a?e[0]:o.call(e,0,t)},I.initial=function(e,t,a){return o.call(e,0,e.length-(null==t||a?1:t))},I.last=function(e,t,a){return null==e?void 0:null==t||a?e[e.length-1]:o.call(e,Math.max(e.length-t,0))},I.rest=I.tail=I.drop=function(e,t,a){return o.call(e,null==t||a?1:t)},I.compact=function(e){return I.filter(e,I.identity)};var T=function(e,t,a){return M(e,function(e){I.isArray(e)?t?r.apply(a,e):T(e,t,a):a.push(e)}),a};I.flatten=function(e,t){return T(e,t,[])},I.without=function(e){return I.difference(e,o.call(arguments,1))},I.uniq=I.unique=function(e,t,a,n){I.isFunction(t)&&(n=a,a=t,t=!1);var i=a?I.map(e,a,n):e,s=[],r=[];return M(i,function(a,n){(t?n&&r[r.length-1]===a:I.contains(r,a))||(r.push(a),s.push(e[n]))}),s},I.union=function(){return I.uniq(c.apply(n,arguments))},I.intersection=function(e){var t=o.call(arguments,1);return I.filter(I.uniq(e),function(e){return I.every(t,function(t){return I.indexOf(t,e)>=0})})},I.difference=function(e){var t=c.apply(n,o.call(arguments,1));return I.filter(e,function(e){return!I.contains(t,e)})},I.zip=function(){for(var e=o.call(arguments),t=I.max(I.pluck(e,"length")),a=Array(t),n=0;t>n;n++)a[n]=I.pluck(e,""+n);return a},I.object=function(e,t){if(null==e)return{};for(var a={},n=0,i=e.length;i>n;n++)t?a[e[n]]=t[n]:a[e[n][0]]=e[n][1];return a},I.indexOf=function(e,t,a){if(null==e)return-1;var n=0,i=e.length;if(a){if("number"!=typeof a)return n=I.sortedIndex(e,t),e[n]===t?n:-1;n=0>a?Math.max(0,i+a):a}if(g&&e.indexOf===g)return e.indexOf(t,a);for(;i>n;n++)if(e[n]===t)return n;return-1},I.lastIndexOf=function(e,t,a){if(null==e)return-1;var n=null!=a;if(y&&e.lastIndexOf===y)return n?e.lastIndexOf(t,a):e.lastIndexOf(t);for(var i=n?a:e.length;i--;)if(e[i]===t)return i;return-1},I.range=function(e,t,a){1>=arguments.length&&(t=e||0,e=0),a=arguments[2]||1;for(var n=Math.max(Math.ceil((t-e)/a),0),i=0,s=Array(n);n>i;)s[i++]=e,e+=a;return s},I.bind=function(e,t){if(e.bind===C&&C)return C.apply(e,o.call(arguments,1));var a=o.call(arguments,2);return function(){return e.apply(t,a.concat(o.call(arguments)))}},I.partial=function(e){var t=o.call(arguments,1);return function(){return e.apply(this,t.concat(o.call(arguments)))}},I.bindAll=function(e){var t=o.call(arguments,1);return 0===t.length&&(t=I.functions(e)),M(t,function(t){e[t]=I.bind(e[t],e)}),e},I.memoize=function(e,t){var a={};return t||(t=I.identity),function(){var n=t.apply(this,arguments);return I.has(a,n)?a[n]:a[n]=e.apply(this,arguments)}},I.delay=function(e,t){var a=o.call(arguments,2);return setTimeout(function(){return e.apply(null,a)},t)},I.defer=function(e){return I.delay.apply(I,[e,1].concat(o.call(arguments,1)))},I.throttle=function(e,t){var a,n,i,s,r=0,o=function(){r=new Date,i=null,s=e.apply(a,n)};return function(){var c=new Date,l=t-(c-r);return a=this,n=arguments,0>=l?(clearTimeout(i),i=null,r=c,s=e.apply(a,n)):i||(i=setTimeout(o,l)),s}},I.debounce=function(e,t,a){var n,i;return function(){var s=this,r=arguments,o=function(){n=null,a||(i=e.apply(s,r))},c=a&&!n;return clearTimeout(n),n=setTimeout(o,t),c&&(i=e.apply(s,r)),i}},I.once=function(e){var t,a=!1;return function(){return a?t:(a=!0,t=e.apply(this,arguments),e=null,t)}},I.wrap=function(e,t){return function(){var a=[e];return r.apply(a,arguments),t.apply(this,a)}},I.compose=function(){var e=arguments;return function(){for(var t=arguments,a=e.length-1;a>=0;a--)t=[e[a].apply(this,t)];return t[0]}},I.after=function(e,t){return 0>=e?t():function(){return 1>--e?t.apply(this,arguments):void 0}},I.keys=R||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var a in e)I.has(e,a)&&(t[t.length]=a);return t},I.values=function(e){var t=[];for(var a in e)I.has(e,a)&&t.push(e[a]);return t},I.pairs=function(e){var t=[];for(var a in e)I.has(e,a)&&t.push([a,e[a]]);return t},I.invert=function(e){var t={};for(var a in e)I.has(e,a)&&(t[e[a]]=a);return t},I.functions=I.methods=function(e){var t=[];for(var a in e)I.isFunction(e[a])&&t.push(a);return t.sort()},I.extend=function(e){return M(o.call(arguments,1),function(t){if(t)for(var a in t)e[a]=t[a]}),e},I.pick=function(e){var t={},a=c.apply(n,o.call(arguments,1));return M(a,function(a){a in e&&(t[a]=e[a])}),t},I.omit=function(e){var t={},a=c.apply(n,o.call(arguments,1));for(var i in e)I.contains(a,i)||(t[i]=e[i]);return t},I.defaults=function(e){return M(o.call(arguments,1),function(t){if(t)for(var a in t)null==e[a]&&(e[a]=t[a])}),e},I.clone=function(e){return I.isObject(e)?I.isArray(e)?e.slice():I.extend({},e):e},I.tap=function(e,t){return t(e),e};var k=function(e,t,a,n){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;e instanceof I&&(e=e._wrapped),t instanceof I&&(t=t._wrapped);var i=l.call(e);if(i!=l.call(t))return!1;switch(i){case"[object String]":return e==t+"";case"[object Number]":return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if("object"!=typeof e||"object"!=typeof t)return!1;for(var s=a.length;s--;)if(a[s]==e)return n[s]==t;a.push(e),n.push(t);var r=0,o=!0;if("[object Array]"==i){if(r=e.length,o=r==t.length)for(;r--&&(o=k(e[r],t[r],a,n)););}else{var c=e.constructor,u=t.constructor;if(c!==u&&!(I.isFunction(c)&&c instanceof c&&I.isFunction(u)&&u instanceof u))return!1;for(var h in e)if(I.has(e,h)&&(r++,!(o=I.has(t,h)&&k(e[h],t[h],a,n))))break;if(o){for(h in t)if(I.has(t,h)&&!r--)break;o=!r}}return a.pop(),n.pop(),o};I.isEqual=function(e,t){return k(e,t,[],[])},I.isEmpty=function(e){if(null==e)return!0;if(I.isArray(e)||I.isString(e))return 0===e.length;for(var t in e)if(I.has(e,t))return!1;return!0},I.isElement=function(e){return!(!e||1!==e.nodeType)},I.isArray=b||function(e){return"[object Array]"==l.call(e)},I.isObject=function(e){return e===Object(e)},M(["Arguments","Function","String","Number","Date","RegExp"],function(e){I["is"+e]=function(t){return l.call(t)=="[object "+e+"]"}}),I.isArguments(arguments)||(I.isArguments=function(e){return!(!e||!I.has(e,"callee"))}),true&&(I.isFunction=function(e){return"function"==typeof e}),I.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},I.isNaN=function(e){return I.isNumber(e)&&e!=+e},I.isBoolean=function(e){return e===!0||e===!1||"[object Boolean]"==l.call(e)},I.isNull=function(e){return null===e},I.isUndefined=function(e){return void 0===e},I.has=function(e,t){return u.call(e,t)},I.noConflict=function(){return e._=t,this},I.identity=function(e){return e},I.times=function(e,t,a){for(var n=Array(e),i=0;e>i;i++)n[i]=t.call(a,i);return n},I.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))};var N={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};N.unescape=I.invert(N.escape);var E={escape:RegExp("["+I.keys(N.escape).join("")+"]","g"),unescape:RegExp("("+I.keys(N.unescape).join("|")+")","g")};I.each(["escape","unescape"],function(e){I[e]=function(t){return null==t?"":(""+t).replace(E[e],function(t){return N[e][t]})}}),I.result=function(e,t){if(null==e)return null;var a=e[t];return I.isFunction(a)?a.call(e):a},I.mixin=function(e){M(I.functions(e),function(t){var a=I[t]=e[t];I.prototype[t]=function(){var e=[this._wrapped];return r.apply(e,arguments),P.call(this,a.apply(I,e))}})};var S=0;I.uniqueId=function(e){var t=++S+"";return e?e+t:t},I.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var A=/(.)^/,L={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;I.template=function(e,t,a){var n;a=I.defaults({},a,I.templateSettings);var i=RegExp([(a.escape||A).source,(a.interpolate||A).source,(a.evaluate||A).source].join("|")+"|$","g"),s=0,r="__p+='";e.replace(i,function(t,a,n,i,o){return r+=e.slice(s,o).replace(D,function(e){return"\\"+L[e]}),a&&(r+="'+\n((__t=("+a+"))==null?'':_.escape(__t))+\n'"),n&&(r+="'+\n((__t=("+n+"))==null?'':__t)+\n'"),i&&(r+="';\n"+i+"\n__p+='"),s=o+t.length,t}),r+="';\n",a.variable||(r="with(obj||{}){\n"+r+"}\n"),r="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+r+"return __p;\n";try{n=Function(a.variable||"obj","_",r)}catch(o){throw o.source=r,o}if(t)return n(t,I);var c=function(e){return n.call(this,e,I)};return c.source="function("+(a.variable||"obj")+"){\n"+r+"}",c},I.chain=function(e){return I(e).chain()};var P=function(e){return this._chain?I(e).chain():e};I.mixin(I),M(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=n[e];I.prototype[e]=function(){var a=this._wrapped;return t.apply(a,arguments),"shift"!=e&&"splice"!=e||0!==a.length||delete a[0],P.call(this,a)}}),M(["concat","join","slice"],function(e){var t=n[e];I.prototype[e]=function(){return P.call(this,t.apply(this._wrapped,arguments))}}),I.extend(I.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this),this.ChiselchatDefaultTemplates=this.ChiselchatDefaultTemplates||{},this.ChiselchatDefaultTemplates["templates/layout-full.html"]=function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+="
        \n\n
        \n
        \n
        \nPeople\n\n_\n▀\n\n
        \n
        \n\n
        \n
        \n
        \n
        \n
        \nRooms\n\n_\n▀\n\n
        \n
        \n\n
        \n
          \n
          \n
          \n
          \n
          ";return __p},this.ChiselchatDefaultTemplates["templates/layout-popout.html"]=function(obj){obj||(obj={});var __p="";with(_.escape,obj)__p+="
          \n
          \n\n
          \n
          \n
          ";return __p},this.ChiselchatDefaultTemplates["templates/message.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(Array.prototype.join,obj)__p+="
          \n
          \n\n
          "+__e(localtime)+"
          \n
          \n
          "+__e(name)+"\n \n\n",disableActions||(__p+="\nPM\nMute\n",userIsModerator&&(__p+="\nWarn\nBan (hour)\nBan (day)\n"),__p+="\n"),__p+="\n\n
          \n
          \n"+(null==(__t=message)?"":__t)+"\n",userIsModerator&&(__p+="\n ×\n"),__p+="\n
          \n
          ";return __p},this.ChiselchatDefaultTemplates["templates/room-list-item.html"]=function(obj){obj||(obj={});var __p="",__e=_.escape;with(Array.prototype.join,obj)__p+="
        • \n"+__e(name)+"\n","official"!=type&&(__p+="\n",userIsModerator&&(__p+="\n×\n"),__p+="\n"),__p+="\n
        • ";return __p},this.ChiselchatDefaultTemplates["templates/room-user-list-item.html"]=function(obj){obj||(obj={});var __p="",__e=_.escape;with(Array.prototype.join,obj)__p+="
        • \n\n"+__e(name)+"\n\n",disableActions||(__p+="\n\n",__p+=isMuted?"Unmute":"Mute",__p+="\nPM\n\n"),__p+="\n
        • ";return __p},this.ChiselchatDefaultTemplates["templates/room-user-search-list-item.html"]=function(obj){obj||(obj={});var __p="",__e=_.escape;with(Array.prototype.join,obj)__p+="
        • \n\n",__p+=disableActions?"\n"+__e(name)+"\n":"\n"+__e(name)+"\n+\n",__p+="\n\n
        • ";return __p},this.ChiselchatDefaultTemplates["templates/tab-content.html"]=function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+="
          \n
          \n'+__e(name)+"\n\n_\n▀\n×\n\n
          \n
          \n
          \n\n
            \nInvite\n\n
            \n
              \n
              \n
              \n
              \n
              \n\n
              \n
              ";return __p},this.ChiselchatDefaultTemplates["templates/tab-menu-item.html"]=function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+="
            • \n"+__e(name)+" 0\n
            • ";return __p},this.ChiselchatDefaultTemplates["templates/user-search-list-item.html"]=function(obj){obj||(obj={});var __p="",__e=_.escape;with(Array.prototype.join,obj)__p+="
            • \n",__p+=disableActions?"\n"+__e(name)+"\n":"\n"+__e(name)+"\nPM\n",__p+="\n\n
            • ";return __p},function(){Function.prototype.bind||(Function.prototype.bind=function(e){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),a=this,n=function(){},i=function(){return a.apply(this instanceof n&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};return n.prototype=this.prototype,i.prototype=new n,i}),Object.keys=Object.keys||function(e){var t=[];for(var a in e)e.hasOwnProperty(a)&&t.push(a);return t}}(),function(e){function t(e,t){this._firebase=e,this._user=null,this._userId=null,this._userName=null,this._avatarUri="",this._profileUri="",this._isModerator=!1,this._isStaff=!1,this._isGuest=!1,this._sessionId=null,this._events={},this._rooms={},this._presenceBits={},this._userRef=null,this._messageRef=this._firebase.child("room-messages"),this._roomRef=this._firebase.child("room-metadata"),this._privateRoomRef=this._firebase.child("room-private-metadata"),this._moderatorsRef=this._firebase.child("moderators"),this._suspensionsRef=this._firebase.child("suspensions"),this._usersOnlineRef=this._firebase.child("user-names-online"),this._guestNameList=["Arnold","Burton","Cal","Caroline","Peabody","Pubert","Gomez","Morticia","Wednesday","Uncle Fester","Pugsly","Greggory","Greg","Bruce","Jean Claude","Herobrine","Cake","Lilith","Penelope","Rhiannon","Medusa","Sally","Barry","Elmer","Gretel","Chris","David","Donald","Dude","Dudette","Ernest","Esther","Fern","Gertrude","Gus","Hazel","Isobel","Kevin","Malcolm","Neville","Oscar","Paul","Quentin","Rupert","Simon","Thom","Vern","Wally","Trudy","Bertha","Abernathy","Adolf","Attila","Kurt","Helen","Marv","Magda","Hansel","Mort","Gunther","Dreshawn","Percy","Shaneekwa","Ronald","Tyquasia","Tallulah","Margot","Ennis","Roscoe","Heloise","Eunice","Cecil","Bueford","Eustace","Baxter","Tiara","Garland","Judy","Cooter","Daisy","Cletus","Crystal","Martha","Jesse","Bo","Luke","Martha","Jefferson","Martha","Albert","Beauregard","Al","Peggy","Bud","Kelly","Igor","Boris","Natasha","Moose","Squirrel","Fannie","Chuck","Dennis","Hamish","Angus","Tate","Mildred","Waldo","Stewart","Horace","Jean Luc","William","Beverly","Data","Geordi","Worf","Deanna","James","Spock","Leonard","Pavel","Hickaru","Nyota","Wesley","Laren","Miles","Keiko","Montgomery","Christine","Janice"],this._options=t||{},this._chatter_cache={},this._options.numMaxMessages=this._options.numMaxMessages||50}var a=this,n=a.Chiselchat;t.noConflict=function(){return a.Chiselchat=n,t},a.Chiselchat=t,t.prototype={_loadUserMetadata:function(e){var t=this;this._userRef.transaction(function(e){var a={id:t._userId,name:t._userName,avatarUri:t._avatarUri,profileUri:t._profileUri,isModerator:t._isModerator,isStaff:t._isStaff,isGuest:t._isGuest};return e&&(e.rooms&&(a.rooms=e.rooms),e.sessions&&(a.sessions=e.sessions),e.muted&&(a.muted=e.muted)),a.isGuest&&(e&&""!==e.name&&void 0!==e.name?(t._userName=e.name,a.name=e.name,console.log("using existing guest name "+a.name)):(a.name="Guest "+t._guestNameList[Math.floor(Math.random()*t._guestNameList.length)],t._userName=a.name,console.log("setting guest name to "+a.name))),a},function(n,i,s){n?console.warn(n):(t._user=s.val(),t._chatter_cache[t._user.id]=t._user,t._moderatorsRef.child(t._userId).once("value",function(n){t._isModerator=!!n.val(),a.setTimeout(e,0)}))},!1)},_setupDataEvents:function(){this._firebase.root().child(".info/connected").on("value",function(e){if(e.val()===!0)for(var t=0;this._presenceBits>t;t++){var a=this._presenceBits[t],n=this._firebase.root().child(a.ref);n.onDisconnect().set(a.offlineValue),n.set(a.onlineValue)}},this);var e=this._userRef.child("sessions").push();this._sessionId=e.name(),this._queuePresenceOperation(e,!0,null);var t=this._usersOnlineRef.child(this._userName.toLowerCase()),a=t.child(this._sessionId);this._queuePresenceOperation(a,{id:this._userId,name:this._userName},null),this._userRef.on("value",this._onUpdateUser,this),this._userRef.child("invites").on("child_added",this._onChiselchatInvite,this),this._userRef.child("notifications").on("child_added",this._onNotification,this);var n=this;this._roomRef.on("child_removed",function(e){n.leaveRoom(e.name())}),this._roomRef.startAt(Date.now()).on("child_added",function(e){this._onCreateRoom(e)},this),n._roomRef.on("child_changed",function(e){n._invokeEventCallbacks("room-changed",e.val())})},_addEventCallback:function(e,t){this._events[e]=this._events[e]||[],this._events[e].push(t)},_getEventCallbacks:function(e){return this._events.hasOwnProperty(e)?this._events[e]:[]},_invokeEventCallbacks:function(e){var t=[],a=this._getEventCallbacks(e);Array.prototype.push.apply(t,arguments),t=t.slice(1);for(var n=0;a.length>n;n+=1)a[n].apply(null,t)},_queuePresenceOperation:function(e,t,a){e.onDisconnect().set(a),e.set(t),this._presenceBits[""+e]={ref:e,onlineValue:t,offlineValue:a}},_removePresenceOperation:function(t,a){var n=new e(t);n.onDisconnect().cancel(),n.set(a),delete this._presenceBits[t]},_onUpdateUser:function(e){this._user=e.val(),this._invokeEventCallbacks("user-update",this._user)},_onCreateRoom:function(e){var t=e.val();this._invokeEventCallbacks("room-create",t)},_onAuthRequired:function(){this._invokeEventCallbacks("auth-required")},_onEnterRoom:function(e){this._invokeEventCallbacks("room-enter",e)},_onNewMessage:function(e,t){var a=t.val();a.id=t.name(),this._invokeEventCallbacks("message-add",e,a)},_onRemoveMessage:function(e,t){var a=t.name();this._invokeEventCallbacks("message-remove",e,a)},_onLeaveRoom:function(e){this._invokeEventCallbacks("room-exit",e)},_onNotification:function(e){var t=e.val();t.read?e.ref().remove():(e.ref().child("read").set(!0),this._invokeEventCallbacks("notification",t))},_onChiselchatInvite:function(e){var t=this,a=e.val();a.status||(a.id=a.id||e.name(),t.getRoom(a.roomId,function(e){a.toRoomName=e.name,t._invokeEventCallbacks("room-invite",a)}))},_onChiselchatInviteResponse:function(e){var t=e.val();t.id=t.id||e.name(),this._invokeEventCallbacks("room-invite-response",t)}},t.prototype.setUser=function(e,t){var n=this;n._firebase.root().child(".info/authenticated").on("value",function(i){i.val()===!0&&(n._firebase.root().child(".info/authenticated").off(),n._userId=e.userId,n._userName=e.userName,n._isModerator=e.isModerator,n._avatarUri=e.avatarUri,n._profileUri=e.profileUri,n._isGuest=e.isGuest,n._isStaff=e.isStaff,n._isModerator===!0&&(n._moderatorsRef.child(n._userId).set(!0),n._moderatorsRef.child(n._userId).onDisconnect().remove()),n._userRef=n._firebase.child("users").child(n._userId),n._loadUserMetadata(function(){a.setTimeout(function(){n._setupDataEvents(),t(n._user)},0)}))})},t.prototype.unsetUser=function(){var e=this;e._userRef.child("rooms").once("value",function(t){var a=t.val();for(var n in a)e.leaveRoom(a[n].id);e._firebase.root().child(".info/connected").off(),e._userRef.child("invites").off(),e._userRef.child("notifications").off(),e._userRef.off(),e._firebase.root().child(".info/authenticated").off(),e._user=null,e._userId=null,e._userName=null,e._isModerator=!1,e._isGuest=!0,e._avatarUri=null,e._profileUri=null,e._sessionId=null,e._userRef=null})},t.prototype.lookupUser=function(e,t){var a=this;e in a._chatter_cache?t(this._chatter_cache[e]):a._firebase.child("users").child(e).once("value",function(n){var i=n.val();a._chatter_cache[e]=i,t(i)})},t.prototype.resumeSession=function(){this._userRef.child("rooms").once("value",function(e){var t=e.val();for(var a in t)this.enterRoom(t[a].id)},function(){},this),this._roomRef.once("value",function(e){var t=e.val();for(var a in t)"official"==t[a].type&&this.enterRoom(a)},function(){},this)},t.prototype.on=function(e,t){this._addEventCallback(e,t)},t.prototype.createRoom=function(t,a,n){var i=this,s=this._roomRef.push(),r={id:s.name(),name:t,type:a||"public",createdByUserId:this._userId,".priority":e.ServerValue.TIMESTAMP};"private"===a&&(r.authorizedUsers={},r.authorizedUsers[this._userId]=!0),s.set(r,function(e){e||i.enterRoom(s.name()),n&&n(s.name())})},t.prototype.enterRoom=function(e){var t=this;t.getRoom(e,function(a){var n=a.name;if(e&&n&&!t._rooms[e]){if(t._rooms[e]=!0,t._user){t._userRef.child("rooms").child(e).set({id:e,name:n,active:!0});var i=t._firebase.child("room-users").child(e).child(t._userId).child(t._sessionId);t._queuePresenceOperation(i,{id:t._userId,name:t._userName},null)}t._onEnterRoom({id:e,name:n}),t._roomRef.child(e).once("value",function(){t._messageRef.child(e).limit(t._options.numMaxMessages).on("child_added",function(a){t._onNewMessage(e,a)},function(){t.leaveRoom(e)},t),t._messageRef.child(e).limit(t._options.numMaxMessages).on("child_removed",function(a){t._onRemoveMessage(e,a)},function(){},t)},function(){},t)}})},t.prototype.leaveRoom=function(e){var t=this,a=t._firebase.child("room-users").child(e);if(t._messageRef.child(e).off(),t._user){var n=a.child(t._userId).child(t._sessionId);t._removePresenceOperation(""+n,null),t._userRef.child("rooms").child(e).remove()}delete t._rooms[e],t._onLeaveRoom(e)},t.prototype.removeRoom=function(e){var t=this;t.leaveRoom(e),t._firebase.child("users").once("value",function(a){var n=a.val();for(var i in n)t._firebase.child("users").child(i).child(e).remove()}),t._messageRef.child(e).remove(),t._firebase.child("room-users").child(e).remove(),t._roomRef.child(e).remove()},t.prototype.sendMessage=function(t,a,n,i){var s,r=this,o={userId:r._userId,name:r._userName,timestamp:e.ServerValue.TIMESTAMP,message:a,type:n||"default"};return r._user?(s=r._messageRef.child(t).push(),s.setWithPriority(o,e.ServerValue.TIMESTAMP,i),void 0):(r._onAuthRequired(),i&&i(Error("Not authenticated or user not set!")),void 0)},t.prototype.deleteMessage=function(e,t,a){var n=this; +n._messageRef.child(e).child(t).remove(a)},t.prototype.toggleUserMute=function(e,t){var a=this;return a._user?(a._firebase.child("users").child(e).once("value",function(n){n.val().isModerator?t(Error("Cannot mute a moderator.")):a._userRef.child("muted").child(e).transaction(function(e){return e?null:!0},t)}),void 0):(a._onAuthRequired(),t&&t(Error("Not authenticated or user not set!")),void 0)},t.prototype.sendSuperuserNotification=function(t,a,n,i){var s=this,r=s._firebase.child("users").child(t).child("notifications");r.push({fromUserId:s._userId,timestamp:e.ServerValue.TIMESTAMP,notificationType:a,data:n||{}},i)},t.prototype.warnUser=function(e){var t=this;t.sendSuperuserNotification(e,"warning")},t.prototype.suspendUser=function(e,t,a){var n=this,i=(new Date).getTime()+1e3*t;n._suspensionsRef.child(e).set(i,function(t){return t&&a?a(t):(n.sendSuperuserNotification(e,"suspension",{suspendedUntil:i}),a(null))})},t.prototype.inviteUser=function(e,t){var a=this,n=function(){var n=a._firebase.child("users").child(e).child("invites").push();n.set({id:n.name(),fromUserId:a._userId,fromUserName:a._userName,roomId:t}),n.on("value",a._onChiselchatInviteResponse,function(){},a)};return a._user?(a.getRoom(t,function(i){if("private"===i.type){var s=a._roomRef.child(t).child("authorizedUsers");s.child(e).set(!0,function(e){e||n()})}else n()}),void 0):(a._onAuthRequired(),void 0)},t.prototype.acceptInvite=function(e,t){var a=this;a._userRef.child("invites").child(e).once("value",function(n){var i=n.val();return null===i&&t?t(Error("acceptInvite("+e+"): invalid invite id")):(a.enterRoom(i.roomId),a._userRef.child("invites").child(e).update({status:"accepted",toUserName:a._userName},t(i)),void 0)},a)},t.prototype.declineInvite=function(e,t){var a=this,n={status:"declined",toUserName:a._userName};a._userRef.child("invites").child(e).update(n,t)},t.prototype.getRoomList=function(e){var t=this;t._roomRef.once("value",function(t){e(t.val())})},t.prototype.getUserNameById=function(e,t){var a=this;a._firebase.child("users").child(e+"/name").once("value",t)},t.prototype.getUsersByRoom=function(){var e=this,t=arguments[0],n=e._firebase.child("room-users").child(t),i=arguments[arguments.length-1],s=null;arguments.length>2&&(s=arguments[1]),n=s?n.limit(s):n,n.once("value",function(e){var t=e.val()||{},n={};for(var s in t)for(var r in t[s]){n[s]=t[s][r];break}a.setTimeout(function(){i(n)},0)})},t.prototype.getUsersByPrefix=function(e,t,n,i,s){var r=this._usersOnlineRef,o=e.toLowerCase();r=t?r.startAt(null,t):n?r.endAt(null,n):o?r.startAt(null,o):r.startAt(),r=i?r.limit(i):r,r.once("value",function(t){var n=t.val()||{},i={};for(var r in n){var c,l,u=n[r];for(var h in u){c=u[h].name,l=u[h].id;break}e.length>0&&0!==c.toLowerCase().indexOf(o)||(i[c]={name:c,id:l})}a.setTimeout(function(){s(i)},0)})},t.prototype.getRoom=function(e,t){this._roomRef.child(e).once("value",function(e){t(e.val())})},t.prototype.userIsModerator=function(){return this._isModerator},t.prototype.userIsStaff=function(){return this._isStaff}}(Firebase),function(e,t){function a(t,a,n){if(!t)throw Error("ChiselchatUI: Missing required argument `firebaseRef`");if(!a)throw Error("ChiselchatUI: Missing required argument `el`");n=n||{},this._options=n,this._el=a,this._user=null,this._chat=new Chiselchat(t,n),this._roomQueue=[],this.autoFocusTab=!1,this.fullScreenTab=!1,this.displayNewMessageCount=!1,this.commands=[],this.maxLengthUsername=15,this.maxLengthUsernameDisplay=15,this.maxLengthRoomName=16,this.maxLengthMessage=1e3,this.maxUserSearchResults=100,this.messageHistoryScrollHeight=80,this.urlPattern=/\b(?:https?|ftp):\/\/[a-z0-9-+&@#\/%?=~_|!:,.;]*[a-z0-9-+&@#\/%=~_|]/gim,this.pseudoUrlPattern=/(^|[^\/])(www\.[\S]+(\b|$))/gim,this._renderLayout(),this.$wrapper=e("#chiselchat"),this.$roomList=e("#chiselchat-room-list"),this.$tabList=e("#chiselchat-tab-list"),this.$tabContent=e("#chiselchat-tab-content"),this.$messages={},this.$rateLimit={limitCount:10,limitInterval:1e4,limitWaitTime:3e4,history:{}},this._bindUIEvents(),this._bindDataEvents(),this._initCommands()}if(!e||170>parseInt(e().jquery.replace(/\./g,""),10))throw Error("jQuery 1.7 or later required!");var n=this,i=n.ChiselchatUI;if(n.ChiselchatUI=a,!self.ChiselchatDefaultTemplates)throw Error("Unable to find chat templates!");a.noConflict=function(){return n.ChiselchatUI=i,a},a.prototype={_initCommands:function(){self=this,self.addCommand({match:/^\/help$/,func:function(e,t){var a="";for(var n in t.commands)(!t.commands[n].moderatorOnly||t._chat.userIsModerator())&&(a+="

              "+t.commands[n].name+" - "+t.commands[n].help+"

              ");t.info(a,"Chat Help"),e.type="command"},name:"/help",help:"Display this message."}),self.addCommand({match:/^\/me\s/,func:function(e){e.content=e.content.replace(/^\/me/,""),e.type="activity"},name:"/me ",help:"Your name will appear followed by any text you write."}),self.addCommand({match:/^\/whoami$/,func:function(e,t){var a='You are "'+t._user.name+'", ';a+=t._user.isStaff?"a staffer.":t._user.isModerator?"a moderator.":t._user.isGuest?"an anonymous guest user.":"a normal user.",t.info(a,"Who Am I?"),e.type="command"},name:"/whoami",help:"Display your name."}),self.addCommand({match:/^\/leave$/,func:function(e,t){t._chat.leaveRoom(e.roomId),e.type="command"},name:"/leave",help:"Leave the current room."}),self.addCommand({match:/^\/topic\s/,func:function(e,t){var a=e.content.replace(/^\/topic\s+/,"");if(e.content.match(/\w+/)){var n=t._chat._roomRef.child(e.roomId);n.transaction(function(i){"official"==i.type?t.error("Cannot modify the topic of an official room."):(n.child("name").set(a),t._chat.sendMessage(e.roomId,'changed the topic to "'+a+'".',"activity"))})}e.type="command"},name:"/topic ",help:"Change the name of the room.",moderatorOnly:!0})},_bindUIEvents:function(){this._bindForRoomList(),this._bindForUserRoomList(),this._bindForUserSearch(),this._bindForUserMuting(),this._bindForChatInvites(),this._bindForRoomListing(),this._bindForRoomNotification(),this._setupTabs(),this._bindTextInputFieldLimits()},_bindDataEvents:function(){this._chat.on("user-update",this._onUpdateUser.bind(this)),this._chat.on("room-enter",this._onEnterRoom.bind(this)),this._chat.on("room-create",this._onCreateRoom.bind(this)),this._chat.on("room-changed",this._onRoomChanged.bind(this)),this._chat.on("room-exit",this._onLeaveRoom.bind(this)),this._chat.on("message-add",this._onNewMessage.bind(this)),this._chat.on("message-remove",this._onRemoveMessage.bind(this)),this._chat.on("room-invite",this._onChatInvite.bind(this)),this._chat.on("room-invite-response",this._onChatInviteResponse.bind(this)),this._chat.on("notification",this._onNotification.bind(this))},_renderLayout:function(){var t=ChiselchatDefaultTemplates["templates/layout-full.html"];e(this._el).html(t({maxLengthUsername:this.maxLengthUsername,maxLengthRoomName:this.maxLengthRoomName,isModerator:this._chat.userIsModerator(),isStaff:this._chat.userIsStaff()}))},_onUpdateUser:function(t){this._user=t;var a=this._user.muted||{};e('[data-event="chiselchat-user-mute-toggle"]').each(function(){var t=e(this).closest("[data-user-id]").data("user-id");e(this).toggleClass("chiselchat-muted",!!a[t])});for(var n in a)e('.message[data-user-id="'+n+'"]').fadeOut()},_onEnterRoom:function(e){this.attachTab(e.id,e.name)},_onRoomChanged:function(t){e('#chiselchat-tab-list li[data-room-id="'+t.id+'"] a .chiselchat-tab-text').html(t.name),e('[data-room-id="'+t.id+'"] .chiselchat-title-text').html(t.name)},_onCreateRoom:function(e){self=this,"public"==e.type&&self.info('A new public chatroom called "'+e.name+'" has been created.',"New Public Room")},_onLeaveRoom:function(e){this.removeTab(e),this._roomQueue.length>0&&this._chat.enterRoom(this._roomQueue.shift(e))},_onNewMessage:function(t,a){var n=a.userId,i=this;this._user&&this._user.muted&&this._user.muted[n]||(i.showMessage(t,a),this._chat.lookupUser(n,function(t){var n=e('div[data-message-id="'+a.id+'"]');t.profileUri&&(n.find(".chiselchat-avatar > a").attr("href",t.profileUri),n.find(".chiselchat-user > a").attr("href",t.profileUri)),t.avatarUri&&n.find(".chiselchat-avatar img").attr("src",t.avatarUri),t.isGuest&&n.find(".chiselchat-user > a").addClass("chiselchat-guest"),t.isModerator&&n.find(".chiselchat-user > a").addClass("chiselchat-moderator"),t.isStaff&&n.find(".chiselchat-user > a").addClass("chiselchat-staff")}))},_onRemoveMessage:function(e,t){this.removeMessage(e,t)},_onChatInvite:function(e){var t=this;t.confirm(e.fromUserName+" invited you to join "+e.toRoomName,"Invitation",function(){return t._chat.acceptInvite(e.id,function(e){e instanceof Error||t.focusTab(e.roomId)}),!1},function(){return t._chat.declineInvite(e.id),!1})},_onChatInviteResponse:function(t){if(t.status){var a=this;t.status&&"accepted"===t.status?(a.success(t.toUserName+" accepted your invite.","Invitation Accepted"),this._chat.getRoom(t.roomId,function(n){var i=e('#chiselchat-tab-list li[data-room-id="'+t.roomId+'"]');i.length||(a.autoFocusTab=!0,a.attachTab(t.roomId,n.name))})):a.error(t.toUserName+" declined your invite.","Invitation Declined")}},_onNotification:function(e){if("warning"===e.notificationType)this.warn("You are being warned for inappropriate messaging. Further violation may result in temporary or permanent ban of service.");else if("suspension"===e.notificationType){var t=e.data.suspendedUntil,a=Math.round((t-(new Date).getTime())/1e3),n="";if(a>0){if(a>7200){var i=Math.floor(a/3600);n=i+" hours, ",a-=3600*i}n+=Math.floor(a/60)+" minutes",this.error("A moderator has suspended you for violating site rules. You cannot send messages for another "+n+".","Suspended")}}}},a.prototype.setUser=function(e){var a=this;e.userName===void 0&&(e.userName=""),e.isModerator===void 0&&(e.isModerator=!1),e.isStaff===void 0&&(e.isStaff=!1),e.isGuest===void 0&&(e.isGuest=!0),e.avatarUri===void 0&&(e.avatarUri=""),e.profileUri===void 0&&(e.profileUri=""),a._chat.setUser(e,function(e){a._user=e,a._chat.userIsModerator()&&a._bindSuperuserUIEvents(),t.setTimeout(function(){a.displayNewMessageCount=!0},1e3),a._chat.resumeSession()})},a.prototype.unsetUser=function(){var e=this;e._chat.unsetUser(),e._user=null,e._roomQueue=[],e.displayNewMessageCount=!1},a.prototype.on=function(e,t){this._chat.on(e,t)},a.prototype._bindSuperuserUIEvents=function(){var t=this,a=function(){var t=e(this),a=t.closest("[data-message-id]").data("message-id"),n=e('[data-message-id="'+a+'"]').closest("[data-user-id]").data("user-id"),i=e('[data-message-id="'+a+'"]').closest("[data-room-id]").data("room-id");return{messageId:a,userId:n,roomId:i}};e(document).delegate('[data-event="chiselchat-user-warn"]',"click",function(e){var n=a.call(this,e);t._chat.warnUser(n.userId),t._chat.getUserNameById(n.userId,function(e){t._chat.sendMessage(n.roomId,"warned "+e.val()+".","activity")})}),e(document).delegate('[data-event="chiselchat-user-suspend-hour"]',"click",function(e){var n=a.call(this,e);t._chat.suspendUser(n.userId,3600),t._chat.getUserNameById(n.userId,function(e){t._chat.sendMessage(n.roomId,"suspended "+e.val()+" for 1 hour.","activity")})}),e(document).delegate('[data-event="chiselchat-user-suspend-day"]',"click",function(e){var n=a.call(this,e);t._chat.suspendUser(n.userId,86400),t._chat.getUserNameById(n.userId,function(e){t._chat.sendMessage(n.roomId,"suspended "+e.val()+" for 1 day.","activity")})}),e(document).delegate('[data-event="chiselchat-message-delete"]',"click",function(e){var n=a.call(this,e);t._chat.deleteMessage(n.roomId,n.messageId)})},a.prototype._bindForRoomList=function(){var t=this;e("#chiselchat-room-tab").bind("click",function(){var a=(e(this),ChiselchatDefaultTemplates["templates/room-list-item.html"]),n=function(){var a=e(this).parent(),n=a.data("room-id"),i=a.data("room-name");return t.$messages[n]?t.focusTab(n):(t.autoFocusTab=!0,t._chat.enterRoom(n,i)),!1};deleteRoom=function(){var a=e(this).closest("li"),n=a.data("room-id");t._chat.removeRoom(n),a.remove()},t._chat.getRoomList(function(i){t.$roomList.empty();for(var s in i){var r=i[s];if("private"!=r.type){r.isRoomOpen=!!t.$messages[r.id],r.userIsModerator=t._chat.userIsModerator();var o=e(a(r));o.children(".chiselchat-room-list-item").bind("click",n),o.children(".chiselchat-delete-room").bind("click",deleteRoom),t.$roomList.append(o.toggle(!0))}}})})},a.prototype._bindForUserRoomList=function(){var t=this;e(document).delegate('[data-event="chiselchat-user-room-list-btn"]',"click",function(a){a.stopPropagation();var n=e(this),i=n.closest("[data-room-id]").data("room-id"),s=ChiselchatDefaultTemplates["templates/room-user-list-item.html"],r=n.data("target"),o=e("#"+r);o.empty(),t._chat.getUsersByRoom(i,function(a){for(var n in a)user=a[n],user.disableActions=!t._user||user.id===t._user.id,user.nameTrimmed=t.trimWithEllipsis(user.name,t.maxLengthUsernameDisplay),user.isMuted=t._user&&t._user.muted&&t._user.muted[user.id],o.append(e(s(user)));t.sortListLexicographically("#"+r)})})},a.prototype._bindForUserSearch=function(){var t=this,a=function(t){var a=e(this),i=a.data("target"),s=a.data("controls"),r=a.data("template"),o=a.val()||a.data("prefix")||"",c=a.data("startAt")||null,l=a.data("endAt")||null;t.preventDefault(),n(i,r,s,o,c,l)},n=function(a,n,i,s,r,o){var c=e("#"+a),l=ChiselchatDefaultTemplates[n];t._chat.getUsersByPrefix(s,r,o,t.maxUserSearchResults,function(e){var a,n,i,s=0;c.empty();for(a in e){var r=e[a];if(r.disableActions=!t._user||r.id===t._user.id,s+=1,c.append(l(r)),1===s)n=r.name.toLowerCase();else if(s>=t.maxUserSearchResults){i=r.name.toLowerCase();break}}})};e(document).delegate('[data-event="chiselchat-user-search"]',"keyup",a),e(document).delegate('[data-event="chiselchat-user-search"]',"click",a),e(document).delegate("#chiselchat-user-search-form","submit",a),e(document).delegate("#chiselchat-presence-tab","click",function(t){t.stopPropagation();var a=e("#chiselchat-user-search-form").find("input");a.focus(),a.trigger(jQuery.Event("keyup"))})},a.prototype._bindForUserMuting=function(){var t=this;e(document).delegate('[data-event="chiselchat-user-mute-toggle"]',"click",function(a){var n=e(this),i=n.closest("[data-user-id]").data("user-id"),s=n.closest("[data-user-name]").data("user-name"),r=n.hasClass("chiselchat-muted");a.preventDefault(),t._chat.toggleUserMute(i,function(e){e?t.error(e.message):r?(t.success(s+" has been unmuted.","User Unmuted"),n.html("Mute")):(t.error(s+" has been muted.","User Muted"),n.html("Unmute"))})})},a.prototype._bindForChatInvites=function(){var t=this,a=function(){var a=e(this),n=a.closest("[data-user-id]").data("user-id"),i=a.closest("[data-room-id]").data("room-id"),s=a.closest("[data-user-name]").data("user-name");return t._chat.getRoom(i,function(e){t._chat.inviteUser(n,i,e.name),t.info(s+" invited.")}),!1},n=function(){var a=e(this),n=a.closest("[data-user-id]").data("user-id"),i=a.closest("[data-user-name]").data("user-name");if(n&&i){var s="Private Chat";t.autoFocusTab=!0,t._chat.createRoom(s,"private",function(e){t._chat.inviteUser(n,e,s),t.info(i+" invited.")})}return!1};e(document).delegate('[data-event="chiselchat-user-chat"]',"click",n),e(document).delegate('[data-event="chiselchat-user-invite"]',"click",a)},a.prototype._bindForRoomNotification=function(){var t=this,a=function(){var a=e(this),n=a.data("room-id"),i=a.data("room-name");return t.autoFocusTab=!0,t._chat.enterRoom(n,i),!1};e(document).delegate('[data-event="chiselchat-room-notification"]',"click",a)},a.prototype._bindForRoomListing=function(){var t=this;e("#chiselchat-create-room").bind("submit",function(){var a=e("#chiselchat-input-room-name").val();return e("#chiselchat-input-room-name").val(""),a.length?(t.autoFocusTab=!0,t._chat.createRoom(a)):t.error("Room name must be specified."),!1})},a.prototype._setupTabs=function(){var a=this,n=function(t){t.parent("li").removeClass("active"),e("#chiselchat-tab-content .chiselchat-tab-pane").removeClass("active"),a.resetNewMessageCount(t.parent("li").attr("data-room-id"))},i=function(t){var n,i,r=t,o=r.closest("ul"),c=r.attr("data-target"),l=o.find(".active:last a")[0];c||(c=r.attr("href"),c=c&&c.replace(/.*(?=#[^\s]*$)/,"")),a.resetNewMessageCount(e(l).parent("li").attr("data-room-id")),r.parent("li").hasClass("active")||(i=e.Event("show",{relatedTarget:l}),r.trigger(i),i.isDefaultPrevented()||(n=e(c),s(r.parent("li"),o),s(n,n.parent(),function(){r.trigger({type:"shown",relatedTarget:l})}),n.find(".chiselchat-history").css("height",n.height()-a.messageHistoryScrollHeight+"px")))},s=function(e,t,n){var i=t.find("> .active");i.removeClass("active").removeClass("fullscreen"),e.addClass("active"),a.fullScreenTab&&e.addClass("fullscreen"),n&&n()};e(document).delegate('[chisel-toggle="tab"]',"click",function(t){t.preventDefault();var a=e(this);a.parent("li").hasClass("active")?n(a):i(a)}),e(document).delegate('[data-event="chiselchat-minimize-pane"]',"click",function(){var t=e(this).closest("[data-room-id]").data("room-id");return n(e('#chiselchat-tab-list li[data-room-id="'+t+'"] a, #chiselchat-room-tab a, #chiselchat-presence-tab a')),!1}),e(document).delegate('[data-event="chiselchat-close-tab"]',"click",function(){var t=e(this).closest("[data-room-id]").data("room-id");return a._chat.leaveRoom(t),!1}),e(document).delegate('[data-event="chiselchat-toggle-pane-size"]',"click",function(){return a.fullScreenTab?(a.fullScreenTab=!1,e(this).closest(".chiselchat-tab-pane").removeClass("fullscreen")):(e(this).closest(".chiselchat-tab-pane").addClass("fullscreen"),a.fullScreenTab=!0),e(t).trigger("resize"),!1})},a.prototype._bindTextInputFieldLimits=function(){e("body").delegate('input[data-provide="limit"], textarea[data-provide="limit"]',"keyup",function(){var t=e(this),a=e(t.data("counter")),n=t.attr("maxlength"),i=t.val().length;a.html(Math.max(0,n-i))})},a.prototype.confirm=function(e,t,a,n){new PNotify({title:t||"Confirmation Needed",text:e,addclass:"chiselchat-alert",type:"info",icon:"chiselchat-glyphicon chiselchat-glyphicon-question-sign",hide:!1,confirm:{confirm:!0},buttons:{closer:!1,sticker:!1},history:{history:!1}}).get().on("pnotify.confirm",function(){a()}).on("pnotify.cancel",function(){n()})},a.prototype.warn=function(e,t){new PNotify({addclass:"chiselchat-alert",title:t||"Warning",text:e,icon:"chiselchat-glyphicon chiselchat-glyphicon-exclamation-sign",opacity:.95,history:!1,sticker:!1})},a.prototype.info=function(e,t){new PNotify({addclass:"chiselchat-alert",type:"info",title:t||"Info",text:e,icon:"chiselchat-glyphicon chiselchat-glyphicon-info-sign",opacity:.95,history:!1,sticker:!1})},a.prototype.error=function(e,t){new PNotify({addclass:"chiselchat-alert",type:"error",title:t||"Error",text:e,icon:"chiselchat-glyphicon chiselchat-glyphicon-warning-sign",opacity:.95,history:!1,sticker:!1})},a.prototype.success=function(e,t){new PNotify({addclass:"chiselchat-alert",type:"success",title:t||"Success",text:e,icon:"chiselchat-glyphicon chiselchat-glyphicon-ok-sign",opacity:.95,history:!1,sticker:!1})},a.prototype.addCommand=function(e){self=this,self.commands.push(e)},a.prototype.executeCommands=function(e){var t=this;for(var a in t.commands){var n=t.commands[a];if(e.content.match(n.match)){if(n.moderatorOnly&&!t._chat.userIsModerator())continue;n.func(e,t)}}},a.prototype.resetNewMessageCount=function(e){var t=this.$tabList.find("[data-room-id="+e+"]").find("a");if(t.length){var a=t.first().children(".chiselchat-new-count");a.html("0"),a.removeClass("chiselchat-new-count-alert")}},a.prototype.toggleInputs=function(t){e("#chiselchat-tab-content textarea").each(function(){var a=e(this);t?e(this).val(""):e(this).val("You have exceeded the message limit, please wait before sending."),a.prop("disabled",!t)}),e("#chiselchat-input-name").prop("disabled",!t)},a.prototype.attachTab=function(a,n){var i=this;if(this.$messages[a])return this.focusTab(a),void 0;var s={id:a,name:n},r=ChiselchatDefaultTemplates["templates/tab-content.html"],o=e(r(s));this.$tabContent.prepend(o);var c=e("#chiselchat-messages"+a);this.$messages[a]=c;var l=o.find("textarea").first();l.bind("keydown",function(e){var t={content:i.trimWithEllipsis(l.val(),i.maxLengthMessage),type:"default",roomId:a};if(13===e.which&&""!==t.content){if(e.shiftKey){var n=this.value;if("number"==typeof this.selectionStart&&"number"==typeof this.selectionEnd){var s=this.selectionStart;this.value=n.slice(0,s)+"\n"+n.slice(this.selectionEnd),this.selectionStart=this.selectionEnd=s+1}else if(document.selection&&document.selection.createRange){this.focus();var r=document.selection.createRange();r.text="\r\n",r.collapse(!1),r.select()}}else l.val(""),i.executeCommands(t),("activity"==t.type||"default"==t.type)&&i._chat.sendMessage(t.roomId,t.content,t.type,function(e){e&&i.error("You are not allowed to post messages right now.")});return!1}});var u=ChiselchatDefaultTemplates["templates/tab-menu-item.html"],h=e(u(s));this.$tabList.append(h),c.css("height",o.height()-i.messageHistoryScrollHeight+"px"),e(t).resize(function(){c.css("height",o.height()-i.messageHistoryScrollHeight+"px"),c.scrollTop(c[0].scrollHeight)}),h.bind("shown",function(){c.scrollTop(c[0].scrollHeight)}),e("#chiselchat-btn-room-user-list-"+a).bind("click",function(){return i.sortListLexicographically("#chiselchat-room-user-list-"+a),!1}),i.autoFocusTab?(this.focusTab(a),i.autoFocusTab=!1):i.resetNewMessageCount(a)},a.prototype.focusTab=function(e){var t=this;if(t.$messages[e]){var a=t.$tabList.find("[data-room-id="+e+"]").find("a");a.length&&(a.first().trigger("click"),t.resetNewMessageCount(e))}},a.prototype.removeTab=function(e){delete this.$messages[e],this.$tabContent.find("[data-room-id="+e+"]").remove();var t=this.$tabList.find("[data-room-id="+e+"]"),a=t.hasClass("active");t.remove(),a&&this.$tabList.find("[chisel-toggle=tab]").first().trigger("click")},a.prototype.showMessage=function(t,a){var n=this,i={id:a.id,localtime:n.formatTime(a.timestamp),message:a.message||"",userId:a.userId,name:a.name,type:a.type||"default",isSelfMessage:n._user&&a.userId==n._user.id,disableActions:!n._user||a.userId==n._user.id,userIsModerator:n._chat.userIsModerator(),avatarUri:"",profileUri:""};i.message=_.map(i.message.split(" "),function(e){return n.urlPattern.test(e)||n.pseudoUrlPattern.test(e)?n.linkify(encodeURI(e)):_.escape(e)}).join(" "),i.message=n.trimWithEllipsis(i.message,n.maxLengthMessage),i.message=i.message.replace(/\n/g,"
              ");var s=ChiselchatDefaultTemplates["templates/message.html"],r=e(s(i)),o=n.$messages[t];if(o){var c=!1;o.scrollTop()/(o[0].scrollHeight-o[0].offsetHeight)>=.95?c=!0:o[0].scrollHeight<=o.height()&&(c=!0),o.append(r);var l=this.$tabList.find("[data-room-id="+t+"]").find("a");if(l.length&&n.displayNewMessageCount){var u=l.first().children(".chiselchat-new-count");u.html(parseInt(u.html(),10)+1),this.pulse(u,"chiselchat-new-count-alert",{pulses:2,duration:300})}c&&o.scrollTop(o[0].scrollHeight)}},a.prototype.removeMessage=function(t,a){e('.chiselchat-message[data-message-id="'+a+'"]').remove()},a.prototype.sortListLexicographically=function(t){e(t).children("li").sort(function(t,a){var n=e(t).text().toUpperCase(),i=e(a).text().toUpperCase();return i>n?-1:n>i?1:0}).appendTo(t)},a.prototype.trimWithEllipsis=function(e,t){return e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),t&&t>=e.length?e:e.substring(0,t)+"..."},a.prototype.formatTime=function(e){var t=e?new Date(e):new Date,a=t.getHours()||12,n=""+t.getMinutes(),i=t.getHours()>=12?"pm":"am";return a=a>12?a-12:a,n=2>n.length?"0"+n:n,""+a+":"+n+i},a.prototype.linkify=function(e){var t=this;return e.replace(t.urlPattern,'$&').replace(t.pseudoUrlPattern,'$1$2')},a.prototype.pulse=function(a,n,i,s){var r={pulses:1,interval:0,returnDelay:0,duration:500},o="destroy"===n;return"function"==typeof i&&(s=i,i={}),i=e.extend({},r,i),0>i.interval&&(i.interval=0),0>i.returnDelay&&(i.returnDelay=0),0>i.duration&&(i.duration=500),-1>i.pulses&&(i.pulses=1),"function"!=typeof s&&(s=function(){}),a.each(function(){function a(){if(void 0!==r.data("pulse")&&!r.data("pulse").stop){if(i.pulses>-1&&++l>i.pulses)return s.apply(r);r.removeClass(n),t.setTimeout(h.complete,h.duration)}}var r=e(this),c=r.data("pulse")||{};c.stop=o,r.data("pulse",c);var l=0,u=e.extend({},i);u.duration=i.duration/2,u.complete=function(){t.setTimeout(a,i.interval)};var h=e.extend({},i);h.duration=i.duration/2,h.complete=function(){t.setTimeout(function(){r.addClass(n),t.setTimeout(u.complete,u.duration)},i.returnDelay)},a()})}}(jQuery,window,document);