MeKLiN2

Untitled

Jan 27th, 2024
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 475.25 KB | None | 0 0
  1. tc_token: ${this.chatRoom.tc_token},
  2. debug: ${this.app.debug}) ... ${0<this.reconnect_tries?this.reconnect_tries:""} `),this.closedLastReasonCode=-2;let d=new a.RoomConnectEvent(this.reconnect_tries);if(this.EventBus.broadcast(a.RoomConnectEvent.ID,d),void 0!==b&&b){let b=new a.RoomReconnected;this.EventBus.broadcast(a.RoomReconnected.ID,b),this.ws.onclose=function(){},this.close()}this.ws=new WebSocket(c,"tc"),this.ws.onopen=a=>{this.onOpen(a)},this.ws.onclose=a=>{this.onClose(a)},this.ws.onmessage=a=>{this.packetWorker.onMessage(a)}}onOpen(){this.send(this.chatRoom.tcPkt_Connect(this.chatRoom.onRoomConnectCallback))}onClose(b){console.warn("Chatroom.Disconnected"),this.closedReasonStr=""+b.code+": "+b.reason;let c=new TinychatApp.BLL.RoomQuitEvent(TinychatApp.BLL.RoomQuitEvent.WS,this.chatRoom);this.EventBus.broadcast(TinychatApp.BLL.RoomQuitEvent.ID,c),this.chatRoom.wsReset();let d=this,e=1e3+Math.floor(2e3*Math.random());this.reconnect_wait+=e,this.reconnect_tries+=1;let f=new a.RoomConnectStandby(this.reconnect_tries,this.reconnect_wait);if(this.EventBus.broadcast(a.RoomConnectStandby.ID,f),999>d.reconnect_tries)switch(this.closedLastReasonCode){case 0:case 1:case 5:case 7:case 8:case 9:case 10:case 11:console.warn("Chatroom.ConnectStandby: "+d.reconnect_wait+"ms"),d.reconnect_timer=setInterval(()=>{d.Reconnect()},d.reconnect_wait);break;default:}else{let b=new a.RoomConnectFatal;this.EventBus.broadcast(a.RoomConnectFatal.ID,b),console.error("Chatroom.ConnectFatal")}}reset(){this.wsHandle=null}send(a){if(!(1<this.ws.readyState)){const b=JSON.stringify(a);this.ws.send(b)}}close(){this.ws.close()}}})();</script><script>(function(){"use strict";const a=window.TinychatApp.BLL.TCSocket;class b{constructor(b){this.chatRoom=b,this.app=b.app,this.EventBus=b.EventBus,this.reqid=0,this.queue={},this.tcSocket=new a(this.chatRoom,this)}get userlist(){return this.chatRoom.userlist}get videolist(){return this.chatRoom.videolist}get chatlog(){return this.chatRoom.chatlog}reset(){this.tcSocket.reset(),this.reqid=0,this.queue={}}send(a){return this.tcSocket.send(a)}connect(a){this.tcSocket.connect(a)}onMessage(a){let b=JSON.parse(a.data),c=b.req;if(c!==void 0){let a=this.queue[c];if(void 0!==a)return Object.isObj(a)&&Object.isFunc(a.func)?a.func.call(this.chatRoom,b,a.params):Object.isFunc(a)&&a.call(this.chatRoom,b),void delete this.queue[c]}let d=b.tc;"string"===typeof d?"ping"===d?this.chatRoom.onPing(b):"userlist"===d?this.chatRoom.onRoomUserlist(b):"join"===d?this.chatRoom.onRoomUserJoin(b):"room_settings"===d?this.chatRoom.onRoomSettings(b):"quit"===d?this.chatRoom.onRoomUserQuit(b):"publish"===d?this.chatRoom.onRoomPublish(b):"unpublish"===d?this.chatRoom.onRoomUnPublish(b):"stream_connected"===d?this.chatRoom.onStreamConnected(b):"pending_moderation"===d?this.chatRoom.onPendingModeration(b):"waiting_slot"===d?this.chatRoom.onWaitingSlot(b):"stream_closed"===d?this.chatRoom.onStreamClosed(b):"stream_moder_allow"===d?this.chatRoom.onStreamModerAllow(b):"msg"===d?this.chatRoom.onSendMessagePublicCallback(b):"nick"===d?this.chatRoom.onNicknameChanged(b):"pvtmsg"===d?this.chatRoom.onSendMessagePrivateCallback(b):"closed"===d?(this.chatRoom.onClosed(b),this.tcSocket.close()):"sysmsg"===d?this.chatRoom.onSystemMessage(b):"gift"===d?this.chatRoom.onGiftMessage(b):d.startsWith("yut_")?this.chatRoom.onYoutube(b):"yut_playlist"===d?this.chatRoom.onYoutubePlaylist(b):d.startsWith("guest_session_timeout")?this.chatRoom.onGuestSessTimeout(b):d.startsWith("multiple_videos_timeout")?this.chatRoom.onMultipleVideosTimeout(b):console.error("Unknown pkt: "+JSON.stringify(b)):console.error("Unknown pkt format: "+JSON.stringify(b))}wsCreatePacket(a,b){const c={tc:a,req:++this.reqid};return this.registerPacketCallback(c,b),c}registerPacketCallback(a,b){b!==void 0&&(this.queue[a.req]=b)}}window.TinychatApp.BLL.PacketWorker=b})();</script><script>(function(){"use strict";let a=null;class b{constructor(){}static getInstance(){return null==a&&(a=new b),a}getRoomEvent(){}}window.TinychatApp.BLL.Tracker=b})();</script><script>(function(){"use strict";let a=null;class b{constructor(){}static getInstance(){return null==a&&(a=new b),a}gotoUrl(a,b){if(b){let b=window.open(a,"_blank");b.focus()}else window.location.href=a}get backUrl(){return window.location.href}LiveDirectory(){this.gotoUrl(b.url_livedirectory(this.backUrl))}GiveAGift(a){this.gotoUrl(b.url_giveagift(a),!0)}EarnCoins(){this.gotoUrl(b.url_get_coins(this.backUrl),!0)}UpgradeSub(){this.gotoUrl(b.url_upgradenow(this.backUrl),!0)}Login(a){this.gotoUrl(b.urlpath_login(this.backUrl,a))}DevNews(){this.gotoUrl(b.url_devnews(this.backUrl),!0)}WebSettings(){this.gotoUrl(b.url_websettings(this.backUrl),!0)}Register(){this.gotoUrl(b.urlpath_register(this.backUrl))}Logout(){this.gotoUrl(b.urlpath_logout(this.backUrl))}PromoteRoom(){this.gotoUrl(b.urlpath_promoteroom(this.backUrl))}static url_giveagift(a){var b="/gifts/";return"string"!==typeof a||a.isEmpty()||(b=b+"?to="+encodeURI(a)),b}static url_earncoins(){return"/offers"}static url_upgradenow(){return"/subscription/intro"}static url_livedirectory(){return"/"}static urlpath_register(a){return urlpath_login(a)}static urlpath_login(a,b){var c="";return void 0!=a&&(c="?next="+encodeURI(a)),b&&(c+="&header="+b),"/start/"+c}static urlpath_logout(){return"/logout"}static urlpath_promoteroom(){return"/promote/intro"}static url_devnews(){return"https://twitter.com/tinychatdev"}static url_websettings(){return"/settings/privacy"}static url_get_coins(){return"https://tinychat.com/coins/intro"}}window.TinychatApp.BLL.Router=b})();</script><script>(function(){"use strict";let a=null;class b{constructor(a){this.EventBus=a}static getInstance(c){return null==a&&(a=new b(c)),a}isYoutube(){let a=this.getSettings();return a.enableYoutube}isPrivateMessage(){let a=this.getSettings();return a.enablePMs}isAcousticEchoCancelation(){let a=this.getSettings();return a.enableAcousticEchoCancelation}switchPrivatemessaging(a){let b=this.getSettings();b.enablePMs=a,this.saveSettings(b)}switchYoutube(a){let b=this.getSettings();b.enableYoutube=a,this.saveSettings(b)}switchSound(a){let b=this.getSettings();b.enableSound=a,this.saveSettings(b)}switchConfirmBan(a){let b=this.getSettings();b.сonfirmBans=a,this.saveSettings(b)}switchAcousticEchoCancelation(a){let b=this.getSettings();b.enableAcousticEchoCancelation=a,this.saveSettings(b)}switchRememberVolume(a){let b=this.getSettings();b.rememberVolume=a,this.saveSettings(b)}switchDarkMode(a){let b=this.getSettings();b.darkMode=a,this.saveSettings(b)}isDarkMode(){let a=this.getSettings();return a.darkMode}changeNickname(a){let b=this.getSettings();b.nickname=a,this.saveSettings(b)}getSettings(){var a=this._get("tinychat_settings");try{a=Object.assign(new TinychatApp.DAL.SettingsEntity,JSON.parse(a))}catch(a){}return(void 0==a||"object"!==typeof a)&&(a=new TinychatApp.DAL.SettingsEntity),a}saveSettings(a){if("object"===typeof a){let b=this.getSettings();this._set("tinychat_settings",JSON.stringify(a));let c=this.getSettings();if(!b.equals(c)){let a=new d(c);this.EventBus.broadcast(d.ID,a)}}}_set(a,b){"undefined"===typeof Storage||(localStorage[a]=b)}_get(a,b){if("undefined"===typeof Storage)return b;var c=localStorage[a];return void 0===c&&(c=b),c}_remove(a){localStorage.removeItem(a)}}const c="SettingsChangedEvent_"+Math.Guid.newGuid();class d{static get ID(){return c}constructor(a){return this.settingsEntity=a,this}}window.TinychatApp.BLL.SettingsFeature=b,window.TinychatApp.BLL.SettingsChangedEvent=d})();</script><script>(function(){"use strict";window.TinychatApp.BLL.SoundPlayer=class{static playGift(a){let b=new Audio(window.rootDir+"/sound/magic.mp3");b.volume=a,b.play()}static playMessage(a){let b=new Audio(window.rootDir+"/sound/pop.mp3");b.volume=a,b.play()}}})();</script><script>(function(){"use strict";class a{static get STYPE_FREE(){return 0}static get STYPE_PRO(){return 10}static get STYPE_EXTREME(){return 20}static get STYPE_GOLD(){return 30}static isSubscription(b){return b>a.STYPE_FREE}static isSubPro(b){return b>=a.STYPE_PRO&&b<a.STYPE_EXTREME}static isSubExtreme(b){return b>=a.STYPE_EXTREME&&b<a.STYPE_GOLD}static isSubGold(b){return b>=a.STYPE_GOLD}static isSubHighest(b){return a.isSubGold(b)}static canUseFilters(b){return b>a.STYPE_PRO}static getCssClass(b){var c=0;b instanceof TinychatApp.DAL.UserEntity&&(c=b.subscriptionType),b instanceof TinychatApp.DAL.UserProfileEntity&&(c=b.stype);var d="";return a.isSubPro(c)?d="pro":a.isSubExtreme(c)?d="extreme":a.isSubGold(c)&&(d="gold"),d}}window.TinychatApp.BLL.User=a})();</script><script>(function(){"use strict";var a=Math.Guid;class b{constructor(a){this.chatroom=a,this.EventBus=a.app.EventBus,this.items=[],this.bannedItems=[],this.ignored=[],this.firstBanlist=!0}get app(){return this.chatroom.app}clear(){this.items=[],this.bannedItems=[],this.ignored=[],this.firstBanlist=!0}start(a){this.items=a,this.sorting(this.items);let b=new d(this.items,this.chatroom);this.EventBus.broadcast(d.ID,b)}joined(a){this.items.push(a);this.sorting(this.items);let b=new f(this.items.indexOf(a),a,this.chatroom);this.EventBus.broadcast(f.ID,b)}quited(a){for(var b in this.items){var c=this.items[b];if(c.handle===a){this.items.splice(b,1);let a=new h(b,c,this.chatroom);this.EventBus.broadcast(h.ID,a);break}}}updateBroadcasting(a,b){this.generateUpdateEvent(a,a=>{a.isBroadcasting=b})}updateNickname(a,b){this.generateUpdateEvent(a,a=>{a.nickname=b})}generateUpdateEvent(a,b){var c=-1,d=null,e=-1,f=null;if((Object.keys(this.items).forEach(b=>{let e=this.items[b];if(e.handle===a)return c=Number.parseInt(b),d=Object.assign(new TinychatApp.DAL.UserEntity,e),f=e,!0}),null!=d)&&(b(f),!Object.equals(d,f))){this.sorting(this.items),e=this.items.indexOf(f);let a=new j(c,d,e,f,this);this.EventBus.broadcast(j.ID,a)}}sorting(a){a.sort((c,a)=>{let b=a.subscriptionType-c.subscriptionType||(a.isOperator?1:0)-(c.isOperator?1:0)||(a.isBroadcasting?1:0)-(c.isBroadcasting?1:0)||a.giftpoints-c.giftpoints||(a.username.localeCompare("")?1:0)-(c.username.localeCompare("")?1:0)||c.nickname.toLowerCase().localeCompare(a.nickname.toLowerCase())||c.handle-a.handle;return b})}get(a){for(var b in this.items){var c=this.items[b];if(c.handle===a){return c}}return null}getByNickname(a){let b=a.toLowerCase();for(var c in this.items){var d=this.items[c];if(d.nickname.toLowerCase()===b){return d}}return null}getItems(){return this.items}getBannedItems(){return this.bannedItems}isBanned(){return!1}banIsAllowed(a){return!a.isSelf&&!a.isOwner&&this.chatroom.isOperator()}followIsAllowed(a){return!a.isSelf&&!a.isGuest}ignoreIsAllowed(a){return!a.isSelf&&!this.isIgnored(a)}kickIsAllowed(a){return!a.isSelf&&!a.isOwner&&this.chatroom.isOperator()}videoForceCloseAllow(a){if(this.chatroom.isOwner())return!a.isSelf;return!!this.chatroom.isOperator()&&!a.isSelf&&!a.isOwner&&!a.isOperator}changenick(a){if(a.handle===this.chatroom.self_handle){let a=new TinychatApp.BLL.RoomNicknameChangeEvent("",ModalDialogChangeNickname.MODE_CHANGE);this.EventBus.broadcast(TinychatApp.BLL.RoomNicknameChangeEvent.ID,a)}}abuse(a){this.chatroom.Abuse(a)}kick(a){this.chatroom.Kick(a)}ban(a){this.chatroom.Ban(a)}videoForceClose(a){this.chatroom.VideoForceClose(a)}unban(a){this.app.showToast("unban "+a.handle)}isIgnored(a){let b=a.isUsername?a.username:a.nickname;return-1<this.ignored.indexOf(b)}ignore(a){let b=a.isUsername?a.username:a.nickname;this.isIgnored(a)||this.ignored.push(b);let c=new t(a);this.EventBus.broadcast(t.ID,c),this.app.showToast(a.username+" ignored successfully")}unignore(a){let b=a.isUsername?a.username:a.nickname,c=this.ignored.indexOf(b);-1<c&&this.ignored.splice(c,1);let d=new t(a);this.EventBus.broadcast(t.ID,d),this.app.showToast(a.username+" unignored")}follow(a){if(a.isInsta)return void this.app.showToastWarn("Unfortunately, you can't follow insta-room",4e3);if(a.isGuest)return void this.app.showToastWarn("User is not signed in to Tinychat",4e3);let b=this;this.app.Follow(a.username,function(c){"success"===c?b.app.showToast("You are now following "+a.nickname):"already"===c?b.app.showToast("You are already following "+a.nickname):"unregistered"===c?b.app.showToastWarn("You must be logged into a Tinychat account to initiate follow. Please sign in (sign up) and try again",4e3):"unknown "===c&&b.app.showToastWarn("User is not signed in to Tinychat",4e3)},function(){})}unfollow(a){this.app.showToast("unfollow "+a.handle)}}const c="UserlistUpdateallEvent_"+a.newGuid();class d{static get ID(){return c}constructor(a,b){return this.users=a,this.chatroom=b,this}}const e="UserlistAddUserEvent_"+a.newGuid();class f{static get ID(){return e}constructor(a,b,c){return this.index=a,this.userentity=b,this.chatroom=c,this}}const g="UserlistRemoveUserEvent_"+a.newGuid();class h{static get ID(){return g}constructor(a,b,c){return this.index=a,this.userentity=b,this.chatroom=c,this}}const i="UserlistUpdateUserEvent_"+a.newGuid();class j{static get ID(){return i}constructor(a,b,c,d,e){return this.fromIndex=a,this.fromUserEntity=b,this.toIndex=c,this.toUserEntity=d,this.userlist=e,this}}const k="BanlistUpdateallEvent_"+a.newGuid();class l{static get ID(){return k}constructor(a){return this.chatroom=a,this}}const m="BanlistAddUserEvent_"+a.newGuid();class n{static get ID(){return m}constructor(a,b,c){return this.index=a,this.userentity=b,this.chatroom=c,this}}const o="BanlistRemoveUserEvent_"+a.newGuid();class p{static get ID(){return o}constructor(a,b,c){return this.index=a,this.userentity=b,this.chatroom=c,this}}const q="BanlistUpdateUserEvent_"+a.newGuid();class r{static get ID(){return q}constructor(a,b,c,d,e){return a,b,c,d,e,this.fromIndex=a,this.fromUserentity=b,this.toUserIndex=c,this.toUserEntity=d,this.chatroom=e,this}}const s="IgnorelistUpdateUserEvent_"+a.newGuid();class t{static get ID(){return s}constructor(a){return this.userentity=a,this}}window.TinychatApp.BLL.Userlist=b,window.TinychatApp.BLL.UserlistUpdateallEvent=d,window.TinychatApp.BLL.UserlistAddUserEvent=f,window.TinychatApp.BLL.UserlistRemoveUserEvent=h,window.TinychatApp.BLL.UserlistUpdateUserEvent=j,window.TinychatApp.BLL.IgnorelistUpdateUserEvent=t})();</script><script>(function(){"use strict";var a=Math.Guid;class b{constructor(a){this.chatroom=a,this.EventBus=a.app.EventBus,this.items={},this.items[b.PUBLIC]=[],this.chatlist=[],this.selectedchat=b.PUBLIC,this.EventBus.subscribe(TinychatApp.BLL.UserlistUpdateUserEvent.ID,a=>{this.onUserlistUpdate(a)}),this.EventBus.subscribe(TinychatApp.BLL.UserlistRemoveUserEvent.ID,a=>{this.onUserlistRemove(a)})}static get PUBLIC(){return-1}static get MAX(){return 999}static get MAX_INPUT_LEN(){return 500}get userlist(){return this.chatroom.userlist}get settings(){return this.chatroom.app.settings}SendMessage(a,c){c.length>b.MAX_INPUT_LEN&&console.warn("Message length is limited by "+b.MAX_INPUT_LEN);let d=this.chatroom.selfUser();if(a===b.PUBLIC)return this.public_add_unconfirmed(c,d),this.chatroom.SendMessagePublic(c,d),!0;if(a instanceof TinychatApp.DAL.UserEntity){let b=this.userlist.get(a.handle);return null==b?(this.system_add(a.handle,"Message has not delivered. User is offline ..."),!1):(this.private_add_unconfirmed(c,d,a),this.chatroom.SendMessagePrivate(c,d,a),!0)}return!1}clear(){this.items={},this.items[b.PUBLIC]=[],this.chatlist=[],this.selectedchat=b.PUBLIC}isequal(a,c){if(a===b.PUBLIC)return a===c;return!!(a instanceof TinychatApp.DAL.UserEntity)&&a.handle===c}subscribed_add(a){let c=TinychatApp.DAL.ChatLogItemEntity,d=new c;d.chatname=b.PUBLIC;let e,f="Subscribed user "+a.username+" has joined to the room",g=this.getitems(d.chatname);for(e=0;e<g.length;e++)if(g[e].message_text===f)return;d.message_text=f,d.user=a,d.type=a.subscriptionType,this.additem(g,d);let h=this.settings.getSettings();h.enableSound&&5>=this.userlist.items.length&&window.TinychatApp.BLL.SoundPlayer.playMessage(this.chatroom.volume)}gift_add(a){a.type=TinychatApp.DAL.ChatLogItemEntity.GIFT,a.chatname=b.PUBLIC;let c=this.getitems(a.chatname);this.additem(c,a);let d=this.settings.getSettings();d.enableSound&&window.TinychatApp.BLL.SoundPlayer.playGift(this.chatroom.volume)}system_add(a,b){a instanceof TinychatApp.DAL.UserEntity&&(a=a.handle);let c=TinychatApp.DAL.ChatLogItemEntity,d=new c;d.type=c.SYSTEM,d.user=null,d.message_text=b,d.chatname=a;let e=this.getitems(d.chatname);this.additem(e,d)}public_add(a){if(null!=a.user){if(null!=a.user&&a.user.handle===this.chatroom.self_handle){let b=new h(a,a.chatname);return void this.EventBus.broadcast(h.ID,b)}a.chatname=b.PUBLIC;let c=this.getitems(a.chatname);this.additem(c,a);let d=this.settings.getSettings();d.enableSound&&5>=this.userlist.items.length&&window.TinychatApp.BLL.SoundPlayer.playMessage(this.chatroom.volume)}}public_add_unconfirmed(a,c){if(null==c)return;let d=TinychatApp.DAL.ChatLogItemEntity,e=new d;e.type=d.PUBLIC,e.user=c,e.message_text=a,e.chatname=b.PUBLIC;let f=this.getitems(e.chatname);this.additem(f,e);let g=this.settings.getSettings();g.enableSound&&5>=this.userlist.items.length&&window.TinychatApp.BLL.SoundPlayer.playMessage(this.chatroom.volume)}private_add(a){if(null!=a.user){if(null!=a.user&&a.user.handle===this.chatroom.self_handle){let b=new h(a,a.chatname);return void this.EventBus.broadcast(h.ID,b)}var b=this.settings.isPrivateMessage();if(b&&!this.isopenedprivate(a.user)&&this.openprivate(a.user,!0),b){let b=this.getitems(a.chatname);this.additem(b,a);let c=this.settings.getSettings();c.enableSound&&window.TinychatApp.BLL.SoundPlayer.playMessage(this.chatroom.volume)}}}private_add_unconfirmed(a,b,c){if(null==a)return;if(null==b)return;if(null==c)return;let d=TinychatApp.DAL.ChatLogItemEntity,e=new d;e.type=d.PRIVATE,e.user=b,e.chatname=c.handle,e.message_text=a;let f=this.getitems(e.chatname);this.additem(f,e);let g=this.settings.getSettings();g.enableSound&&window.TinychatApp.BLL.SoundPlayer.playMessage(this.chatroom.volume)}getitems(a){let b=this.items[a];return void 0==b&&(b=[],this.items[a]=b),b}additem(a,c){if(a.length>=b.MAX){let b=a.shift(),d=new f(0,b,c.chatname);this.EventBus.broadcast(f.ID,d)}var e=a.push(c)-1;let g=new d(e,c,c.chatname);this.EventBus.broadcast(d.ID,g)}onUserlistRemove(a){let b=this.getopenedprivate(a.userentity);if(null==b)return;let c=TinychatApp.DAL.UserEntity;b.isOffline=!0,this.selectedchat instanceof c&&this.selectedchat.handle===b.handle&&(this.selectedchat=Object.assign(this.selectedchat,b));let d=this.chatlist.indexOf(b),e=new n(d,b,d,b);this.EventBus.broadcast(n.ID,e)}onUserlistUpdate(a){let b=this.getopenedprivate(a.toUserEntity);if(null==b)return;let c=this.chatlist.indexOf(b),d=this.chatlist.indexOf(a.toUserEntity),e=a.toUserEntity,f=TinychatApp.DAL.UserEntity;this.selectedchat instanceof f&&this.selectedchat.handle===e.handle&&(this.selectedchat=Object.assign(this.selectedchat,e));let g=new n(c,b,d,e);this.EventBus.broadcast(n.ID,g)}selectChat(a){this.selectedchat=a;let b=new p(this.selectedchat,this.getitems(this.selectedchat.handle));this.EventBus.broadcast(p.ID,b)}selectPublic(a){this.selectedchat=b.PUBLIC;let c=new p(this.selectedchat,this.getitems(this.selectedchat));this.EventBus.broadcast(p.ID,c),a instanceof TinychatApp.DAL.UserEntity&&this.closeprivate(a)}closeChat(a){this.selectPublic(a)}chatlist(){return this.chatlist}openprivate(a,b){let c=this.isopenedprivate(a);if(c||this.chatlist.push(a),void 0==b&&this.selectChat(a),!c){let b=new j(this.chatlist.indexOf(a),a,this.chatroom);this.EventBus.broadcast(j.ID,b)}}closeprivate(a){for(var b in this.chatlist){var c=this.chatlist[b];if(c.handle===a.handle){this.chatlist.splice(b,1);let a=new l(b,c,this.chatroom);this.EventBus.broadcast(l.ID,a);break}}}getopenedprivate(a){var b=null;for(var c in this.chatlist){var d=this.chatlist[c];if(d.handle===a.handle){b=d;break}}return b}isopenedprivate(a){var b=!1;for(var c in this.chatlist){var d=this.chatlist[c];if(d.handle===a.handle){b=!0;break}}return b}}const c="ChatlogItemAddedEvent_"+a.newGuid();class d{static get ID(){return c}constructor(a,b,c){return this.index=a,this.chatentity=b,this.chatname=c,this}}const e="ChatlogItemRemovedEvent_"+a.newGuid();class f{static get ID(){return e}constructor(a,b,c){return this.index=a,this.chatentity=b,this.chatname=c,this}}const g="ChatlogItemSentEvent_"+a.newGuid();class h{static get ID(){return g}constructor(a,b){return this.chatentity=a,this.chatname=b,this}}const i="ChatlistAddEvent_"+a.newGuid();class j{static get ID(){return i}constructor(a,b,c){return this.index=a,this.userentity=b,this.chatroom=c,this}}const k="ChatlistRemoveEvent_"+a.newGuid();class l{static get ID(){return k}constructor(a,b,c){return this.index=a,this.userentity=b,this.chatroom=c,this}}const m="ChatlistUpdateEvent_"+a.newGuid();class n{static get ID(){return m}constructor(a,b,c,d){return this.fromIndex=a,this.fromUserEntity=b,this.toIndex=c,this.toUserEntity=d,this}}const o="ChatlistSelectedEvent_"+a.newGuid();class p{static get ID(){return o}constructor(a,b){return this.userentity=a,this.chatitems=b,this}}const q="ChatlistUIUpdateEvent_"+a.newGuid();class r{static get ID(){return q}constructor(){return this}}window.TinychatApp.BLL.Chatlog=b,window.TinychatApp.BLL.ChatlogItemAddedEvent=d,window.TinychatApp.BLL.ChatlogItemRemovedEvent=f,window.TinychatApp.BLL.ChatlogItemSentEvent=h,window.TinychatApp.BLL.ChatlistAddEvent=j,window.TinychatApp.BLL.ChatlistRemoveEvent=l,window.TinychatApp.BLL.ChatlistUpdateEvent=n,window.TinychatApp.BLL.ChatlistSelectedEvent=p,window.TinychatApp.BLL.ChatlistUIUpdateEvent=r})();</script><script>(function(){"use strict";var a=Math.Guid;class b{constructor(a,b,d){this.videolist=a,this.userentity=b,this.mediastream=d,this.progress=!1,this.large=!1,this.hidden=!1,this.mute=!1,this.volume=1,this.audiolevel=0,this.featured=!1,this.blured=!1;try{let a=this,b=d.getAudioTracks();if(!Array.isArray(b)||1>b.length)return;this.soundMeter=new SoundMeter(this.videolist.audioContext),this.soundMeter.connectToSource(this.mediastream,b=>b?void console.warn(b):void(a.soundMeterTimer=setInterval(function(){let b=a.audiolevel;if(a.audiolevel=Math.ceil(10*a.soundMeter.instant.toFixed(2)),10<a.audiolevel&&(a.audiolevel=10),b!=a.audiolevel){let b=a.videolist.getitems().indexOf(a);if(-1<b){let d=new f(c.Update,a,b);a.videolist.EventBus.broadcast(f.ID,d)}}},200)))}catch(a){console.warn("Web Audio API not supported.",a)}}Dispose(){this.soundMeter&&this.soundMeter.stop(),this.soundMeterTimer&&clearInterval(this.soundMeterTimer)}get userlist(){return this.videolist.chatroom.userlist}get handle(){return this.userentity.handle}get nickname(){return this.userentity.nickname}get muted(){return this.mute||this.userentity.isSelf}get achivementUrl(){return this.userentity.achivementUrl||""}get videoForceCloseAllow(){return this.videolist.chatroom.userlist.videoForceCloseAllow(this.userentity)}get ignoreAllow(){return this.videolist.chatroom.userlist.ignoreIsAllowed(this.userentity)}get unignoreAllow(){return this.videolist.chatroom.userlist.isIgnored(this.userentity)}get followAllow(){return this.videolist.chatroom.userlist.followIsAllowed(this.userentity)}get openprivateAllow(){return!this.userentity.isSelf&&!this.videolist.chatroom.selfUser().isGuest}get profileAllow(){return!0}get abuseAllow(){return!this.userentity.isSelf}get banAllow(){return this.userlist.banIsAllowed(this.userentity)}get kickAllow(){return this.userlist.kickIsAllowed(this.userentity)}get filtersAllow(){return this.userentity.isSelf}get giveagiftAllow(){return!this.userentity.isSelf}get upgradeAllow(){return this.userentity.isSelf}get volumeControlAllow(){return!this.userentity.isSelf}}const c={Add:"Add",AddWaiting:"AddWaiting",AddPending:"AddPending",AddModeration:"AddModeration",Remove:"Remove",RemovePendingWaiting:"RemovePendingWaiting",RemoveModeration:"RemoveModeration",Update:"Update",UpdateModeration:"UpdateModeration"},d="VideolistEvent_"+a.newGuid();class f{static get ID(){return d}constructor(a,b,c){return this.action=a,this.videolistitem=b,this.index=c,this}}const e="VideolistClear_"+a.newGuid();class g{static get ID(){return e}constructor(a){return this.chatroom=a,this}}const h="VideolistAcceptedEvent_"+a.newGuid();class i{static get ID(){return h}constructor(a,b){return this.userId=a,this.chatroom=b,this}}window.TinychatApp.BLL.Videolist=class{constructor(a){this.chatroom=a,this.EventBus=a.app.EventBus,this.items=[],this.moderationitems=[],this.selfItem,this.audioContext=new AudioContext,this.needToBlurOtherVids=!1,this.EventBus.subscribe(TinychatApp.BLL.UserlistRemoveUserEvent.ID,a=>this.onUserlistRemoved(a)),this.EventBus.subscribe(TinychatApp.BLL.UserlistUpdateUserEvent.ID,a=>this.onUserlistUpdate(a))}getitems(){return this.items}getModerationItems(){return this.moderationitems}count(){return this.items.length}clear(){this.items=[],this.needToBlurOtherVids=!1,this.EventBus.broadcast(g.ID,new g(this.chatroom))}switchPTT(a){let b=this._getSelfMediaStream();null!=b&&this._muteMediaStream(b,!a)}setVolume(a,b){b==void 0?(this.chatroom.volume=a,Object.keys(this.items).forEach(b=>{let c=this.items[b];this._volMediaStream(c.mediastream,a)})):this._volMediaStream(b.mediastream,a)}toggleFeatured(a){let b=this.items.indexOf(a);if(!(0>b)){a.featured=!a.featured;let d=new f(c.Update,a,b);this.EventBus.broadcast(f.ID,d)}}toggleSizeVW2Normal(a){Object.keys(this.items).forEach(b=>{let d=this.items[b];if(d.large&&(a==void 0||d.userentity.handle!=a.handle)){d.large=!1;let a=new f(c.Update,d,b);this.EventBus.broadcast(f.ID,a)}})}toggleSizeVW(a){a.large=!a.large,a.large&&this.toggleSizeVW2Normal(a);let b=this.items.indexOf(a);if(0<=b){let d=new f(c.Update,a,b);this.EventBus.broadcast(f.ID,d)}}toggleHiddenVW(a){let b=this.items.indexOf(a);if(!(0>b)){a.hidden=!a.hidden,this._pauseMediaStream(a.mediastream,a.hidden),a.hidden||this._muteMediaStream(a.mediastream,a.mute);let d=new f(c.Update,a,b);this.EventBus.broadcast(f.ID,d)}}toggleMuteVW(a){let b=this.items.indexOf(a);if(!(0>b)){a.mute=!a.mute,a.hidden||this.switchMute(a.mute,a);let d=new f(c.Update,a,b);this.EventBus.broadcast(f.ID,d)}}switchMicMute(a){this.chatroom.micmuted=void 0==a?!this.chatroom.micmuted:a;let b=this._getSelfMediaStream();return null!=b&&this._muteMediaStream(b,this.chatroom.micmuted),this.chatroom.micmuted}switchMute(a,b){let d=(d,a)=>{this._muteMediaStream(d.mediastream,d.mute);let b=new f(c.Update,d,a);this.EventBus.broadcast(f.ID,b)};if(void 0==b)return this.chatroom.mute=void 0==a?!this.chatroom.mute:a,Object.keys(this.items).forEach(a=>{let b=this.items[a];b.mute!=this.chatroom.mute&&b.userentity.handle!=this.chatroom.self_handle&&(b.mute=this.chatroom.mute,d(b,a))}),this.chatroom.mute;else{let c=b,e=this.items.indexOf(c);c.mute=a,d(c,e)}}CanMakeLargeVideo(){let a=this.chatroom.selfUser().subscriptionType,b=chatroom.app.IsLoggedIn()&&TinychatApp.BLL.User.isSubscription(a);return b}AddingVideoSelf(){}RemovingVideoSelf(a){if(this.chatroom.self_handle==a){this.selfItem=null;let a=new f(c.RemovePendingWaiting,this.selfItem,0);this.EventBus.broadcast(f.ID,a)}}AddVideoSelf(a,c){let d=this.chatroom.userlist.get(a),e=new b(this,d,c);(this.chatroom.roomSettings.pushtotalk||this.chatroom.micmuted)&&this._muteMediaStream(e.mediastream,!0),this._volMediaStream(e.mediastream,this.chatroom.volume),this.selfItem=e}PublishedVideoSelf(){this.items.push(this.selfItem);let a=new f(c.Add,this.selfItem,this.items.indexOf(this.selfItem));this.EventBus.broadcast(f.ID,a),this.selfItem=null}PendingModerationVideoSelf(){let a=new f(c.AddPending,this.selfItem,0);this.EventBus.broadcast(f.ID,a)}WaitingSlotVideoSelf(){let a=new f(c.AddWaiting,this.selfItem,0);this.EventBus.broadcast(f.ID,a)}RemoveVideoSelf(a){this.RemovingVideoSelf(a),this.RemoveVideoRemote(a)}AcceptedSelfVideoByModerator(a){this.EventBus.broadcast(VideoModeratorAcceptedEvent.ID,new VideoModeratorAcceptedEvent(a,this.chatroom))}AddVideoRemote(a,d){let e=this.chatroom.userlist.get(a),g=new b(this,e,d);if(this._muteMediaStream(g.mediastream,this.chatroom.mute),this._volMediaStream(g.mediastream,this.chatroom.volume),e.needToUpprove){this.moderationitems.push(g);let a=new f(c.AddModeration,g,this.moderationitems.indexOf(g));this.EventBus.broadcast(f.ID,a)}else{this.items.push(g);let a=new f(c.Add,g,this.items.indexOf(g));this.EventBus.broadcast(f.ID,a)}}onUserlistRemoved(a){this.RemoveVideoRemote(a.userentity.handle)}onUserlistUpdate(a){let d=this.items.find(b=>b.userentity.handle===a.toUserEntity.handle);if(d instanceof b){d.userentity=a.toUserEntity;let b=this.items.indexOf(d),e=new f(c.Update,d,b);this.EventBus.broadcast(f.ID,e)}}RemoveVideoRemote(a){var b=Number.parseInt;let d=null,e=-1;if(Object.keys(this.items).forEach(c=>{let f=this.items[c];if(f.userentity.handle===a)return d=f,e=b(c),!0}),null!=d){this.items.splice(e,1),d.Dispose();let a=new f(c.Remove,d,e);this.EventBus.broadcast(f.ID,a)}else{let d=null,e=-1;if(Object.keys(this.moderationitems).forEach(c=>{let f=this.moderationitems[c];if(f.userentity.handle===a)return d=f,e=b(c),!0}),null!=d){this.moderationitems.splice(e,1),d.Dispose();let a=new f(c.RemoveModeration,d,e);this.EventBus.broadcast(f.ID,a)}}}_muteMediaStream(a,b){let c=a.getAudioTracks();!Array.isArray(c)||1>c.length||Object.keys(c).forEach(a=>{c[a].enabled=!b})}_pauseMediaStream(a,b){let c=a.getAudioTracks();if(!Array.isArray(c)||1>c.length)return;Object.keys(c).forEach(a=>{c[a].enabled=!b});let d=a.getVideoTracks();!Array.isArray(d)||1>d.length||Object.keys(d).forEach(a=>{d[a].enabled=!b})}_volMediaStream(a,b){let c=a.getAudioTracks();!Array.isArray(c)||1>c.length||Object.keys(c).forEach(a=>{c[a].volume=b,console.log(c[a].kind+" - "+c[a].readyState+", remote:"+c[a].remote+" - "+c[a].id+" -> vol: "+c[a].volume)})}_getSelfMediaStream(){let a=this.items.find(a=>a.userentity.handle==this.chatroom.self_handle);return a?a.mediastream:null}setNeedToBlurOtherVids(a){this.needToBlurOtherVids=a}blurOtherVids(a,b){this.needToBlurOtherVids&&Object.keys(this.items).forEach(d=>{let e=this.items[d],g=!0;if(-1<a.indexOf(e.handle)?e.blured=!0:-1<b.indexOf(e.handle)?e.blured=!1:g=!1,g){let a=new f(c.Update,e,d);this.EventBus.broadcast(f.ID,a)}})}},window.TinychatApp.BLL.VideolistItem=b,window.TinychatApp.BLL.VideolistAction=c,window.TinychatApp.BLL.VideolistEvent=f,window.TinychatApp.BLL.VideolistClear=g,window.TinychatApp.BLL.VideolistAcceptedEvent=i})();</script><script>(function(){"use strict";var a=Math.Guid;const b=window.TinychatApp.BLL.PacketWorker;class c{constructor(a,c,d,e){this.app=a,this.tc_token=c,this.roomname=d,this.nickname=e,this.EventBus=a.EventBus,this.roomSettings=null,this._enterroomresult=null,this._userlist=null,this._chatlog=null,this._videolist=null,this.reqid=0,this.wsHandle=null,this.queue={},this.mediaConnections={local:null,remote:{}},this.mediaStream=null,this.mediaStreamVideo=null,this.mediaStreamCanvas=null,this.mediaStreamFilter=window.TinychatApp.BLL.VideoFilters.getAll[0].name,this.mediaStreamOrigin=null,this.mediaLastState=null,this.mediaLastConstraints=null;let f=this;this.EventBus.subscribe(TinychatApp.BLL.BroadcastProgressEvent.ID,function(a){f.mediaLastState=a.stage}),this.banlist=null,this.youtubelist=[],this.youtubelist_random=!1,this.youtubelist_repeat=!1,this.fullscreen=!1,this.mute=!1,this.volume=1,this.micmuted=!1,this.wsEndpoint="wss://wss.tinychat.com:443",this.packetWorker=new b(this),this.autoReconnectTryouts=0,this.autoReconnectPeriod=500,this.manualReconnectTryouts=0,this.pushNotificationSentYet=!1,setInterval(()=>{this.pushNotificationSentYet=!1},10800000),this.wsReset()}wsReset(){for(let a in null!=this.mediaStream&&this.mediaStream.stop(),null!=this.mediaConnections.local&&this.mediaConnections.local.Close(),this.mediaConnections.remote){let b=this.mediaConnections.remote[a];b.Close()}this.roomSettings=new TinychatApp.DAL.RoomSettingsEntity,this._enterroomresult=null,null!=this._userlist&&this.userlist.clear(),null!=this._videolist&&this._videolist.clear(),this.mediaConnections={local:null,remote:{}},this.streamReset(),this.fullscreen=!1,this.mute=!1,this.packetWorker.reset()}streamReset(){null!=this.mediaStream&&this.mediaStream.stop(),this.mediaStream=null,this.mediaStreamCanvas=null,this.mediaStreamVideo=null,null!=this.mediaStreamOrigin&&this.mediaStreamOrigin.stop(),this.mediaStreamOrigin=null}get settings(){return this.app.settings}get enterroomresult(){return null==this._enterroomresult&&(this._enterroomresult=new TinychatApp.DAL.EnterRoomResultEntity),this._enterroomresult}get userlist(){return null==this._userlist&&(this._userlist=new TinychatApp.BLL.Userlist(this)),this._userlist}get chatlog(){return null==this._chatlog&&(this._chatlog=new TinychatApp.BLL.Chatlog(this)),this._chatlog}get videolist(){return null==this._videolist&&(this._videolist=new TinychatApp.BLL.Videolist(this)),this._videolist}get _tracker(){return TinychatApp.BLL.Tracker.getInstance()}get _router(){return TinychatApp.BLL.Router.getInstance()}get _api(){return WebAPI.getInstance()}get _cookie(){return CookieUtils}get self_handle(){let a=this.enterroomresult;return null==a||null==a.selfuser?-1:a.selfuser.handle}get url(){return TinychatApp.url+"/room/"+this.chatroomName()}get id__miconly(){return"__miconly"}getRoomAvatarUrl(){return this.app.GetAvatarUrl(this.chatroomName())}selfUser(){return this.enterroomresult.selfuser}chatroomName(){let a=TinychatApp.DAL.RoomSettingsEntity,b=this.roomname;return this.roomSettings instanceof a&&this.roomSettings.name.isNotEmpty()&&(b=this.roomSettings.name),b}updateSelfUser(a){a.isSelf=!0,this.enterroomresult.selfuser=a}updateRoomSettings(a){this.roomSettings=a;let b=new e(this.roomSettings);this.EventBus.broadcast(e.ID,b)}isLurker(){return null!=this.enterroomresult.selfuser&&this.enterroomresult.selfuser.isLurker}isOperator(){return null!=this.enterroomresult.selfuser&&this.enterroomresult.selfuser.isOperator}isOwner(){return null!=this.enterroomresult.selfuser&&this.enterroomresult.selfuser.isOwner}gotoGift(a){this.app.GiveAGift(a.username)}gotoLiveDirectory(){this.app.LiveDirectory()}Reconnect(){clearInterval(this.reconnect_timer),null!=this.wsHandle&&this.wsReset(),this.Connect(!0)}Connect(a){let b=this;this.app.isDebug()?this.packetWorker.connect(a):(console.log("Chatroom.Connecting: reinvoke tc token ..."),this._api.wsj({src:TinychatApp.url_api_room_token(b.chatroomName())}).then(c=>{b.tc_token=c.result,b.wsEndpoint=c.endpoint,b.packetWorker.connect(a)}).catch(c=>{console.error(c),b.app.showToastWarn("Some unknown server error occurred"),b.packetWorker.connect(a)}))}ConnectSolveCaptcha(a){this.packetWorker.send(this.tcPkt_ConnectCaptcha(a,this.onRoomConnectCallback))}ConnectSolveSkip(){this.packetWorker.send(this.tcPkt_ConnectCaptcha("",this.onRoomConnectCallback))}ConnectSolveTimeout(){this.packetWorker.send(this.tcPkt_ConnectCaptcha("",this.onRoomConnectCallback))}ConnectPassword(a){this.packetWorker.send(this.tcPkt_ConnectPassword(a,this.onRoomConnectCallback))}NicknameChange(a,b){this.packetWorker.send(this.tcPkt_NickChange(a,this.onNicknameChanged)),b&&this.app.settings.changeNickname(a)}NicknameIsValid(a){return this.app.IsValidNickname(a)}NicknameIsInUseFast(a){if("string"!=typeof a||a.isEmpty())return!1;let b=this.userlist.getByNickname(a);return null!=b}BroadcastSwitch(a){a?this.BroadcastStop():this.BroadcastStart()}IsLastCam(a,b){let c=!0;for(let d in a){let e=a[d];"videoinput"===e.kind&&(c=e.deviceId===b.deviceId)}return c}BroadcastStart(a){let b=this,c=this.settings,d=this.settings.getSettings();if(null===d.video)return void this.app.MediaSettings(()=>this.BroadcastStart());this.videolist.AddingVideoSelf(this.self_handle);let e={};if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)e.audio=!0,e.video={width:320,height:240};else{let f=!1;navigator.mediaDevices.enumerateDevices().then(g=>{let h=!1;for(let c in g){let i=g[c];"videoinput"===i.kind&&(console.log(i),e.video===void 0&&(e.video={width:320,height:240,frameRate:{ideal:15,max:30}}),h&&(d.video=i,h=!1,this.settings.saveSettings(d),f=b.IsLastCam(g,i)),null===d.video&&(d.video=i,this.settings.saveSettings(d)),null!=d.video&&"object"==typeof d.video&&d.video.deviceId==i.deviceId&&d.video.deviceId!==a?e.video.deviceId={exact:d.video.deviceId}:d.video.deviceId===a&&(h=!0)),"audioinput"===i.kind&&(console.log(i),e.audio===void 0&&(e.audio={}),null!=d.audio&&"object"==typeof d.audio&&d.audio.deviceId==i.deviceId&&(e.audio.deviceId={exact:d.audio.deviceId}))}null!=e.video&&null!=d.video&&d.video.deviceId==b.id__miconly&&delete e.video;let i=navigator.mediaDevices.getSupportedConstraints();for(let a in i)i.hasOwnProperty(a)&&"echoCancellation"==a&&e.audio&&(e.audio[a]=c.isAcousticEchoCancelation());if(!(e.audio||e.video))b.onMediaFailedCallback(new Error("No media devices to start broadcast."));else if("https:"===location.protocol||this.app.isDebug()){console.log("Broadcast: Media ...");let a=new y(y.MEDIA_START);this.EventBus.broadcast(y.ID,a),console.log(e),b.mediaLastConstraints=e,navigator.mediaDevices.getUserMedia(e).then(a=>{b.onMediaSuccessCallback(a)}).catch(a=>{f?b.onMediaFailedCallback(a):this.BroadcastStart(e.video.deviceId.exact)})}else b.onMediaFailedCallback(new Error("Use https:// protocol for safe open media devices."))}).catch(a=>{console.log(a)})}}BroadcastStop(){console.log("Broadcast: Media ... stop");let a=new y(y.MEDIA_STOPING);this.EventBus.broadcast(y.ID,a);let b=this.tcPkt_StreamClose(this.self_handle,this.onStreamClosed);this.packetWorker.send(b)}Youtube(a){let b=this.tcPkt_Youtube(a.cmd,a);this.packetWorker.send(b)}YoutubePlaylistLoad(a){let b=this,c=this.tcPkt_YoutubePlaylist(c=>{b.onYoutubePlaylist(c),a&&a()});this.packetWorker.send(c)}YoutubePlaylistMode(a,b,c){let d=this.tcPkt_YoutubePlaylistMode(a,b,a=>{!0===a.success&&c&&c()});this.packetWorker.send(d)}YoutubePlaylistAdd(a,b){let c=this.tcPkt_YoutubePlaylistAdd(a,a=>{!0===a.success&&b&&b()});this.packetWorker.send(c)}YoutubePlaylistRemove(a,b){let c=this.tcPkt_YoutubePlaylistRemove(a,a=>{!0===a.success&&b&&b()});this.packetWorker.send(c)}YoutubePlaylistClear(a){let b=this.tcPkt_YoutubePlaylistClear(b=>{!0===b.success&&a&&a()});this.packetWorker.send(b)}SendMessagePublic(a){this.packetWorker.send(this.tcPkt_Msg(a,this.onSendMessagePublicCallback))}SendMessagePrivate(a,b,c){this.packetWorker.send(this.tcPkt_Msg_Private(a,c.handle,this.onSendMessagePrivateCallback))}Kick(a){this.packetWorker.send(this.tcPkt_Kick(a.handle))}Abuse(a){this.app.showToast("["+a.nickname+"] was reported"),this.packetWorker.send(this.tcPkt_Abuse(a.handle))}Ban(a){this.app.showToast("["+a.nickname+"] has been banned"),this.packetWorker.send(this.tcPkt_Ban(a.handle,this.onBanCallback))}Unban(a){this.packetWorker.send(this.tcPkt_Unban(a.id,this.onUnbanCallback))}Banlist(a){let b=this;this.packetWorker.send(this.tcPkt_Banlist(c=>{b.onBanlistCallback(c),a(Array.isArray(b.banlist)?b.banlist:[])}))}VideoForceClose(a){this.packetWorker.send(this.tcPkt_VideoForceClose(a.handle,this.onVideoForceCloseCallback))}VideoAllow(a){this.packetWorker.send(this.tcPkt_VideoAllow(a.handle))}switchFullscreen(a){return this.fullscreen=void 0==a?!this.fullscreen:a,this.fullscreen}takeSnapshot(){return!0}tcPkt_Connect(a){let b=this.packetWorker.wsCreatePacket("join",a);return b.useragent=this.app.useragent,b.token=this.tc_token,b.room=this.roomname,b.nick=this.nickname,b}tcPkt_Pong(){let a=this.packetWorker.wsCreatePacket("pong");return a}tcPkt_GetICE(a){let b=this.packetWorker.wsCreatePacket("getice",a);return b}tcPkt_Trickle(a,b){let c=this.packetWorker.wsCreatePacket("trickle");return c.handle=a,c.candidate=b,c}tcPkt_SDP(a,b,c,d){let e=this.packetWorker.wsCreatePacket("sdp",d);return e.type=a,e.sdp=b,e.handle=c,e}tcPkt_Subscribe(a,b){let c=this.packetWorker.wsCreatePacket("subscribe",b);return c.handle=a,c}tcPkt_Msg(a,b){let c=this.packetWorker.wsCreatePacket("msg",b);return c.text=this.tcPktPrepareText(a),c}tcPkt_Msg_Private(a,b,c){let d=this.packetWorker.wsCreatePacket("pvtmsg",c);return d.text=this.tcPktPrepareText(a),d.handle=b,d}tcPkt_Kick(a,b){let c=this.packetWorker.wsCreatePacket("kick",b);return c.handle=a,c}tcPkt_Ban(a,b){let c=this.packetWorker.wsCreatePacket("ban",b);return c.handle=a,c}tcPkt_Unban(a,b){let c=this.packetWorker.wsCreatePacket("unban",b);return c.id=a,c}tcPkt_Banlist(a){let b=this.packetWorker.wsCreatePacket("banlist",a);return b}tcPkt_VideoForceClose(a,b){let c=this.packetWorker.wsCreatePacket("stream_moder_close",b);return c.handle=a,c}tcPkt_VideoAllow(a){let b=this.packetWorker.wsCreatePacket("stream_moder_allow");return b.handle=a,b}tcPkt_Youtube(a,b,c){let d=this.packetWorker.wsCreatePacket(a,c);return d.item={id:b.id,duration:b.duration,offset:b.offset},void 0!==b.title&&(d.item.title=b.title),!0===b.seekByUser&&(d.item.seek=!0),void 0!==b.playlist&&(d.item.playlist=b.playlist),d}tcPkt_YoutubePlaylist(a){return this.packetWorker.wsCreatePacket("yut_playlist",a)}tcPkt_YoutubePlaylistMode(a,b,c){let d=this.packetWorker.wsCreatePacket("yut_playlist_mode",c);return d.mode={random:a,repeat:b},d}tcPkt_YoutubePlaylistAdd(a,b){let c=this.packetWorker.wsCreatePacket("yut_playlist_add",b);return c.item={id:a.id,duration:a.duration,title:a.title,image:a.imgurl,playlist:!0},c}tcPkt_YoutubePlaylistRemove(a,b){let c=this.packetWorker.wsCreatePacket("yut_playlist_remove",b);return c.item={id:a.id,duration:a.duration,title:a.title,image:a.imgurl,playlist:!0},c}tcPkt_YoutubePlaylistClear(a){let b=this.packetWorker.wsCreatePacket("yut_playlist_clear",a);return b}tcPkt_Abuse(a,b){let c=this.packetWorker.wsCreatePacket("abuse",b);return c.handle=a,c}tcPkt_ConnectCaptcha(a,b){let c=this.packetWorker.wsCreatePacket("captcha",b);return c.token=a,c}tcPkt_ConnectPassword(a,b){let c=this.packetWorker.wsCreatePacket("password",b);return c.password=a,c}tcPkt_NickChange(a,b){let c=this.packetWorker.wsCreatePacket("nick",b);return c.nick=a,c}tcPkt_StreamClose(a,b){let c=this.packetWorker.wsCreatePacket("stream_close",b);return c.handle=a,c}tcPktPrepareText(a){return a}tcPkt_UserParse(a){let b=new TinychatApp.DAL.UserEntity;return b.path=a.handle||0,b.nickname=a.nick||"",b.username=a.username||"",b.subscriptionType=a.subscription||0,b.avatarUrl=a.avatar||"",b.giftpoints=a.giftpoints||0,b.achivementUrl=a.achievement_url||"",b.isLurker=a.lurker||!1,b.isOwner=a.owner||!1,b.isOperator=a.mod||!1,b.isFeatured=a.featured||!1,b}tcPkt_RoomSettingsParse(a){let b=new TinychatApp.DAL.RoomSettingsEntity;b.type=a.type||"",b.name=a.name||"",b.topic=a.topic||"",b.subtype=a.subscription||0,b.giftpoints=a.giftpoints||0,b.pushtotalk="boolean"==typeof a.pushtotalk?a.pushtotalk:a.pushtotalk||!1;let c=a.recent_gifts,d=[];return Array.isArray(c)&&Object.keys(c).forEach(a=>{let b=new TinychatApp.DAL.GiftEntity;b.giftUrl=c[a],d.push(b)}),b.recent_gifts=d,b.biography=a.biography||"",b.location=a.location||"",b.website=a.website||"",b.avatar=a.avatar||"",b.isYTavailable=a.youtube_enabled||0,b.sessionTimeoutForGuests=a.session_timeout_for_guests||60,b.msgConstraints=a.msg_constraints||0,b}tcPkt_MsgParse(a){let b=new TinychatApp.DAL.ChatLogItemEntity;b.message_text=a.text||"";let c=a.handle||0;return b.user=this.userlist.get(c),b}tcPkt_GiftParse(a){let b=new TinychatApp.DAL.GiftEntity,c=a.gift,d=c.anon;if(b.giftComment=c.comment,b.giftExt=c.extensions,b.giftName=c.name,b.giftStore=c.store_url,b.giftUrl=c.url,!d){let c=a.from;b.fromUsername=c.name,b.fromUrl=c.url}else b.fromUsername="",b.fromUrl="";let e=a.to;return b.toUsername=e.name,b.toUrl=e.url,b}tcPkt_BanlistItemParse(a){let b=new TinychatApp.DAL.BanlistItemEntity;return b.id=a.id||"",b.username=a.username||"",b.nickname=a.nick||"",b.reason=a.reason||"",b.moderator=a.moderator||"",b}tcPkt_TcCallbackCheck(a,b){return!(a.tc!==b)||(console.error("Unexpected pkt: "+JSON.stringify(a)),console.error("Protocol Callback error:"+b+" ~ "+a.tc),!1)}_stopRemoteMediaConnection(a){this.mediaConnections.remote[a]!==void 0&&(this.mediaConnections.remote[a].Close(),delete this.mediaConnections.remote[a])}onPing(){this.packetWorker.send(this.tcPkt_Pong())}onRoomUserlist(a){let b=a.users,c=[];for(let d in b){let a=b[d],e=this.tcPkt_UserParse(a);e.handle==this.self_handle&&(e.isSelf=!0),c.push(e)}this.userlist.start(c)}onRoomUserJoin(a){let b=this.tcPkt_UserParse(a);b.handle==this.self_handle&&(b.isSelf=!0),this.userlist.joined(b)}onRoomSettings(a){if(this.tcPkt_TcCallbackCheck(a,"room_settings")){let b=this.tcPkt_RoomSettingsParse(a.room);this.updateRoomSettings(b)}}onRoomUserQuit(a){let b=a.handle;this._stopRemoteMediaConnection(b),this.userlist.quited(b)}onRoomPublish(a){let b=a.handle;if(this.userlist.updateBroadcasting(b,!0),b===this.self_handle)return void this.videolist.PublishedVideoSelf();let c=this.tcPkt_Subscribe(b,this.onRemoteConnectionReadyCallback);this.packetWorker.send(c)}onRoomPublishReconnect(a){if(a!==this.self_handle){let b=this.userlist.get(a);if(null!==b&&(b.isBroadcasting||b.needToUpprove)){let b=this.tcPkt_Subscribe(a,this.onRemoteConnectionReadyCallback);this.packetWorker.send(b)}}}onRoomUnPublish(a){let b=a.handle;this._stopRemoteMediaConnection(b),this.userlist.updateBroadcasting(b,!1)}onStreamConnected(a){!this.tcPkt_TcCallbackCheck(a,"stream_connected")}onPendingModeration(a){let b=a.handle;if(b===this.self_handle)return void this.videolist.PendingModerationVideoSelf();const c=this.userlist.get(b);c.needToUpprove=!0;let d=this.tcPkt_Subscribe(b,this.onRemoteConnectionReadyCallback);this.packetWorker.send(d)}onWaitingSlot(a){let b=a.handle;b===this.self_handle&&this.videolist.WaitingSlotVideoSelf()}onStreamClosed(a){if(!this.tcPkt_TcCallbackCheck(a,"stream_closed"))return;let b=a.publish,c=a.handle;this.self_handle==c?(this._selfMediaStreamStop(c,"Broadcast closed due server request"),a.reason!==void 0&&null!==a.reason&&this._selfShowReason(a.reason)):(this._stopRemoteMediaConnection(c),this.onRoomPublishReconnect(c),this.videolist.RemoveVideoRemote(c))}onStreamModerAllow(a){if(!this.tcPkt_TcCallbackCheck(a,"stream_moder_allow"))return;let b=a.handle,c=a.allowed_by;this._stopRemoteMediaConnection(b);let d=this.userlist.get(b),e=this.userlist.get(c);d.needToUpprove=!1,null!==e&&this.app.showToast(`[${d.nickname}]'s broadcast allowed by [${e.nickname}]`)}_selfMediaStreamStop(a,b){if(null!=this.mediaConnections.local){if(null!=this.mediaStream&&this.mediaStream.active&&this.mediaLastState!==y.MEDIA_STOPING){this.mediaStream.stop(),null!=this.mediaStreamOrigin&&this.mediaStreamOrigin.stop();let a=TinychatApp.BLL.BroadcastProgressEvent,c=new a(a.MEDIA_RTC_FAILED);c.error=new Error(b),this.EventBus.broadcast(a.ID,c)}this.mediaConnections.local.Close(),this.mediaConnections.local=null}null!=this.mediaStream&&(this.mediaStream.stop(),this.mediaStream=null,this.streamReset()),this.videolist.RemoveVideoSelf(a);let c=new y(y.MEDIA_STOPED);this.EventBus.broadcast(y.ID,c)}_selfShowReason(a){this.app.Notify(a.text)}onMediaSuccessCallback(a){this.mediaStream=this.mediaLastConstraints.video?this.prepareStream(a):a;let b=this.tcPkt_GetICE(this.onPublisherConnectionReadyCallback);this.packetWorker.send(b),console.log("Broadcast: Media OK ...");let c=new y(y.MEDIA_OK);this.EventBus.broadcast(y.ID,c)}applyFilter(a){this.mediaStreamFilter=a}prepareStream(a){function b(){if(null==c.mediaStreamCanvas)return;d.clearRect(0,0,c.mediaStreamCanvas.width,c.mediaStreamCanvas.height);let a=c.mediaStreamVideo.videoHeight,e=c.mediaStreamVideo.videoWidth;c.mediaStreamCanvas.width=e,c.mediaStreamCanvas.height=a,window.TinychatApp.BLL.VideoFilters.getFilter(c.mediaStreamFilter).apply(d,e,a),d.drawImage(c.mediaStreamVideo,0,0,e,a,0,0,c.mediaStreamCanvas.width,c.mediaStreamCanvas.height),requestAnimationFrame(b)}if(this.app.isSafari())return a;this.mediaStreamOrigin=a,this.mediaStreamVideo=document.createElement("video"),this.mediaStreamVideo.srcObject=this.mediaStreamOrigin,this.mediaStreamVideo.pause(),this.mediaStreamVideo.oncanplay=function(){requestAnimationFrame(b)},this.mediaStreamVideo.autoplay=!0,this.mediaStreamVideo.muted=!0,this.mediaStreamCanvas=document.createElement("canvas");let c=this,d=this.mediaStreamCanvas.getContext("2d");this.mediaStreamVideo.play();let e=this.mediaStreamCanvas.captureStream(15);return e.addTrack(this.mediaStreamOrigin.getAudioTracks()[0]),e}onMediaFailedCallback(a){console.warn("Broadcast: Media Failed ..."),this.mediaStream=null,this.videolist.RemoveVideoSelf(this.self_handle);let b=a.message;if(""==a.message)switch(a.name){case"NotFoundError":case"DevicesNotFoundError":b="Please setup your webcam first.";break;case"SourceUnavailableError":b="Your webcam is busy.";break;case"PermissionDeniedError":case"SecurityError":case"NotAllowedError":b="CAMERA/MICROPHONE access permission denied!";break;case"PermissionDismissedError":b="Tinychat is required to access CAMERA/MICROPHONE to have media broadcast!";break;default:b="Failed to start broadcast... Please check your webcam!";}else switch(a.name){case"OverconstrainedError":b="Failed to start broadcast... Please check your webcam!";}let c=new y(y.MEDIA_FAILED);c.error=new Error(b),this.EventBus.broadcast(y.ID,c)}onBanCallback(a){if(this.tcPkt_TcCallbackCheck(a,"ban")){let b=a.success;if(!0===b);else{a.reason;console.error(a)}}}onUnbanCallback(a){if(this.tcPkt_TcCallbackCheck(a,"unban")){let b=a.success;if(!0===b){a.id}else{a.reason;console.error(a)}}}onBanlistCallback(a){if(!this.tcPkt_TcCallbackCheck(a,"banlist"))return;let b=a.success,c=a.items;if(!0===b&&Array.isArray(c))for(let a in this.banlist=[],c){let b=this.tcPkt_BanlistItemParse(c[a]);this.banlist.push(b)}else{a.reason;console.error(a)}}onVideoForceCloseCallback(a){if(this.tcPkt_TcCallbackCheck(a,"stream_moder_close")){let b=a.success;if(!0===b){const b=a.handle,c=this.userlist.get(b);null===c?this.app.showToast("There is no such user to close video"):this.app.showToast("["+c.nickname+"] video was closed")}else{const b=a.error;this.app.showToastWarn(b.text)}}}onRoomConnectCallback(a){if("joined"===a.tc){let b=this.tcPkt_UserParse(a.self),c=this.tcPkt_RoomSettingsParse(a.room);this.updateSelfUser(b),this.updateRoomSettings(c),b.isLurker?console.warn("Chatroom.Connected: nickname: "+b.nickname+" - IsLurker!"):console.log("Chatroom.Connected: nickname: "+b.nickname),this.reconnect_wait=0,b.username||this.app.showToastTimeoutToLogin(this.roomSettings.sessionTimeoutForGuests);let d=new q;this.EventBus.broadcast(q.ID,d),""===this.nickname}else if("password"===a.tc){let a=new k;this.EventBus.broadcast(k.ID,a)}else if("captcha"===a.tc){let b=a.key,c=new i(b);this.EventBus.broadcast(i.ID,c)}else"closed"===a.tc?this.onClosed(a):this.tcPkt_TcCallbackCheck(a,null)}onPublisherConnectionReadyCallback(a){if(this.tcPkt_TcCallbackCheck(a,"iceservers"))if(!0==a.success){let b=a.servers,c=this.self_handle,d=new TinychatApp.BLL.MediaConnection(this.videolist,c,!0,b);d.AddStream(this.mediaStream),this.mediaConnections.local=d,console.log("Broadcast: Media.ICE.SDP ...");let e=new y(y.MEDIA_ICE);this.EventBus.broadcast(y.ID,e),d.Connect()}else{console.error(a);try{this._selfMediaStreamStop(this.self_handle,"Broadcast closed due server request (ICE)");let a=TinychatApp.BLL.BroadcastProgressEvent,b=new a(a.MEDIA_RTC_FAILED);b.error=new Error("Broadcast closed due server request (ICE)"),this.EventBus.broadcast(a.ID,b)}catch(a){console.error(a)}}}onRemoteConnectionReadyCallback(a){if(!this.tcPkt_TcCallbackCheck(a,"sdp"))return;if(!0!==a.success||"offer"!==a.type)return;let b=a.servers,c=a.sdp,d=a.handle,e=new TinychatApp.BLL.MediaConnection(this.videolist,d,!1,b,c);this.mediaConnections.remote[d]=e,e.Connect()}onSendMessagePublicCallback(a){if(this.tcPkt_TcCallbackCheck(a,"msg")){let b=this.tcPkt_MsgParse(a);this._userlist.isIgnored(b.user)||this.chatlog.public_add(b)}}onSendMessagePrivateCallback(a){if(!this.tcPkt_TcCallbackCheck(a,"pvtmsg"))return;let b=this.tcPkt_MsgParse(a),c=TinychatApp.DAL.ChatLogItemEntity;b.type=c.PRIVATE,b.chatname=b.user.handle;this._userlist.isIgnored(b.user)||this.chatlog.private_add(b)}onSystemMessage(a){if(!this.tcPkt_TcCallbackCheck(a,"sysmsg"))return;let b=a.handle||0;if(0<b){let a=this.userlist.get(b);null==a&&(b=0)}let c=0<b?b:TinychatApp.BLL.Chatlog.PUBLIC,d=a.text||"";this.chatlog.system_add(c,d)}onGuestSessTimeout(a){this.tcPkt_TcCallbackCheck(a,"guest_session_timeout")&&this.app.Login(777)}onMultipleVideosTimeout(a){this.tcPkt_TcCallbackCheck(a,"multiple_videos_timeout")&&(this.videolist.setNeedToBlurOtherVids(!0),this.videolist.blurOtherVids(a.locked,a.unlocked))}onGiftMessage(a){if(!this.tcPkt_TcCallbackCheck(a,"gift"))return;let b=this.tcPkt_GiftParse(a),c=new TinychatApp.DAL.ChatLogItemEntity;c.chatname=TinychatApp.BLL.Chatlog.PUBLIC,c.user=null,c.message_text="["+(b.fromUsername.isEmpty()?"Anonymous":b.fromUsername)+"] sent gift '"+b.giftName+"' to ["+b.toUsername+"]\n >"+b.giftComment+"",c.giftUrl=b.giftUrl,this.chatlog.gift_add(c)}onClosed(a){if(this.tcPkt_TcCallbackCheck(a,"closed")){let b=a.error;this.closedLastReasonCode=b,console.warn("Chatroom.ConnectionClosed: "+this.closedLastReasonCode)}}onNicknameChanged(a){if(!this.tcPkt_TcCallbackCheck(a,"nick"))return;let b=a.handle,c=a.nick;if(!(b==this.self_handle))this.userlist.updateNickname(b,c);else if(!0===a.success){let a=this.selfUser();a.nickname=c,this.updateSelfUser(a),this.userlist.updateNickname(b,c)}else console.warn(a),this.app.showToastWarn("Nickname was not changed for some reason...")}onYoutube(a){if(!this.app.settings.isYoutube())return void console.log("YouTube cmds blocked by chat settings...");let b="",c=a.tc;if("yut_play"===c)b=A.YT_PLAY;else if("yut_stop"===c)b=A.YT_STOP;else return void this.tcPkt_TcCallbackCheck(a,"-");let d=new A(b);if(d.cmd=b,void 0!=a.item){let b=a.item;d.id=b.id,d.duration=b.duration,d.offset=parseFloat(b.offset),d.playlist=b.playlist}else d.id=a.id,d.duration=a.duration,d.offset=parseFloat(a.offset);d.handle=parseInt(a.handle),d.server=!0,d.success=void 0==a.success||a.success,d.reason=void 0==a.reason?"":a.reason,isNaN(d.offset)&&(d.offset=0),isNaN(d.handle)&&(d.handle=-1),d.success?this.EventBus.broadcast(A.ID,d):this.app.showToastWarn("Youtube command has failed, due: "+d.reason)}onYoutubePlaylist(a){if(!this.tcPkt_TcCallbackCheck(a,"yut_playlist"))return;let b=TinychatApp.DAL.YoutubeItem,c=a.success,d=a.reason;if(!0===c){let c=[],d=a.items;if(Array.isArray(d))for(let a in d){let e=d[a],f=new b;f.id=e.id,f.duration=e.duration,f.title=e.title,f.imgurl=e.image,f.playlist=!0,c.push(f)}if(void 0!=a.mode){let b=a.mode;this.youtubelist_random=b.random,this.youtubelist_repeat=b.repeat}this.youtubelist=c}else this.app.showToastWarn("Youtube Playlist load has failed, due: "+d)}sendPushForUnreadPrivateMessage(){if(this.pushNotificationSentYet)return;this.pushNotificationSentYet=!0;let a="username="+encodeURIComponent(this.enterroomresult.selfuser.username)+"&roomname="+encodeURIComponent(this.chatroomName()),b=new XMLHttpRequest;b.open("POST","/pushnotification/privatemessage",!0),b.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),b.send(a)}}const d="RoomSettingsEvent_"+a.newGuid();class e{static get ID(){return d}constructor(a){return this.roomSettings=a,this}}const f="RoomConnectEvent_"+a.newGuid();class g{static get ID(){return f}constructor(a){return this.attempts=a,this}}const h="RoomConnectCaptcha_"+a.newGuid();class i{static get ID(){return h}constructor(a){return this.key=a,this}}const j="RoomConnectPassword_"+a.newGuid();class k{static get ID(){return j}constructor(){return this}}const l="RoomConnectStandby_"+a.newGuid();class m{static get ID(){return l}constructor(a,b){return this.tries=a,this.waitms=b,this}}const n="RoomConnectFatal_"+a.newGuid();class o{static get ID(){return n}constructor(){return this}}const p="RoomConnected_"+a.newGuid();class q{static get ID(){return p}constructor(){return this}}const r="RoomReconnected_"+a.newGuid();class s{static get ID(){return r}constructor(){return this}}const t="RoomQuitEvent_"+a.newGuid();class u{static get ID(){return t}constructor(a,b){return this.reasonCode=a,this.chatroom=b,this}static get WS(){return-3}static ConvertReason(a){let b="";switch(a){case 0:b="There is no internet connection...";break;case 1:b="Opss, chatroom has no free slots for users";break;case 2:b="Chatroom has been closed by administrator";break;case 3:b="This room does not allow guests to join, please sign in";break;case 4:b="You have been banned by a moderator";break;case 5:b="Wrong password";break;case 6:b="Single connection is allowed for chatroom";break;case 7:b="An error occurred while connecting to the server...";break;case 8:b="An error occurred while connecting to the server...";break;case 9:b="An error occurred while connecting to the server...";break;case 10:b="An error occurred while connecting to the server...";break;case 11:b="An error occurred while connecting to the server...";break;case 12:b="You have been kicked by a moderator";break;case 22:b="You must be at least 18 years old to join this room";break;case 23:b="Your connection limit is exceeded.";break;case 24:b="This alias has been expired.";break;case 25:b="Your connection limit is exceeded. You can upgrade to get more.";break;default:b="There is no internet connection...";}return b}static ConvertAction(a){let b="";switch(a){case 3:b="SIGN IN";break;case 25:b="UPGRADE";break;default:b="RETRY";}return b}}const v="RoomNicknameChangeEvent_"+a.newGuid();class w{static get ID(){return v}constructor(a,b){return this.nickname=a,this.type=b,this}}const x="BroadcastProgressEvent_"+a.newGuid();class y{static get ID(){return x}static get MEDIA_START(){return"media_start"}static get MEDIA_OK(){return"media_ok"}static get MEDIA_ICE(){return"media_ice"}static get MEDIA_STARTED_SUCCESS(){return"media_started_success"}static get MEDIA_FAILED(){return"media_failed"}static get MEDIA_RTC_FAILED(){return"media_rtc_failed"}static get MEDIA_STOPING(){return"media_stoping"}static get MEDIA_STOPED(){return"media_stoped"}constructor(a){return this.stage=a,this.error="",this}}const z="YoutubeEvent_"+a.newGuid();class A{static get ID(){return z}static get YT_PLAY(){return"yut_play"}static get YT_STOP(){return"yut_stop"}constructor(a){return this.handle=-1,this.cmd=a,this.id="",this.offset=0,this.duration=void 0,this.seekByUser=void 0,this.playlist=void 0,this.success=!0,this.reason="",this.server=void 0,this}}window.TinychatApp.BLL.ChatRoom=c,window.TinychatApp.BLL.RoomSettingsEvent=e,window.TinychatApp.BLL.RoomConnectEvent=g,window.TinychatApp.BLL.RoomConnectCaptcha=i,window.TinychatApp.BLL.RoomConnectPassword=k,window.TinychatApp.BLL.RoomConnectStandby=m,window.TinychatApp.BLL.RoomConnectFatal=o,window.TinychatApp.BLL.RoomConnected=q,window.TinychatApp.BLL.RoomReconnected=s,window.TinychatApp.BLL.RoomQuitEvent=u,window.TinychatApp.BLL.RoomNicknameChangeEvent=w,window.TinychatApp.BLL.BroadcastProgressEvent=y,window.TinychatApp.BLL.YoutubeEvent=A})();</script><script>(function(){"use strict";class a{static get getAll(){return[{name:"No Filter",css:"nofilter",filter:"",background:"",mixBlendMode:"",apply:function(){}},{name:"1977",css:"_1977",filter:"contrast(1.1) brightness(1.1) saturate(1.3)",background:"rgba(243,106,188,.3)",mixBlendMode:"screen",apply:function(a,b,c){a.filter=this.filter,a.fillStyle=this.background,a.fillRect(0,0,b,c),a.globalCompositeOperation=this.mixBlendMode}},{name:"Aden",css:"aden",filter:"hue-rotate(-20deg) contrast(.9) saturate(.85) brightness(1.2)",background:"linear-gradient(to right,rgba(66,10,14,.2),transparent)",mixBlendMode:"darken",apply:function(a,b,c){a.filter=this.filter;let d=a.createLinearGradient(0,0,b,c);d.addColorStop(0,"rgba(66, 10, 14, .2)"),d.addColorStop(1,"rgba(0, 0, 0, .0)"),a.fillStyle=d,a.fillRect(0,0,b,c),a.globalCompositeOperation=this.mixBlendMode}},{name:"Brannan",css:"brannan",filter:"sepia(.5) contrast(1.4)",background:"rgba(161,44,199,.31)",mixBlendMode:"lighten",apply:function(a,b,c){a.filter=this.filter,a.fillStyle=this.background,a.fillRect(0,0,b,c),a.globalCompositeOperation=this.mixBlendMode}},{name:"Brooklyn",css:"brooklyn",filter:"contrast(.9) brightness(1.1)",background:"radial-gradient(circle, rgba(168,223,193,.4) 70%, #c4b7c8)",mixBlendMode:"overlay",apply:function(a,b,c){a.filter=this.filter;let d=a.createRadialGradient(b/2,c/2,0,b/2,c/2,.7*b);d.addColorStop(0,"rgba(168,223,193,.4)"),d.addColorStop(1,"#c4b7c8"),a.fillStyle=d,a.fillRect(0,0,b,c),a.globalCompositeOperation=this.mixBlendMode}},{name:"Clarendon",css:"clarendon",filter:"contrast(1.2) saturate(1.35)",background:"rgba(127,187,227,.2)",mixBlendMode:"overlay",apply:function(a,b,c){a.filter=this.filter,a.fillStyle=this.background,a.fillRect(0,0,b,c),a.globalCompositeOperation=this.mixBlendMode}},{name:"Earlybird",css:"earlybird",filter:"contrast(.9) sepia(.2)",background:"radial-gradient(circle,#d0ba8e 20%,#360309 85%,#1d0210 100%)",mixBlendMode:"overlay",apply:function(a,b,c){a.filter=this.filter;let d=a.createRadialGradient(b/2,c/2,.2*(b/2),b/2,c/2,.85*(b/2));d.addColorStop(0,"rgba(208, 186, 142, .5)"),d.addColorStop(1,"rgba(54, 3, 9, .5)"),a.fillStyle=d,a.fillRect(0,0,b,c),a.globalCompositeOperation=this.mixBlendMode}},{name:"Gingham",css:"gingham",filter:"brightness(1.05) hue-rotate(-10deg)",background:"rgba(230, 230, 250, .3)",mixBlendMode:"soft-light",apply:function(a,b,c){a.filter=this.filter,a.fillStyle=this.background,a.fillRect(0,0,b,c),a.globalCompositeOperation=this.mixBlendMode}},{name:"Hudson",css:"hudson",filter:"brightness(1.2) contrast(.9) saturate(1.1)",background:"radial-gradient(circle,#a6b1ff 50%,#342134)",mixBlendMode:"multiply",apply:function(a,b,c){a.filter=this.filter;let d=a.createRadialGradient(b/2,c/2,.5*(b/2),b/2,c/2,b/2);d.addColorStop(0,"rgba(166, 177, 255, .5)"),d.addColorStop(1,"rgba(52, 33, 52, .5)"),a.fillStyle=d,a.fillRect(0,0,b,c),a.globalCompositeOperation=this.mixBlendMode}},{name:"Inkwell",css:"inkwell",filter:"sepia(.3) contrast(1.1) brightness(1.1) grayscale(1)",background:"",mixBlendMode:"",apply:function(a){a.filter=this.filter}},{name:"Lo-Fi",css:"lofi",filter:"saturate(1.1) contrast(1.5)",background:"radial-gradient(circle,transparent 70%,#222 150%)",mixBlendMode:"multiply",apply:function(a,b,c){a.filter=this.filter;let d=a.createRadialGradient(b/2,c/2,.7*(b/2),b/2,c/2,1.5*(b/2));d.addColorStop(0,"rgba(0, 0, 0, 0)"),d.addColorStop(1,"rgb(34, 34, 34)"),a.fillStyle=d,a.fillRect(0,0,b,c),a.globalCompositeOperation=this.mixBlendMode}},{name:"Maven",css:"maven",filter:"sepia(.25) brightness(.95) contrast(.95) saturate(1.5)",background:"rgba(3, 230, 26, .2)",mixBlendMode:"hue",apply:function(a,b,c){a.filter=this.filter,a.fillStyle=this.background,a.fillRect(0,0,b,c),a.globalCompositeOperation=this.mixBlendMode}}]}static getFilter(b){return a.getAll.find(a=>a.name===b)}}window.TinychatApp.BLL.VideoFilters=a})();</script><script type="text/javascript" charset="utf-8">(function(e){if("object"===typeof exports&&"undefined"!==typeof module)module.exports=e();else if("function"===typeof define&&define.amd)define([],e);else{var t;t="undefined"===typeof window?"undefined"===typeof global?"undefined"===typeof self?this:self:global:window,t.adapter=e()}})(function(){var e=Math.min;return function c(d,e,t){function r(i,o){if(!e[i]){if(!d[i]){var s="function"==typeof require&&require;if(!o&&s)return s(i,!0);if(n)return n(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=e[i]={exports:{}};d[i][0].call(p.exports,function(t){var e=d[i][1][t];return r(e?e:t)},p,p.exports,c,d,e,t)}return e[i].exports}for(var n="function"==typeof require&&require,a=0;a<t.length;a++)r(t[a]);return r}({1:[function(t,r){"use strict";function a(e){return{inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type}function n(e,t,r,a,n){var i=p.writeRtpDescription(e.kind,t);if(i+=p.writeIceParameters(e.iceGatherer.getLocalParameters()),i+=p.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===r?"actpass":n||"active"),i+="a=mid:"+e.mid+"\r\n",i+=e.rtpSender&&e.rtpReceiver?"a=sendrecv\r\n":e.rtpSender?"a=sendonly\r\n":e.rtpReceiver?"a=recvonly\r\n":"a=inactive\r\n",e.rtpSender){var o=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=o;var s="msid:"+(a?a.id:"-")+" "+o+"\r\n";i+="a="+s,i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+s,e.sendEncodingParameters[0].rtx&&(i+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+s,i+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+p.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(i+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+p.localCName+"\r\n"),i}function o(e,t){var r=!1;return e=JSON.parse(JSON.stringify(e)),e.filter(function(e){if(e&&(e.urls||e.url)){var a=e.urls||e.url;e.url&&!e.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var n="string"===typeof a;return n&&(a=[a]),a=a.filter(function(e){var a=0===e.indexOf("turn:")&&-1!==e.indexOf("transport=udp")&&-1===e.indexOf("turn:[")&&!r;return a?(r=!0,!0):0===e.indexOf("stun:")&&14393<=t&&-1===e.indexOf("?transport=udp")}),delete e.url,e.urls=n?a[0]:a,!!a.length}})}function i(t,r){var a={codecs:[],headerExtensions:[],fecMechanisms:[]},n=function(e,t){e=parseInt(e,10);for(var r=0;r<t.length;r++)if(t[r].payloadType===e||t[r].preferredPayloadType===e)return t[r]},i=function(e,t,r,a){var i=n(e.parameters.apt,r),o=n(t.parameters.apt,a);return i&&o&&i.name.toLowerCase()===o.name.toLowerCase()};return t.codecs.forEach(function(n){for(var o,s=0;s<r.codecs.length;s++)if(o=r.codecs[s],n.name.toLowerCase()===o.name.toLowerCase()&&n.clockRate===o.clockRate){if("rtx"===n.name.toLowerCase()&&n.parameters&&o.parameters.apt&&!i(n,o,t.codecs,r.codecs))continue;o=JSON.parse(JSON.stringify(o)),o.numChannels=e(n.numChannels,o.numChannels),a.codecs.push(o),o.rtcpFeedback=o.rtcpFeedback.filter(function(e){for(var t=0;t<n.rtcpFeedback.length;t++)if(n.rtcpFeedback[t].type===e.type&&n.rtcpFeedback[t].parameter===e.parameter)return!0;return!1});break}}),t.headerExtensions.forEach(function(e){for(var t,n=0;n<r.headerExtensions.length;n++)if(t=r.headerExtensions[n],e.uri===t.uri){a.headerExtensions.push(t);break}}),a}function s(e,t,r){return-1!=={offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[t][e].indexOf(r)}function c(e,t){var r=e.getRemoteCandidates().find(function(e){return t.foundation===e.foundation&&t.ip===e.ip&&t.port===e.port&&t.priority===e.priority&&t.protocol===e.protocol&&t.type===e.type});return r||e.addRemoteCandidate(t),!r}function d(t,r){var a=new Error(r);return a.name=t,a.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[t],a}var p=t("sdp");r.exports=function(e,t){function r(t,r){r.addTrack(t),r.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function m(t,r){r.removeTrack(t),r.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:t}))}function l(t,r,a,n){var i=new Event("track");i.track=r,i.receiver=a,i.transceiver={receiver:a},i.streams=n,e.setTimeout(function(){t._dispatchEvent("track",i)})}var h=function(r){var a=this,n=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach(function(e){a[e]=n[e].bind(n)}),this.canTrickleIceCandidates=null,this.needNegotiation=!1,this.localStreams=[],this.remoteStreams=[],this.localDescription=null,this.remoteDescription=null,this.signalingState="stable",this.iceConnectionState="new",this.connectionState="new",this.iceGatheringState="new",r=JSON.parse(JSON.stringify(r||{})),this.usingBundle="max-bundle"===r.bundlePolicy,"negotiate"===r.rtcpMuxPolicy)throw d("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");else r.rtcpMuxPolicy||(r.rtcpMuxPolicy="require");switch(r.iceTransportPolicy){case"all":case"relay":break;default:r.iceTransportPolicy="all";}switch(r.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:r.bundlePolicy="balanced";}if(r.iceServers=o(r.iceServers||[],t),this._iceGatherers=[],r.iceCandidatePoolSize)for(var s=r.iceCandidatePoolSize;0<s;s--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:r.iceServers,gatherPolicy:r.iceTransportPolicy}));else r.iceCandidatePoolSize=0;this._config=r,this.transceivers=[],this._sdpSessionId=p.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};h.prototype.onicecandidate=null,h.prototype.onaddstream=null,h.prototype.ontrack=null,h.prototype.onremovestream=null,h.prototype.onsignalingstatechange=null,h.prototype.oniceconnectionstatechange=null,h.prototype.onconnectionstatechange=null,h.prototype.onicegatheringstatechange=null,h.prototype.onnegotiationneeded=null,h.prototype.ondatachannel=null,h.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"===typeof this["on"+e]&&this["on"+e](t))},h.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},h.prototype.getConfiguration=function(){return this._config},h.prototype.getLocalStreams=function(){return this.localStreams},h.prototype.getRemoteStreams=function(){return this.remoteStreams},h.prototype._createTransceiver=function(e,t){var r=0<this.transceivers.length,a={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&r)a.iceTransport=this.transceivers[0].iceTransport,a.dtlsTransport=this.transceivers[0].dtlsTransport;else{var n=this._createIceAndDtlsTransports();a.iceTransport=n.iceTransport,a.dtlsTransport=n.dtlsTransport}return t||this.transceivers.push(a),a},h.prototype.addTrack=function(t,r){if(this._isClosed)throw d("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var a=this.transceivers.find(function(e){return e.track===t});if(a)throw d("InvalidAccessError","Track already exists.");for(var n,o=0;o<this.transceivers.length;o++)this.transceivers[o].track||this.transceivers[o].kind!==t.kind||(n=this.transceivers[o]);return n||(n=this._createTransceiver(t.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(r)&&this.localStreams.push(r),n.track=t,n.stream=r,n.rtpSender=new e.RTCRtpSender(t,n.dtlsTransport),n.rtpSender},h.prototype.addStream=function(e){var r=this;if(15025<=t)e.getTracks().forEach(function(t){r.addTrack(t,e)});else{var a=e.clone();e.getTracks().forEach(function(e,t){var r=a.getTracks()[t];e.addEventListener("enabled",function(e){r.enabled=e.enabled})}),a.getTracks().forEach(function(e){r.addTrack(e,a)})}},h.prototype.removeTrack=function(r){if(this._isClosed)throw d("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(r instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var t=this.transceivers.find(function(e){return e.rtpSender===r});if(!t)throw d("InvalidAccessError","Sender was not created by this connection.");var a=t.stream;t.rtpSender.stop(),t.rtpSender=null,t.track=null,t.stream=null;var n=this.transceivers.map(function(e){return e.stream});-1===n.indexOf(a)&&-1<this.localStreams.indexOf(a)&&this.localStreams.splice(this.localStreams.indexOf(a),1),this._maybeFireNegotiationNeeded()},h.prototype.removeStream=function(e){var t=this;e.getTracks().forEach(function(e){var r=t.getSenders().find(function(t){return t.track===e});r&&t.removeTrack(r)})},h.prototype.getSenders=function(){return this.transceivers.filter(function(e){return!!e.rtpSender}).map(function(e){return e.rtpSender})},h.prototype.getReceivers=function(){return this.transceivers.filter(function(e){return!!e.rtpReceiver}).map(function(e){return e.rtpReceiver})},h.prototype._createIceGatherer=function(t,r){var a=this;if(r&&0<t)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var n=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(n,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var r=!e.candidate||0===Object.keys(e.candidate).length;n.state=r?"completed":"gathering",null!==a.transceivers[t].bufferedCandidateEvents&&a.transceivers[t].bufferedCandidateEvents.push(e)},n.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),n},h.prototype._gather=function(t,r){var a=this,n=this.transceivers[r].iceGatherer;if(!n.onlocalcandidate){var i=this.transceivers[r].bufferedCandidateEvents;this.transceivers[r].bufferedCandidateEvents=null,n.removeEventListener("localcandidate",this.transceivers[r].bufferCandidates),n.onlocalcandidate=function(e){if(!(a.usingBundle&&0<r)){var i=new Event("icecandidate");i.candidate={sdpMid:t,sdpMLineIndex:r};var o=e.candidate,s=!o||0===Object.keys(o).length;if(s)("new"===n.state||"gathering"===n.state)&&(n.state="completed");else{"new"===n.state&&(n.state="gathering"),o.component=1,o.ufrag=n.getLocalParameters().usernameFragment;var c=p.writeCandidate(o);i.candidate=Object.assign(i.candidate,p.parseCandidate(c)),i.candidate.candidate=c,i.candidate.toJSON=function(){return{candidate:i.candidate.candidate,sdpMid:i.candidate.sdpMid,sdpMLineIndex:i.candidate.sdpMLineIndex,usernameFragment:i.candidate.usernameFragment}}}var d=p.getMediaSections(a.localDescription.sdp);d[i.candidate.sdpMLineIndex]+=s?"a=end-of-candidates\r\n":"a="+i.candidate.candidate+"\r\n",a.localDescription.sdp=p.getDescription(a.localDescription.sdp)+d.join("");var m=a.transceivers.every(function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state});"gathering"!==a.iceGatheringState&&(a.iceGatheringState="gathering",a._emitGatheringStateChange()),s||a._dispatchEvent("icecandidate",i),m&&(a._dispatchEvent("icecandidate",new Event("icecandidate")),a.iceGatheringState="complete",a._emitGatheringStateChange())}},e.setTimeout(function(){i.forEach(function(t){n.onlocalcandidate(t)})},0)}},h.prototype._createIceAndDtlsTransports=function(){var t=this,r=new e.RTCIceTransport(null);r.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var a=new e.RTCDtlsTransport(r);return a.ondtlsstatechange=function(){t._updateConnectionState()},a.onerror=function(){Object.defineProperty(a,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:r,dtlsTransport:a}},h.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var r=this.transceivers[e].iceTransport;r&&(delete r.onicestatechange,delete this.transceivers[e].iceTransport);var a=this.transceivers[e].dtlsTransport;a&&(delete a.ondtlsstatechange,delete a.onerror,delete this.transceivers[e].dtlsTransport)},h.prototype._transceive=function(e,r,a){var n=i(e.localCapabilities,e.remoteCapabilities);r&&e.rtpSender&&(n.encodings=e.sendEncodingParameters,n.rtcp={cname:p.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(n.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(n)),a&&e.rtpReceiver&&0<n.codecs.length&&("video"===e.kind&&e.recvEncodingParameters&&15019>t&&e.recvEncodingParameters.forEach(function(e){delete e.rtx}),n.encodings=e.recvEncodingParameters.length?e.recvEncodingParameters:[{}],n.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(n.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(n.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(n))},h.prototype.setLocalDescription=function(e){var t=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(d("TypeError","Unsupported type \""+e.type+"\""));if(!s("setLocalDescription",e.type,t.signalingState)||t._isClosed)return Promise.reject(d("InvalidStateError","Can not set local "+e.type+" in state "+t.signalingState));var r,a;if("offer"===e.type)r=p.splitSections(e.sdp),a=r.shift(),r.forEach(function(e,r){var a=p.parseRtpParameters(e);t.transceivers[r].localCapabilities=a}),t.transceivers.forEach(function(e,r){t._gather(e.mid,r)});else if("answer"===e.type){r=p.splitSections(t.remoteDescription.sdp),a=r.shift();var n=0<p.matchPrefix(a,"a=ice-lite").length;r.forEach(function(e,r){var o=t.transceivers[r],s=o.iceGatherer,c=o.iceTransport,d=o.dtlsTransport,m=o.localCapabilities,l=o.remoteCapabilities,h=p.isRejected(e)&&0===p.matchPrefix(e,"a=bundle-only").length;if(!h&&!o.rejected){var g=p.getIceParameters(e,a),f=p.getDtlsParameters(e,a);n&&(f.role="server"),t.usingBundle&&0!==r||(t._gather(o.mid,r),"new"===c.state&&c.start(s,g,n?"controlling":"controlled"),"new"===d.state&&d.start(f));var C=i(m,l);t._transceive(o,0<C.codecs.length,!1)}})}return t.localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?t._updateSignalingState("have-local-offer"):t._updateSignalingState("stable"),Promise.resolve()},h.prototype.setRemoteDescription=function(a){var n=this;if(-1===["offer","answer"].indexOf(a.type))return Promise.reject(d("TypeError","Unsupported type \""+a.type+"\""));if(!s("setRemoteDescription",a.type,n.signalingState)||n._isClosed)return Promise.reject(d("InvalidStateError","Can not set remote "+a.type+" in state "+n.signalingState));var i={};n.remoteStreams.forEach(function(e){i[e.id]=e});var o=[],h=p.splitSections(a.sdp),g=h.shift(),f=0<p.matchPrefix(g,"a=ice-lite").length,C=0<p.matchPrefix(g,"a=group:BUNDLE ").length;n.usingBundle=C;var v=p.matchPrefix(g,"a=ice-options:")[0];return n.canTrickleIceCandidates=!!v&&0<=v.substr(14).split(" ").indexOf("trickle"),h.forEach(function(s,d){var l=p.splitLines(s),h=p.getKind(s),v=p.isRejected(s)&&0===p.matchPrefix(s,"a=bundle-only").length,y=l[0].substr(2).split(" ")[2],u=p.getDirection(s,g),T=p.parseMsid(s),S=p.getMid(s)||p.generateIdentifier();if("application"===h&&"DTLS/SCTP"===y||v)return void(n.transceivers[d]={mid:S,kind:h,rejected:!0});!v&&n.transceivers[d]&&n.transceivers[d].rejected&&(n.transceivers[d]=n._createTransceiver(h,!0));var R,P,E,k,b,_,x,M,L,I,D,w=p.parseRtpParameters(s);v||(I=p.getIceParameters(s,g),D=p.getDtlsParameters(s,g),D.role="client"),x=p.parseRtpEncodingParameters(s);var j=p.parseRtcpParameters(s),O=0<p.matchPrefix(s,"a=end-of-candidates",g).length,A=p.matchPrefix(s,"a=candidate:").map(function(e){return p.parseCandidate(e)}).filter(function(e){return 1===e.component});if(("offer"===a.type||"answer"===a.type)&&!v&&C&&0<d&&n.transceivers[d]&&(n._disposeIceAndDtlsTransports(d),n.transceivers[d].iceGatherer=n.transceivers[0].iceGatherer,n.transceivers[d].iceTransport=n.transceivers[0].iceTransport,n.transceivers[d].dtlsTransport=n.transceivers[0].dtlsTransport,n.transceivers[d].rtpSender&&n.transceivers[d].rtpSender.setTransport(n.transceivers[0].dtlsTransport),n.transceivers[d].rtpReceiver&&n.transceivers[d].rtpReceiver.setTransport(n.transceivers[0].dtlsTransport)),"offer"===a.type&&!v){R=n.transceivers[d]||n._createTransceiver(h),R.mid=S,R.iceGatherer||(R.iceGatherer=n._createIceGatherer(d,C)),A.length&&"new"===R.iceTransport.state&&(O&&(!C||0===d)?R.iceTransport.setRemoteCandidates(A):A.forEach(function(e){c(R.iceTransport,e)})),M=e.RTCRtpReceiver.getCapabilities(h),15019>t&&(M.codecs=M.codecs.filter(function(e){return"rtx"!==e.name})),_=R.sendEncodingParameters||[{ssrc:1001*(2*d+2)}];var U=!1;if("sendrecv"!==u&&"sendonly"!==u)R.rtpReceiver&&R.rtpReceiver.track&&(R.associatedRemoteMediaStreams.forEach(function(e){var t=e.getTracks().find(function(e){return e.id===R.rtpReceiver.track.id});t&&m(t,e)}),R.associatedRemoteMediaStreams=[]);else if(U=!R.rtpReceiver,b=R.rtpReceiver||new e.RTCRtpReceiver(R.dtlsTransport,h),U){var G;L=b.track,T&&"-"===T.stream||(T?(!i[T.stream]&&(i[T.stream]=new e.MediaStream,Object.defineProperty(i[T.stream],"id",{get:function(){return T.stream}})),Object.defineProperty(L,"id",{get:function(){return T.track}}),G=i[T.stream]):(!i.default&&(i.default=new e.MediaStream),G=i.default)),G&&(r(L,G),R.associatedRemoteMediaStreams.push(G)),o.push([L,b,G])}R.localCapabilities=M,R.remoteCapabilities=w,R.rtpReceiver=b,R.rtcpParameters=j,R.sendEncodingParameters=_,R.recvEncodingParameters=x,n._transceive(n.transceivers[d],!1,U)}else"answer"!==a.type||v||(R=n.transceivers[d],P=R.iceGatherer,E=R.iceTransport,k=R.dtlsTransport,b=R.rtpReceiver,_=R.sendEncodingParameters,M=R.localCapabilities,n.transceivers[d].recvEncodingParameters=x,n.transceivers[d].remoteCapabilities=w,n.transceivers[d].rtcpParameters=j,A.length&&"new"===E.state&&((f||O)&&(!C||0===d)?E.setRemoteCandidates(A):A.forEach(function(e){c(R.iceTransport,e)})),C&&0!==d||("new"===E.state&&E.start(P,I,"controlling"),"new"===k.state&&k.start(D)),n._transceive(R,"sendrecv"===u||"recvonly"===u,"sendrecv"===u||"sendonly"===u),b&&("sendrecv"===u||"sendonly"===u)?(L=b.track,T?(!i[T.stream]&&(i[T.stream]=new e.MediaStream),r(L,i[T.stream]),o.push([L,b,i[T.stream]])):(!i.default&&(i.default=new e.MediaStream),r(L,i.default),o.push([L,b,i.default]))):delete R.rtpReceiver)}),void 0===n._dtlsRole&&(n._dtlsRole="offer"===a.type?"active":"passive"),n.remoteDescription={type:a.type,sdp:a.sdp},"offer"===a.type?n._updateSignalingState("have-remote-offer"):n._updateSignalingState("stable"),Object.keys(i).forEach(function(t){var r=i[t];if(r.getTracks().length){if(-1===n.remoteStreams.indexOf(r)){n.remoteStreams.push(r);var a=new Event("addstream");a.stream=r,e.setTimeout(function(){n._dispatchEvent("addstream",a)})}o.forEach(function(e){var t=e[0],a=e[1];r.id!==e[2].id||l(n,t,a,[r])})}}),o.forEach(function(e){e[2]||l(n,e[0],e[1],[])}),e.setTimeout(function(){n&&n.transceivers&&n.transceivers.forEach(function(e){e.iceTransport&&"new"===e.iceTransport.state&&0<e.iceTransport.getRemoteCandidates().length&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))})},4e3),Promise.resolve()},h.prototype.close=function(){this.transceivers.forEach(function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()}),this._isClosed=!0,this._updateSignalingState("closed")},h.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},h.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"!==this.signalingState||!0===this.needNegotiation||(this.needNegotiation=!0,e.setTimeout(function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}},0))},h.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach(function(e){t[e.iceTransport.state]++}),e="new",0<t.failed?e="failed":0<t.checking?e="checking":0<t.disconnected?e="disconnected":0<t.new?e="new":0<t.connected?e="connected":0<t.completed&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var r=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",r)}},h.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach(function(e){t[e.iceTransport.state]++,t[e.dtlsTransport.state]++}),t.connected+=t.completed,e="new",0<t.failed?e="failed":0<t.connecting?e="connecting":0<t.disconnected?e="disconnected":0<t.new?e="new":0<t.connected&&(e="connected"),e!==this.connectionState){this.connectionState=e;var r=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",r)}},h.prototype.createOffer=function(){var r=this;if(r._isClosed)return Promise.reject(d("InvalidStateError","Can not call createOffer after close"));var a=r.transceivers.filter(function(e){return"audio"===e.kind}).length,i=r.transceivers.filter(function(e){return"video"===e.kind}).length,o=arguments[0];if(o){if(o.mandatory||o.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==o.offerToReceiveAudio&&(!0===o.offerToReceiveAudio?a=1:!1===o.offerToReceiveAudio?a=0:a=o.offerToReceiveAudio),void 0!==o.offerToReceiveVideo&&(!0===o.offerToReceiveVideo?i=1:!1===o.offerToReceiveVideo?i=0:i=o.offerToReceiveVideo)}for(r.transceivers.forEach(function(e){"audio"===e.kind?(a--,0>a&&(e.wantReceive=!1)):"video"===e.kind&&(i--,0>i&&(e.wantReceive=!1))});0<a||0<i;)0<a&&(r._createTransceiver("audio"),a--),0<i&&(r._createTransceiver("video"),i--);var s=p.writeSessionBoilerplate(r._sdpSessionId,r._sdpSessionVersion++);r.transceivers.forEach(function(a,n){var i=a.track,o=a.kind,s=a.mid||p.generateIdentifier();a.mid=s,a.iceGatherer||(a.iceGatherer=r._createIceGatherer(n,r.usingBundle));var c=e.RTCRtpSender.getCapabilities(o);15019>t&&(c.codecs=c.codecs.filter(function(e){return"rtx"!==e.name})),c.codecs.forEach(function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),a.remoteCapabilities&&a.remoteCapabilities.codecs&&a.remoteCapabilities.codecs.forEach(function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)})}),c.headerExtensions.forEach(function(e){var t=a.remoteCapabilities&&a.remoteCapabilities.headerExtensions||[];t.forEach(function(t){e.uri===t.uri&&(e.id=t.id)})});var d=a.sendEncodingParameters||[{ssrc:1001*(2*n+1)}];i&&15019<=t&&"video"===o&&!d[0].rtx&&(d[0].rtx={ssrc:d[0].ssrc+1}),a.wantReceive&&(a.rtpReceiver=new e.RTCRtpReceiver(a.dtlsTransport,o)),a.localCapabilities=c,a.sendEncodingParameters=d}),"max-compat"!==r._config.bundlePolicy&&(s+="a=group:BUNDLE "+r.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n"),s+="a=ice-options:trickle\r\n",r.transceivers.forEach(function(e,t){s+=n(e,e.localCapabilities,"offer",e.stream,r._dtlsRole),s+="a=rtcp-rsize\r\n",e.iceGatherer&&"new"!==r.iceGatheringState&&(0===t||!r.usingBundle)&&(e.iceGatherer.getLocalCandidates().forEach(function(e){e.component=1,s+="a="+p.writeCandidate(e)+"\r\n"}),"completed"===e.iceGatherer.state&&(s+="a=end-of-candidates\r\n"))});var c=new e.RTCSessionDescription({type:"offer",sdp:s});return Promise.resolve(c)},h.prototype.createAnswer=function(){var r=this;if(r._isClosed)return Promise.reject(d("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==r.signalingState&&"have-local-pranswer"!==r.signalingState)return Promise.reject(d("InvalidStateError","Can not call createAnswer in signalingState "+r.signalingState));var a=p.writeSessionBoilerplate(r._sdpSessionId,r._sdpSessionVersion++);r.usingBundle&&(a+="a=group:BUNDLE "+r.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n");var o=p.getMediaSections(r.remoteDescription.sdp).length;r.transceivers.forEach(function(e,s){if(!(s+1>o)){if(e.rejected)return"application"===e.kind?a+="m=application 0 DTLS/SCTP 5000\r\n":"audio"===e.kind?a+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(a+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(a+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");if(e.stream){var c;"audio"===e.kind?c=e.stream.getAudioTracks()[0]:"video"===e.kind&&(c=e.stream.getVideoTracks()[0]),c&&15019<=t&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1})}var d=i(e.localCapabilities,e.remoteCapabilities),p=d.codecs.filter(function(e){return"rtx"===e.name.toLowerCase()}).length;!p&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,a+=n(e,d,"answer",e.stream,r._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(a+="a=rtcp-rsize\r\n")}});var s=new e.RTCSessionDescription({type:"answer",sdp:a});return Promise.resolve(s)},h.prototype.addIceCandidate=function(e){var t,r=this;return e&&!(void 0!==e.sdpMLineIndex||e.sdpMid)?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise(function(a,n){if(!r.remoteDescription)return n(d("InvalidStateError","Can not add ICE candidate without a remote description"));if(!e||""===e.candidate)for(var o=0;o<r.transceivers.length&&(r.transceivers[o].rejected||(r.transceivers[o].iceTransport.addRemoteCandidate({}),t=p.getMediaSections(r.remoteDescription.sdp),t[o]+="a=end-of-candidates\r\n",r.remoteDescription.sdp=p.getDescription(r.remoteDescription.sdp)+t.join(""),!r.usingBundle));o++);else{var s=e.sdpMLineIndex;if(e.sdpMid)for(var m=0;m<r.transceivers.length;m++)if(r.transceivers[m].mid===e.sdpMid){s=m;break}var i=r.transceivers[s];if(i){if(i.rejected)return a();var l=0<Object.keys(e.candidate).length?p.parseCandidate(e.candidate):{};if("tcp"===l.protocol&&(0===l.port||9===l.port))return a();if(l.component&&1!==l.component)return a();if((0===s||0<s&&i.iceTransport!==r.transceivers[0].iceTransport)&&!c(i.iceTransport,l))return n(d("OperationError","Can not add ICE candidate"));var h=e.candidate.trim();0===h.indexOf("a=")&&(h=h.substr(2)),t=p.getMediaSections(r.remoteDescription.sdp),t[s]+="a="+(l.type?h:"end-of-candidates")+"\r\n",r.remoteDescription.sdp=p.getDescription(r.remoteDescription.sdp)+t.join("")}else return n(d("OperationError","Can not add ICE candidate"))}a()})},h.prototype.getStats=function(t){if(t&&t instanceof e.MediaStreamTrack){var r=null;if(this.transceivers.forEach(function(e){e.rtpSender&&e.rtpSender.track===t?r=e.rtpSender:e.rtpReceiver&&e.rtpReceiver.track===t&&(r=e.rtpReceiver)}),!r)throw d("InvalidAccessError","Invalid selector.");return r.getStats()}var a=[];return this.transceivers.forEach(function(e){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach(function(t){e[t]&&a.push(e[t].getStats())})}),Promise.all(a).then(function(e){var t=new Map;return e.forEach(function(e){e.forEach(function(e){t.set(e.id,e)})}),t})};["RTCRtpSender","RTCRtpReceiver","RTCIceGatherer","RTCIceTransport","RTCDtlsTransport"].forEach(function(t){var r=e[t];if(r&&r.prototype&&r.prototype.getStats){var n=r.prototype.getStats;r.prototype.getStats=function(){return n.apply(this).then(function(e){var t=new Map;return Object.keys(e).forEach(function(r){e[r].type=a(e[r]),t.set(r,e[r])}),t})}}});var g=["createOffer","createAnswer"];return g.forEach(function(e){var t=h.prototype[e];h.prototype[e]=function(){var e=arguments;return"function"===typeof e[0]||"function"===typeof e[1]?t.apply(this,[arguments[2]]).then(function(t){"function"===typeof e[0]&&e[0].apply(null,[t])},function(t){"function"===typeof e[1]&&e[1].apply(null,[t])}):t.apply(this,arguments)}}),g=["setLocalDescription","setRemoteDescription","addIceCandidate"],g.forEach(function(e){var t=h.prototype[e];h.prototype[e]=function(){var e=arguments;return"function"===typeof e[1]||"function"===typeof e[2]?t.apply(this,arguments).then(function(){"function"===typeof e[1]&&e[1].apply(null)},function(t){"function"===typeof e[2]&&e[2].apply(null,[t])}):t.apply(this,arguments)}}),["getStats"].forEach(function(e){var t=h.prototype[e];h.prototype[e]=function(){var e=arguments;return"function"===typeof e[1]?t.apply(this,arguments).then(function(){"function"===typeof e[1]&&e[1].apply(null)}):t.apply(this,arguments)}}),h}},{sdp:2}],2:[function(e,t){"use strict";var r={};r.generateIdentifier=function(){return Math.random().toString(36).substr(2,10)},r.localCName=r.generateIdentifier(),r.splitLines=function(e){return e.trim().split("\n").map(function(e){return e.trim()})},r.splitSections=function(e){var t=e.split("\nm=");return t.map(function(e,t){return(0<t?"m="+e:e).trim()+"\r\n"})},r.getDescription=function(e){var t=r.splitSections(e);return t&&t[0]},r.getMediaSections=function(e){var t=r.splitSections(e);return t.shift(),t},r.matchPrefix=function(e,t){return r.splitLines(e).filter(function(e){return 0===e.indexOf(t)})},r.parseCandidate=function(e){var t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");for(var r={foundation:t[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],port:parseInt(t[5],10),type:t[7]},a=8;a<t.length;a+=2)switch(t[a]){case"raddr":r.relatedAddress=t[a+1];break;case"rport":r.relatedPort=parseInt(t[a+1],10);break;case"tcptype":r.tcpType=t[a+1];break;case"ufrag":r.ufrag=t[a+1],r.usernameFragment=t[a+1];break;default:r[t[a]]=t[a+1];}return r},r.writeCandidate=function(e){var t=[e.foundation,e.component,e.protocol.toUpperCase(),e.priority,e.ip,e.port],r=e.type;return t.push("typ"),t.push(r),"host"!==r&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},r.parseIceOptions=function(e){return e.substr(14).split(" ")},r.parseRtpMap=function(e){var t=e.substr(9).split(" "),r={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),r.name=t[0],r.clockRate=parseInt(t[1],10),r.channels=3===t.length?parseInt(t[2],10):1,r.numChannels=r.channels,r},r.writeRtpMap=function(e){var t=e.payloadType;e.preferredPayloadType!==void 0&&(t=e.preferredPayloadType);var r=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1===r?"":"/"+r)+"\r\n"},r.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:0<t[0].indexOf("/")?t[0].split("/")[1]:"sendrecv",uri:t[1]}},r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},r.parseFmtp=function(e){for(var t,r={},a=e.substr(e.indexOf(" ")+1).split(";"),n=0;n<a.length;n++)t=a[n].trim().split("="),r[t[0].trim()]=t[1];return r},r.writeFmtp=function(e){var t="",r=e.payloadType;if(void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var a=[];Object.keys(e.parameters).forEach(function(t){e.parameters[t]?a.push(t+"="+e.parameters[t]):a.push(t)}),t+="a=fmtp:"+r+" "+a.join(";")+"\r\n"}return t},r.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},r.writeRtcpFb=function(e){var t="",r=e.payloadType;return void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach(function(e){t+="a=rtcp-fb:"+r+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"}),t},r.parseSsrcMedia=function(e){var t=e.indexOf(" "),r={ssrc:parseInt(e.substr(7,t-7),10)},a=e.indexOf(":",t);return-1<a?(r.attribute=e.substr(t+1,a-t-1),r.value=e.substr(a+1)):r.attribute=e.substr(t+1),r},r.getMid=function(e){var t=r.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},r.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},r.getDtlsParameters=function(e,t){var a=r.matchPrefix(e+t,"a=fingerprint:");return{role:"auto",fingerprints:a.map(r.parseFingerprint)}},r.writeDtlsParameters=function(e,t){var r="a=setup:"+t+"\r\n";return e.fingerprints.forEach(function(e){r+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),r},r.getIceParameters=function(e,t){var a=r.splitLines(e);a=a.concat(r.splitLines(t));var n={usernameFragment:a.filter(function(e){return 0===e.indexOf("a=ice-ufrag:")})[0].substr(12),password:a.filter(function(e){return 0===e.indexOf("a=ice-pwd:")})[0].substr(10)};return n},r.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},r.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},a=r.splitLines(e),n=a[0].split(" "),o=3;o<n.length;o++){var i=n[o],s=r.matchPrefix(e,"a=rtpmap:"+i+" ")[0];if(s){var c=r.parseRtpMap(s),d=r.matchPrefix(e,"a=fmtp:"+i+" ");switch(c.parameters=d.length?r.parseFmtp(d[0]):{},c.rtcpFeedback=r.matchPrefix(e,"a=rtcp-fb:"+i+" ").map(r.parseRtcpFb),t.codecs.push(c),c.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(c.name.toUpperCase());break;default:}}}return r.matchPrefix(e,"a=extmap:").forEach(function(e){t.headerExtensions.push(r.parseExtmap(e))}),t},r.writeRtpDescription=function(e,t){var a="";a+="m="+e+" ",a+=0<t.codecs.length?"9":"0",a+=" UDP/TLS/RTP/SAVPF ",a+=t.codecs.map(function(e){return void 0===e.preferredPayloadType?e.payloadType:e.preferredPayloadType}).join(" ")+"\r\n",a+="c=IN IP4 0.0.0.0\r\n",a+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach(function(e){a+=r.writeRtpMap(e),a+=r.writeFmtp(e),a+=r.writeRtcpFb(e)});var n=0;return t.codecs.forEach(function(e){e.maxptime>n&&(n=e.maxptime)}),0<n&&(a+="a=maxptime:"+n+"\r\n"),a+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach(function(e){a+=r.writeExtmap(e)}),a},r.parseRtpEncodingParameters=function(e){var t,a=[],n=r.parseRtpParameters(e),i=-1!==n.fecMechanisms.indexOf("RED"),o=-1!==n.fecMechanisms.indexOf("ULPFEC"),s=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute}),c=0<s.length&&s[0].ssrc,d=r.matchPrefix(e,"a=ssrc-group:FID").map(function(e){var t=e.substr(17).split(" ");return t.map(function(e){return parseInt(e,10)})});0<d.length&&1<d[0].length&&d[0][0]===c&&(t=d[0][1]),n.codecs.forEach(function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&t&&(r.rtx={ssrc:t}),a.push(r),i&&(r=JSON.parse(JSON.stringify(r)),r.fec={ssrc:t,mechanism:o?"red+ulpfec":"red"},a.push(r))}}),0===a.length&&c&&a.push({ssrc:c});var p=r.matchPrefix(e,"b=");return p.length&&(p=0===p[0].indexOf("b=TIAS:")?parseInt(p[0].substr(7),10):0===p[0].indexOf("b=AS:")?.95*(1e3*parseInt(p[0].substr(5),10))-16000:void 0,a.forEach(function(e){e.maxBitrate=p})),a},r.parseRtcpParameters=function(e){var t={},a=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute})[0];a&&(t.cname=a.value,t.ssrc=a.ssrc);var n=r.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=0<n.length,t.compound=0===n.length;var i=r.matchPrefix(e,"a=rtcp-mux");return t.mux=0<i.length,t},r.parseMsid=function(e){var t,a=r.matchPrefix(e,"a=msid:");if(1===a.length)return t=a[0].substr(7).split(" "),{stream:t[0],track:t[1]};var n=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"msid"===e.attribute});if(0<n.length)return t=n[0].value.split(" "),{stream:t[0],track:t[1]}},r.generateSessionId=function(){return Math.random().toString().substr(2,21)},r.writeSessionBoilerplate=function(e,t){var a,n=void 0===t?2:t;return a=e?e:r.generateSessionId(),"v=0\r\no=thisisadapterortc "+a+" "+n+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.writeMediaSection=function(e,t,a,n){var i=r.writeRtpDescription(e.kind,t);if(i+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),i+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===a?"actpass":"active"),i+="a=mid:"+e.mid+"\r\n",i+=e.direction?"a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?"a=sendrecv\r\n":e.rtpSender?"a=sendonly\r\n":e.rtpReceiver?"a=recvonly\r\n":"a=inactive\r\n",e.rtpSender){var o="msid:"+n.id+" "+e.rtpSender.track.id+"\r\n";i+="a="+o,i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+o,e.sendEncodingParameters[0].rtx&&(i+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+o,i+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(i+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),i},r.getDirection=function(e,t){for(var a=r.splitLines(e),n=0;n<a.length;n++)switch(a[n]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return a[n].substr(2);default:}return t?r.getDirection(t):"sendrecv"},r.getKind=function(e){var t=r.splitLines(e),a=t[0].split(" ");return a[0].substr(2)},r.isRejected=function(e){return"0"===e.split(" ",2)[1]},r.parseMLine=function(e){var t=r.splitLines(e),a=t[0].substr(2).split(" ");return{kind:a[0],port:parseInt(a[1],10),protocol:a[2],fmt:a.slice(3).join(" ")}},r.parseOLine=function(e){var t=r.matchPrefix(e,"o=")[0],a=t.substr(2).split(" ");return{username:a[0],sessionId:a[1],sessionVersion:parseInt(a[2],10),netType:a[3],addressType:a[4],address:a[5]}},"object"===typeof t&&(t.exports=r)},{}],3:[function(e,t){(function(r){"use strict";var a=e("./adapter_factory.js");t.exports=a({window:r.window})}).call(this,"undefined"===typeof global?"undefined"===typeof self?"undefined"===typeof window?{}:window:self:global)},{"./adapter_factory.js":4}],4:[function(e,t){"use strict";var r=e("./utils");t.exports=function(t,a){var n=t&&t.window,i={shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0};for(var o in a)hasOwnProperty.call(a,o)&&(i[o]=a[o]);var s=r.log,c=r.detectBrowser(n),d=e("./chrome/chrome_shim")||null,p=e("./edge/edge_shim")||null,m=e("./firefox/firefox_shim")||null,l=e("./safari/safari_shim")||null,h=e("./common_shim")||null,g={browserDetails:c,commonShim:h,extractVersion:r.extractVersion,disableLog:r.disableLog,disableWarnings:r.disableWarnings};switch(c.browser){case"chrome":if(!d||!d.shimPeerConnection||!i.shimChrome)return s("Chrome shim is not included in this adapter release."),g;s("adapter.js shimming chrome."),g.browserShim=d,h.shimCreateObjectURL(n),d.shimGetUserMedia(n),d.shimMediaStream(n),d.shimSourceObject(n),d.shimPeerConnection(n),d.shimOnTrack(n),d.shimAddTrackRemoveTrack(n),d.shimGetSendersWithDtmf(n),d.shimSenderReceiverGetStats(n),h.shimRTCIceCandidate(n),h.shimMaxMessageSize(n),h.shimSendThrowTypeError(n);break;case"firefox":if(!m||!m.shimPeerConnection||!i.shimFirefox)return s("Firefox shim is not included in this adapter release."),g;s("adapter.js shimming firefox."),g.browserShim=m,h.shimCreateObjectURL(n),m.shimGetUserMedia(n),m.shimSourceObject(n),m.shimPeerConnection(n),m.shimOnTrack(n),m.shimRemoveStream(n),m.shimSenderGetStats(n),m.shimReceiverGetStats(n),m.shimRTCDataChannel(n),h.shimRTCIceCandidate(n),h.shimMaxMessageSize(n),h.shimSendThrowTypeError(n);break;case"edge":if(!p||!p.shimPeerConnection||!i.shimEdge)return s("MS edge shim is not included in this adapter release."),g;s("adapter.js shimming edge."),g.browserShim=p,h.shimCreateObjectURL(n),p.shimGetUserMedia(n),p.shimPeerConnection(n),p.shimReplaceTrack(n),h.shimMaxMessageSize(n),h.shimSendThrowTypeError(n);break;case"safari":if(!l||!i.shimSafari)return s("Safari shim is not included in this adapter release."),g;s("adapter.js shimming safari."),g.browserShim=l,h.shimCreateObjectURL(n),l.shimRTCIceServerUrls(n),l.shimCallbacksAPI(n),l.shimLocalStreamsAPI(n),l.shimRemoteStreamsAPI(n),l.shimTrackEventTransceiver(n),l.shimGetUserMedia(n),l.shimCreateOfferLegacy(n),h.shimRTCIceCandidate(n),h.shimMaxMessageSize(n),h.shimSendThrowTypeError(n);break;default:s("Unsupported browser!");}return g}},{"./chrome/chrome_shim":5,"./common_shim":7,"./edge/edge_shim":8,"./firefox/firefox_shim":11,"./safari/safari_shim":13,"./utils":14}],5:[function(e,t){"use strict";function r(e,t,a){!t||a.has(t.id)||(a.set(t.id,t),Object.keys(t).forEach(function(n){n.endsWith("Id")?r(e,e.get(t[n]),a):n.endsWith("Ids")&&t[n].forEach(function(t){r(e,e.get(t),a)})}))}function a(e,t,a){var n=a?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;var o=[];return e.forEach(function(e){"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)}),o.forEach(function(t){e.forEach(function(a){a.type===n&&a.trackId===t.id&&r(e,a,i)})}),i}var n=e("../utils.js"),i=n.log;t.exports={shimGetUserMedia:e("./getusermedia"),shimMediaStream:function(e){e.MediaStream=e.MediaStream||e.webkitMediaStream},shimOnTrack:function(t){if("object"===typeof t&&t.RTCPeerConnection&&!("ontrack"in t.RTCPeerConnection.prototype)){Object.defineProperty(t.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)}});var e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){var r=this;return r._ontrackpoly||(r._ontrackpoly=function(a){a.stream.addEventListener("addtrack",function(e){var n=t.RTCPeerConnection.prototype.getReceivers?r.getReceivers().find(function(t){return t.track&&t.track.id===e.track.id}):{track:e.track};var i=new Event("track");i.track=e.track,i.receiver=n,i.transceiver={receiver:n},i.streams=[a.stream],r.dispatchEvent(i)}),a.stream.getTracks().forEach(function(e){var n=t.RTCPeerConnection.prototype.getReceivers?r.getReceivers().find(function(t){return t.track&&t.track.id===e.id}):{track:e};var i=new Event("track");i.track=e,i.receiver=n,i.transceiver={receiver:n},i.streams=[a.stream],r.dispatchEvent(i)})},r.addEventListener("addstream",r._ontrackpoly)),e.apply(r,arguments)}}else"RTCRtpTransceiver"in t||n.wrapPeerConnectionEvent(t,"track",function(t){return t.transceiver||(t.transceiver={receiver:t.receiver}),t})},shimGetSendersWithDtmf:function(e){if("object"===typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){var t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var r=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e){var a=this,n=r.apply(a,arguments);return n||(n=t(a,e),a._senders.push(n)),n};var a=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;a.apply(t,arguments);var r=t._senders.indexOf(e);-1!==r&&t._senders.splice(r,1)}}var n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var r=this;r._senders=r._senders||[],n.apply(r,[e]),e.getTracks().forEach(function(e){r._senders.push(t(r,e))})};var i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;t._senders=t._senders||[],i.apply(t,[e]),e.getTracks().forEach(function(e){var r=t._senders.find(function(t){return t.track===e});r&&t._senders.splice(t._senders.indexOf(r),1)})}}else if("object"===typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){var o=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=o.apply(e,[]);return t.forEach(function(t){t._pc=e}),t},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}},shimSenderReceiverGetStats:function(e){if("object"===typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver){if(!("getStats"in e.RTCRtpSender.prototype)){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,r=t.apply(e,[]);return r.forEach(function(t){t._pc=e}),r});var r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){var e=this;return this._pc.getStats().then(function(t){return a(t,e.track,!0)})}}if(!("getStats"in e.RTCRtpReceiver.prototype)){var i=e.RTCPeerConnection.prototype.getReceivers;i&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,t=i.apply(e,[]);return t.forEach(function(t){t._pc=e}),t}),n.wrapPeerConnectionEvent(e,"track",function(t){return t.receiver._pc=t.srcElement,t}),e.RTCRtpReceiver.prototype.getStats=function(){var e=this;return this._pc.getStats().then(function(t){return a(t,e.track,!1)})}}if("getStats"in e.RTCRtpSender.prototype&&"getStats"in e.RTCRtpReceiver.prototype){var o=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var t=this;if(0<arguments.length&&arguments[0]instanceof e.MediaStreamTrack){var r,a,n,i=arguments[0];return(t.getSenders().forEach(function(e){e.track===i&&(r?n=!0:r=e)}),t.getReceivers().forEach(function(e){return e.track===i&&(a?n=!0:a=e),e.track===i}),n||r&&a)?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):r?r.getStats():a?a.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return o.apply(t,arguments)}}}},shimSourceObject:function(e){var t=e&&e.URL;"object"===typeof e&&e.HTMLMediaElement&&!("srcObject"in e.HTMLMediaElement.prototype)&&Object.defineProperty(e.HTMLMediaElement.prototype,"srcObject",{get:function(){return this._srcObject},set:function(e){var r=this;return this._srcObject=e,this.src&&t.revokeObjectURL(this.src),e?void(this.src=t.createObjectURL(e),e.addEventListener("addtrack",function(){r.src&&t.revokeObjectURL(r.src),r.src=t.createObjectURL(e)}),e.addEventListener("removetrack",function(){r.src&&t.revokeObjectURL(r.src),r.src=t.createObjectURL(e)})):void(this.src="")}})},shimAddTrackRemoveTrackWithNative:function(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(function(t){return e._shimmedLocalStreams[t][0]})};var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){if(!r)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var a=t.apply(this,arguments);return this._shimmedLocalStreams[r.id]?-1===this._shimmedLocalStreams[r.id].indexOf(a)&&this._shimmedLocalStreams[r.id].push(a):this._shimmedLocalStreams[r.id]=[r,a],a};var r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var t=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach(function(e){var r=t.getSenders().find(function(t){return t.track===e});if(r)throw new DOMException("Track already exists.","InvalidAccessError")});var a=t.getSenders();r.apply(this,arguments);var n=t.getSenders().filter(function(e){return-1===a.indexOf(e)});this._shimmedLocalStreams[e.id]=[e].concat(n)};var a=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],a.apply(this,arguments)};var n=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach(function(r){var a=t._shimmedLocalStreams[r].indexOf(e);-1!==a&&t._shimmedLocalStreams[r].splice(a,1),1===t._shimmedLocalStreams[r].length&&delete t._shimmedLocalStreams[r]}),n.apply(this,arguments)}},shimAddTrackRemoveTrack:function(e){function t(e,t){var r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(function(t){var a=e._reverseStreams[t],n=e._streams[a.id];r=r.replace(new RegExp(n.id,"g"),a.id)}),new RTCSessionDescription({type:t.type,sdp:r})}function r(e,t){var r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(function(t){var a=e._reverseStreams[t],n=e._streams[a.id];r=r.replace(new RegExp(a.id,"g"),n.id)}),new RTCSessionDescription({type:t.type,sdp:r})}var a=n.detectBrowser(e);if(e.RTCPeerConnection.prototype.addTrack&&65<=a.version)return this.shimAddTrackRemoveTrackWithNative(e);var i=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this,t=i.apply(this);return e._reverseStreams=e._reverseStreams||{},t.map(function(t){return e._reverseStreams[t.id]})};var o=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){var r=this;if(r._streams=r._streams||{},r._reverseStreams=r._reverseStreams||{},t.getTracks().forEach(function(e){var t=r.getSenders().find(function(t){return t.track===e});if(t)throw new DOMException("Track already exists.","InvalidAccessError")}),!r._reverseStreams[t.id]){var a=new e.MediaStream(t.getTracks());r._streams[t.id]=a,r._reverseStreams[a.id]=t,t=a}o.apply(r,[t])};var s=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;t._streams=t._streams||{},t._reverseStreams=t._reverseStreams||{},s.apply(t,[t._streams[e.id]||e]),delete t._reverseStreams[t._streams[e.id]?t._streams[e.id].id:e.id],delete t._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(r,t){var a=this;if("closed"===a.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var n=[].slice.call(arguments,1);if(1!==n.length||!n[0].getTracks().find(function(e){return e===r}))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");var i=a.getSenders().find(function(e){return e.track===r});if(i)throw new DOMException("Track already exists.","InvalidAccessError");a._streams=a._streams||{},a._reverseStreams=a._reverseStreams||{};var o=a._streams[t.id];if(o)o.addTrack(r),Promise.resolve().then(function(){a.dispatchEvent(new Event("negotiationneeded"))});else{var s=new e.MediaStream([r]);a._streams[t.id]=s,a._reverseStreams[s.id]=t,a.addStream(s)}return a.getSenders().find(function(e){return e.track===r})},["createOffer","createAnswer"].forEach(function(r){var a=e.RTCPeerConnection.prototype[r];e.RTCPeerConnection.prototype[r]=function(){var e=this,r=arguments,n=arguments.length&&"function"===typeof arguments[0];return n?a.apply(e,[function(a){var n=t(e,a);r[0].apply(null,[n])},function(e){r[1]&&r[1].apply(null,e)},arguments[2]]):a.apply(e,arguments).then(function(r){return t(e,r)})}});var c=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){var e=this;return arguments.length&&arguments[0].type?(arguments[0]=r(e,arguments[0]),c.apply(e,arguments)):c.apply(e,arguments)};var d=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get:function(){var e=this,r=d.get.apply(this);return""===r.type?r:t(e,r)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;if("closed"===t.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");var r=e._pc===t;if(!r)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");t._streams=t._streams||{};var a;Object.keys(t._streams).forEach(function(r){var n=t._streams[r].getTracks().find(function(t){return e.track===t});n&&(a=t._streams[r])}),a&&(1===a.getTracks().length?t.removeStream(t._reverseStreams[a.id]):a.removeTrack(e.track),t.dispatchEvent(new Event("negotiationneeded")))}},shimPeerConnection:function(e){var t=n.detectBrowser(e);if(!e.RTCPeerConnection&&e.webkitRTCPeerConnection)e.RTCPeerConnection=function(t,r){return i("PeerConnection"),t&&t.iceTransportPolicy&&(t.iceTransports=t.iceTransportPolicy),new e.webkitRTCPeerConnection(t,r)},e.RTCPeerConnection.prototype=e.webkitRTCPeerConnection.prototype,e.webkitRTCPeerConnection.generateCertificate&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return e.webkitRTCPeerConnection.generateCertificate}});else{var r=e.RTCPeerConnection;e.RTCPeerConnection=function(e,t){if(e&&e.iceServers){for(var a,o=[],s=0;s<e.iceServers.length;s++)a=e.iceServers[s],!a.hasOwnProperty("urls")&&a.hasOwnProperty("url")?(n.deprecated("RTCIceServer.url","RTCIceServer.urls"),a=JSON.parse(JSON.stringify(a)),a.urls=a.url,o.push(a)):o.push(e.iceServers[s]);e.iceServers=o}return new r(e,t)},e.RTCPeerConnection.prototype=r.prototype,Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return r.generateCertificate}})}var a=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(e,t,r){var n=this,i=arguments;if(0<arguments.length&&"function"===typeof e)return a.apply(this,arguments);if(0===a.length&&(0===arguments.length||"function"!==typeof arguments[0]))return a.apply(this,[]);var o=function(e){var t={},r=e.result();return r.forEach(function(e){var r={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach(function(t){r[t]=e.stat(t)}),t[r.id]=r}),t},s=function(e){return new Map(Object.keys(e).map(function(t){return[t,e[t]]}))};if(2<=arguments.length){var c=function(e){i[1](s(o(e)))};return a.apply(this,[c,arguments[0]])}return new Promise(function(e,t){a.apply(n,[function(t){e(s(o(t)))},t])}).then(t,r)},51>t.version&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){var r=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){var e=arguments,t=this,a=new Promise(function(a,n){r.apply(t,[e[0],a,n])});return 2>e.length?a:a.then(function(){e[1].apply(null,[])},function(t){3<=e.length&&e[2].apply(null,[t])})}}),52>t.version&&["createOffer","createAnswer"].forEach(function(t){var r=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){var e=this;if(1>arguments.length||1===arguments.length&&"object"===typeof arguments[0]){var t=1===arguments.length?arguments[0]:void 0;return new Promise(function(a,n){r.apply(e,[a,n,t])})}return r.apply(this,arguments)}}),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){var r=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}});var o=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?o.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}}},{"../utils.js":14,"./getusermedia":6}],6:[function(e,t){"use strict";var r=e("../utils.js"),a=r.log;t.exports=function(e){var t=r.detectBrowser(e),n=e&&e.navigator,i=function(e){if("object"!==typeof e||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach(function(a){if("require"!==a&&"advanced"!==a&&"mediaSource"!==a){var n="object"===typeof e[a]?e[a]:{ideal:e[a]};void 0!==n.exact&&"number"===typeof n.exact&&(n.min=n.max=n.exact);var r=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==n.ideal){t.optional=t.optional||[];var i={};"number"===typeof n.ideal?(i[r("min",a)]=n.ideal,t.optional.push(i),i={},i[r("max",a)]=n.ideal,t.optional.push(i)):(i[r("",a)]=n.ideal,t.optional.push(i))}void 0!==n.exact&&"number"!==typeof n.exact?(t.mandatory=t.mandatory||{},t.mandatory[r("",a)]=n.exact):["min","max"].forEach(function(e){void 0!==n[e]&&(t.mandatory=t.mandatory||{},t.mandatory[r(e,a)]=n[e])})}}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},o=function(e,r){if(61<=t.version)return r(e);if(e=JSON.parse(JSON.stringify(e)),e&&"object"===typeof e.audio){var o=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])};e=JSON.parse(JSON.stringify(e)),o(e.audio,"autoGainControl","googAutoGainControl"),o(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=i(e.audio)}if(e&&"object"===typeof e.video){var s=e.video.facingMode;s=s&&("object"===typeof s?s:{ideal:s});var c=66>t.version;if(s&&("user"===s.exact||"environment"===s.exact||"user"===s.ideal||"environment"===s.ideal)&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!c)){delete e.video.facingMode;var p;if("environment"===s.exact||"environment"===s.ideal?p=["back","rear"]:("user"===s.exact||"user"===s.ideal)&&(p=["front"]),p)return n.mediaDevices.enumerateDevices().then(function(t){t=t.filter(function(e){return"videoinput"===e.kind});var n=t.find(function(e){return p.some(function(t){return-1!==e.label.toLowerCase().indexOf(t)})});return!n&&t.length&&-1!==p.indexOf("back")&&(n=t[t.length-1]),n&&(e.video.deviceId=s.exact?{exact:n.deviceId}:{ideal:n.deviceId}),e.video=i(e.video),a("chrome: "+JSON.stringify(e)),r(e)})}e.video=i(e.video)}return a("chrome: "+JSON.stringify(e)),r(e)},s=function(t){return{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[t.name]||t.name,message:t.message,constraint:t.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}};n.getUserMedia=function(e,t,r){o(e,function(e){n.webkitGetUserMedia(e,t,function(t){r&&r(s(t))})})};var c=function(e){return new Promise(function(t,r){n.getUserMedia(e,t,r)})};if(n.mediaDevices||(n.mediaDevices={getUserMedia:c,enumerateDevices:function(){return new Promise(function(t){var r={audio:"audioinput",video:"videoinput"};return e.MediaStreamTrack.getSources(function(e){t(e.map(function(e){return{label:e.label,kind:r[e.kind],deviceId:e.id,groupId:""}}))})})},getSupportedConstraints:function(){return{deviceId:!0,echoCancellation:!0,facingMode:!0,frameRate:!0,height:!0,width:!0}}}),!n.mediaDevices.getUserMedia)n.mediaDevices.getUserMedia=function(e){return c(e)};else{var d=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(e){return o(e,function(e){return d(e).then(function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach(function(e){e.stop()}),new DOMException("","NotFoundError");return t},function(t){return Promise.reject(s(t))})})}}"undefined"===typeof n.mediaDevices.addEventListener&&(n.mediaDevices.addEventListener=function(){a("Dummy mediaDevices.addEventListener called.")}),"undefined"===typeof n.mediaDevices.removeEventListener&&(n.mediaDevices.removeEventListener=function(){a("Dummy mediaDevices.removeEventListener called.")})}},{"../utils.js":14}],7:[function(t,r){"use strict";var a=t("sdp"),n=t("./utils");r.exports={shimRTCIceCandidate:function(t){if(!(!t.RTCIceCandidate||t.RTCIceCandidate&&"foundation"in t.RTCIceCandidate.prototype)){var e=t.RTCIceCandidate;t.RTCIceCandidate=function(t){if("object"===typeof t&&t.candidate&&0===t.candidate.indexOf("a=")&&(t=JSON.parse(JSON.stringify(t)),t.candidate=t.candidate.substr(2)),t.candidate&&t.candidate.length){var r=new e(t),n=a.parseCandidate(t.candidate),i=Object.assign(r,n);return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new e(t)},t.RTCIceCandidate.prototype=e.prototype,n.wrapPeerConnectionEvent(t,"icecandidate",function(r){return r.candidate&&Object.defineProperty(r,"candidate",{value:new t.RTCIceCandidate(r.candidate),writable:"false"}),r})}},shimCreateObjectURL:function(e){var t=e&&e.URL;if("object"===typeof e&&e.HTMLMediaElement&&"srcObject"in e.HTMLMediaElement.prototype&&t.createObjectURL&&t.revokeObjectURL){var r=t.createObjectURL.bind(t),a=t.revokeObjectURL.bind(t),i=new Map,o=0;t.createObjectURL=function(e){if("getTracks"in e){var t="polyblob:"+ ++o;return i.set(t,e),n.deprecated("URL.createObjectURL(stream)","elem.srcObject = stream"),t}return r(e)},t.revokeObjectURL=function(e){a(e),i.delete(e)};var s=Object.getOwnPropertyDescriptor(e.HTMLMediaElement.prototype,"src");Object.defineProperty(e.HTMLMediaElement.prototype,"src",{get:function(){return s.get.apply(this)},set:function(e){return this.srcObject=i.get(e)||null,s.set.apply(this,[e])}});var c=e.HTMLMediaElement.prototype.setAttribute;e.HTMLMediaElement.prototype.setAttribute=function(){return 2===arguments.length&&"src"===(""+arguments[0]).toLowerCase()&&(this.srcObject=i.get(arguments[1])||null),c.apply(this,arguments)}}},shimMaxMessageSize:function(t){if(!t.RTCSctpTransport&&t.RTCPeerConnection){var r=n.detectBrowser(t);"sctp"in t.RTCPeerConnection.prototype||Object.defineProperty(t.RTCPeerConnection.prototype,"sctp",{get:function(){return"undefined"===typeof this._sctp?null:this._sctp}});var i=function(e){var t=a.splitSections(e.sdp);return t.shift(),t.some(function(e){var t=a.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")})},o=function(e){var t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||2>t.length)return-1;var r=parseInt(t[1],10);return r===r?r:-1},s=function(e){var t=65536;return"firefox"===r.browser&&(57>r.version?-1===e?t=16384:t=2147483637:60>r.version?t=57===r.version?65535:65536:t=2147483637),t},c=function(e,t){var n=65536;"firefox"===r.browser&&57===r.version&&(n=65535);var i=a.matchPrefix(e.sdp,"a=max-message-size:");return 0<i.length?n=parseInt(i[0].substr(19),10):"firefox"===r.browser&&-1!==t&&(n=2147483637),n},d=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){var t=this;if(t._sctp=null,i(arguments[0])){var r,a=o(arguments[0]),n=s(a),p=c(arguments[0],a);r=0===n&&0===p?Number.POSITIVE_INFINITY:0===n||0===p?Math.max(n,p):e(n,p);var m={};Object.defineProperty(m,"maxMessageSize",{get:function(){return r}}),t._sctp=m}return d.apply(t,arguments)}}},shimSendThrowTypeError:function(e){function t(e,t){var r=e.send;e.send=function(){var a=arguments[0],n=a.length||a.size||a.byteLength;if("open"===e.readyState&&t.sctp&&n>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return r.apply(e,arguments)}}if(e.RTCPeerConnection&&"createDataChannel"in e.RTCPeerConnection.prototype){var r=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){var e=this,a=r.apply(e,arguments);return t(a,e),a},n.wrapPeerConnectionEvent(e,"datachannel",function(r){return t(r.channel,r.target),r})}}}},{"./utils":14,sdp:2}],8:[function(e,t){"use strict";var r=e("../utils"),a=e("./filtericeservers"),n=e("rtcpeerconnection-shim");t.exports={shimGetUserMedia:e("./getusermedia"),shimPeerConnection:function(e){var t=r.detectBrowser(e);if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),15025>t.version)){var i=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set:function(e){i.set.call(this,e);var t=new Event("enabled");t.enabled=e,this.dispatchEvent(t)}})}e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)&&Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);var o=n(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=a(e.iceServers)),new o(e)},e.RTCPeerConnection.prototype=o.prototype},shimReplaceTrack:function(e){e.RTCRtpSender&&!("replaceTrack"in e.RTCRtpSender.prototype)&&(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)}}},{"../utils":14,"./filtericeservers":9,"./getusermedia":10,"rtcpeerconnection-shim":1}],9:[function(e,t){"use strict";var r=e("../utils");t.exports=function(e,t){var a=!1;return e=JSON.parse(JSON.stringify(e)),e.filter(function(e){if(e&&(e.urls||e.url)){var n=e.urls||e.url;e.url&&!e.urls&&r.deprecated("RTCIceServer.url","RTCIceServer.urls");var i="string"===typeof n;return i&&(n=[n]),n=n.filter(function(e){var r=0===e.indexOf("turn:")&&-1!==e.indexOf("transport=udp")&&-1===e.indexOf("turn:[")&&!a;return r?(a=!0,!0):0===e.indexOf("stun:")&&14393<=t&&-1===e.indexOf("?transport=udp")}),delete e.url,e.urls=i?n[0]:n,!!n.length}})}},{"../utils":14}],10:[function(e,t){"use strict";t.exports=function(e){var t=e&&e.navigator,r=function(t){return{name:{PermissionDeniedError:"NotAllowedError"}[t.name]||t.name,message:t.message,constraint:t.constraint,toString:function(){return this.name}}},a=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return a(e).catch(function(t){return Promise.reject(r(t))})}}},{}],11:[function(e,t){"use strict";var r=e("../utils");t.exports={shimGetUserMedia:e("./getusermedia"),shimOnTrack:function(e){"object"===typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)&&Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&(this.removeEventListener("track",this._ontrack),this.removeEventListener("addstream",this._ontrackpoly)),this.addEventListener("track",this._ontrack=e),this.addEventListener("addstream",this._ontrackpoly=function(t){t.stream.getTracks().forEach(function(e){var r=new Event("track");r.track=e,r.receiver={track:e},r.transceiver={receiver:r.receiver},r.streams=[t.stream],this.dispatchEvent(r)}.bind(this))}.bind(this))}}),"object"===typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},shimSourceObject:function(e){"object"===typeof e&&e.HTMLMediaElement&&!("srcObject"in e.HTMLMediaElement.prototype)&&Object.defineProperty(e.HTMLMediaElement.prototype,"srcObject",{get:function(){return this.mozSrcObject},set:function(e){this.mozSrcObject=e}})},shimPeerConnection:function(e){var t=r.detectBrowser(e);if("object"===typeof e&&(e.RTCPeerConnection||e.mozRTCPeerConnection)){e.RTCPeerConnection||(e.RTCPeerConnection=function(r,a){if(38>t.version&&r&&r.iceServers){for(var n,o=[],s=0;s<r.iceServers.length;s++)if(n=r.iceServers[s],n.hasOwnProperty("urls"))for(var i,c=0;c<n.urls.length;c++)i={url:n.urls[c]},0===n.urls[c].indexOf("turn")&&(i.username=n.username,i.credential=n.credential),o.push(i);else o.push(r.iceServers[s]);r.iceServers=o}return new e.mozRTCPeerConnection(r,a)},e.RTCPeerConnection.prototype=e.mozRTCPeerConnection.prototype,e.mozRTCPeerConnection.generateCertificate&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return e.mozRTCPeerConnection.generateCertificate}}),e.RTCSessionDescription=e.mozRTCSessionDescription,e.RTCIceCandidate=e.mozRTCIceCandidate),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){var r=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}});var a=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?a.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())};var n=function(e){var t=new Map;return Object.keys(e).forEach(function(r){t.set(r,e[r]),t[r]=e[r]}),t},o={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},i=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(e,r,a){return i.apply(this,[e||null]).then(function(a){if(48>t.version&&(a=n(a)),53>t.version&&!r)try{a.forEach(function(e){e.type=o[e.type]||e.type})}catch(t){if("TypeError"!==t.name)throw t;a.forEach(function(e,t){a.set(t,Object.assign({},e,{type:o[e.type]||e.type}))})}return a}).then(r,a)}}},shimSenderGetStats:function(e){if("object"===typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&!(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,r=t.apply(e,[]);return r.forEach(function(t){t._pc=e}),r});var r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}},shimReceiverGetStats:function(e){if("object"===typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&!(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)){var t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,r=t.apply(e,[]);return r.forEach(function(t){t._pc=e}),r}),r.wrapPeerConnectionEvent(e,"track",function(t){return t.receiver._pc=t.srcElement,t}),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}},shimRemoveStream:function(e){!e.RTCPeerConnection||"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;r.deprecated("removeStream","removeTrack"),this.getSenders().forEach(function(r){r.track&&-1!==e.getTracks().indexOf(r.track)&&t.removeTrack(r)})})},shimRTCDataChannel:function(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}}},{"../utils":14,"./getusermedia":12}],12:[function(e,t){"use strict";var r=e("../utils"),a=r.log;t.exports=function(e){var t=r.detectBrowser(e),n=e&&e.navigator,i=e&&e.MediaStreamTrack,o=function(t){return{name:{InternalError:"NotReadableError",NotSupportedError:"TypeError",PermissionDeniedError:"NotAllowedError",SecurityError:"NotAllowedError"}[t.name]||t.name,message:{"The operation is insecure.":"The request is not allowed by the user agent or the platform in the current context."}[t.message]||t.message,constraint:t.constraint,toString:function(){return this.name+(this.message&&": ")+this.message}}},s=function(e,r,i){var s=function(e){if("object"!==typeof e||e.require)return e;var t=[];return Object.keys(e).forEach(function(a){if("require"!==a&&"advanced"!==a&&"mediaSource"!==a){var n=e[a]="object"===typeof e[a]?e[a]:{ideal:e[a]};if((void 0!==n.min||void 0!==n.max||void 0!==n.exact)&&t.push(a),void 0!==n.exact&&("number"===typeof n.exact?n.min=n.max=n.exact:e[a]=n.exact,delete n.exact),void 0!==n.ideal){e.advanced=e.advanced||[];var r={};r[a]="number"===typeof n.ideal?{min:n.ideal,max:n.ideal}:n.ideal,e.advanced.push(r),delete n.ideal,Object.keys(n).length||delete e[a]}}}),t.length&&(e.require=t),e};return e=JSON.parse(JSON.stringify(e)),38>t.version&&(a("spec: "+JSON.stringify(e)),e.audio&&(e.audio=s(e.audio)),e.video&&(e.video=s(e.video)),a("ff37: "+JSON.stringify(e))),n.mozGetUserMedia(e,r,function(t){i(o(t))})};if(n.mediaDevices||(n.mediaDevices={getUserMedia:function(e){return new Promise(function(t,r){s(e,t,r)})},addEventListener:function(){},removeEventListener:function(){}}),n.mediaDevices.enumerateDevices=n.mediaDevices.enumerateDevices||function(){return new Promise(function(e){e([{kind:"audioinput",deviceId:"default",label:"",groupId:""},{kind:"videoinput",deviceId:"default",label:"",groupId:""}])})},41>t.version){var c=n.mediaDevices.enumerateDevices.bind(n.mediaDevices);n.mediaDevices.enumerateDevices=function(){return c().then(void 0,function(t){if("NotFoundError"===t.name)return[];throw t})}}if(49>t.version){var d=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(e){return d(e).then(function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach(function(e){e.stop()}),new DOMException("The object can not be found here.","NotFoundError");return t},function(t){return Promise.reject(o(t))})}}if(!(55<t.version&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){var p=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])},m=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(e){return"object"===typeof e&&"object"===typeof e.audio&&(e=JSON.parse(JSON.stringify(e)),p(e.audio,"autoGainControl","mozAutoGainControl"),p(e.audio,"noiseSuppression","mozNoiseSuppression")),m(e)},i&&i.prototype.getSettings){var l=i.prototype.getSettings;i.prototype.getSettings=function(){var e=l.apply(this,arguments);return p(e,"mozAutoGainControl","autoGainControl"),p(e,"mozNoiseSuppression","noiseSuppression"),e}}if(i&&i.prototype.applyConstraints){var h=i.prototype.applyConstraints;i.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"===typeof e&&(e=JSON.parse(JSON.stringify(e)),p(e,"autoGainControl","mozAutoGainControl"),p(e,"noiseSuppression","mozNoiseSuppression")),h.apply(this,[e])}}}n.getUserMedia=function(e,a,i){return 44>t.version?s(e,a,i):void(r.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(a,i))}}},{"../utils":14}],13:[function(e,t){"use strict";var r=e("../utils");t.exports={shimLocalStreamsAPI:function(e){if("object"===typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),"getStreamById"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getStreamById=function(e){var t=null;return this._localStreams&&this._localStreams.forEach(function(r){r.id===e&&(t=r)}),this._remoteStreams&&this._remoteStreams.forEach(function(r){r.id===e&&(t=r)}),t}),!("addStream"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),-1===this._localStreams.indexOf(e)&&this._localStreams.push(e);var r=this;e.getTracks().forEach(function(a){t.call(r,a,e)})},e.RTCPeerConnection.prototype.addTrack=function(e,r){return r&&(this._localStreams?-1===this._localStreams.indexOf(r)&&this._localStreams.push(r):this._localStreams=[r]),t.call(this,e,r)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);var t=this._localStreams.indexOf(e);if(-1!==t){this._localStreams.splice(t,1);var r=this,a=e.getTracks();this.getSenders().forEach(function(e){-1!==a.indexOf(e.track)&&r.removeTrack(e)})}})}},shimRemoteStreamsAPI:function(e){"object"===typeof e&&e.RTCPeerConnection&&(!("getRemoteStreams"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype)&&Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(e){var t=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=function(r){r.streams.forEach(function(e){if(t._remoteStreams||(t._remoteStreams=[]),!(0<=t._remoteStreams.indexOf(e))){t._remoteStreams.push(e);var r=new Event("addstream");r.stream=e,t.dispatchEvent(r)}})})}}))},shimCallbacksAPI:function(e){if("object"===typeof e&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype,r=t.createOffer,a=t.createAnswer,n=t.setLocalDescription,i=t.setRemoteDescription,o=t.addIceCandidate;t.createOffer=function(e,t){var a=2<=arguments.length?arguments[2]:arguments[0],n=r.apply(this,[a]);return t?(n.then(e,t),Promise.resolve()):n},t.createAnswer=function(e,t){var r=2<=arguments.length?arguments[2]:arguments[0],n=a.apply(this,[r]);return t?(n.then(e,t),Promise.resolve()):n};var s=function(e,t,r){var a=n.apply(this,[e]);return r?(a.then(t,r),Promise.resolve()):a};t.setLocalDescription=s,s=function(e,t,r){var a=i.apply(this,[e]);return r?(a.then(t,r),Promise.resolve()):a},t.setRemoteDescription=s,s=function(e,t,r){var a=o.apply(this,[e]);return r?(a.then(t,r),Promise.resolve()):a},t.addIceCandidate=s}},shimGetUserMedia:function(e){var t=e&&e.navigator;t.getUserMedia||(t.webkitGetUserMedia?t.getUserMedia=t.webkitGetUserMedia.bind(t):t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,r,a){t.mediaDevices.getUserMedia(e).then(r,a)}.bind(t)))},shimRTCIceServerUrls:function(e){var t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,a){if(e&&e.iceServers){for(var n,o=[],s=0;s<e.iceServers.length;s++)n=e.iceServers[s],!n.hasOwnProperty("urls")&&n.hasOwnProperty("url")?(r.deprecated("RTCIceServer.url","RTCIceServer.urls"),n=JSON.parse(JSON.stringify(n)),n.urls=n.url,delete n.url,o.push(n)):o.push(e.iceServers[s]);e.iceServers=o}return new t(e,a)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in e.RTCPeerConnection&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return t.generateCertificate}})},shimTrackEventTransceiver:function(e){"object"===typeof e&&e.RTCPeerConnection&&"receiver"in e.RTCTrackEvent.prototype&&!e.RTCTransceiver&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},shimCreateOfferLegacy:function(e){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){var r=this;if(e){"undefined"!==typeof e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);var a=r.getTransceivers().find(function(e){return e.sender.track&&"audio"===e.sender.track.kind});!1===e.offerToReceiveAudio&&a?"sendrecv"===a.direction?a.setDirection?a.setDirection("sendonly"):a.direction="sendonly":"recvonly"===a.direction&&(a.setDirection?a.setDirection("inactive"):a.direction="inactive"):!0===e.offerToReceiveAudio&&!a&&r.addTransceiver("audio"),"undefined"!==typeof e.offerToReceiveAudio&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);var n=r.getTransceivers().find(function(e){return e.sender.track&&"video"===e.sender.track.kind});!1===e.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection("sendonly"):"recvonly"===n.direction&&n.setDirection("inactive"):!0===e.offerToReceiveVideo&&!n&&r.addTransceiver("video")}return t.apply(r,arguments)}}}},{"../utils":14}],14:[function(e,t){"use strict";function r(e,t,r){var a=e.match(t);return a&&a.length>=r&&parseInt(a[r],10)}var a=!0,n=!0;t.exports={extractVersion:r,wrapPeerConnectionEvent:function(e,t,r){if(e.RTCPeerConnection){var a=e.RTCPeerConnection.prototype,n=a.addEventListener;a.addEventListener=function(e,a){if(e!==t)return n.apply(this,arguments);var i=function(t){a(r(t))};return this._eventMap=this._eventMap||{},this._eventMap[a]=i,n.apply(this,[e,i])};var i=a.removeEventListener;a.removeEventListener=function(e,r){if(e!==t||!this._eventMap||!this._eventMap[r])return i.apply(this,arguments);var a=this._eventMap[r];return delete this._eventMap[r],i.apply(this,[e,a])},Object.defineProperty(a,"on"+t,{get:function(){return this["_on"+t]},set:function(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}},disableLog:function(e){return"boolean"===typeof e?(a=e,e?"adapter.js logging disabled":"adapter.js logging enabled"):new Error("Argument type: "+typeof e+". Please use a boolean.")},disableWarnings:function(e){return"boolean"===typeof e?(n=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled")):new Error("Argument type: "+typeof e+". Please use a boolean.")},log:function(){if("object"===typeof window){if(a)return;"undefined"!==typeof console&&"function"===typeof console.log&&console.log.apply(console,arguments)}},deprecated:function(e,t){n&&console.warn(e+" is deprecated, please use "+t+" instead.")},detectBrowser:function(e){var t=e&&e.navigator,a={};if(a.browser=null,a.version=null,"undefined"===typeof e||!e.navigator)return a.browser="Not a browser.",a;if(t.mozGetUserMedia)a.browser="firefox",a.version=r(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia)a.browser="chrome",a.version=r(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))a.browser="edge",a.version=r(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else if(e.RTCPeerConnection&&t.userAgent.match(/AppleWebKit\/(\d+)\./))a.browser="safari",a.version=r(t.userAgent,/AppleWebKit\/(\d+)\./,1);else return a.browser="Not a supported browser.",a;return a}}},{}]},{},[3])(3)});</script><script>(function(){"use strict";class a{constructor(a,b,c,d,e){this.videolist=a,this.chatroom=a.chatroom,this.app=a.chatroom.app,this.EventBus=a.chatroom.app.EventBus,this.handle=b,this.outgoing=c,this.sdp=e,this.mediaStream=null,this.iceStateLast="",this.iceConnectedCount=0;let f=this;this.rtc=new RTCPeerConnection({rtcpMuxPolicy:"require",bundlePolicy:"max-bundle",iceServers:[{urls:d}]},{}),this.rtc.onicecandidate=function(a){f.onICE_Candidate(a)},this.rtc.oniceconnectionstatechange=function(a){f.onICE_ConnectionStateChange(a)},this.rtc.onaddstream=function(a){f.onAddStream(a)},this.rtc.onremovestream=a=>{f.onRemoveStream(a)}}get ingoing(){return!this.outgoing}Connect(){this.outgoing?this._sendOfferPublisher():this._sendOfferRemote()}Close(){if(null!=this.rtc){let a=this.rtc;this.rtc=null,null!=this.mediaStream&&(this.mediaStream.active&&"closed"!==a.signalingState&&"function"===typeof a.removeStream&&a.removeStream(this.mediaStream),this.mediaStream.stop(),this.mediaStream=null),"closed"!==a.signalingState&&a.close(),console.log("MediaConnection.SignalingState: "+a.signalingState+" ->>> Close")}}AddStream(a){this.rtc.addStream(a),this.mediaStream=a}onICE_Candidate(a){if(console.log(a.candidate),null!=a.candidate&&"object"===typeof a.candidate&&"string"===typeof a.candidate.candidate){var b=this.chatroom.tcPkt_Trickle(this.handle,a.candidate.candidate);this.chatroom.packetWorker.send(b)}}onICE_ConnectionStateChange(a){console.log(a);let b=TinychatApp.BLL.BroadcastProgressEvent,c=a.target;if(null!=c){switch(c.iceConnectionState){case"starting":break;case"checking":break;case"completed":break;case"connected":if(this.outgoing&&0===this.iceConnectedCount){console.log("Broadcast: Started Successfully"),this.videolist.AddVideoSelf(this.handle,this.mediaStream);let a=new b(b.MEDIA_STARTED_SUCCESS);this.EventBus.broadcast(b.ID,a)}this.iceConnectedCount+=1;break;case"disconnected":break;case"failed":console.error(a);case"closed":if(this.outgoing){this.videolist.RemoveVideoSelf(this.handle);let a=new b(b.MEDIA_STOPED);this.EventBus.broadcast(b.ID,a)}else this.videolist.RemoveVideoRemote(this.handle);}this.iceStateLast=c.iceConnectionState}}onAddStream(a){return this.outgoing?void console.log("Broadcast: LocalMedia.Added ("+this.handle+")!!!"):void(console.log("Broadcast: RemoteMedia.Added ("+this.handle+")!!!"),this.videolist.AddVideoRemote(this.handle,a.stream))}onRemoveStream(){return this.outgoing?void console.log("Broadcast: LocalMedia.Removed ("+this.handle+")!!!"):void(console.log("Broadcast: RemoteMedia.Removed ("+this.handle+")!!!"),this.videolist.RemoveVideoRemote(this.handle,event.stream))}_sendOfferPublisher(){let a=this,b=new Map;b.set("offerToReceiveAudio",!1),b.set("offerToReceiveVideo",!1),this.rtc.createOffer(b).then(function(b){a.rtc.setLocalDescription(b),console.log({sdp:b.sdp});let c=a.chatroom.tcPkt_SDP(b.type,b.sdp,0,function(b){a._onOfferPublisher(b)});a.chatroom.packetWorker.send(c)},function(a){console.error(a);let b=TinychatApp.BLL.BroadcastProgressEvent,c=new b(b.MEDIA_RTC_FAILED);c.error=a,this.EventBus.broadcast(b.ID,c)})}_onOfferPublisher(a){if(this.chatroom.tcPkt_TcCallbackCheck(a,"sdp"))if(!0===a.success)console.log({sdp:a.sdp}),this.rtc.setRemoteDescription(new RTCSessionDescription({type:a.type,sdp:a.sdp}));else{if(void 0!==a.reason&&null!==a.reason)if(16===a.reason.code){let b=a.timeout.timeToReadable();60<a.timeout?this.app.showToastWarn(`${a.reason.text}, you can try to broadcast again in ${b}`,4e3):this.app.showToast(`${a.reason.text}, you can try to broadcast again in ${b}`,4e3)}else 18===a.reason.code&&this.app.showToast(a.reason.text,3e3);this.rtc.close()}}_sendOfferRemote(){let a=this;this.rtc.setRemoteDescription(new RTCSessionDescription({type:"offer",sdp:this.sdp})).then(function(){return a.rtc.remoteDescription}).then(function(){a.rtc.createAnswer().then(function(b){return a.rtc.setLocalDescription(b)}).then(function(){let b=a.rtc.localDescription.type,c=a.rtc.localDescription.sdp,d=a.handle;var e=a.chatroom.tcPkt_SDP(b,c,d,function(){});a.chatroom.packetWorker.send(e)}).catch(function(a){console.error(a)})}).catch(function(a){console.error(a)})}_onOfferRemote(a){this.chatroom.tcPkt_TcCallbackCheck(a,"sdp")&&(!0!==a.success&&this.Close(),console.log("Broadcast: RemoteMedia.SDP ..."))}}window.TinychatApp.BLL.MediaConnection=a})();</script><script>(function(){"use strict";var a=Math.Guid;let b=null;class c{constructor(a,b,c){this.debug=c,c&&(window.DEBUG=c),this.EventBus=new EventBus,this._version=new i(2,0,20,420,c),window.rootDir=this._version.rootDir(),this.defaultChatroom=null,console.log("App.useragent (?) - "+this.useragent),this.tc_token=a,this.loginState=null,this.LoginInfo(b),this.showShareHandler=null,this.showMediaFiltersHandler=null,this.showMediaSettingsHandler=null,this.showSettingsHandler=null,this.showUpgradeHandler=null,this.showNotificationHandler=null,this.showUserProfile=null,this.showBanlistHandler=null,this.showYoutubeHandler=null}static getInstance(a,d,e){return null==b&&(b=new c(a,d,e)),b}static get RegExp_Nickname(){return /\w+/ig}static get url(){return"https://tinychat.com"}static url_avatar(a){var a=a==void 0?"guest":a;return"https://upload.tinychat.com/pic/"+encodeURI(a)}static url_api_v1_0(){return c.url+"/api/v1.0"}static url_api_login_info(){return this.url_api_v1_0()+"/user/info"}static url_api_room_token(a){return this.url_api_v1_0()+"/room/token/"+encodeURI(a)}static url_api_settings_switchclient(a){return"/settings/version/"+encodeURI(a)}static url_api_userprofile(a){var a=a==void 0?"guest":a;return this.url_api_v1_0()+"/user/profile?username="+encodeURI(a)}static url_api_follow(){return this.url+"/user/follow"}get version(){return this._version}get useragent(){return this._version.userAgent()}get settings(){return TinychatApp.BLL.SettingsFeature.getInstance(this.EventBus)}get _tracker(){return TinychatApp.BLL.Tracker.getInstance()}get _router(){return TinychatApp.BLL.Router.getInstance()}get _api(){return WebAPI.getInstance()}get _cookie(){return CookieUtils}isDebug(){return this.debug}setDarkModeCSSclass(a){return a?"dark":""}GetChatroom(a){if(this.isDebug()&&console.warn("App.isDebug"),void 0==a)throw new Exception("Roomname is empty");let b=this.settings.getSettings();return this.defaultChatroom=new TinychatApp.BLL.ChatRoom(this,this.tc_token,a,b.nickname),this.defaultChatroom}GiveAGift(a){"string"==typeof a&&0<a.length?this._router.GiveAGift(a):this._router.GiveAGift()}LiveDirectory(){this._router.LiveDirectory()}EarnCoins(){this._router.EarnCoins()}UpgradeSub(){this._router.UpgradeSub()}SwitchClientVersion(){let a=this;this._api.wsj({src:a.url_api_settings_switchclient("old")}).then(a=>{console.log(a),window.location.reload()}).catch(b=>{console.error(b),a.showToastWarn("Some unknown server error occurred")})}PromoteRoom(){this._router.PromoteRoom()}Login(a){this._router.Login(a)}Register(){this._router.Register()}Logout(){this._router.Logout()}Share(){Object.isFunc(this.showShareHandler)&&this.showShareHandler()}Banlist(){Object.isFunc(this.showBanlistHandler)&&this.showBanlistHandler()}Youtube(){Object.isFunc(this.showYoutubeHandler)&&this.showYoutubeHandler()}MediaFilters(){Object.isFunc(this.showMediaFiltersHandler)&&this.showMediaFiltersHandler()}MediaSettings(a){Object.isFunc(this.showMediaSettingsHandler)&&this.showMediaSettingsHandler(a)}Settings(){Object.isFunc(this.showSettingsHandler)&&this.showSettingsHandler()}Upgrade(a){Object.isFunc(this.showUpgradeHandler)&&this.showUpgradeHandler(a)}Notify(a,b){Object.isFunc(this.showNotificationHandler)&&this.showNotificationHandler(a,b)}DevNews(){this._router.DevNews()}WebSettings(){this._router.WebSettings()}UserProfile(a){Object.isFunc(this.showUserProfile)&&this.showUserProfile(a)}LoginInfo(a){var b=this;if("object"===typeof a){let b=a,c=new TinychatApp.DAL.LoginUserInfoEntity,d=new TinychatApp.DAL.LoginResultEntity;return d.loggedIn=b.loggedIn,d.loginName=b.username,d.userInfo=c,void this.OnLoginInfo(d)}this._api.wsj({src:c.url_api_login_info()}).then(function(a){let c=new TinychatApp.DAL.LoginResultEntity;if(c.errorcode=a.result,c.errormsg=a.message,"success"==a.result){var d=new TinychatApp.DAL.LoginUserInfoEntity;c.usersuggestion=a.username,c.userInfo=d,b.OnLoginInfo(c)}let f=b._parseLoginCookies();c.loggedIn=null!=f,c.loginName=null==f?"":f.login_name;let g=b.loginState,h=new e(g,c);b.EventBus.broadcast(e.ID,h)}).catch(function(a){console.error(a)})}OnLoginInfo(a){this.loginState=a==void 0?null:a}LoginState(){return this.loginState}IsLoggedIn(){return null!=this.loginState&&this.loginState.loggedIn}LoginName(){return null==this.loginState?null:this.loginState.loginName}IsFree(){return!(null!=this.loginState)||null==this.loginState.userInfo||0===this.loginState.userInfo.stype}GetAvatarUrl(a){return c.url_avatar(a)}Follow(a,b,d){return this._api.wsj({src:c.url_api_follow(),params:{event:1,favourite:a}},!0).then(function(a){Object.isFunc(b)&&b(a)}).catch(function(a){console.error(a),Object.isFunc(d)&&d(a)})}GetProfile(a,b,d){return this._api.wsj({src:c.url_api_userprofile(a)}).then(function(a){if("success"!=a.result)return!1;let c=new TinychatApp.DAL.UserProfileEntity;c.username=a.username,c.biography=a.biography,c.gender=a.gender,c.age=a.age,c.location=a.location,c.role=a.role,c.stype=a.stype,c.avatarUrl=a.avatarUrl,c.achieveUrl=a.achieveUrl,c.percentToNextAchieve=a.percentToNextAchieve,c.giftpoints=a.giftpoints;let d=a.virtualgifts,e=[];Array.isArray(d)&&Object.keys(d).forEach(a=>{let b=new TinychatApp.DAL.GiftEntity,c=d[a];b.giftUrl=c.imageSource,b.giftName=c.name,e.push(b)}),c.gifts=e,Object.isFunc(b)&&b(c)}).catch(function(a){console.error(a),Object.isFunc(d)&&d(a)})}IsValidNickname(a){if("string"!=typeof a)return!1;if(1>a.length)return!1;var b=c.RegExp_Nickname.exec(a);return null!=b&&b.input.length==b[0].length}IsValidRoomname(a){return this.IsValidNickname(a)}ReconnectDefaultChatroom(){this.defaultChatroom?this.defaultChatroom.Reconnect():window.location.reload()}showToastLurker(){let a=this,b=Toast.TYPE.WARN,c=new g(b,"You're in view-only mode. Reconnect and solve captcha...",4e3,()=>{a.ReconnectDefaultChatroom()},"Solve Captcha");this.EventBus.broadcast(g.ID,c)}showToastWarn(a,b=2e3){let c=Toast.TYPE.WARN,d=new g(c,a,b,null);this.EventBus.broadcast(g.ID,d)}showToast(a,b=2e3){let c=new g("",a,b,null);this.EventBus.broadcast(g.ID,c)}showToastTimeoutToLogin(a=60){let b=Toast.TYPE.TIMEOUT_TO_LOGIN,c=new g(b,"",a,null);this.EventBus.broadcast(g.ID,c)}_readLoginState(){let a=this._parseLoginCookies(),b=new TinychatApp.DAL.LoginResultEntity;return b.loggedIn=null!=a,b.loginName=null==a?"":a.login_name,b}_parseLoginCookies(){try{let a=this._cookie.getCookie("pass"),b=this._cookie.getCookie("user"),c=this._cookie.getCookie("hash"),d=new h;if(d.login_hash=c,d.login_passhash=a,d.login_name=b,void 0!=d.login_hash&&"string"===typeof d.login_hash&&void 0!=d.login_passhash&&"string"===typeof d.login_passhash&&void 0!=d.login_name&&"string"===typeof d.login_name)return d}catch(a){}return null}isSafari(){let a=new UAParser;return-1!==a.getBrowser().name.indexOf("Safari")}}const d="LoginStateChangedEvent_"+a.newGuid();class e{static get ID(){return d}constructor(a,b){return this.beforeState=a,this.loginState=b,this}}const f="ToastEvent_"+a.newGuid();class g{static get ID(){return f}constructor(a,b,c,d,e){return this.type=a,this.text=b,this.wait=c,this.ok_handler=d,this.ok_text=e,this}}class h{constructor(){this.login_hash="",this.login_passhash="",this.login_name=""}}class i{constructor(a,b,c,d,e){this.app_name="Tinychat",this.major=a,this.minor=b,this.patch=c,this.build=d,this.debug=e!=void 0&&e}toString(){return this.shortTitle()}userAgent(){return this.format("{0}-client-webrtc-{3}-{1}-{2}").toLowerCase()}shortTitle(){return this.format("v{1} ({2})")}title(){return this.format("{0} for WebRTC v{1} ({2})")}rootDir(){return this.format("/webrtc/{1}-{2}")}format(a){a=a==void 0?"{0} for WebRTC v{1} ({2}-{3})":a;let b=this.major+"."+this.minor+"."+this.patch+(this.debug?"~d":""),c=this.getBrowser()+"_"+navigator.platform,d=this.build;return a.format(this.app_name,b,d,c)}getBrowser(){try{var a,b=a.width}catch(a){var c=a.toString();return-1===c.search("not an object")?-1===c.search("Cannot read")?-1===c.search("e is undefined")?-1===c.search("Unable to get property 'width' of undefined or null reference")?-1===c.search("cannot convert e into object")?void 0:"opera":document.documentMode||!window.StyleMedia?"IE":"edge":"firefox":"chrome":"safari"}}}c.BLL=window.TinychatApp.BLL,c.DAL=window.TinychatApp.DAL,c.BLL.LoginStateChangedEvent=e,c.BLL.ToastEvent=g,window.TinychatApp=c})();</script><script>(function(){"use strict";var a=window.TinychatApp||{};a.UI={},window.TinychatApp=a})();</script><script>(function(){"use strict";var a=Math.Guid;const b="UISideMenuToggle_"+a.newGuid();class c{static get ID(){return b}constructor(){return this}}const d="UIChatlogWiderToggle_"+a.newGuid();class e{static get ID(){return d}constructor(){return this}}window.TinychatApp.UI.UISideMenuToggle=c,window.TinychatApp.UI.UIChatlogWiderToggle=e})();</script><dom-module id="tc-chatlist-style" assetpath="../ui/tc-chatlist/"><template><style>#chatlist *{user-select:none;-webkit-user-select:none;-moz-user-select:none;}#chatlist{font-size:0;}#chatlist.hidden #header,
  3. #chatlist.hidden .list-item,
  4. #chatlist > .list-item.hidden{height:0;opacity:0;visibility:hidden;}#chatlist > div{display:block;height:33px;overflow:hidden;opacity:1;visibility:visible;transition:.5s;animation:show-item .5s ease 0s 1;-webkit-animation:show-item .5s ease 0s 1;}@keyframes show-item{0%{height:0;opacity:0;visibility:visible;}100%{height:33px;opacity:1;visibility:visible;}}@-webkit-keyframes show-item{0%{height:0;opacity:0;visibility:visible;}100%{height:33px;opacity:1;visibility:visible;}}#chatlist > #header + .list-item{height:0;}#chatlist > #header ~ .list-item:not(.hidden):nth-child(2):last-of-type{height:33px;cursor:default;}#chatlist > div > span{position:relative;display:inline-block;height:30px;width:100%;padding-left:36px;border-radius:0 30px 30px 0;box-sizing:border-box;font-size:14px;color:#7b868a;line-height:30px;text-align:left;white-space:nowrap;overflow:hidden;transition:.2s;}#chatlist > #header{position:relative;height:70px;top:33px;font-weight:600;text-transform:uppercase;cursor:default;animation:show-header .5s ease 0s 1;-webkit-animation:show-header .5s ease 0s 1;}@keyframes show-header{0%{height:0;opacity:0;visibility:visible;}100%{height:70px;opacity:1;visibility:visible;}}@-webkit-keyframes show-header{0%{height:0;opacity:0;visibility:visible;}100%{height:70px;opacity:1;visibility:visible;}}#chatlist > #header ~ .list-item > span.active{background-color:#202628;cursor:default;}.list-item ~ span:not(.active)[data-status=""]:hover{color:#fff;}.list-item > span[data-status="gold"]{color:#ffbe00;}.list-item > span[data-status="extreme"]{color:#ad6ed1;}.list-item > span[data-status="pro"]{color:#31ea5d;}.list-item > span[data-status="gold"]:before,
  5. .list-item > span[data-status="extreme"]:before,
  6. .list-item > span[data-status="pro"]:before{content:'';position:absolute;display:inline-block;height:12px;width:12px;top:9px;left:0;background-repeat:no-repeat;}.list-item > span[data-status="gold"]:before{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPHBhdGggZD0iTTAgMGg4LjAwNEMxMC4yMSAwIDEyIDEuNzk3IDEyIDMuOTk2djQuMDA4QzEyIDEwLjIxIDEwLjIwMyAxMiA4LjAwNCAxMkgwVjB6IiBmaWxsPSIjZWZhNzAxIi8+DQoJPHBhdGggaWQ9InN0YXR1cy1nb2xkIiBkPSJNNS45NSA1LjY1NmgyLjQ2NHYzLjA3OGMtLjY3LjIzLTEuNDA1LjM0NC0yLjIwNy4zNDQtLjg4IDAtMS41Ni0uMjU1LTIuMDQtLjc2NXMtLjcyMi0xLjI0LS43MjItMi4xODRjMC0uOTIzLjI2My0xLjY0Ljc5LTIuMTUzLjUyNS0uNTEzIDEuMjYyLS43NyAyLjIxLS43Ny4zNiAwIC43LjAzNCAxLjAxOC4xMDIuMzIuMDY2LjU5Ny4xNTIuODM0LjI1NmwtLjQ4OCAxLjIxYy0uNDEzLS4yMDItLjg2NS0uMzAzLTEuMzU3LS4zMDMtLjQ1IDAtLjguMTQ2LTEuMDQ1LjQ0LS4yNDYuMjkyLS4zNy43MS0uMzcgMS4yNTUgMCAuNTM0LjExMi45NC4zMzUgMS4yMi4yMjMuMjguNTQ0LjQyLjk2My40Mi4yMyAwIC40NC0uMDIyLjYzMy0uMDY2di0uODk0SDUuOTVWNS42NTZ6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4NCgk8dXNlIGZpbGw9IiMwMDAiIHhsaW5rOmhyZWY9IiNzdGF0dXMtZ29sZCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAxKSIgZmlsbC1vcGFjaXR5PSIuMiIvPg0KCTx1c2UgZmlsbD0iI2ZmZiIgeGxpbms6aHJlZj0iI3N0YXR1cy1nb2xkIi8+DQo8L3N2Zz4=);}.list-item > span[data-status="extreme"]:before{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPHBhdGggZD0iTTAgMGg4LjAwNEMxMC4yMSAwIDEyIDEuNzk3IDEyIDMuOTk2djQuMDA4QzEyIDEwLjIxIDEwLjIwMyAxMiA4LjAwNCAxMkgwVjB6IiBmaWxsPSIjYWQ2YmNlIi8+DQoJPHBhdGggaWQ9InN0YXR1cy1leHRyZW1lIiBkPSJNNy44MTMgOWgtMy4zOVYzLjI5aDMuMzl2MS4yMzdINS45NjV2LjloMS43MXYxLjIzN2gtMS43MXYxLjA3OGgxLjg0OHoiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI3N0YXR1cy1leHRyZW1lIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDEpIiBmaWxsLW9wYWNpdHk9Ii4yIi8+DQoJPHVzZSBmaWxsPSIjZmZmIiB4bGluazpocmVmPSIjc3RhdHVzLWV4dHJlbWUiLz4NCjwvc3ZnPg==);}.list-item > span[data-status="pro"]:before{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPHBhdGggZD0iTTAgMGg4LjAwNEMxMC4yMSAwIDEyIDEuNzk3IDEyIDMuOTk2djQuMDA4QzEyIDEwLjIxIDEwLjIwMyAxMiA4LjAwNCAxMkgwVjB6IiBmaWxsPSIjMzhjZDU3Ii8+DQoJPHBhdGggaWQ9InN0YXR1cy1wcm8iIGQ9Ik04LjIzNCA1LjEwNWMwIC42MzgtLjE4OCAxLjEzLS41NjQgMS40OC0uMzc2LjM0Ny0uOTEuNTItMS42MDQuNTJoLS40MzNWOUg0LjA5VjMuMjloMS45NzZjLjcyMiAwIDEuMjYzLjE1NyAxLjYyNS40NzIuMzYzLjMxNS41NDQuNzYzLjU0NCAxLjM0M3ptLTIuNi43NDNoLjI4Yy4yMzIgMCAuNDE2LS4wNjUuNTUzLS4xOTYuMTM3LS4xMy4yMDUtLjMxLjIwNS0uNTQgMC0uMzg0LS4yMTQtLjU3Ny0uNjQtLjU3N2gtLjR2MS4zMTN6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4NCgk8dXNlIGZpbGw9IiMwMDAiIHhsaW5rOmhyZWY9IiNzdGF0dXMtcHJvIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDEpIiBmaWxsLW9wYWNpdHk9Ii4yIi8+DQoJPHVzZSBmaWxsPSIjZmZmIiB4bGluazpocmVmPSIjc3RhdHVzLXBybyIvPg0KPC9zdmc+);}.list-item > span > img{position:absolute;display:inline-block;height:10px;width:10px;top:10px;left:20px;opacity:1;visibility:visible;transition:.2s;}.list-item > span > img[src=""]{opacity:0;visibility:hidden;}.list-item + .list-item > span:hover{background-color:#272f31;cursor:pointer;}.list-item > span > span{position:absolute;display:inline-block;height:100%;top:0;right:0;padding:0 5px 0 10px;background-color:#2d373a;font-size:0;box-shadow:0 0 3px 3px #2d373a;transition:.2s;}.list-item > span:hover > span{background-color:#272f31;box-shadow:0 0 3px 3px #272f31;}.list-item > span.active > span{background-color:#202628;box-shadow:0 0 3px 3px #202628;}.list-item > span > span[data-messages]:before{content:attr(data-messages);position:relative;display:inline-block;height:20px;min-width:20px;top:3px;padding:0 5px;border-radius:10px;box-sizing:border-box;font-size:10px;font-weight:800;color:#fff;background-color:#38cd57;line-height:20px;text-align:center;}.list-item > span > span[data-messages=""]:before,
  7. .list-item > span > span[data-messages="0"]:before{display:none;}.list-item > span > span > .send-gift{content:'';position:relative;display:inline-block;height:14px;width:0;top:6px;padding:0;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOC4zMTMgMi4yNmMwLS42MDQuNDktMS4wOTMgMS4wOTMtMS4wOTMuNjA0IDAgMS4wOTQuNDkgMS4wOTQgMS4wOTMgMCAuNjA0LS40OSAxLjA5NC0xLjA5NCAxLjA5NEg3LjU4M2wuNzMuNzNWMi4yNnpNNyAyLjMzM3YyLjMzNGgyLjMzM2MxLjI5IDAgMi4zMzQtMS4wNDUgMi4zMzQtMi4zMzRDMTEuNjY3IDEuMDQ1IDEwLjYyMiAwIDkuMzMzIDAgOC4wNDUgMCA3IDEuMDQ1IDcgMi4zMzN6TTUuNjg4IDIuMjZjMC0uNjA0LS40OS0xLjA5My0xLjA5NC0xLjA5My0uNjA0IDAtMS4wOTQuNDktMS4wOTQgMS4wOTMgMCAuNjA0LjQ5IDEuMDk0IDEuMDk0IDEuMDk0aDEuODIzbC0uNzMuNzNWMi4yNnpNNyAyLjMzM3YyLjMzNEg0LjY2N2MtMS4yOSAwLTIuMzM0LTEuMDQ1LTIuMzM0LTIuMzM0QzIuMzMzIDEuMDQ1IDMuMzc4IDAgNC42NjcgMCA1Ljk1NSAwIDcgMS4wNDUgNyAyLjMzM3oiIGZpbGw9IiMwNGNhZmYiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGQ9Ik0wIDQuMmgxNFY3SDB6TS45MzMgOC40aDEyLjEzM1YxNEguOTMzeiIgZmlsbD0iIzA0Y2FmZiIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+);background-repeat:no-repeat;opacity:0;visibility:hidden;cursor:pointer;transition:.2s;}.list-item > span:hover > span[data-gift="1"] > .send-gift{width:14px;margin:0 3px 0 5px;opacity:1;visibility:visible;}.list-item > span > span > .close-instant{content:'';position:relative;display:inline-block;height:12px;width:0;top:7px;padding:2px 0;opacity:0;visibility:hidden;cursor:pointer;transition:.2s;}.list-item > span > span > .close-instant > path{transition:.2s;}.list-item > span > span > .close-instant:hover > path{fill:#768488;}.list-item > span > span > .close-instant:active > path{fill:#454d50;}.list-item > span:hover > span > .close-instant{width:12px;padding:2px 2px 2px 6px;opacity:1;visibility:visible;}.list-item > span:hover > span[data-gift="1"] > .close-instant{padding:2px;}</style></template></dom-module><dom-module id="tc-chatlist" assetpath="../ui/tc-chatlist/"><template strip-whitespace=""><style include="tc-chatlist-style"></style><div id="chatlist"><div id="header"><span>Direct messages</span></div><div class="list-item"><span>No chats yet</span></div><dom-repeat items="[[_items]]"><template strip-whitespace=""><div class$="[[convertClass(item)]]" on-click="selectChat"><span class$="[[convertActive(item, _selected)]]" data-chat-id$="[[item.handle]]" data-status$="[[convertSubType(item)]]"><img src$="[[item.achivementUrl]]"> [[item.nickname]]<dom-if if="[[item.isOffline]]"><template strip-whitespace="">(offline)</template></dom-if><span data-messages$="[[convertMessages(item, _unreaded)]]" data-cam$="[[convertBool(item.isBroadcasting)]]" data-moderator$="[[convertBool(item.isOperator)]]" data-gift$="[[convertBool(item.isUsername)]]"><span class="send-gift" on-click="sendgiftTap"></span> <svg class="close-instant" on-click="closeChat" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M6 4L2 0 0 2l4 4-4 4 2 2 4-4 4 4 2-2-4-4 4-4-2-2" fill="#5a6366" fill-rule="evenodd"></path></svg></span></span></div></template></dom-repeat></div></template><script>class ChatroomChatlist extends Polymer.Element{static get is(){return"tc-chatlist"}static get properties(){return{chatlog:{type:Object,observer:"chatlogAssigned"},_items:{type:Array,value:[],notify:!0},_selected:{type:Object,value:null},_unreaded:{type:Object,value:{}}}}constructor(){super()}connectedCallback(){super.connectedCallback()}chatlogAssigned(){let a=this,b=this.chatlog.chatroom.app.EventBus,c=TinychatApp.DAL.UserEntity;b.subscribe(TinychatApp.BLL.ChatlistAddEvent.ID,function(b){let d=a._items.length;a.splice("_items",b.index,0,Object.assign(new c,b.userentity)),d!=a._items.length&&(0==d||0==a._items.length)&&a.notifyPath("_items");let e=b.userentity.handle;a._unreaded[e]=0,a._updateUnreaded(e),a.notifyPath("_unreaded."+e)}),b.subscribe(TinychatApp.BLL.ChatlistRemoveEvent.ID,function(b){var d=a._items.find(a=>a.handle===b.userentity.handle);d.isDeleting=!0,a._items[b.index]=Object.assign(new c,d),a.notifyPath("_items."+b.index),setTimeout(()=>{let c=a._items.length;a.splice("_items",b.index,1),c!=a._items.length&&(0==c||0==a._items.length)&&a.notifyPath("_items")},500)}),b.subscribe(TinychatApp.BLL.ChatlistUpdateEvent.ID,function(b){let c=TinychatApp.DAL.UserEntity;b.fromIndex==b.toIndex?a.splice("_items",b.fromIndex,1,Object.assign(new c,b.toUserEntity)):(b.fromUserEntity.isDeleting=!0,a.notifyPath("_items."+b.fromIndex,b.fromUserEntity),setTimeout(()=>{a.splice("_items",b.fromIndex,1),a.splice("_items",b.toIndex,0,Object.assign(new c,b.toUserEntity))},500))}),b.subscribe(TinychatApp.BLL.ChatlistSelectedEvent.ID,function(b){a.set("_selected",b.userentity),b.userentity instanceof c?Object.keys(a._items).forEach(c=>{let d=a._items[c];if(d.handle==b.userentity.handle)return a.notifyPath("_items"),!0}):a._selected===TinychatApp.BLL.Chatlog.PUBLIC&&a.notifyPath("_items");let d=b.userentity.handle;a._unreaded[d]=0,a._updateUnreaded(d)}),b.subscribe(TinychatApp.BLL.ChatlogItemAddedEvent.ID,function(b){if(!a.chatlog.isequal(a._selected,b.chatname)){var c=a._unreaded[b.chatname];c==void 0&&(c=0),++c,a._unreaded[b.chatname]=c,a._updateUnreaded(b.chatname)}})}_updateUnreaded(a){let b=TinychatApp.DAL.UserEntity,c=this;for(var d in c._items){let e=c._items[d];if(e.handle==a){let a=c._items.indexOf(e);c._items[a]=Object.assign(new b,e),c.notifyPath("_items."+a);break}}}isShown(){let a=Array.isArray(this._items)&&0<this._items.length;return a}convertClass(a){var b="list-item";return a.isDeleting&&(b+=" hidden"),b}convertActive(a,b){let c=TinychatApp.DAL.UserEntity;return b instanceof c&&a instanceof c&&b.handle===a.handle?"active":""}convertSubType(a){return TinychatApp.BLL.User.getCssClass(a)}convertMessages(a,b){let c=a.handle,d=b[c];return setTimeout(()=>{d&&this.chatlog.chatroom.sendPushForUnreadPrivateMessage()},3e4),d}convertBool(a){return a?"1":"0"}selectChat(a){let b=a.path?a.path[0]:(a.composedPath&&a.composedPath())[0],c=0<parseInt(b.getAttribute("data-chat-id"));c&&this.chatlog.selectChat(a.model.item)}closeChat(a){this.chatlog.closeChat(a.model.item),a.stopPropagation()}sendgiftTap(a){a.preventDefault(),this.chatlog.chatroom.gotoGift(a.model.item)}}customElements.define(ChatroomChatlist.is,ChatroomChatlist);</script></dom-module><dom-module id="tc-message-html-style" assetpath="../ui/tc-utils/"><template><style>.message{font-size:14px;color:#2e373a;white-space:pre-line;word-wrap:break-word;}.message.system{font-size:12px;font-weight:600;color:#8f999c;}.message.gift{padding-bottom:12px;font-size:12px;font-weight:600;color:#8f999c;cursor:default;}.message[data-mode="dark"]{color:#fff;}.message.sub-pro,
  8. .message.sub-extreme,
  9. .message.sub-gold{font-weight:600;font-size:14px;color:#3c3c3c;white-space:nowrap;}.message.sub-pro > span{color:#3fd64f;}.message.sub-extreme > span{color:#c27ddf;}.message.sub-gold > span{color:#f3b100;}.full-screen.message{color:#fff;}a{color:#4682b4;}@media screen and (max-width: 600px){.message{font-size:12px;}}</style></template></dom-module><dom-module id="tc-message-html" assetpath="../ui/tc-utils/"><template strip-whitespace=""><style include="tc-message-html-style"></style><span id="html" class$="[[classType]]" data-mode$="[[modestyle]]">{{html}}</span></template><script>class TcMessageHtml extends Polymer.Element{static get is(){return"tc-message-html"}static get properties(){return{classType:{type:String,value:""},html:{type:String,value:"html",observer:"messageRender"},nickname:{type:String,value:"html"},modestyle:String,onFullscreenHandler:Object}}constructor(){super()}ready(){super.ready(),Polymer.RenderStatus.afterNextRender(this,function(){this.filterText(this.html)})}messageRender(a){this.filterText(a)}connectedCallback(){super.connectedCallback(),this.onFullscreenHandler=this.onFullscreen.bind(this),window.fullscreenManager.addEventListener(this.onFullscreenHandler,!1)}disconnectedCallback(){super.disconnectedCallback(),window.fullscreenManager.removeEventListener(this.onFullscreenHandler,!1)}onFullscreen(){let a=window.fullscreenManager.status();a?this.$.html.classList.add("full-screen"):this.$.html.classList.remove("full-screen")}replaceSpecSymbols(a){let b=a.replace(/&rlo;|\u202E/gi,"");return b.replace(/[&<>"']/g,function(a){return"&"+{"&":"amp","<":"lt",">":"gt",'"':"quot","'":"#39"}[a]+";"})}filterText(a){return-1<this.classType.indexOf("sub-pro")||-1<this.classType.indexOf("sub-extreme")||-1<this.classType.indexOf("sub-gold")?void(this.$.html.innerHTML=Autolinker.link("<span>"+this.replaceSpecSymbols(this.nickname)+"</span> has joined")):void(this.$.html.innerHTML=Autolinker.link(this.replaceSpecSymbols(a)))}}customElements.define(TcMessageHtml.is,TcMessageHtml);</script></dom-module><dom-module id="tc-chatlog-style" assetpath="../ui/tc-chatlog/"><template><style>.on-white-scroll{padding-left:16px;box-sizing:border-box;overflow-x:hidden;overflow-y:scroll;}.on-white-scroll::-webkit-scrollbar{position:absolute;width:15px;cursor:pointer;}.on-white-scroll::-webkit-scrollbar-track{background-color:#fff;}.on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #fff;border-radius:6px/8px;background-color:rgba(0, 0, 0, .2);}.on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}:host,
  10. #chat-wrapper{position:relative;height:100%;}#chat-wider{position:absolute;display:block;height:40px;width:16px;top:50%;left:-8px;margin-top:-20px;border-radius:16px;font-size:0;background-color:#e9eaea;cursor:pointer;z-index:1;}#chat-wider:before{content:'';position:absolute;display:block;height:0;width:0;top:50%;left:50%;margin:-4px 0 0 -2px;border-width:4px 4px 4px 0;border-style:solid;border-color:transparent #bcc2c2;transition:.8s;}#chat-wider[data-mode="dark"]{background-color:#2e373a;}#chat-wider[data-mode="dark"]:before{border-color:transparent #5a6366;}#chat-wider.active:before{transform:rotate(180deg);-webkit-transform:rotate(180deg);}#chat-wrapper{min-width:350px;border-left:1px solid rgba(0, 0, 0, .1);box-sizing:border-box;background-color:#fff;overflow-x:hidden;transition:.8s;}#chat-wrapper[data-mode="dark"]{background-color:#202628;}#chat-wider.active + #chat-wrapper{min-width:500px;}#chatlog-button{display:none;}#chat-position{position:absolute;display:flex;flex-direction:column;align-items:stretch;top:20px;left:20px;right:20px;bottom:19px;}#chat-instant{position:relative;height:0;min-height:0;width:100%;padding-left:106px;box-sizing:border-box;background-color:#fff;overflow:hidden;}[data-mode="dark"] #chat-instant{background-color:#202628;}#chat-instant.show{height:50px;min-height:50px;}#chat-instant > .nickname{white-space:nowrap;font-size:16px;font-weight:700;color:#000;line-height:44px;overflow:hidden;text-overflow:ellipsis;cursor:default;}#chat-instant-button{position:absolute;display:block;height:40px;width:40px;top:2px;left:0;border-radius:4px;background-color:transparent;cursor:pointer;transition:.2s;}#chat-instant-button:before{content:"";position:relative;display:inline-block;height:14px;width:14px;top:13px;left:18px;margin-right:4px;border-width:0 0 2px 2px;border-style:solid;border-color:#53b6ef;box-sizing:border-box;transform:rotate(45deg);-webkit-transform:rotate(45deg);transition:.2s;}#chat-instant-button:hover:before{border-color:#54ccf3;}#chat-instant-button:active:before{border-color:#38a8dd;}#chat-position > #chat-instant > a{position:absolute;height:40px;width:40px;top:2px;left:60px;}#chat-instant:after{content:'';position:absolute;display:block;height:10px;left:0;right:15px;bottom:-10px;background:-moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);background:-webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%);background:linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#00ffffff',GradientType=0 );z-index:1;}#chat{position:relative;height:100%;min-height:120px;padding-left:2px;}[data-mode="dark"] #chat::-webkit-scrollbar-track{background-color:#202628;}[data-mode="dark"] #chat::-webkit-scrollbar-thumb{border-color:#202628;background-color:#5a6366;}#chat-content{display:flex;flex-direction:column;justify-content:flex-end;min-height:100%;}#chat-content > .message{position:relative;left:0;margin-bottom:10px;animation:show-message .2s ease 0s 1;-webkit-animation:show-message .2s ease 0s 1;}@keyframes show-message{0%{left:100%;}100%{left:0;}}@-webkit-keyframes show-message{0%{left:100%;}100%{left:0;}}#chat-content > .message.common{min-height:50px;padding:10px 10px 0 50px;box-sizing:border-box;font-size:0;text-align:left;}#chat-content > .message.system{padding:8px 10px;border-radius:4px;box-sizing:border-box;background-color:#f6f6f6;cursor:default;}[data-mode="dark"] #chat-content > .message.system{background-color:#101314;}#chat-content > .message.gift{min-height:50px;padding:10px 10px 0 50px;box-sizing:border-box;font-size:0;text-align:left;}#chat-content > .message.sub-pro,
  11. #chat-content > .message.sub-extreme,
  12. #chat-content > .message.sub-gold{height:50px;padding:10px 10px 0 50px;box-sizing:border-box;font-size:0;text-align:left;animation-duration:0s;-webkit-animation-duration:0s;}#chat-instant > a > .avatar,
  13. #chat-content > .message > .avatar{position:absolute;height:40px;width:40px;top:10px;left:0;transform:scale(1);-webkit-transform:scale(1);}#chat-instant > a > .avatar{top:0;}#chat-content > .message.sub-pro > .avatar,
  14. #chat-content > .message.sub-extreme > .avatar,
  15. #chat-content > .message.sub-gold > .avatar{background-repeat:no-repeat;background-position:center;animation:sub-avatar 4s ease 0s 1;-webkit-animation:sub-avatar 4s ease 0s 1;}#chat-content > .message.sub-pro > .avatar{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAb1BMVEUAAABFz2NFz2NGz2JV2WxFz2NFz2NGz2NFz2NH0GJF0GJI0GRJ02ZG0WhFzmI3tVFDy2A6u1RG0WM4uVNAx11Byl08vVY3v1NFz2JL5GpJ3WhG1GQ8wVg/w1ozu08vt0xK4GlI2Wcss0hM52w8xVlfBdHmAAAADnRSTlMA86h/C+jZ07+CclIjFiAigZkAAAHgSURBVDjLnZWLloIgEIbVtNKKwDQFSlD3/Z9xmRlhXWyvc05ypP/MxzAXk892rrLjPk33x6w6J1/apTywlR3Ky0tZvktZZOku3+pOBXthxSnW7Xr6p+kGM5lheHB673efsRnu8m4yXQMS3nTdG0mzNZ503TS0K2z7aEm54qI7Y7wsSGkj0E89bE4D2xrHcy4R5QXsTB17ZTXGnn+ATfAXKwP8kkIcJsCedyHuTx6EoEwhRyWCfRyP62IPrxzhUTrhARwuYC6c5CbEzS2CLy415N3VC7x4h8LJGkyQkwpGpuBxTirYNoF798R7oI9wygqT0nUEdv5wRajzSXA9YnqO7jkgjj2v1wb8w/lwedIhgX1M9nCJfKHdQNdAJODSn8O63z5JIRYfigA+GqdXNAk3iULzCyGiB+bRKI/QtQQ0BcNXwXARBaMtBpPB/TXfXY9SeD0VtsB3Fy41XDilEIVxCm9LrmdMIRXFWxsXBaxEtoqKIikRyuIy8/WjZ0h16Qu3bePChdVF3csRCze0Agm3ZmUf+jAvfL9tTSG4yEO7UhfF1ttZh3YlOCpjqZaSejAeKfW4ltZ2HhGVbYcU02rUNTaUkrOq/ZCKxx55VdZKaZX2Y+9vg/Tn0fzvYf/z5+MdJM1NvlcaLmYAAAAASUVORK5CYII);}#chat-content > .message.sub-extreme > .avatar{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAXVBMVEUAAADFieTEiOPFiePRk+nFiOLEiOPFiePEiOPFiOTHiePFiunFi+jEiOKta86yctPCheCwb9DHiuW1ddXDh+LBg9+4edi+gN3RkfG6e9rYlvjKjOjUlPXbmPzNj+3fm8g8AAAADXRSTlMAgPOoC+jZ079yUiMWKVQbwgAAAddJREFUOMudVQ1zgyAM9bOtthgQQUTt//+ZIwnclLntttwVz/h8L1+mxdmeXf24VdXtUXfP4lt7lXdxsHv5uoQ1ZSUyq8rmK65vxYW1fY4r45PZalCg9SKjozzL1uSUVoGdESLNYmdG1kd5xlmlzUHWzIaRma4EOMLIZc7qPb2v9PQ1GXb1McAWX1ZWXNlIuTefwqDxvEQm8VeFeUDSlYsG4OowEJHVKxJKZWJMdohm05vvRHlHwigsIUAUgAoXkJFyxb6HecGbSDhBgM3UoABN0Tg8nkWHbmBX0E01mnRQj0CMsqOmWHbJwDelOk+Bk8XXN7XnEU7NbV2GYUZ+jI8uCweJ2o/iFs4Ytx4U4hbMBAMfYopb+N2KCl3sAHxuBjLDt2QeK0lAOADlN0CS1iJJEzyTHj1KczLykIyELJl1o2RqRJifyuMclaejQfip4H6lgj8JIS5aqGKvd2ohD8Vs8qFAY/INle9pbmeRjRkaGExlx1aXaXCNFOfBnfBqMULHg5sojbi2zX9+h01Lopc4R8JtEz9Xzu6Kbydvf148Yw5dvR+z9VMz8n2EjtvuspVCS4o5nFtH+qCc392YL6mkzqxu895vbk1r72+L9PfV/O9l//vfxwcJv0btEV6iYwAAAABJRU5ErkJggg);}#chat-content > .message.sub-gold > .avatar{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAilBMVEUAAAD700b60kb60Ub/2VX60kb60kf50kf60kf70kj800j/00n/3FH50UbvrAH5zkD50ET4zTzxtA7xsQjzuBj500v61lX2wyn3wSTytRH3txD73G35yjf94oT833j51E/3uxf0vR/+5Y/4vh72yDT2xzP94X783XD72WP611r4xi/3tAn2sgX+44gBPK44AAAADXRSTlMAgPPWC+i/qqVyUiMWL88EHAAAAgRJREFUOMudVdl2gjAQZRNBCSHshEWKVevS//+9zmSCB5C2p50HwHiZO3c2jLntfc+1Lct2PX9vfGuBabOJ2WawCnNMiy3MMp1X3G7DVmyzW+JMRtYce3mX/bHg+sCc027VIT8+ZNkghDdleSPkdkqvcFH56MWEVtwEIRe8XMqGzU2IOftOBXfvI7a0iCLVihzUy+8lW7NMaXeexJHs2brlT/IA81zKkZcXaRynmB2yAyKtQDvkD60jegu1vY1vfowusb5HTcxjgCRVlcAt5trlFesO/YI/HoL8xQB7x6f3BJDaZ42XveFjaiQdAW+q/41SYNdAVO4bHjKXRAz+EMcFIsEnJ90YpWe4cO1JShGGJ7idgFUAexgWlMoOLq7SIunVNEwQV6ASeEjClLjPSg1m8U4HcVhBfSk74LJC+Ai0FFD+DPxEoKLu2Uit4AvqQ6uoXVTNJ2JEvBCTkxgPEc0sPWKenvqi0uMjovwp4S3W0KcSEpBKeKISoncKcaASKjU38doUI3OHzPY4MDe2bLOQJLF8yHSbBRbFP2ncChqXl2kFEWVtTY07uhQRW7Wupb59Dhfjq7haEW+cybiybGUEuyGncZ0tnvywHMC2zRbrZ6s7dAo9dENNK+V1SbFrXeeZmtG6HS4Z4ZzVtZd9dOfzZ9tdruPa+9si/X01/3vZ//75+AKpPkxfozkotAAAAABJRU5ErkJggg);}@keyframes sub-avatar{0%, 5%{transform:scale(0);}15%, 100%{transform:scale(1);}}@-webkit-keyframes sub-avatar{0%, 5%{-webkit-transform:scale(0);}15%, 100%{-webkit-transform:scale(1);}}#chat-content > .message.sub-pro > .avatar:after,
  16. #chat-content > .message.sub-extreme > .avatar:after,
  17. #chat-content > .message.sub-gold > .avatar:after{content:'';position:absolute;display:block;height:14px;width:14px;top:auto;bottom:auto;left:auto;right:auto;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOBAMAAADtZjDiAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAAC3RSTlMAUjYgEPzs0qt6PMPBap4AAAA4SURBVAjXY4ABLjC5gIFhCpDyBGIPAwbmFiDNXMSgbgCSUxNMAqthDBWA0zBxmDq4Pqg5CHOhAADgTQij9mC39wAAAABJRU5ErkJggg);background-repeat:no-repeat;background-position:center;opacity:0;animation:sub-avatar-star 4s linear 0s 1;-webkit-animation:sub-avatar-star 4s linear 0s 1;}@keyframes sub-avatar-star{0%{transform:rotate(0deg);}15%, 30%{top:auto;bottom:1px;left:auto;right:1px;opacity:0;}20%, 25%{opacity:1;}60%, 75%{top:1px;bottom:auto;left:auto;right:1px;opacity:0;}65%, 70%{opacity:1;}80%, 95%{top:1px;bottom:auto;left:1px;right:auto;opacity:0;}85%, 90%{opacity:1;}100%{transform:rotate(720deg);}}@-webkit-keyframes sub-avatar-star{0%{-webkit-transform:rotate(0deg);}15%, 30%{top:auto;bottom:1px;left:auto;right:1px;opacity:0;}20%, 25%{opacity:1;}60%, 75%{top:1px;bottom:auto;left:auto;right:1px;opacity:0;}65%, 70%{opacity:1;}80%, 95%{top:1px;bottom:auto;left:1px;right:auto;opacity:0;}85%, 90%{opacity:1;}100%{-webkit-transform:rotate(720deg);}}#chat-instant > a > .avatar > div,
  18. #chat-content > .message > .avatar > div{position:absolute;height:100%;width:100%;top:0;left:0;border-radius:100%;overflow:hidden;}#chat-content > .message.sub-pro > .avatar > div,
  19. #chat-content > .message.sub-extreme > .avatar > div,
  20. #chat-content > .message.sub-gold > .avatar > div{height:34px;width:34px;top:3px;left:3px;animation:sub-avatar-img 4s ease 0s 1;-webkit-animation:sub-avatar-img 4s ease 0s 1;}@keyframes sub-avatar-img{0%, 15%{transform:scale(0);}24%, 25%{transform:scale(1.1);}25%, 100%{transform:scale(1);}}@-webkit-keyframes sub-avatar-img{0%, 15%{-webkit-transform:scale(0);}24%, 25%{-webkit-transform:scale(1.1);}25%, 100%{-webkit-transform:scale(1);}}#chat-instant > a > .avatar > div > img,
  21. #chat-content > .message > .avatar > div > img{position:relative;height:100%;left:-7px;}#chat-content > .message.sub-pro > .avatar > div > img,
  22. #chat-content > .message.sub-extreme > .avatar > div > img,
  23. #chat-content > .message.sub-gold > .avatar > div > img{left:-5px;}#chat-instant > a > .status-icon,
  24. #chat-content > .message > .avatar > .status-icon{position:absolute;height:10px;width:10px;top:26px;left:-2px;padding:3px;border-radius:100%;background-color:#fff;}#chat-content > .message.sub-pro > .avatar > .status-icon,
  25. #chat-content > .message.sub-extreme > .avatar > .status-icon,
  26. #chat-content > .message.sub-gold > .avatar > .status-icon{display:none;}#chat-instant > a > .status-icon[src=""],
  27. #chat-instant > a > .avatar > div > img[src=""],
  28. #chat-content > .message > .avatar > .status-icon[src=""],
  29. #chat-content > .message > .avatar > div > img[src=""]{opacity:0;visibility:hidden;}#chat-content > .message > .nickname{display:inline-block;font-size:14px;font-weight:600;color:#000;line-height:20px;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:.2s;}[data-mode="dark"] #chat-content > .message > .nickname{color:#7b868a;}#chat-content > .message.sub-pro > .nickname,
  30. #chat-content > .message.sub-extreme > .nickname,
  31. #chat-content > .message.sub-gold > .nickname{display:none;}#chat-content > .message > .nickname:hover{opacity:.5;}#chat-instant > .nickname[data-status="gold"],
  32. #chat-wrapper.full-screen #chat-instant > .nickname[data-status="gold"],
  33. #chat-content > .message > .nickname[data-status="gold"],
  34. #chat-wrapper.full-screen #chat-content > .message > .nickname[data-status="gold"]{color:#ffbe00;}#chat-instant > .nickname[data-status="extreme"],
  35. #chat-wrapper.full-screen #chat-instant > .nickname[data-status="extreme"],
  36. #chat-content > .message > .nickname[data-status="extreme"],
  37. #chat-wrapper.full-screen #chat-content > .message > .nickname[data-status="extreme"]{color:#ad6ed1;}#chat-instant > .nickname[data-status="pro"],
  38. #chat-wrapper.full-screen #chat-instant > .nickname[data-status="pro"],
  39. #chat-content > .message > .nickname[data-status="pro"],
  40. #chat-wrapper.full-screen #chat-content > .message > .nickname[data-status="pro"]{color:#31ea5d;}#chat-content > .message > .content{padding-top:2px;font-size:14px;color:#2e373a;white-space:pre-line;word-wrap:break-word;}#chat-content > .message.system > .content{font-size:12px;font-weight:600;color:#8f999c;}#chat-content > .message.gift > .content{padding-bottom:12px;font-size:12px;font-weight:600;color:#8f999c;cursor:default;}#chat-content > .message.sub-pro > .content,
  41. #chat-content > .message.sub-extreme > .content,
  42. #chat-content > .message.sub-gold > .content{width:100%;line-height:40px;white-space:nowrap;overflow:hidden;animation:sub-content 4s ease 0s 1;-webkit-animation:sub-content 4s ease 0s 1;}@keyframes sub-content{0%, 40%{width:0;}60%, 100%{width:100%;}}@-webkit-keyframes sub-content{0%, 40%{width:0;}60%, 100%{width:100%;}}#chat-content > .message.gift > .gift-image{display:block;height:100px;width:100px;}#chat-content > .message.sub-pro > .gift-image,
  43. #chat-content > .message.sub-extreme > .gift-image,
  44. #chat-content > .message.sub-gold > .gift-image{display:none;}#chat-content > .message.gift > .gift-image > img{height:100%;width:100%;}#input{position:relative;display:block;padding-top:10px;}#input:before{content:'';position:absolute;display:block;height:10px;left:0;right:15px;top:-10px;background:-moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);background:-webkit-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);background:linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffffff', endColorstr='#ffffff', GradientType=0);}#input:after{content:"";position:absolute;display:block;top:10px;left:0;right:0;bottom:0;border:2px solid #cbcfcf;border-radius:12px;box-sizing:border-box;pointer-events:none;}[data-mode="dark"] #input:before{background:-moz-linear-gradient(top, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);background:-webkit-linear-gradient(top, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);background:linear-gradient(to bottom, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00202628', endColorstr='#202628', GradientType=0);}[data-mode="dark"] #input:after{border-color:#5a6366;}#input-unread{position:absolute;display:inline-block;height:24px;top:-30px;right:-200px;padding:0 15px;border-radius:12px;background-color:#41b7ef;font-size:12px;color:#fff;line-height:24px;white-space:nowrap;opacity:.8;cursor:pointer;transition:.2s;}#input-unread:before{content:attr(data-messages);display:inline-block;}#input-unread:after{content:"";position:absolute;display:inline-block;height:0;width:0;left:19px;bottom:-5px;border-width:5px 5px 0 5px;border-style:solid;border-color:#41b7ef transparent transparent;}#input #input-unread.show{right:0;opacity:1;}#input > textarea{position:relative;display:block;min-height:50px;height:50px;max-height:140px;width:100%;padding:12px 20px;border:none;border-radius:12px;box-sizing:border-box;font-family:"Open Sans", sans-serif;font-size:16px;line-height:22px;vertical-align:top;white-space:pre-line;outline:none;resize:none;}[data-mode="dark"] #input > textarea{background-color:#202628;color:#fff;}[data-mode="dark"] #input > textarea::-webkit-scrollbar-track{background-color:#202628;}[data-mode="dark"] #input > textarea::-webkit-scrollbar-thumb{border-color:#202628;background-color:#5a6366;}#input > .waiting{position:absolute;width:auto;top:10px;bottom:0;left:0;right:0;border-radius:12px;background-color:#e9eaea;z-index:1;opacity:0;visibility:hidden;transition:.2s;}#input.wait > .waiting{opacity:1;visibility:visible;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #cacece;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite paused;-webkit-animation:waiting 1s ease-in-out 0s infinite paused;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}#input.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@media screen and (max-width: 1200px){#chat-wider{opacity:0;visibility:hidden;}:host,
  45. #chat-wrapper{position:relative;height:auto;}#chat-wrapper{min-height:270px;max-height:350px;border-top:1px solid rgba(0, 0, 0, .1);}#chat-position{top:20px;left:30px;right:30px;}#input > textarea{max-height:50px;}}@media screen and (max-width: 600px){:host,
  46. #chat-wrapper,
  47. #chat-wider + #chat-wrapper,
  48. #chat-wider.active + #chat-wrapper{position:relative;min-width:320px;}#chat-wrapper{border-top:1px solid #e6e6e6;}#chat-wrapper{border-top-color:rgba(0, 0, 0, .1);}#chat-position{left:15px;right:15px;bottom:15px;}#chat-content > .message{margin-bottom:10px;}#chat-content > .message.common{min-height:30px;padding:0 10px 0 32px;}#chat-content > .message.system{padding:5px 10px;}#chat-content > .message.gift{min-height:50px;padding:0 10px 0 32px;}#chat-content > .message > .avatar{height:24px;width:24px;top:0;}#chat-content > .message > .avatar > .status-icon{top:14px;left:-4px;}#chat-content > .message > .avatar > div > img{left:-4px;}#chat-content > .message > .nickname,
  49. #chat-content > .message > .content{font-size:12px;}}#chat-wrapper.full-screen{background-color:#202628;border-color:#202628;color:#fff;}#chat-wrapper.full-screen #chat-instant,
  50. #chat-wrapper.full-screen #chat-instant > a > .status-icon,
  51. #chat-wrapper.full-screen #chat-content > .message > .avatar > .status-icon{background-color:#202628;}#chat-wrapper.full-screen #input:before{background:-moz-linear-gradient(top, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);background:-webkit-linear-gradient(top, rgba(32,38,40,0) 0%,rgba(32,38,40,1) 100%);background:linear-gradient(to bottom, rgba(32,38,40,0) 0%,rgba(32,38,40,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00202628', endColorstr='#202628',GradientType=0 );}#chat-wrapper.full-screen .on-white-scroll::-webkit-scrollbar-track{background-color:#202628;}#chat-wrapper.full-screen .on-white-scroll::-webkit-scrollbar-thumb{border-color:#202628;background-color:#5a6366;}#chat-wrapper.full-screen .on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:#70797c;}#chat-wrapper.full-screen #chat-content > .message > .nickname{color:#7b868a;}#chat-wrapper.full-screen #chat-content > .message > .content{color:#fff;}#chat-wrapper.full-screen #input > textarea{background-color:#202628;color:#fff;}#chat-wrapper.full-screen #input > .waiting{top:12px;bottom:2px;left:2px;right:2px;background-color:#202628;}#chat-wrapper.full-screen .waiting > .waiting-content > span,
  52. #chat-wrapper.full-screen #input:after{border-color:#5a6366;}#chat-wrapper.full-screen #chat-content > .message.system{background-color:#5a6366;}#chat-wrapper.full-screen #chatlog-button{position:absolute;display:block;height:54px;width:54px;top:8px;right:10px;border-radius:100%;background-color:#101314;line-height:54px;text-align:center;z-index:1;cursor:pointer;}#chat-wrapper.full-screen #chat-instant.show + #chatlog-button{top:58px;}#chat-wrapper.full-screen #chatlog-button > svg{vertical-align:middle;}#chat-wrapper.full-screen #chatlog-button > svg + svg{display:none;}#chat-wrapper.full-screen.show,
  53. #chat-wider.active + #chat-wrapper.full-screen.show{height:100%;width:0;min-width:0;}#chat-wrapper.full-screen.show #chatlog-button{height:54px;width:64px;right:auto;left:-65px;border-radius:27px 0 0 27px;background-color:#202628;}#chat-wrapper.full-screen.show #chatlog-button > svg{display:none;}#chat-wrapper.full-screen.show #chatlog-button > svg + svg{display:inline-block;}#chat-wrapper.full-screen.show #chat-instant{padding:0;}#chat-wrapper.full-screen.show > #chat-position{left:0;}#chat-wrapper.full-screen #chat-instant > .nickname{color:#fff;}#chat-wrapper.full-screen.show #chat-instant,
  54. #chat-wrapper.full-screen.show #chat,
  55. #chat-wrapper.full-screen.show #input{display:none;}@media screen and (max-width: 1200px){#chat-wrapper.full-screen.show{height:0;min-height:0;width:100%;}#input-switch-chatlog:checked + #chat-wrapper.full-screen > #chat-position{top:0;}#input-switch-chatlog:checked + #chat-wrapper.full-screen #chatlog-button{height:54px;width:54px;top:-54px;left:-1px;border-radius:100% 100% 0 0;}}@media screen and (max-width: 600px){#chat-wrapper.full-screen{display:none;}}</style></template></dom-module><dom-module id="tc-chatlog" assetpath="../ui/tc-chatlog/"><template strip-whitespace=""><style include="tc-chatlog-style"></style><div id="chat-wider" on-click="onWider" data-mode$="[[modeStyle]]"></div><div id="chat-wrapper" data-mode$="[[modeStyle]]"><div id="chat-position"><div id="chat-instant" class$="[[_getClass(_selected)]]"><span id="chat-instant-button" on-click="back2Public"></span> <a href="#"><div class="avatar"><dom-if if="[[showAvatarImg(_selected)]]"><template strip-whitespace=""><div><img src="[[_selected.avatarUrl]]"></div></template></dom-if></div><dom-if if="[[showAchiveImg(_selected)]]"><template strip-whitespace=""><img class="status-icon" src="[[_selected.achivementUrl]]"></template></dom-if></a><div class="nickname" data-status$="[[convertSubType(_selected)]]" title="[[_selected.nickname]]">[[_selected.nickname]]<dom-if if="[[_selected.isOffline]]"><template strip-whitespace=""><span style="font-weight:bold;">(offline)</span></template></dom-if></div></div><div id="chatlog-button" on-click="onChatlogShow"><svg width="18" height="18" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><path d="M9 7.464L1.85.314A1.09 1.09 0 0 0 .322.322a1.08 1.08 0 0 0-.006 1.53L7.466 9l-7.15 7.15a1.09 1.09 0 0 0 .005 1.53 1.08 1.08 0 0 0 1.53.005L9 10.535l7.15 7.15a1.09 1.09 0 0 0 1.53-.006 1.08 1.08 0 0 0 .005-1.53L10.535 9l7.15-7.15A1.09 1.09 0 0 0 17.68.322a1.08 1.08 0 0 0-1.53-.006L9 7.466z" fill="#53b6ef" fill-rule="evenodd"></path></svg> <svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2.767 0C1.92 0 1.1.4.58 1.07a2.71 2.71 0 0 0-.496 2.343l1.678 7.49c.086.403.264.772.51 1.086a2.74 2.74 0 0 0-.514 1.103L.075 20.62a2.713 2.713 0 0 0 .505 2.31A2.795 2.795 0 0 0 2.767 24c.427 0 .855-.102 1.24-.294l18.47-9.204a2.78 2.78 0 0 0 .03-4.943L4.007.294A2.787 2.787 0 0 0 2.768 0m0 2c.114 0 .23.026.345.083l18.472 9.25a.78.78 0 0 1 0 1.38L3.112 21.916a.767.767 0 0 1-.345.083c-.464 0-.87-.428-.744-.928l1.69-7.56a.782.782 0 0 1 .666-.6l9.446-.734c.13-.01.197-.113.2-.22a.238.238 0 0 0-.2-.247l-9.447-.666a.732.732 0 0 1-.667-.578l-1.69-7.538c-.125-.5.28-.928.744-.928" fill="#53b6ef" fill-rule="evenodd"></path></svg></div><div id="chat" class="on-white-scroll" on-scroll="onScroll"><div id="chat-content"><dom-repeat items="[[_items]]"><template strip-whitespace=""><div class$="[[_getClassType(item.type)]]"><dom-if if="[[showNick(item)]]"><template strip-whitespace=""><a href="#" class="avatar"><div><img src="[[item.user.avatarUrl]]"></div><dom-if if="[[showAchiveImg(item.user)]]"><template strip-whitespace=""><img class="status-icon" src="[[item.user.achivementUrl]]"></template></dom-if></a><a href="#" class="nickname" data-status$="[[convertSubType(item.user)]]">[[item.user.nickname]]</a></template></dom-if><div class="content"><tc-message-html class-type="[[_getClassType(item.type, isFullScreen)]]" html="[[item.message_text]]" nickname="[[item.user.nickname]]" modestyle="[[modeStyle]]"></tc-message-html></div><dom-if if="[[showGift(item.type)]]"><template strip-whitespace=""><a class="gift-image" href="#"><img src="[[item.giftUrl]]"></a></template></dom-if></div></template></dom-repeat></div></div><form id="input" on-submit="onOK" class$="[[sendProgressClass]]"><span id="input-unread" class$="[[_getClassUnreaded(_unreaded,_selected)]]" data-messages$="[[_getCountUnreaded(_unreaded,_selected)]]" on-click="unreadedClick">Unread messages</span> <textarea id="textarea" class="on-white-scroll" form="input" wrap="off" placeholder="Type a message" maxlength$="[[textareaMaxLen]]" on-click="onInput" on-keyup="onInputKeyup" on-keydown="onInputKeydown"></textarea><div class="waiting"><div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div></div></form></div></div></template><script>class ChatroomChatlog extends Polymer.Element{static get is(){return"tc-chatlog"}static get WORD_LENGTH_LIMIT(){return 32}static get FLAG_NO_MULTIPLE_ROWS(){return 1}static get FLAG_NO_LONG_WORDS(){return 2}static get properties(){return{chatlog:{type:Object,observer:"chatlogAssigned"},_items:Array,_selected:{type:Object,notify:!0},textareaHeight:Number,textareaMaxLen:Number,scrolled:Boolean,_unreaded:{type:Object,value:{}},_scrollPos:{type:Object,value:{}},sendProgress:{type:Boolean,value:!1},sendProgressClass:{type:String,computed:"convertSendClass(sendProgress)"},onFullscreenHandler:Object,isFullScreen:Boolean,modeStyle:String}}constructor(){super()}connectedCallback(){super.connectedCallback(),this.onFullscreenHandler=this.onFullscreen.bind(this),window.fullscreenManager.addEventListener(this.onFullscreenHandler,!1)}disconnectedCallback(){super.disconnectedCallback(),window.fullscreenManager.removeEventListener(this.onFullscreenHandler,!1)}get app(){return this.chatlog.chatroom.app}get chatroom(){return this.chatlog.chatroom}get userlist(){return this.chatlog.chatroom.userlist}chatlogAssigned(a){this.modeStyle=this.app.setDarkModeCSSclass(this.app.settings.isDarkMode());let b=this,c=this.chatlog.chatroom.app.EventBus,d=TinychatApp.DAL.UserEntity,f=TinychatApp.DAL.ChatLogItemEntity,e=TinychatApp.BLL.Chatlog;b.textareaHeight=this.$.textarea.clientHeight,b.setProperties({_selected:e.PUBLIC,_items:Array.from(this.chatlog.getitems(e.PUBLIC)),textareaMaxLen:e.MAX_INPUT_LEN}),c.subscribe(TinychatApp.BLL.SettingsChangedEvent.ID,a=>{b.modeStyle=b.app.setDarkModeCSSclass(a.settingsEntity.darkMode)}),c.subscribe(TinychatApp.BLL.RoomConnected.ID,()=>{b.sendProgress=!1}),c.subscribe(TinychatApp.BLL.RoomReconnected.ID,()=>{let a=TinychatApp.BLL.Chatlog.PUBLIC;b.chatlog.system_add(a,"You were reconnected the room"),b.sendProgress=!1}),c.subscribe(TinychatApp.BLL.ChatlogItemAddedEvent.ID,c=>{a.isequal(b._selected,c.chatentity.chatname)&&(b.scrollChatCheck(b.$.chat,b.$["chat-content"]),setTimeout(()=>{b.splice("_items",c.index,0,Object.assign(new f,c.chatentity)),setTimeout(()=>{b.scrollChatToBottom(b.$.chat,b.$["chat-content"])},1)},1))}),c.subscribe(TinychatApp.BLL.ChatlogItemRemovedEvent.ID,c=>{a.isequal(b._selected,c.chatentity.chatname)&&b.splice("_items",c.index,1)}),c.subscribe(TinychatApp.BLL.ChatlogItemSentEvent.ID,()=>{b.sendProgress=!1}),c.subscribe(TinychatApp.BLL.ChatlistSelectedEvent.ID,function(a){b.setProperties({_selected:a.userentity,_items:Array.from(a.chatitems)}),setTimeout(()=>{b.scrollChatToBottom(b.$.chat,b.$["chat-content"],!0)},1),b.cleanTextarea(b.$.textarea),a.userentity instanceof d&&setTimeout(()=>{b.$.textarea.focus()},1)}),c.subscribe(TinychatApp.BLL.ChatlistUpdateEvent.ID,function(a){if(b._selected instanceof d&&a.toUserEntity.handle===b._selected.handle){let c=Object.assign(new d,a.toUserEntity);b.set("_selected",c),b.notifyPath("_items")}}),c.subscribe(TinychatApp.BLL.ChatlistRemoveEvent.ID,function(){}),c.subscribe(TinychatApp.BLL.UserlistAddUserEvent.ID,function(a){a.userentity.subscriptionType>TinychatApp.BLL.User.STYPE_PRO&&b.chatlog.subscribed_add(a.userentity)})}onFullscreen(){if(this.isFullScreen=window.fullscreenManager.status(),this.isFullScreen)this.$["chat-wrapper"].classList.add("full-screen");else{this.$["chat-wrapper"].classList.remove("full-screen");let a=this._selected instanceof TinychatApp.DAL.UserEntity?this._selected.handle:this._selected,b=this._unreaded[a];b=void 0==b?0:b,b||this.scrollChatToBottom(this.$.chat,this.$["chat-content"],!0)}}onWider(a){a.target.classList.toggle("active");let b=new UI.UIChatlogWiderToggle;this.chatroom.app.EventBus.broadcast(UI.UIChatlogWiderToggle.ID,b)}onChatlogShow(){this.$["chat-wrapper"].classList.toggle("show");let a=new TinychatApp.BLL.ChatlistUIUpdateEvent;this.chatlog.chatroom.app.EventBus.broadcast(TinychatApp.BLL.ChatlistUIUpdateEvent.ID,a)}onInput(){}onInputKeyup(a){let b=a.path?a.path[0]:(a.composedPath&&a.composedPath())[0],c=b.form;setTimeout(()=>{b.scrollHeight>b.clientHeight&&(b.style.height=b.scrollHeight+"px")},0);let d=13==a.which||13==a.keyCode;return d&&(a.shiftKey||a.altKey||a.ctrlKey)?void(a.altKey&&(b.value+="\n",a.preventDefault())):void(!d||this.sendProgress||c.dispatchEvent(new Event("submit",{view:c,bubbles:!1,cancelable:!0})))}onInputKeydown(a){let b=13==a.which||13==a.keyCode;b&&!(a.shiftKey||a.altKey||a.ctrlKey)&&a.preventDefault()}onOK(a){a.preventDefault();let b=a.target,c=b.textarea,d=c.value.trim();if(this.cleanTextarea(c),""===d)return!1;let e=this.chatroom.roomSettings.msgConstraints;return e&ChatroomChatlog.FLAG_NO_MULTIPLE_ROWS&&this.hasMultipleRows(d)?(this.app.showToastWarn("Multiple rows are not available in this chat"),!1):e&ChatroomChatlog.FLAG_NO_LONG_WORDS&&this.hasLongWords(d)?(this.app.showToastWarn("Long words are not available in this chat"),!1):(this.sendmessage(d),!1)}hasLongWords(a){let b=a.split(" "),c=0;for(let d=0;d<b.length;d++)b[d].length>c&&(c=b[d].length);return c>ChatroomChatlog.WORD_LENGTH_LIMIT}hasMultipleRows(a){return(a.match(/\n/g)||[]).length}cleanTextarea(a){a.value="",a.style.height=""}sendmessage(a){return this.chatroom.isLurker()?(this.chatlog.system_add(this._selected,"You're in view-only mode, please reconnect and solve captcha."),void this.app.showToastLurker()):void(!this.sendProgress&&(this.sendProgress=this.chatlog.SendMessage(this._selected,a)))}back2Public(){this.chatlog.selectPublic(),this.sendProgress=!1}_getClass(a){var b="";return a instanceof TinychatApp.DAL.UserEntity&&(b="show"),b}_getClassUnreaded(a,b){let c=b instanceof TinychatApp.DAL.UserEntity?b.handle:b;var d=a[c];return d=void 0==d?0:d,0<d?"show":""}_getCountUnreaded(a,b){let c=this._selected instanceof TinychatApp.DAL.UserEntity?b.handle:b;var d=a[c];return void 0==d?0:(setTimeout(()=>{a[c]&&this.chatlog.chatroom.sendPushForUnreadPrivateMessage()},3e4),d)}_clearUnreadCurrent(){let a=this._selected instanceof TinychatApp.DAL.UserEntity?this._selected.handle:this._selected;var b=this._unreaded[a];void 0==b||(delete this._unreaded[a],this.set("_unreaded",Object.assign({},this._unreaded)))}_incUnreadCurrent(){let a=this._selected instanceof TinychatApp.DAL.UserEntity?this._selected.handle:this._selected;var b=this._unreaded[a];b==void 0&&(b=0),++b,this._unreaded[a]=b,this.set("_unreaded",Object.assign({},this._unreaded))}_getClassType(a,b){let c=TinychatApp.DAL.ChatLogItemEntity;var d="message";return a===c.PUBLIC?d+=" common":a===c.PRIVATE?d+=" common":a===c.SYSTEM?d+=" system":a===c.GIFT?d+=" gift":a===c.SUB_EXTREME?d+=" sub-extreme":a===c.SUB_GOLD?d+=" sub-gold":void 0,b&&(d+=" full-screen"),d}showNick(a){let b=a.type,c=TinychatApp.DAL.ChatLogItemEntity;var d=!1;return b===c.PUBLIC?d=!0:b===c.PRIVATE?d=!0:b===c.GIFT?d=null!=a.user:b===c.SUB_EXTREME?d=!0:b===c.SUB_GOLD?d=!0:void 0,d}showAvatarImg(a){return!!(a instanceof TinychatApp.DAL.UserEntity)&&""!==a.avatarUrl}showAchiveImg(a){return!!(a instanceof TinychatApp.DAL.UserEntity)&&0<a.giftpoints&&""!==a.achivementUrl}showGift(a){let b=TinychatApp.DAL.ChatLogItemEntity;var c=!1;return a===b.GIFT?c=!0:void 0,c}convertSendClass(a){return a?"wait":""}convertSubType(a){let b=TinychatApp.BLL.User;return a instanceof TinychatApp.DAL.UserEntity?b.getCssClass(a):""}unreadedClick(a){a.stopPropagation();let b=this;this._clearUnreadCurrent(),b.scrollChatToBottom(b.$.chat,b.$["chat-content"],!0)}onScroll(a){let b=a.path?a.path[0]:(a.composedPath&&a.composedPath())[0],c=b.childNodes[0],d=b.scrollTop+b.clientHeight+1>c.clientHeight;d&&this._clearUnreadCurrent()}scrollChatCheck(a,b){let c=a.scrollTop+a.clientHeight+1>b.clientHeight;this.scrolled=!c}scrollChatToBottom(a,b,c){let d=this,e=b.clientHeight-a.clientHeight,f=0<e&&(!0===c||!d.scrolled);f?this.smoothScrollTo(a,e,void 0,()=>{d._clearUnreadCurrent()}):0!=e&&d._incUnreadCurrent()}smoothScrollTo(a,b,c){if(("string"==typeof b||"number"==typeof b)&&(b*=1,b===+b&&0===b%1)){var d=a.scrollTop,e=b-d,f=0,g=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),h=function(){e!=b-d&&(d=a.scrollTop,e=b-d,f=0),f+=20,a.scrollTop=Math.inOutQuintic(f,d,e,200),200>f?g(h):c&&Object.isFunc(c)&&c()};h()}}}customElements.define(ChatroomChatlog.is,ChatroomChatlog);</script></dom-module><dom-module id="tc-modal-style" assetpath="../ui/tc-modal/"><template><style>#modal-window{position:fixed;height:100%;min-height:100%;width:100%;top:0;left:-100%;font-size:0;text-align:center;background-color:rgba(0, 0, 0, .8);overflow-y:scroll;white-space:nowrap;opacity:0;z-index:10;transition:opacity .2s;}#modal-window.modal-show{left:0;opacity:1;}#modal-window:before{content:"";display:inline-block;height:100%;width:0;vertical-align:middle;}#modal-content{position:relative;display:inline-block;width:100%;margin:50px auto;font-size:0;white-space:normal;vertical-align:middle;}#modal-content > *{display:none;}#modal-content > *:last-child{display:block;}</style></template></dom-module><dom-module id="tc-modal" assetpath="../ui/tc-modal/"><template strip-whitespace=""><style include="tc-modal-style"></style><div id="modal-window"><div id="modal-content"><slot></slot></div></div></template><script>class Modal extends Polymer.Element{static get is(){return"tc-modal"}static get properties(){return{dialogs:{type:Object,value:{}},onkeydownHandler:Object,onclickHandler:Object}}constructor(){super()}connectedCallback(){super.connectedCallback(),this.onkeydownHandler=this.onkeydown.bind(this),this.onclickHandler=this.onclick.bind(this),document.addEventListener("keydown",this.onkeydownHandler),document.addEventListener("click",this.onclickHandler)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.onkeydownHandler),document.removeEventListener("click",this.onclickHandler)}onkeydown(a){a=a||window.event,27!=a.keyCode&&"Escape"!=a.key&&"Esc"!=a.key}onclick(){}isopen(a){let b=this.dialogs[a];return!0===b}open(a){let b=0>=Object.keys(this.dialogs).length;this.dialogs[a]=!0,b&&(document.body.classList.add("modal-show"),this.$["modal-window"].classList.add("modal-show"))}close(a,b){delete this.dialogs[a];let c=0>=Object.keys(this.dialogs).length;c&&(document.body.classList.remove("modal-show"),this.$["modal-window"].classList.remove("modal-show")),this.removeChild(b)}}customElements.define(Modal.is,Modal);</script></dom-module><dom-module id="tc-modal-banlist-style" assetpath="../ui/tc-modal-banlist/"><template><style>*{user-select:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;}.on-white-scroll{padding-left:16px;box-sizing:border-box;overflow-x:hidden;overflow-y:scroll;}.on-white-scroll::-webkit-scrollbar{position:absolute;width:15px;cursor:pointer;}.on-white-scroll::-webkit-scrollbar-track{background-color:#fff;}.on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #fff;border-radius:6px/8px;background-color:rgba(0, 0, 0, .2);}.on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}[data-mode="dark"] .on-white-scroll::-webkit-scrollbar-track{background-color:#202628;}[data-mode="dark"] .on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #202628;background-color:rgba(0, 0, 0, .2);}[data-mode="dark"] .on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}#modal-content-banlist{position:relative;width:100%;max-width:400px;margin:0 auto;padding:50px 70px 60px;box-sizing:border-box;border-radius:4px;background-color:#fff;}#modal-content-banlist[data-mode="dark"]{background-color:#202628;}#modal-content-banlist *:focus{outline:none;}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;}#close-button > path{transition:.2s;}#close-button:hover > path{fill:#41b7ef;}#close-button:active > path{fill:#38a8dd;}#modal-content-banlist > h1{margin:0;padding-bottom:40px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;cursor:default;}#modal-content-banlist[data-mode="dark"] > h1{color:#fff;}#banlist-wrapper{position:relative;min-height:40px;max-height:360px;transition:.2s;}#banlist-wrapper:after{content:'';position:absolute;display:block;height:40px;bottom:0;left:0;right:15px;background:-moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);background:-webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);background:linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=0 );pointer-events:none;}[data-mode="dark"] #banlist-wrapper:after{background:-moz-linear-gradient(top, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);background:-webkit-linear-gradient(top, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);background:linear-gradient(to bottom, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00202628', endColorstr='#202628', GradientType=0);}#banlist-wrapper.wait{max-height:40px;}#banlist-wrapper > .waiting{position:absolute;width:auto;top:0;bottom:0;left:0;right:0;background-color:#fff;z-index:1;opacity:0;visibility:hidden;transition:.2s;}[data-mode="dark"] #banlist-wrapper > .waiting{background-color:#202628;}#banlist-wrapper.wait > .waiting{opacity:1;visibility:visible;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #cacece;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite paused;-webkit-animation:waiting 1s ease-in-out 0s infinite paused;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}#banlist-wrapper.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}#banlist-wrapper > ul > li:first-child{height:0;overflow:hidden;transition:.2s;}#banlist-wrapper > ul > li:only-of-type{height:40px;padding:0 0 0 15px;text-align:center;}#banlist-wrapper > ul{position:relative;max-height:inherit;width:100%;margin:0;padding:0 0 40px 0;box-sizing:border-box;text-align:left;}#banlist-wrapper > ul > li{position:relative;display:inline-block;height:40px;width:100%;padding:0 40px 0 20px;box-sizing:border-box;overflow:hidden;transition:background-color .2s,
  56. height .5s;}#banlist-wrapper > ul > li.hidden{height:0;}#banlist-wrapper > ul > li + li:hover{background-color:#fde3e7;}#banlist-wrapper > ul > li > span{display:inline-block;height:40px;width:100%;font-size:14px;color:#414141;line-height:40px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:default;}[data-mode="dark"] #banlist-wrapper > ul > li > span{color:#fff;transition:.2s;}[data-mode="dark"] #banlist-wrapper > ul > li:hover > span{color:#414141;}#banlist-wrapper > ul > li > button{position:absolute;display:block;height:40px;width:40px;margin:0;padding:0;border:0;top:0;right:0;background-color:transparent;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCgk8cGF0aCBkPSJNNiA0LjVMMS41IDAgMCAxLjUgNC41IDYgMCAxMC41IDEuNSAxMiA2IDcuNWw0LjUgNC41IDEuNS0xLjVMNy41IDYgMTIgMS41IDEwLjUgMCIgZmlsbD0iI2U1Mzk1MSIgZmlsbC1ydWxlPSJldmVub2RkIi8+DQo8L3N2Zz4=);background-repeat:no-repeat;background-position:center center;cursor:pointer;opacity:0;visibility:hidden;transition:.2s;-webkit-appearance:none;-moz-appearance:none;appearance:none;}#banlist-wrapper > ul > li:hover > button{opacity:1;visibility:visible;}</style></template></dom-module><dom-module id="tc-modal-banlist" assetpath="../ui/tc-modal-banlist/"><template strip-whitespace=""><style include="tc-modal-banlist-style"></style><div id="modal-content-banlist" data-mode$="[[modeStyle]]"><svg id="close-button" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" on-click="close"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><h1>Banlist</h1><div id="banlist-wrapper"><ul class="on-white-scroll"><li><span>Ban List is empty</span></li><dom-repeat items="{{_items}}"><template strip-whitespace=""><li class$="[[convertLiClass(item)]]"><span>[[item.nickname]]</span> <button on-click="onDelete"></button></li></template></dom-repeat></ul><div class="waiting"><div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div></div></div></div></template><script>class ModalDialogBanlist extends Polymer.Element{static get is(){return"tc-modal-banlist"}static get properties(){return{chatroom:{type:Object,observer:"chatroomAssigned"},_items:{type:Array,value:[]},onkeydownHandler:Object}}constructor(){super()}get app(){return this.chatroom.app}get settings(){return this.app.settings}connectedCallback(){super.connectedCallback(),this.onkeydownHandler=this.onkeydown.bind(this),document.addEventListener("keydown",this.onkeydownHandler)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.onkeydownHandler)}chatroomAssigned(){let a=this,b=this.chatroom.app.EventBus;a.$["banlist-wrapper"].classList.add("wait"),this.chatroom.Banlist(b=>{a.$["banlist-wrapper"].classList.remove("wait"),a.set("_items",Array.from(b))})}open(){this.modeStyle=this.app.setDarkModeCSSclass(this.app.settings.isDarkMode()),this.parentNode instanceof Modal&&this.parentNode.open(ModalDialogBanlist.is)}close(){this.parentNode instanceof Modal&&this.parentNode.close(ModalDialogBanlist.is,this)}onkeydown(a){a=a||window.event,(27==a.keyCode||"Escape"==a.key||"Esc"==a.key)&&this.parentNode instanceof Modal&&this.parentNode.isopen(ModalDialogBanlist.is)&&this.close(a)}onDelete(a){let b=this,c=this._items.indexOf(a.model.item),d=Object.assign({},a.model.item);d.isDeleting=!0,b._items[c]=d,b.notifyPath("_items."+c),this.chatroom.Unban(a.model.item),setTimeout(()=>{let c=this._items.indexOf(a.model.item);b.splice("_items",c,1)},500)}convertLiClass(a){var b="";return a.isDeleting&&(b+=" hidden"),b}}customElements.define(ModalDialogBanlist.is,ModalDialogBanlist);</script></dom-module><dom-module id="tc-modal-changenickname-style" assetpath="../ui/tc-modal-changenickname/"><template><style>#modal-content-changenickname{position:relative;width:100%;max-width:540px;margin:0 auto;padding:50px 70px 60px;box-sizing:border-box;border-radius:4px;background-color:#fff;}#modal-content-changenickname[data-mode="dark"]{background-color:#202628;}#modal-content-changenickname > *:focus{outline:none;}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;}#close-button > path{transition:.2s;}#close-button:hover > path{fill:#41b7ef;}#close-button:active > path{fill:#38a8dd;}#modal-content-changenickname.error > label{opacity:0;visibility:hidden;}#modal-content-changenickname.error > #error-text{opacity:1;visibility:visible;overflow:visible;}#modal-content-changenickname.error > input[type="text"]{border-color:#e53951;color:#e53951;}#modal-content-changenickname > h1{margin:0;padding-bottom:40px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;}#modal-content-changenickname[data-mode="dark"] > h1{color:#fff;}#modal-content-changenickname > label{display:block;padding-bottom:4px;font-size:12px;font-weight:600;color:#414141;text-transform:uppercase;opacity:1;visibility:visible;transition:.2s;}#modal-content-changenickname[data-mode="dark"] > label{color:#fff;}#modal-content-changenickname > #error-text{position:relative;display:block;height:0;top:-21px;font-size:12px;font-weight:600;color:#e53951;opacity:0;visibility:hidden;overflow:hidden;transition:.2s;}#modal-content-changenickname > input[type="text"]{height:40px;width:100%;border:1px solid #c5d5dc;box-sizing:border-box;background-color:#fff;font-family:inherit;font-size:16px;font-weight:600;color:#414141;text-align:center;line-height:38px;letter-spacing:.5px;transition:.2s;}#modal-content-changenickname > input[type="submit"]{height:40px;width:100%;margin-top:24px;border:none;font-family:inherit;font-size:12px;font-weight:700;color:#fff;letter-spacing:1px;background-color:#41b7ef;text-transform:uppercase;cursor:pointer;transition:.2s;-webkit-appearance:none;-moz-appearance:none;appearance:none;}#modal-content-changenickname > input[type="submit"]:hover{background-color:#54ccf3;}#modal-content-changenickname > input[type="submit"]:active{background-color:#38a8dd;}</style></template></dom-module><dom-module id="tc-modal-changenickname" assetpath="../ui/tc-modal-changenickname/"><template strip-whitespace=""><style include="tc-modal-changenickname-style"></style><form id="modal-content-changenickname" data-mode$="[[modeStyle]]" on-submit="onOK"><svg id="close-button" on-click="close" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><h1>[[title]]</h1><label>YOUR NICKNAME</label> <span id="error-text">[[error]]</span> <input id="nickname" type="text" on-click="onInput" placeholder="nickname" maxlength="32" value="{{nickname}}"> <input type="submit" value="[[positiveBtn]]"></form></template><script>class ModalDialogChangeNickname extends Polymer.Element{static get is(){return"tc-modal-changenickname"}static get MODE_CHANGE(){return 0}static get MODE_INUSE(){return 1}static get MODE_SETTINGS(){return 2}static get MODE_GUEST(){return 3}static get properties(){return{chatroom:{type:Object,observer:"chatroomAssigned"},nickname:String,mode:{type:Number,observer:"modeAssigned"},positiveBtn:{type:String,value:"OK"},title:{type:String,value:"Please enter nickname"},error:{type:String,value:""},ok:Object,notvalid:Object,inuse:Object,onkeydownHandler:Object}}constructor(a){super(),this.mode=a}get app(){return this.chatroom.app}connectedCallback(){super.connectedCallback();this;this.onkeydownHandler=this.onkeydown.bind(this),document.addEventListener("keydown",this.onkeydownHandler),this.$.nickname.focus()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.onkeydownHandler)}open(){this.modeStyle=this.app.setDarkModeCSSclass(this.app.settings.isDarkMode()),this.parentNode instanceof Modal&&this.parentNode.open(ModalDialogChangeNickname.is)}close(){this.parentNode instanceof Modal&&this.parentNode.close(ModalDialogChangeNickname.is,this)}onkeydown(a){a=a||window.event,(27==a.keyCode||"Escape"==a.key||"Esc"==a.key)&&this.parentNode instanceof Modal&&this.parentNode.isopen(ModalDialogChangeNickname.is)&&this.parentNode.close(ModalDialogChangeNickname.is,this)}onInput(){this.$["modal-content-changenickname"].classList.remove("error")}onOK(a){return(a.preventDefault(),Object.isFunc(this.notvalid)&&this.notvalid(this.$.nickname.value))?(this.error="Invalid nickname (use _, A-Z and 0-9)",this.$["modal-content-changenickname"].classList.add("error"),!1):Object.isFunc(this.inuse)&&this.inuse(this.$.nickname.value)?(this.error="Sorry, your nickname is already exist",this.$["modal-content-changenickname"].classList.add("error"),!1):(Object.isFunc(this.ok)&&this.ok(this.$.nickname.value),!1)}modeAssigned(a){let b="Change Nickname",c="Join Room";a===ModalDialogChangeNickname.MODE_CHANGE?(this.title=b,this.positiveBtn="Change"):a===ModalDialogChangeNickname.MODE_INUSE?(this.title="Enter Nickname",this.positiveBtn=c,this.error="Your current nickname in use",this.$["modal-content-changenickname"].classList.add("error")):a===ModalDialogChangeNickname.MODE_GUEST?(this.title="Enter Nickname",this.positiveBtn=c):a===ModalDialogChangeNickname.MODE_SETTINGS?(this.title=this.nickname.isEmpty()?"Enter Nickname":b,this.positiveBtn="Save"):console.error("unknown mode")}}customElements.define(ModalDialogChangeNickname.is,ModalDialogChangeNickname);</script></dom-module><dom-module id="tc-modal-fatalerror-style" assetpath="../ui/tc-modal-fatalerror/"><template><style>#modal-content-fatalerror{width:100%;max-width:540px;margin:0 auto;padding:50px 70px 60px;box-sizing:border-box;border-radius:4px;background-color:#e53951;}#modal-content-fatalerror > *:focus{outline:none;}#modal-content-fatalerror > h1{margin:0;padding-bottom:9px;box-sizing:border-box;font-size:24px;font-weight:300;color:#fff;line-height:33px;text-align:center;}#modal-content-fatalerror > h1:before{content:'';position:relative;display:inline-block;height:24px;width:24px;top:5px;margin-right:10px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxjaXJjbGUgZmlsbD0iI2ZmZiIgY3g9IjEyIiBjeT0iMTIiIHI9IjEyIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KICAgIDxwYXRoIGZpbGw9IiNlNTM5NTEiIGQ9Ik0xMiAxMC41ODZsLTIuODI4LTIuODMtMS40MTUgMS40MTZMMTAuNTg3IDEybC0yLjgzIDIuODI4IDEuNDE1IDEuNDE1TDEyIDEzLjQxM2wyLjgyOCAyLjgzIDEuNDE1LTEuNDE1TDEzLjQxMyAxMmwyLjgzLTIuODI4LTEuNDE1LTEuNDE1IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KPC9zdmc+);background-repeat:no-repeat;vertical-align:top;}#modal-content-fatalerror > span{display:block;padding-bottom:8px;font-size:12px;font-weight:400;color:#fff;line-height:16px;}#modal-content-fatalerror > input[type="submit"]{height:40px;width:100%;margin-top:24px;border:1px solid #fff;box-sizing:border-box;font-family:inherit;font-size:12px;font-weight:700;color:#fff;letter-spacing:1px;background-color:#e53951;cursor:pointer;transition:.2s;-webkit-appearance:none;-moz-appearance:none;appearance:none;}#modal-content-fatalerror > input[type="submit"]:hover,
  57. #modal-content-fatalerror > input[type="submit"]:active{color:#e53951;background-color:#fff;}</style></template></dom-module><dom-module id="tc-modal-fatalerror" assetpath="../ui/tc-modal-fatalerror/"><template strip-whitespace=""><style include="tc-modal-fatalerror-style"></style><form id="modal-content-fatalerror" on-submit="onOK"><h1>Fatal error</h1><span>[[textError()]]</span> <input type="submit" value="RELOAD"></form></template><script>class ModalFatalError extends Polymer.Element{static get is(){return"tc-modal-fatalerror"}static get properties(){return{error:Object}}constructor(){super()}connectedCallback(){super.connectedCallback()}open(){this.parentNode instanceof Modal&&this.parentNode.open(ModalFatalError.is)}close(){this.parentNode instanceof Modal&&this.parentNode.close(ModalFatalError.is,this)}textError(){return this.error instanceof Error,"Something went wrong, please reload the page."}onOK(a){return a.preventDefault(),location.reload(!0),!1}}customElements.define(ModalFatalError.is,ModalFatalError);</script></dom-module><dom-module id="tc-modal-loader-style" assetpath="../ui/tc-modal-loader/"><template><style>#modal-content-loading-eye{position:relative;height:160px;width:160px;margin:30px auto 0;font-size:0;white-space:nowrap;}#modal-content-loading-eye > svg{position:absolute;top:0;left:0;}#modal-content-loading-eye:before{content:"";display:inline-block;height:100%;width:0;vertical-align:middle;}#modal-content-loading-eyeball{position:relative;display:inline-block;height:114px;width:114px;margin-left:-10px;border-radius:100%;background-color:#fff;vertical-align:middle;transform-origin:67px 57px;animation:eye-rotation 1.2s linear 0s infinite;}@keyframes eye-rotation{0%{transform:rotate(0deg);}50%{transform:rotate(180deg);}100%{transform:rotate(360deg);}}#modal-content-loading-eyeball-pupil{position:absolute;height:58px;width:58px;top:27px;left:27px;margin-left:-14px;border-radius:100%;background-color:#000;animation:pupil-rotation 1.2s linear 0s infinite;}#modal-content-loading-eyeball-pupil:before{content:"";position:absolute;display:block;height:16px;width:16px;top:3px;left:3px;border-radius:100%;background-color:#fff;}@keyframes pupil-rotation{0%{transform:rotate(0deg);}50%{transform:rotate(-180deg);}100%{transform:rotate(-360deg);}}#modal-content-loading > span{display:block;padding-top:15px;font-size:20px;color:#fff;line-height:24px;text-align:center;}</style></template></dom-module><dom-module id="tc-modal-loader" assetpath="../ui/tc-modal-loader/"><template strip-whitespace=""><style include="tc-modal-loader-style"></style><div id="modal-content-loading"><div id="modal-content-loading-eye"><svg width="162" height="162" viewBox="0 0 160 160" xmlns="http://www.w3.org/2000/svg"><path d="M157.975 152.5c-3.58-1.548-7.125-3.724-10.262-7.042-3.436-3.633-5.717-8.774-7.172-13.197C152.656 118.243 160 99.985 160 80c0-44.183-35.818-80-80-80C35.816 0 0 35.817 0 80s35.817 80 80 80c13.394 0 26.007-3.308 37.1-9.127 10.444 8.146 29.617 9.903 40.28 7.795 3.184-.63 3.566-4.882.595-6.167" fill="#04caff" fill-rule="evenodd"></path></svg><div id="modal-content-loading-eyeball"><div id="modal-content-loading-eyeball-pupil"></div></div></div><span>Connecting...</span></div></template><script>class ModalLoader extends Polymer.Element{static get is(){return"tc-modal-loader"}static get properties(){return{}}constructor(){super()}connectedCallback(){super.connectedCallback()}open(){this.parentNode instanceof Modal&&this.parentNode.open(ModalLoader.is)}close(){this.parentNode instanceof Modal&&this.parentNode.close(ModalLoader.is,this)}}customElements.define(ModalLoader.is,ModalLoader);</script></dom-module><dom-module id="tc-modal-mediafilters-style" assetpath="../ui/tc-modal-mediafilters/"><template><style>*{user-select:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;}.on-white-scroll{padding-left:16px;box-sizing:border-box;overflow-x:hidden;overflow-y:scroll;}.on-white-scroll::-webkit-scrollbar{position:absolute;width:15px;cursor:pointer;}.on-white-scroll::-webkit-scrollbar-track{background-color:#fff;}.on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #fff;border-radius:6px/8px;background-color:rgba(0, 0, 0, .2);}.on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}[data-mode="dark"] .on-white-scroll::-webkit-scrollbar-track{background-color:#202628;}[data-mode="dark"] .on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #202628;background-color:rgba(0, 0, 0, .2);}[data-mode="dark"] .on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}#modal-content-filters{position:relative;width:100%;max-width:540px;margin:0 auto;padding:50px 0 60px;box-sizing:border-box;border-radius:4px;background-color:#fff;}#modal-content-filters[data-mode="dark"]{background-color:#202628;}#modal-content-filters *:focus{outline:none;}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;}#close-button > path{transition:.2s;}#close-button:hover > path{fill:#41b7ef;}#close-button:active > path{fill:#38a8dd;}#modal-content-filters > h1{margin:0;padding:0 70px 40px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;cursor:default;}#modal-content-filters[data-mode="dark"] > h1{color:#fff;}#filters-preview{position:relative;padding:0 70px;border-bottom:1px solid rgba(0, 0, 0, .1);transition:.2s;}[data-mode="dark"] #filters-preview{border-bottom-color:#2d373a;}#filters-video{position:relative;width:100%;padding-bottom:40px;text-align:left;}#filters-video > div{width:100%;font-size:14px;color:#414141;line-height:40px;text-align:center;cursor:default;overflow:hidden;transition:.2s;}#filters-video > div > .video{position:relative;width:100%;font-size:0;overflow:hidden;}.video > div > video,
  58. .video > div > canvas{position:relative;width:100%;border-radius:4px;}#filters-wrapper{padding-top:30px;border-bottom:1px solid rgba(0, 0, 0, .1);}[data-mode="dark"] #filters-wrapper{border-bottom-color:#2d373a;}#filters-wrapper > div{height:230px;}#filters-content{width:420px;margin:0 auto;font-size:0;text-align:left;}#filters-content > .filter{display:inline-block;width:120px;margin:0 10px 20px;text-align:center;vertical-align:top;}#filters-content > .filter > span{display:inline-block;padding-top:6px;font-size:12px;color:#333;line-height:16px;cursor:default;}[data-mode="dark"] #filters-content > .filter > span{color:#fff;}#filters-content > .filter > div{position:relative;cursor:pointer;}#filters-content > .filter > div img{border-radius:4px;width:100%;}#filters-content .filter > div > div:before,
  59. #filters-content .filter > div > div:after{border-radius:4px;}.filter > .active:before{content:'';position:absolute;height:100%;width:100%;top:0;left:0;border:4px solid #fff;border-radius:4px;box-sizing:border-box;z-index:2;}[data-mode="dark"] .filter > .active:before{border-color:#202628;}.filter > .active:after{content:'';position:absolute;height:100%;width:100%;top:0;left:0;border:2px solid #41b7ef;border-radius:4px;box-sizing:border-box;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iNTMiIHZpZXdCb3g9IjAgMCA1MyA1MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CgkJPHBhdGggZD0iTTIgNi4wMDJBMy45OTggMy45OTggMCAwIDEgNi4wMDIgMkg1M0wyIDUzVjYuMDAyeiIgZmlsbD0iI2ZmZiIvPgoJCTxwYXRoIGQ9Ik0wIDMuOTk0QTMuOTk1IDMuOTk1IDAgMCAxIDMuOTk0IDBINTJMMCA1MlYzLjk5NHoiIGZpbGw9IiM0MWI3ZWYiLz4KCQk8cGF0aCBzdHJva2U9IiNmZmYiIHN0cm9rZS13aWR0aD0iNCIgZD0iTTkgMTVsNiA1IDctOSIvPgoJPC9nPgo8L3N2Zz4=);background-repeat:no-repeat;background-position:-2px -2px;z-index:3;}#filter-button-wrapper{padding:40px 70px 0;}#filter-button-wrapper > button{display:block;height:40px;width:100%;border:1px solid transparent;box-sizing:border-box;font-family:'Open Sans', sans-serif;font-weight:700;font-size:12px;color:#fff;background-color:#41b7ef;line-height:38px;letter-spacing:1px;text-align:center;text-transform:uppercase;cursor:pointer;transition:.2s;-webkit-appearance:none;-moz-appearance:none;appearance:none;}#filter-button-wrapper > button:hover{background-color:#54ccf3;}#filter-button-wrapper > button:active{background-color:#38a8de;}#modal-content-filters.wait > .waiting{opacity:1;visibility:visible;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #cacece;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite paused;-webkit-animation:waiting 1s ease-in-out 0s infinite paused;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}.waiting > .waiting-content > span:nth-child(5){animation-delay:.6s;-webkit-animation-delay:.6s;}#modal-content-filters.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@media screen and (max-width: 470px){.on-white-scroll::-webkit-scrollbar{position:absolute;height:15px;width:auto;cursor:pointer;}.on-white-scroll::-webkit-scrollbar-thumb{border-radius:8px/6px;}#modal-content-filters{padding-bottom:20px;}#modal-content-filters > h1{padding-bottom:20px;}#filters-preview,
  60. #filter-button-wrapper{padding-left:20px;padding-right:20px;}#filters-video{padding-bottom:0;}#filters-wrapper{padding-top:20px;}#filters-wrapper > div{height:150px;padding-left:10px;overflow-x:scroll;overflow-y:hidden;}#filters-content{white-space:nowrap;}#filters-content:after{content:'';display:inline-block;height:100%;width:10px;}}.aden{position:relative;-webkit-filter:hue-rotate(-20deg) contrast(.9) saturate(.85) brightness(1.2);filter:hue-rotate(-20deg) contrast(.9) saturate(.85) brightness(1.2);}.aden:after,
  61. .aden:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.aden img{width:100%;z-index:1;}.aden:before{z-index:2;}.aden:after{z-index:3;}.aden:after{background:-webkit-linear-gradient(left, rgba(66, 10, 14, .2), transparent);background:linear-gradient(to right, rgba(66, 10, 14, .2), transparent);mix-blend-mode:darken;}.gingham:after,
  62. .perpetua:after,
  63. .reyes:after{mix-blend-mode:soft-light;}.inkwell{position:relative;-webkit-filter:sepia(.3) contrast(1.1) brightness(1.1) grayscale(1);filter:sepia(.3) contrast(1.1) brightness(1.1) grayscale(1);}.inkwell:after,
  64. .inkwell:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.inkwell img{width:100%;z-index:1;}.inkwell:before{z-index:2;}.inkwell:after{z-index:3;}.perpetua{position:relative;}.perpetua:after,
  65. .perpetua:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.perpetua img{width:100%;z-index:1;}.perpetua:before{z-index:2;}.perpetua:after{z-index:3;}.perpetua:after{background:-webkit-linear-gradient(top, #005b9a, #e6c13d);background:linear-gradient(to bottom, #005b9a, #e6c13d);opacity:.5;}.reyes{position:relative;-webkit-filter:sepia(.22) brightness(1.1) contrast(.85) saturate(.75);filter:sepia(.22) brightness(1.1) contrast(.85) saturate(.75);}.reyes:after,
  66. .reyes:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.reyes img{width:100%;z-index:1;}.reyes:before{z-index:2;}.reyes:after{z-index:3;}.reyes:after{background:#efcdad;opacity:.5;}.gingham{position:relative;-webkit-filter:brightness(1.05) hue-rotate(-10deg);filter:brightness(1.05) hue-rotate(-10deg);}.gingham:after,
  67. .gingham:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.gingham img{width:100%;z-index:1;}.gingham:before{z-index:2;}.gingham:after{z-index:3;}.gingham:after{background:rgb(230, 230, 250);}.toaster{position:relative;-webkit-filter:contrast(1.5) brightness(.9);filter:contrast(1.5) brightness(.9);}.toaster:after,
  68. .toaster:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.toaster img{width:100%;z-index:1;}.toaster:before{z-index:2;}.toaster:after{z-index:3;}.toaster:after{background:-webkit-radial-gradient(circle, #804e0f, #3b003b);background:radial-gradient(circle, #804e0f, #3b003b);mix-blend-mode:screen;}.walden{position:relative;-webkit-filter:brightness(1.1) hue-rotate(-10deg) sepia(.3) saturate(1.6);filter:brightness(1.1) hue-rotate(-10deg) sepia(.3) saturate(1.6);}.walden:after,
  69. .walden:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.walden img{width:100%;z-index:1;}.walden:before{z-index:2;}.walden:after{z-index:3;}.walden:after{background:#04c;mix-blend-mode:screen;opacity:.3;}.hudson{position:relative;-webkit-filter:brightness(1.2) contrast(.9) saturate(1.1);filter:brightness(1.2) contrast(.9) saturate(1.1);}.hudson:after,
  70. .hudson:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.hudson img{width:100%;z-index:1;}.hudson:before{z-index:2;}.hudson:after{z-index:3;}.hudson:after{background:-webkit-radial-gradient(circle, #a6b1ff 50%, #342134);background:radial-gradient(circle, rgb(166, 177, 255) 50%, rgb(52, 33, 52));mix-blend-mode:multiply;opacity:.5;}.earlybird{position:relative;-webkit-filter:contrast(.9) sepia(.2);filter:contrast(.9) sepia(.2);}.earlybird:after,
  71. .earlybird:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.earlybird img{width:100%;z-index:1;}.earlybird:before{z-index:2;}.earlybird:after{z-index:3;}.earlybird:after{background:-webkit-radial-gradient(circle, #d0ba8e 20%, #360309 85%, #1d0210 100%);background:radial-gradient(circle, rgb(208, 186, 142) 20%, rgb(54, 3, 9) 85%, #1d0210 100%);mix-blend-mode:overlay;}.mayfair{position:relative;-webkit-filter:contrast(1.1) saturate(1.1);filter:contrast(1.1) saturate(1.1);}.mayfair:after,
  72. .mayfair:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.mayfair img{width:100%;z-index:1;}.mayfair:before{z-index:2;}.mayfair:after{z-index:3;}.mayfair:after{background:-webkit-radial-gradient(40% 40%, circle, rgba(255, 255, 255, .8), rgba(255, 200, 200, .6), #111 60%);background:radial-gradient(circle at 40% 40%, rgba(255, 255, 255, .8), rgba(255, 200, 200, .6), #111 60%);mix-blend-mode:overlay;opacity:.4;}.lofi{position:relative;-webkit-filter:saturate(1.1) contrast(1.5);filter:saturate(1.1) contrast(1.5);}.lofi:after,
  73. .lofi:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.lofi img{width:100%;z-index:1;}.lofi:before{z-index:2;}.lofi:after{z-index:3;}.lofi:after{background:-webkit-radial-gradient(circle, transparent 70%, #222 150%);background:radial-gradient(circle, transparent 70%, #222 150%);mix-blend-mode:multiply;}._1977{position:relative;-webkit-filter:contrast(1.1) brightness(1.1) saturate(1.3);filter:contrast(1.1) brightness(1.1) saturate(1.3);}._1977:after,
  74. ._1977:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}._1977 img{width:100%;z-index:1;}._1977:before{z-index:2;}._1977:after{z-index:3;background:rgba(243, 106, 188, .3);mix-blend-mode:screen;}.brooklyn{position:relative;-webkit-filter:contrast(.9) brightness(1.1);filter:contrast(.9) brightness(1.1);}.brooklyn:after,
  75. .brooklyn:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.brooklyn img{width:100%;z-index:1;}.brooklyn:before{z-index:2;}.brooklyn:after{z-index:3;}.brooklyn:after{background:-webkit-radial-gradient(circle, rgba(168, 223, 193, .4) 70%, #c4b7c8);background:radial-gradient(circle, rgba(168, 223, 193, .4) 70%, #c4b7c8);mix-blend-mode:overlay;}.xpro2{position:relative;-webkit-filter:sepia(.3);filter:sepia(.3);}.xpro2:after,
  76. .xpro2:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.xpro2 img{width:100%;z-index:1;}.xpro2:before{z-index:2;}.xpro2:after{z-index:3;}.xpro2:after{background:-webkit-radial-gradient(circle, #e6e7e0 40%, rgba(43, 42, 161, .6) 110%);background:radial-gradient(circle, #e6e7e0 40%, rgba(43, 42, 161, .6) 110%);mix-blend-mode:color-burn;}.nashville{position:relative;-webkit-filter:sepia(.2) contrast(1.2) brightness(1.05) saturate(1.2);filter:sepia(.2) contrast(1.2) brightness(1.05) saturate(1.2);}.nashville:after,
  77. .nashville:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.nashville img{width:100%;z-index:1;}.nashville:before{z-index:2;}.nashville:after{z-index:3;}.nashville:after{background:rgba(0, 70, 150, .4);mix-blend-mode:lighten;}.nashville:before{background:rgba(247, 176, 153, .56);mix-blend-mode:darken;}.lark{position:relative;-webkit-filter:contrast(.9);filter:contrast(.9);}.lark:after,
  78. .lark:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.lark img{width:100%;z-index:1;}.lark:before{z-index:2;}.lark:after{z-index:3;}.lark:after{background:rgba(242, 242, 242, .8);mix-blend-mode:darken;}.lark:before{background:#22253f;mix-blend-mode:color-dodge;}.moon{position:relative;-webkit-filter:grayscale(1) contrast(1.1) brightness(1.1);filter:grayscale(1) contrast(1.1) brightness(1.1);}.moon:after,
  79. .moon:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.moon img{width:100%;z-index:1;}.moon:before{z-index:2;}.moon:after{z-index:3;}.moon:before{background:#a0a0a0;mix-blend-mode:soft-light;}.moon:after{background:#383838;mix-blend-mode:lighten;}.clarendon{position:relative;-webkit-filter:contrast(1.2) saturate(1.35);filter:contrast(1.2) saturate(1.35);}.clarendon:after,
  80. .clarendon:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.clarendon img{width:100%;z-index:1;}.clarendon:before{z-index:2;background:rgba(127, 187, 227, .2);mix-blend-mode:overlay;}.clarendon:after{z-index:3;}.willow{position:relative;-webkit-filter:grayscale(.5) contrast(.95) brightness(.9);filter:grayscale(.5) contrast(.95) brightness(.9);}.willow:after,
  81. .willow:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.willow img{width:100%;z-index:1;}.willow:before{z-index:2;}.willow:after{z-index:3;}.willow:before{background-color:radial-gradient(40%, circle, #d4a9af 55%, #000 150%);mix-blend-mode:overlay;}.willow:after{background-color:#d8cdcb;mix-blend-mode:color;}.rise{position:relative;-webkit-filter:brightness(1.05) sepia(.2) contrast(.9) saturate(.9);filter:brightness(1.05) sepia(.2) contrast(.9) saturate(.9);}.rise:after,
  82. .rise:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.rise img{width:100%;z-index:1;}.rise:before{z-index:2;}.rise:after{z-index:3;}.rise:after{background:-webkit-radial-gradient(circle, rgba(232, 197, 152, .8), transparent 90%);background:radial-gradient(circle, rgba(232, 197, 152, .8), transparent 90%);mix-blend-mode:overlay;opacity:.6;}.rise:before{background:-webkit-radial-gradient(circle, rgba(236, 205, 169, .15) 55%, rgba(50, 30, 7, .4));background:radial-gradient(circle, rgba(236, 205, 169, .15) 55%, rgba(50, 30, 7, .4));mix-blend-mode:multiply;}.slumber{position:relative;-webkit-filter:saturate(.66) brightness(1.05);filter:saturate(.66) brightness(1.05);}.slumber:after,
  83. .slumber:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.slumber img{width:100%;z-index:1;}.slumber:before{z-index:2;}.slumber:after{z-index:3;}.slumber:after{background:rgba(125, 105, 24, .5);mix-blend-mode:soft-light;}.slumber:before{background:rgba(69, 41, 12, .4);mix-blend-mode:lighten;}.brannan{position:relative;-webkit-filter:sepia(.5) contrast(1.4);filter:sepia(.5) contrast(1.4);}.brannan:after,
  84. .brannan:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.brannan img{width:100%;z-index:1;}.brannan:before{z-index:2;}.brannan:after{z-index:3;}.brannan:after{background-color:rgba(161, 44, 199, .31);mix-blend-mode:lighten;}.valencia{position:relative;-webkit-filter:contrast(1.08) brightness(1.08) sepia(.08);filter:contrast(1.08) brightness(1.08) sepia(.08);}.valencia:after,
  85. .valencia:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.valencia img{width:100%;z-index:1;}.valencia:before{z-index:2;}.valencia:after{z-index:3;}.valencia:after{background:#3a0339;mix-blend-mode:exclusion;opacity:.5;}.kelvin{position:relative;}.kelvin:after,
  86. .kelvin:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.kelvin img{width:100%;z-index:1;}.kelvin:before{z-index:2;}.kelvin:after{z-index:3;}.kelvin:after{background:#b77d21;mix-blend-mode:overlay;}.kelvin:before{background:#382c34;mix-blend-mode:color-dodge;}.maven{position:relative;-webkit-filter:sepia(.25) brightness(.95) contrast(.95) saturate(1.5);filter:sepia(.25) brightness(.95) contrast(.95) saturate(1.5);}.maven:after,
  87. .maven:before{position:absolute;content:'';height:100%;top:0;left:0;pointer-events:none;width:100%;display:block;}.maven img{width:100%;z-index:1;}.maven:before{z-index:2;}.maven:after{z-index:3;background:rgba(3, 230, 26, .2);mix-blend-mode:hue;}.stinson{position:relative;-webkit-filter:contrast(.75) saturate(.85) brightness(1.15);filter:contrast(.75) saturate(.85) brightness(1.15);}.stinson img{width:100%;z-index:1;}.stinson:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;z-index:2;}.stinson:after{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;z-index:3;}.stinson:before{background:rgba(240, 149, 128, .2);mix-blend-mode:soft-light;}</style></template></dom-module><dom-module id="tc-modal-mediafilters" assetpath="../ui/tc-modal-mediafilters/"><template strip-whitespace=""><style include="tc-modal-mediafilters-style"></style><div id="modal-content-filters" data-mode$="[[modeStyle]]"><svg id="close-button" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" on-click="close"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><h1>Filters gallery</h1><div id="filters-preview"><div id="filters-video"><div><div class="video"><div><canvas id="canvas"></canvas></div></div></div></div></div><div id="filters-wrapper"><div class="on-white-scroll"><div id="filters-content"><dom-repeat items="[[filters]]"><template strip-whitespace=""><div class="filter"><div class$="[[getActive(filter, item.name)]]"><div class$="[[item.css]]"><img on-click="onSelect" data-filter$="[[item.name]]" src="[[preview]]"></div></div><span>[[item.name]]</span></div></template></dom-repeat></div></div></div><div id="filter-button-wrapper"><button on-click="onSave">APPLY FILTER</button></div><div class="waiting"><div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div></div></div></template><script>class ModalDialogMediaFilters extends Polymer.Element{static get is(){return"tc-modal-mediafilters"}static get properties(){return{chatroom:{type:Object,observer:"chatroomAssigned"},filter:{type:String,value:""},filters:Array,calcStyle:{type:String,computed:""},video:Object,canvas:Object,preview:String,onkeydownHandler:Object}}constructor(){super()}get app(){return this.chatroom.app}get settings(){return this.app.settings}connectedCallback(){super.connectedCallback(),this.onkeydownHandler=this.onkeydown.bind(this),document.addEventListener("keydown",this.onkeydownHandler)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.onkeydownHandler)}chatroomAssigned(a){this.canvas=this.$.canvas,this.filter=a.mediaStreamFilter,this.filters=window.TinychatApp.BLL.VideoFilters.getAll,this.prepareStream(a.mediaStreamOrigin)}prepareStream(a){function b(){d.clearRect(0,0,c.canvas.width,c.canvas.height);let a=c.video.videoHeight,b=c.video.videoWidth;c.canvas.width=b,c.canvas.height=a,c.preview===void 0&&(d.drawImage(c.video,0,0,b,a,0,0,c.canvas.width,c.canvas.height),c.preview=c.canvas.toDataURL("image/png")),window.TinychatApp.BLL.VideoFilters.getFilter(c.filter).apply(d,b,a),d.drawImage(c.video,0,0,b,a,0,0,c.canvas.width,c.canvas.height)}this.video=document.createElement("video"),this.video.srcObject=a,this.video.pause(),this.video.autoplay=!0,this.video.muted=!0;let c=this,d=this.canvas.getContext("2d");this.video.oncanplay=function(){e(b,15)},this.video.play();let e=function(a,b){let c=new Date().getTime();b=b||60;let d=1e3/b;return function b(){requestAnimationFrame(b);let e=new Date().getTime(),f=e-c;f>d&&(c=e-f%d,a())}(0)}}onSelect(a){this.filter=a.target.dataset.filter}onSave(){let a=this.chatroom.selfUser();a.canUseFilters?(this.chatroom.applyFilter(this.filter),this.close()):(this.close(),this.app.Upgrade("You need at least Extreme subscription to use Video Filters!"))}getActive(a,b){return a===b?"active":""}open(){this.modeStyle=this.app.setDarkModeCSSclass(this.app.settings.isDarkMode()),this.parentNode instanceof Modal&&this.parentNode.open(ModalDialogMediaFilters.is)}close(){this.parentNode instanceof Modal&&this.parentNode.close(ModalDialogMediaFilters.is,this),this.$.video!=void 0&&this.$.video.pause()}onkeydown(a){a=a||window.event,(27==a.keyCode||"Escape"==a.key||"Esc"==a.key)&&this.parentNode instanceof Modal&&this.parentNode.isopen(ModalDialogMediaFilters.is)&&this.close(a)}}customElements.define(ModalDialogMediaFilters.is,ModalDialogMediaFilters);</script></dom-module><dom-module id="tc-modal-mediasettings-style" assetpath="../ui/tc-modal-mediasettings/"><template><style>*{user-select:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;}.on-white-scroll{padding-left:16px;box-sizing:border-box;overflow-x:hidden;overflow-y:scroll;}.on-white-scroll::-webkit-scrollbar{position:absolute;width:15px;cursor:pointer;}.on-white-scroll::-webkit-scrollbar-track{background-color:#fff;}.on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #fff;border-radius:6px/8px;background-color:rgba(0, 0, 0, .2);}.on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}[data-mode="dark"] .on-white-scroll::-webkit-scrollbar-track{background-color:#202628;}[data-mode="dark"] .on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #202628;background-color:rgba(0, 0, 0, .2);}[data-mode="dark"] .on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}#modal-content-media{position:relative;width:100%;max-width:540px;margin:0 auto;padding:50px 70px 60px;box-sizing:border-box;border-radius:4px;background-color:#fff;}#modal-content-media[data-mode="dark"]{background-color:#202628;}#modal-content-media *:focus{outline:none;}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;}#close-button > path{transition:.2s;}#close-button:hover > path{fill:#41b7ef;}#close-button:active > path{fill:#38a8dd;}#modal-content-media > h1{margin:0;padding-bottom:40px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;cursor:default;}#modal-content-media[data-mode="dark"] > h1{color:#fff;}#media-wrapper{position:relative;transition:.2s;}#media-videos{position:relative;width:calc(100% + 20px);left:-10px;padding-bottom:40px;text-align:left;}#media-videos > div:first-child{height:0;overflow:hidden;transition:.2s;}#media-videos > div:only-of-type{height:40px;width:100%;padding:0 10px;box-sizing:border-box;font-size:14px;color:#414141;line-height:40px;text-align:center;cursor:default;}#media-videos > div + div{position:relative;display:inline-block;width:50%;padding:0 10px 10px;box-sizing:border-box;vertical-align:top;}#media-videos > div > .video{position:relative;width:100%;border-radius:5px;font-size:0;overflow:hidden;cursor:pointer;}.video > div{position:relative;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNjQiIHZpZXdCb3g9IjAgMCA0OCA2NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGQ9Ik0xNCAxMy45OTR2MjAuMDEyQzE0IDM5LjUyMyAxOC40NzggNDQgMjQgNDRjNS41MTUgMCAxMC00LjQ4IDEwLTkuOTk0VjEzLjk5NEMzNCA4LjQ3NyAyOS41MjIgNCAyNCA0Yy01LjUxNSAwLTEwIDQuNDgtMTAgOS45OTR6TTI2IDU3LjkydjQuMDgyQTEuOTk0IDEuOTk0IDAgMCAxIDI0IDY0Yy0xLjEwNSAwLTItLjg4Ny0yLTEuOTk4VjU3LjkyQzkuNjk4IDU2LjkyOCAwIDQ2Ljg2IDAgMzQuNTg2YTIgMiAwIDAgMSA0IDBDNCA0NS4yODMgMTIuOTUgNTQgMjQgNTRjMTEuMDYgMCAyMC04LjcwMyAyMC0xOS40MTRhMiAyIDAgMCAxIDQgMGMwIDEyLjI4Ni05LjY5IDIyLjM0NC0yMiAyMy4zMzR6TTEwIDEzLjk5NEMxMCA2LjI3IDE2LjI3NyAwIDI0IDBjNy43MyAwIDE0IDYuMjY3IDE0IDEzLjk5NHYyMC4wMTJDMzggNDEuNzMgMzEuNzIzIDQ4IDI0IDQ4Yy03LjczIDAtMTQtNi4yNjctMTQtMTMuOTk0VjEzLjk5NHoiIGZpbGw9IiNmZmYiLz4KPC9zdmc+);background-repeat:no-repeat;background-position:center;background-color:#c4d4dc;overflow:hidden;}.video > div:before{content:'';display:block;width:100%;padding-bottom:75%;}.video:after{content:'';position:absolute;display:block;top:-5px;bottom:-5px;left:-5px;right:-5px;border:5px solid #fff;border-radius:9px;box-sizing:border-box;pointer-events:none;}.video > div > video{position:absolute;height:100%;top:0;left:0;}.video > div.ratio-16-9 > video{left:-16.66%;}.video > div.ratio-8-5 > video{left:-10%;}.video > div.ratio-3-2 > video{left:-6.25%;}.video + span{display:inline-block;height:16px;width:100%;padding-top:6px;font-size:12px;color:#262626;line-height:16px;text-align:center;cursor:default;}[data-mode="dark"] .video + span{color:#fff;}.video.active:before{content:'';position:absolute;height:100%;width:100%;top:0;left:0;border:2px solid #41b7ef;border-radius:4px;box-sizing:border-box;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iNTMiIHZpZXdCb3g9IjAgMCA1MyA1MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CgkJPHBhdGggZD0iTTIgNi4wMDJBMy45OTggMy45OTggMCAwIDEgNi4wMDIgMkg1M0wyIDUzVjYuMDAyeiIgZmlsbD0iI2ZmZiIvPgoJCTxwYXRoIGQ9Ik0wIDMuOTk0QTMuOTk1IDMuOTk1IDAgMCAxIDMuOTk0IDBINTJMMCA1MlYzLjk5NHoiIGZpbGw9IiM0MWI3ZWYiLz4KCQk8cGF0aCBzdHJva2U9IiNmZmYiIHN0cm9rZS13aWR0aD0iNCIgZD0iTTkgMTVsNiA1IDctOSIvPgoJPC9nPgo8L3N2Zz4=);background-repeat:no-repeat;background-position:-2px -2px;z-index:1;}.video.active:after{border-width:9px;}#media-audios{position:relative;width:100%;max-width:400px;margin:0 auto;padding-right:40px;box-sizing:border-box;}#media-audios-combobox{position:relative;height:40px;width:100%;padding:8px 50px 8px 25px;border:1px solid #c5d5dc;box-sizing:border-box;background-color:#fff;cursor:pointer;transition:.2s;}#media-audios-combobox:after{content:'';position:absolute;display:block;height:0;width:0;top:50%;right:18px;margin-top:-3px;border-width:6px 5px 0;border-style:solid;border-color:#c4d4dc transparent;transition:.2s;}#media-audios-combobox-list{position:absolute;top:40px;left:0;right:40px;border-width:0 1px 1px;border-style:solid;border-color:#c5d5dc;box-sizing:border-box;font-size:14px;color:#414141;text-align:left;background-color:#fff;cursor:pointer;visibility:hidden;z-index:2;transition:.2s;}#media-audios-combobox:focus{border-color:#41b7ef;}#media-audios-combobox:focus:after{transform:rotate(180deg);-webkit-transform:rotate(180deg);}#media-audios-combobox:focus + #media-audios-combobox-list{visibility:visible;}#media-audios-combobox-list > div{position:relative;height:40px;width:100%;padding:8px 50px 8px 35px;box-sizing:border-box;white-space:nowrap;overflow:hidden;opacity:0;visibility:hidden;transition:.2s;}#media-audios-combobox:focus + #media-audios-combobox-list > div{opacity:1;visibility:visible;}#media-audios-combobox-list > div:first-child{display:none;}#media-audios-combobox-list > div:only-of-type{position:absolute;display:block;top:-40px;left:0;line-height:24px;}#media-audios-combobox-list > div.active{position:absolute;top:-40px;left:0;opacity:1;visibility:visible;pointer-events:none;}#media-audios-combobox-list > div:hover{background-color:#e0f5ff;}#media-audios-combobox-list > div > div{position:absolute;height:24px;width:3px;top:8px;left:25px;background-color:#333;}#media-audios-combobox-list > div > div:before{content:'';position:absolute;display:block;width:100%;bottom:0;left:0;background-color:#74d60c;transition:.1s;}#media-audios-combobox-list > div > div[data-mic-level=""]:before,
  88. #media-audios-combobox-list > div > div[data-mic-level="0"]:before{top:100%;}#media-audios-combobox-list > div > div[data-mic-level="1"]:before{top:90%;}#media-audios-combobox-list > div > div[data-mic-level="2"]:before{top:80%;}#media-audios-combobox-list > div > div[data-mic-level="3"]:before{top:70%;}#media-audios-combobox-list > div > div[data-mic-level="4"]:before{top:60%;}#media-audios-combobox-list > div > div[data-mic-level="5"]:before{top:50%;}#media-audios-combobox-list > div > div[data-mic-level="6"]:before{top:40%;}#media-audios-combobox-list > div > div[data-mic-level="7"]:before{top:30%;}#media-audios-combobox-list > div > div[data-mic-level="8"]:before{top:20%;}#media-audios-combobox-list > div > div[data-mic-level="9"]:before{top:10%;}#media-audios-combobox-list > div > div[data-mic-level="10"]:before{top:0;}#media-audios-combobox-list > div > span{display:inline-block;width:100%;line-height:24px;overflow:hidden;}#media-audios > button{position:absolute;height:40px;width:30px;top:0;right:0;padding:0;border:none;background-color:transparent;cursor:pointer;line-height:40px;text-align:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;}#media-audios > button > svg{position:relative;top:3px;}#media-audios > button > svg > rect{opacity:0;visibility:hidden;transition:.2s;}[data-mode="dark"] #media-audios > button > svg > path + rect{fill:#202628;}#media-audios > button.muted > svg > rect{opacity:1;visibility:visible;}#media-ptt{padding-top:25px;text-align:center;}#media-ptt > input{display:none;}#media-ptt > label{position:relative;display:inline-block;height:16px;cursor:pointer;}#media-ptt > label > span{position:relative;display:inline-block;top:-3px;font-size:12px;font-weight:600;color:#414141;}[data-mode="dark"] #media-ptt > label > span{color:#fff;}#media-ptt > label:before{content:'';position:absolute;display:block;height:10px;width:10px;top:3px;right:3px;border-radius:100%;background-color:#fff;z-index:1;transition:.2s;}#media-ptt > label:after{content:'';position:relative;display:inline-block;height:16px;width:30px;margin-left:24px;border-radius:8px;background-color:#c2c9cb;transition:.2s;}#media-ptt > input:checked + label:before{right:17px;}#media-ptt > input:checked + label:after{background-color:#41b7ef;}#media-wrapper > button{display:block;height:40px;width:100%;margin-top:40px;border:1px solid transparent;box-sizing:border-box;font-size:12px;font-weight:700;color:#fff;background-color:#41b7ef;line-height:38px;text-align:center;text-transform:uppercase;cursor:pointer;transition:.2s;-webkit-appearance:none;-moz-appearance:none;appearance:none;}#media-wrapper > button:hover{background-color:#54ccf3;}#media-wrapper > button:active{background-color:#38a8de;}#media-wrapper > .waiting{position:absolute;width:auto;top:0;bottom:0;left:0;right:0;background-color:#fff;z-index:1;opacity:0;visibility:hidden;transition:.2s;}[data-mode="dark"] #media-wrapper > .waiting{background-color:#202628;}#media-wrapper.wait > .waiting{opacity:1;visibility:visible;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #cacece;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite paused;-webkit-animation:waiting 1s ease-in-out 0s infinite paused;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}.waiting > .waiting-content > span:nth-child(5){animation-delay:.6s;-webkit-animation-delay:.6s;}#media-wrapper.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}</style></template></dom-module><dom-module id="tc-modal-mediasettings" assetpath="../ui/tc-modal-mediasettings/"><template strip-whitespace=""><style include="tc-modal-mediasettings-style"></style><div id="modal-content-media" data-mode$="[[modeStyle]]"><svg id="close-button" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" on-click="close"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><h1>Media Devices</h1><div id="media-wrapper"><div id="media-videos"><div>Video List is empty</div><dom-repeat items="[[video_items]]"><template strip-whitespace=""><div><div on-click="onVideoSelect" class$="[[convertVideoClass(videoSelectedDeviceId, item)]]"><div class="ratio-4-3"><video autoplay="" loop="" src="[[item.mediasrc]]" playsinline="">Your browser does not support the video tag...</video></div></div><span>[[item.label]]</span></div></template></dom-repeat></div><div id="media-audios"><div id="media-audios-combobox" tabindex="0"></div><div id="media-audios-combobox-list"><div>Audio List is empty</div><dom-repeat items="[[audio_items]]"><template strip-whitespace=""><div on-click="onAudioSelect" class$="[[convertClassActive('', item.active)]]"><div data-mic-level="4"></div><span>[[item.label]]</span></div></template></dom-repeat></div><button id="btn-mute-mic" on-click="onMuteMic"><svg width="24" height="30" viewBox="0 0 24 30" xmlns="http://www.w3.org/2000/svg"><path d="M7 6.997v8.006a5 5 0 0 0 10 0V6.997a5 5 0 0 0-10 0zm6 19.963v2.03a1 1 0 1 1-2 0v-2.03c-6.15-.496-11-5.53-11-11.667a1 1 0 1 1 2 0C2 20.643 6.475 25 12 25c5.53 0 10-4.352 10-9.707a1 1 0 1 1 2 0c0 6.143-4.845 11.172-11 11.667zM5 6.997a7 7 0 1 1 14 0v8.006a7 7 0 1 1-14 0V6.997z" fill="#41b7ef"></path><rect transform="rotate(-45 11.9 13.9)" width="31" height="2" rx="1" fill="#fff" fill-rule="evenodd" x="-2" y="14.5"></rect><rect transform="rotate(-45 11.9 13.9)" width="31" height="2" rx="1" fill="#41b7ef" fill-rule="evenodd" x="-3" y="13"></rect></svg></button></div><div id="media-ptt"><input id="input-ptt" type="checkbox" on-change="echoChange"> <label for="input-ptt"><span>ACOUSTIC ECHO CANCELLATION</span></label></div><button on-click="onSave">CLOSE</button><div class="waiting"><div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div></div></div></div></template><script>class ModalDialogMediaSettings extends Polymer.Element{static get is(){return"tc-modal-mediasettings"}static get properties(){return{chatroom:{type:Object,observer:"chatroomAssigned"},audio_items:{type:Array,value:[]},video_items:{type:Array,value:[]},audio_selected:{type:Object,value:null},video_selected:{type:Object,value:null},videoSelectedDeviceId:{type:String,value:""},enableAcousticEchoCancelation:{type:String,notify:!0},onkeydownHandler:Object,onClose:Object}}constructor(){super()}get app(){return this.chatroom.app}get settings(){return this.app.settings}connectedCallback(){super.connectedCallback();let a=this.settings.getSettings();this.setProperties({enableAcousticEchoCancelation:a.enableAcousticEchoCancelation}),this.$["input-ptt"].checked=this.enableAcousticEchoCancelation,this.onkeydownHandler=this.onkeydown.bind(this),document.addEventListener("keydown",this.onkeydownHandler)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.onkeydownHandler)}chatroomAssigned(){let a=this,b=this.chatroom.app.EventBus,c=a.$["media-wrapper"];c.classList.add("wait");navigator.mediaDevices.getUserMedia({video:{width:320,height:240,frameRate:{ideal:15,max:30}},audio:!0}).then(()=>{a.mediadevices((b,d)=>{!b&&d&&a.app.showToastWarn(d.message),c.classList.remove("wait")})}).catch(a=>{console.error(a)});let d=this.settings.getSettings();null!==d.video&&(this.videoSelectedDeviceId=d.video.deviceId)}open(){this.modeStyle=this.app.setDarkModeCSSclass(this.app.settings.isDarkMode()),this.parentNode instanceof Modal&&this.parentNode.open(ModalDialogMediaSettings.is)}close(){for(var a in this.parentNode instanceof Modal&&this.parentNode.close(ModalDialogMediaSettings.is,this),this.video_items){let b=this.video_items[a];if(b.mediasrc&&""!=b.mediasrc)try{URL.revokeObjectURL(b.mediasrc),b.mediasrc="",this.notifyPath("video_items."+a+".mediasrc"),null!=b.mediastream&&b.mediastream.stop()}catch(a){console.error(a)}}let b=this.settings.getSettings();null!==b.video&&Object.isFunc(this.onClose)&&this.onClose()}onkeydown(a){a=a||window.event,(27==a.keyCode||"Escape"==a.key||"Esc"==a.key)&&this.parentNode instanceof Modal&&this.parentNode.isopen(ModalDialogMediaSettings.is)&&this.close(a)}onMuteMic(){let a=this.$["btn-mute-mic"];a.classList.toggle("muted")}onSave(){this.close()}echoChange(a){this.settings.switchAcousticEchoCancelation(this._str2bool(a))}onVideoSelect(a){this.video_selected=a.model.item,this.video_selected.active=!0,this.videoSelectedDeviceId=this.video_selected.deviceId;let b=this.video_items.indexOf(this.video_selected);this.notifyPath("video_items."+b+".active");let c=this.settings.getSettings();c.video=a.model.item,this.settings.saveSettings(c)}onAudioSelect(a){for(var b in this.audio_items){let c=this.audio_items[b],d=c.active;c.active=!1,d&&this.notifyPath("audio_items."+b+".active")}this.audio_selected=a.model.item,this.audio_selected.active=!0;let c=this.audio_items.indexOf(this.audio_selected);this.notifyPath("audio_items."+c+".active");let d=this.settings.getSettings();d.audio=a.model.item,this.settings.saveSettings(d)}convertVideoClass(a,b){let c="video",d=this.settings.getSettings();return c+=a===b.deviceId?" active":"",c}convertClassActive(a,b){let c=a,d=this.settings.getSettings();return null!=d.video&&(c+=b?" active":""),c}mediadevices(a){let b=this;if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)a(!1,new Error("Browser does not support Media Devices"));else{let c=b.settings.getSettings(),d={deviceId:this.chatroom.id__miconly,groupId:"",label:"Microphone only",mediasrc:"",active:!1};b.video_items=[d],b.audio_items=[],b.video_selected=null!=c.video&&d.deviceId==c.video.deviceId?d:c.video,b.audio_selected=c.audio,navigator.mediaDevices.enumerateDevices().then(c=>{for(let a in c){let e=c[a];if(e.active=!1,"videoinput"===e.kind){e.mediasrc="https://tinychat.com/images/blank.png",(null==b.video_selected||b.video_selected.deviceId==e.deviceId||b.video_selected.deviceId==d.deviceId)&&(b.video_selected=null==b.video_selected?e:b.video_selected,b.video_selected.active=!0,b.video_selected.deviceId==e.deviceId&&(e.active=!0));let a=b.video_items.indexOf(d);b.video_items.splice(a,0,e);let c={video:{deviceId:{exact:e.deviceId},width:320,height:240,frameRate:{ideal:15,max:30}}};console.log(c),navigator.mediaDevices.getUserMedia(c).then(c=>{try{e.mediastream=c,e.mediasrc=URL.createObjectURL(c),b.notifyPath("video_items."+a+".mediasrc")}catch(a){console.warn("MediaStream URL Object failed.",a)}}).catch(a=>{console.error(a)})}"audioinput"===e.kind&&(b.audio_items.push(e),(null==b.audio_selected||b.audio_selected.deviceId==e.deviceId)&&(b.audio_selected=e,b.audio_selected.active=!0))}1>=b.audio_items.length&&1>=b.video_items.length?a(!1,new Error("No Media Devices has found")):(b.video_items=Array.from(b.video_items),b.audio_items=Array.from(b.audio_items),console.log(b.video_items),console.log(b.video_selected),console.log(b.audio_items),console.log(b.audio_selected)),a(!0)}).catch(a=>{console.log(a)})}}_str2bool(a){let b=a.path?a.path[0]:(a.composedPath&&a.composedPath())[0];return b.checked}}customElements.define(ModalDialogMediaSettings.is,ModalDialogMediaSettings);</script></dom-module><dom-module id="tc-modal-notification-style" assetpath="../ui/tc-modal-notification/"><template><style>#modal-content-notification{position:relative;width:100%;max-width:540px;margin:0 auto;padding:50px 70px 60px;box-sizing:border-box;border-radius:4px;background-color:#fff;}#modal-content-notification[data-mode="dark"]{background-color:#202628;}#modal-content-notification > h1{margin:0;padding-bottom:10px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;}#modal-content-notification[data-mode="dark"] > h1{color:#fff;}#modal-content-notification > label{display:block;font-size:12px;line-height:1.33;text-align:center;color:#262626;transition:.2s;}#modal-content-notification[data-mode="dark"] > label{color:#fff;}#modal-content-notification > button{height:40px;width:100%;margin-top:32px;border:none;font-family:inherit;font-size:12px;font-weight:700;color:#fff;letter-spacing:1px;background-color:#41b7ef;cursor:pointer;transition:.2s;-webkit-appearance:none;-moz-appearance:none;appearance:none;}#modal-content-notification > button:hover{background-color:#54ccf3;}#modal-content-notification > button:active{background-color:#38a8dd;}#modal-content-notification *:focus{outline:none;}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;z-index:1;}#close-button > path{transition:.2s;}#close-button:hover > path{fill:#41b7ef;}#close-button:active > path{fill:#38a8dd;}</style></template></dom-module><dom-module id="tc-modal-notification" assetpath="../ui/tc-modal-notification/"><template strip-whitespace=""><style include="tc-modal-notification-style"></style><div id="modal-content-notification" data-mode$="[[modeStyle]]"><svg id="close-button" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" on-click="close"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><h1>[[title]]</h1><label>[[message]]</label> <button on-click="close">[[btnMessage]]</button></div></template><script>class ModalDialogNotification extends Polymer.Element{static get is(){return"tc-modal-notification"}static get properties(){return{title:{type:String,value:"Your video was rejected by moderator"},message:{type:String,value:"You can try to broadcast again in 1 minute"},btnMessage:{type:String,value:"OK"},onkeydownHandler:Object}}constructor(){super()}get app(){return this.chatroom.app}get settings(){return this.app.settings}connectedCallback(){super.connectedCallback(),this.onkeydownHandler=this.onkeydown.bind(this),document.addEventListener("keydown",this.onkeydownHandler)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.onkeydownHandler)}open(){this.modeStyle=this.app.setDarkModeCSSclass(this.app.settings.isDarkMode()),this.parentNode instanceof Modal&&this.parentNode.open(ModalDialogNotification.is)}close(){this.parentNode instanceof Modal&&this.parentNode.close(ModalDialogNotification.is,this)}onkeydown(a){a=a||window.event,(27==a.keyCode||"Escape"==a.key||"Esc"==a.key)&&this.parentNode instanceof Modal&&this.parentNode.isopen(ModalDialogNotification.is)&&this.cancel(a)}cancel(){this.close()}}customElements.define(ModalDialogNotification.is,ModalDialogNotification);</script></dom-module><dom-module id="tc-modal-password-style" assetpath="../ui/tc-modal-password/"><template><style>#modal-content-password{width:100%;max-width:540px;margin:0 auto;padding:50px 70px 60px;box-sizing:border-box;border-radius:4px;background-color:#fff;}#modal-content-password[data-mode="dark"]{background-color:#202628;}#modal-content-password.error > label{opacity:0;visibility:hidden;}#modal-content-password.error > #error-text{opacity:1;visibility:visible;overflow:visible;}#modal-content-password.error > input[type="password"]{border-color:#e53951;color:#e53951;}#modal-content-password > *:focus{outline:none;}#modal-content-password > h1{margin:0;padding-bottom:40px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;}#modal-content-password[data-mode="dark"] > h1{color:#fff;}#modal-content-password > label{display:block;padding-bottom:4px;font-size:12px;font-weight:600;color:#414141;text-transform:uppercase;opacity:1;visibility:visible;transition:.2s;}#modal-content-password[data-mode="dark"] > label{color:#fff;}#modal-content-password > #error-text{position:relative;display:block;height:0;top:-21px;font-size:12px;font-weight:600;color:#e53951;opacity:0;visibility:hidden;overflow:hidden;transition:.2s;}#modal-content-password > input[type="password"]{height:40px;width:100%;border:1px solid #c5d5dc;box-sizing:border-box;background-color:#fff;font-family:inherit;font-size:16px;font-weight:600;color:#414141;text-align:center;line-height:38px;letter-spacing:.5px;transition:.2s;}#modal-content-password > input[type="submit"]{height:40px;width:100%;margin-top:24px;border:none;font-family:inherit;font-size:12px;font-weight:700;color:#fff;letter-spacing:1px;background-color:#41b7ef;cursor:pointer;transition:.2s;-webkit-appearance:none;-moz-appearance:none;appearance:none;}#modal-content-password > input[type="submit"]:hover{background-color:#54ccf3;}#modal-content-password > input[type="submit"]:active{background-color:#38a8dd;}</style></template></dom-module><dom-module id="tc-modal-password" assetpath="../ui/tc-modal-password/"><template strip-whitespace=""><style include="tc-modal-password-style"></style><form id="modal-content-password" on-submit="onOK" data-mode$="[[modeStyle]]"><h1>[[title]]</h1><label>[[label]]</label> <span id="error-text">[[error]]</span> <input id="password" type="password" placeholder="password" maxlength="255" on-click="onInput"> <input type="submit" value="[[submit]]"></form></template><script>class ModalDialogPassword extends Polymer.Element{static get is(){return"tc-modal-password"}static get properties(){return{modeStyle:String,title:{type:String,value:"The room is password protected"},label:{type:String,value:"CHATROOM PASSWORD"},submit:{type:String,value:"CONNECT"},error:{type:String,value:"Sorry, the password you entered was incorrect"},ok:Object,onkeydownHandler:Object}}constructor(a){super(),this.modeStyle=a}connectedCallback(){super.connectedCallback(),this.onkeydownHandler=this.onkeydown.bind(this),document.addEventListener("keydown",this.onkeydownHandler),this.$.password.focus()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.onkeydownHandler)}open(){this.parentNode instanceof Modal&&this.parentNode.open(ModalDialogPassword.is)}close(){this.parentNode instanceof Modal&&this.parentNode.close(ModalDialogPassword.is,this)}onkeydown(a){a=a||window.event,(27==a.keyCode||"Escape"==a.key||"Esc"==a.key)&&this.parentNode instanceof Modal&&this.parentNode.isopen(ModalDialogPassword.is)&&Object.isFunc(this.ok)&&this.ok("")}onInput(){this.$["modal-content-password"].classList.remove("error")}onOK(a){return a.preventDefault(),Object.isFunc(this.ok)&&this.ok(this.$.password.value),!1}}customElements.define(ModalDialogPassword.is,ModalDialogPassword);</script></dom-module><dom-module id="tc-modal-permissions-style" assetpath="../ui/tc-modal-permissions/"><template><style>#modal-content-permissions{position:relative;width:100%;max-width:540px;margin:0 auto;padding:50px 30px 44px;border-radius:4px;box-sizing:border-box;background-color:#fff;text-align:center;}#modal-content-permissions[data-mode="dark"]{background-color:#202628;}#modal-content-permissions > h2{margin:0;padding-bottom:10px;font-size:24px;font-weight:300;color:#363636;line-height:32px;}#modal-content-permissions[data-mode="dark"] > h2{color:#fff;}#modal-content-permissions > span{display:block;padding-bottom:10px;font-size:12px;color:#262626;line-height:16px;}#modal-content-permissions[data-mode="dark"] > span{color:#fff;}#modal-content-permissions > .waiting{position:relative;height:40px;margin-top:15px;}[data-mode="dark"] .waiting > .waiting-content > span{border-color:#cacece;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #04caff;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite;-webkit-animation:waiting 1s ease-in-out 0s infinite;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}</style></template></dom-module><dom-module id="tc-modal-permissions" assetpath="../ui/tc-modal-permissions/"><template strip-whitespace=""><style include="tc-modal-permissions-style"></style><div id="modal-content-permissions" data-mode$="[[modeStyle]]"><h2>We need some permissions</h2><span>There are the dialog of the browser window. Please grant access.</span><div class="waiting"><div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div></div></div></template><script>class ModalPermissions extends Polymer.Element{static get is(){return"tc-modal-permissions"}static get properties(){return{modeStyle:String,modaloptions:{type:Object,value:{}}}}constructor(a){super(),this.modeStyle=a}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}open(){this.parentNode instanceof Modal&&this.parentNode.open(ModalPermissions.is)}close(){this.parentNode instanceof Modal&&this.parentNode.close(ModalPermissions.is,this)}}customElements.define(ModalPermissions.is,ModalPermissions);</script></dom-module><dom-module id="tc-modal-profile-style" assetpath="../ui/tc-modal-profile/"><template><style>.on-white-scroll,
  89. .on-gray-scroll{padding-left:16px;box-sizing:border-box;overflow-x:hidden;overflow-y:scroll;}.on-white-scroll::-webkit-scrollbar,
  90. .on-gray-scroll::-webkit-scrollbar{position:absolute;width:15px;cursor:pointer;}.on-white-scroll::-webkit-scrollbar-track{background-color:#fff;}.on-gray-scroll::-webkit-scrollbar-track{background-color:#2d373a;}.on-white-scroll::-webkit-scrollbar-thumb,
  91. .on-gray-scroll::-webkit-scrollbar-thumb{border-radius:6px/8px;}.on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #fff;background-color:rgba(0, 0, 0, .2);}.on-gray-scroll::-webkit-scrollbar-thumb{border:5px solid #2d373a;background-color:#5a6366;}.on-white-scroll::-webkit-scrollbar-thumb:hover,
  92. .on-gray-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}.on-gray-scroll::-webkit-scrollbar-thumb:hover{background-color:#6f7b80;}[data-mode="dark"] .on-white-scroll::-webkit-scrollbar-track{background-color:#202628;}[data-mode="dark"] .on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #202628;background-color:rgba(0, 0, 0, .2);}[data-mode="dark"] .on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}#modal-content-profile{position:relative;width:100%;max-width:400px;height:610px;margin:0 auto;border-radius:4px;text-align:center;overflow:hidden;}#modal-content-profile:after{content:'';position:absolute;display:block;height:45px;bottom:0;left:20px;right:20px;border-radius:0 0 4px 4px;background:-moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);background:-webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);background:linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=0 );pointer-events:none;}#modal-content-profile[data-mode="dark"]:after{background:-moz-linear-gradient(top, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);background:-webkit-linear-gradient(top, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);background:linear-gradient(to bottom, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00202628', endColorstr='#202628', GradientType=0);}#modal-content-profile *:focus{outline:none;}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;}#close-button > path{fill:#fff;opacity:.6;transition:.2s;}#close-button:hover > path{fill:#fff;opacity:.8;}#close-button:active > path{fill:#fff;opacity:1;}#modal-content-profile-preview{height:225px;padding-top:40px;box-sizing:border-box;background-color:#969fa2;}#modal-content-profile.gold > #modal-content-profile-preview{background-color:#ffbe00;}#modal-content-profile.extreme > #modal-content-profile-preview{background-color:#ad6ed1;}#modal-content-profile.pro > #modal-content-profile-preview{background-color:#2ecb4e;}#profile-status{position:relative;display:inline-block;height:116px;width:116px;}#profile-status:before{content:'';position:absolute;display:block;height:100%;width:100%;border:4px solid rgba(0, 0, 0, .1);box-sizing:border-box;border-radius:100%;}#profile-status > svg{transform:rotate(180deg);}#profile-status > svg > circle{fill:transparent;stroke:#fff;stroke-width:4px;stroke-linecap:round;transition:stroke .5s,
  93. stroke-dasharray 3s;}#profile-status > svg > circle[stroke-dasharray="0, 352"]{stroke:transparent;}#profile-status-avatar{position:absolute;height:100px;width:100px;top:8px;left:8px;border-radius:100%;overflow:hidden;}#profile-status-avatar > img{position:absolute;height:100%;left:-25px;opacity:0;visibility:hidden;}#profile-status-avatar > img.show{opacity:1;visibility:visible;}#profile-status-level{position:absolute;height:30px;width:30px;top:43px;left:-12px;padding:6px;border-radius:100%;box-sizing:border-box;background-color:#fff;opacity:0;visibility:hidden;transition:.2s;}[data-mode="dark"] #profile-status-level{background-color:#202628;}#profile-status-level.show{opacity:1;visibility:visible;}#profile-status-level > img{height:18px;width:18px;}#profile-nickname{position:relative;display:flex;flex-direction:row;align-items:stretch;justify-content:center;margin:7px 0 29px;padding:0 30px;box-sizing:border-box;font-size:24px;font-weight:300;color:#fff;line-height:33px;white-space:nowrap;}[data-mode="dark"] #profile-nickname{color:#202628;}#profile-nickname > span{position:relative;display:inline-block;max-width:100%;padding-right:15px;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;}#profile-nickname > button{position:relative;display:inline-block;height:20px;top:8px;padding:0 8px;border-radius:2px;border:none;font-size:12px;font-weight:800;color:#41b7ef;background-color:#fff;text-transform:uppercase;line-height:20px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;}[data-mode="dark"] #profile-nickname > button{background-color:#202628;}#profile-nickname > button > svg{display:none;}#profile-nickname > button.pencil > svg{display:inline-block;margin-left:8px;}#profile-nickname > button > svg > path{fill:#41b7ef;}#modal-content-profile.gold #profile-nickname > button{color:#ffbe00;}#modal-content-profile.gold #profile-nickname > button > svg > path{fill:#ffbe00;}#modal-content-profile.extreme #profile-nickname > button{color:#ad6ed1;}#modal-content-profile.extreme #profile-nickname > button > svg > path{fill:#ad6ed1;}#modal-content-profile.pro #profile-nickname > button{color:#2ecb4e;}#modal-content-profile.pro #profile-nickname > button > svg > path{fill:#2ecb4e;}#modal-content-profile-info{position:relative;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;height:385px;background-color:#fff;}[data-mode="dark"] #modal-content-profile-info{background-color:#202628;}#profile-info{padding:20px 60px 10px;box-sizing:border-box;font-size:0;color:#fff;background-color:#b5bcbe;}[data-mode="dark"] #profile-info{color:#202628;}#modal-content-profile.gold #profile-info{background-color:#ffd24c;}#modal-content-profile.extreme #profile-info{background-color:#c699df;}#modal-content-profile.pro #profile-info{background-color:#6cdb83;}#profile-info > div{max-width:100%;margin-bottom:10px;font-size:12px;font-weight:600;line-height:17px;}#profile-info > div + div{display:inline-block;max-height:17px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}#profile-info > div + div[title=""]{display:none;}#profile-info ~ *{padding-right:30px;padding-left:30px;}#modal-content-profile-info > h2{margin:0;padding-top:30px;padding-bottom:10px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;}[data-mode="dark"] #modal-content-profile-info > h2{color:#fff;}#profile-gifts-text{padding-bottom:10px;font-size:12px;font-weight:600;color:#a0a0a0;line-height:17px;}#profile-gifts-coins{height:30px;padding-bottom:10px;font-size:18px;font-weight:700;color:#61686b;line-height:30px;}#profile-gifts-coins > *{display:inline-block;vertical-align:middle;}#profile-gifts-coins > span{margin:0 15px 0 4px;}#profile-gifts-coins > button{height:100%;padding:0 15px;border:1px solid #3cafe1;border-radius:30px;box-sizing:border-box;font-size:12px;color:#3cafe1;background-color:#fff;cursor:pointer;transition:.2s;-webkit-appearance:none;-moz-appearance:none;appearance:none;}#profile-gifts-coins > button:hover{background-color:#d6f2ff;}#profile-gifts-coins > button:active{background-color:#c7e8f8;}#profile-gifts{padding-top:10px;padding-right:15px;padding-bottom:15px;font-size:0;}#profile-gifts > div{display:inline-block;width:33.33%;padding-bottom:30px;vertical-align:top;}#profile-gifts > div > *{display:inline-block;height:80px;width:80px;cursor:pointer;}#profile-gifts > div:first-child > a{border:1px solid #41b7ef;border-radius:100%;box-sizing:border-box;background-color:#fff;line-height:78px;transition:.2s;}#profile-gifts > div:first-child > a:hover{background-color:#d6f2ff;}#profile-gifts > div:first-child > a:active{background-color:#c7e8f8;}[data-mode="dark"] #profile-gifts > div:first-child > a{background-color:transparent;}#profile-gifts > div:first-child > a > svg{vertical-align:middle;}#profile-gifts > div:first-child > a > svg > path{fill:#41b7ef;}#profile-gifts > div:first-child:only-child > a{border-color:transparent;background-color:#41b7ef;}#profile-gifts > div:first-child:only-child > a:hover{background-color:#54ccf3;}#profile-gifts > div:first-child:only-child > a:active{background-color:#38a8de;}#profile-gifts > div:first-child:only-child > a > svg > path{fill:#fff;}#profile-gifts > div > a > img{height:100%;width:100%;opacity:0;visibility:hidden;transition:.2s;}#profile-gifts > div > a > img.show{opacity:1;visibility:visible;}[data-mode="dark"] .waiting > .waiting-content > span{border-color:#cacece;}[data-mode="dark"] .waiting{background-color:#202628;}.waiting{position:absolute;height:100%;width:100%;top:0;left:0;border-radius:inherit;background-color:#fff;opacity:0;visibility:hidden;transition:.2s;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}#modal-content-profile.wait > .waiting{opacity:1;visibility:visible;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #04caff;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite paused;-webkit-animation:waiting 1s ease-in-out 0s infinite paused;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}#modal-content-profile.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}</style></template></dom-module><dom-module id="tc-modal-profile" assetpath="../ui/tc-modal-profile/"><template strip-whitespace=""><style include="tc-modal-profile-style"></style><div id="modal-content-profile" class$="[[convertSubType(userprofile, isLoading)]]" data-mode$="[[modeStyle]]"><svg id="close-button" on-click="close" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><div id="modal-content-profile-preview"><div id="profile-status"><svg height="116px" width="116px"><circle cx="58" cy="58" r="56" stroke-dasharray="0, 352"></circle></svg><div id="profile-status-avatar"><img src="[[userprofile.avatarUrl]]" class$="[[convertShow(userprofile)]]" title$="[[userprofile.percentToNextAchieve]]"></div><div id="profile-status-level"><img src="[[userprofile.achieveUrl]]" class$="[[convertShow(userprofile)]]"></div></div><div id="profile-nickname"><span title="[[userprofile.username]]">[[userprofile.username]]</span> <button class$="[[convertUpgrade(userprofile)]]" on-click="onUpgrade"><span>[[convertUpgradeText(userprofile)]]</span> <svg width="10" height="10" viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><path d="M0 7.915v2.083h2.083l6.144-6.143-2.083-2.083L0 7.915zm9.838-5.67c.216-.218.216-.568 0-.784l-1.3-1.3c-.217-.216-.567-.216-.784 0L6.738 1.178 8.82 3.26 9.84 2.244z" fill-rule="evenodd"></path></svg></button></div></div><div id="modal-content-profile-info"><div id="profile-info"><div>[[convertInfo(userprofile)]]</div><div title="[[userprofile.biography]]">[[userprofile.biography]]</div></div><h2>Virtual Gifts</h2><dom-if if="[[convertIsShownNoGifts(userprofile.gifts)]]"><template><div id="profile-gifts-text">[[userprofile.username]] has no Virtual Gifts.<br>Be the first!</div></template></dom-if><div id="profile-gifts-coins"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10" fill="#f9d046" fill-rule="evenodd"></circle><path d="M14.873 14.53c.186.082.162.347-.037.387-.666.13-1.865.022-2.517-.487-.695.363-1.483.57-2.32.57-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.25-.46 2.39-1.216 3.266.09.277.233.598.448.825.196.208.418.344.64.44zM13.57 10c0-1.972-1.598-3.57-3.57-3.57-1.972 0-3.57 1.598-3.57 3.57 0 1.972 1.598 3.57 3.57 3.57 1.972 0 3.57-1.598 3.57-3.57zM10 8.163c1.014 0 1.837.823 1.837 1.837s-.823 1.837-1.837 1.837S8.163 11.014 8.163 10c0-.335.09-.648.248-.918.08.18.26.306.468.306.28 0 .51-.23.51-.51 0-.21-.126-.388-.306-.467.27-.156.583-.247.918-.247z" fill="#f5b822" fill-rule="evenodd"></path></svg> <span>[[userprofile.giftpoints]]</span> <button on-click="earncoinsTap">Earn Coins</button></div><div id="profile-gifts" class="on-white-scroll"><div><a href="#" on-click="giveagiftTap"><svg width="32" height="31" viewBox="0 0 32 31" xmlns="http://www.w3.org/2000/svg"><path d="M19 5.167c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5h-4.167L19 9.333V5.167zm-3 .166v5.334h5.334c2.945 0 5.333-2.388 5.333-5.334C26.667 2.388 24.28 0 21.333 0 18.388 0 16 2.388 16 5.333zM13 5.167c0-1.38-1.12-2.5-2.5-2.5S8 3.787 8 5.167s1.12 2.5 2.5 2.5h4.167L13 9.333V5.167zm3 .166v5.334h-5.334c-2.945 0-5.333-2.388-5.333-5.334C5.333 2.388 7.72 0 10.667 0 13.612 0 16 2.388 16 5.333z" fill-rule="nonzero"></path><path d="M0 11.006C0 9.898.89 9 2.002 9h27.996C31.104 9 32 9.887 32 11.006V16H0v-4.994zM2 18h28v10.997C30 30.103 29.1 31 28.01 31H3.99C2.893 31 2 30.106 2 28.997V18z" fill-rule="evenodd"></path></svg></a></div><dom-repeat items="[[userprofile.gifts]]"><template strip-whitespace=""><div><a href="#" on-click="tapOnGift"><img src="[[item.giftUrl]]" class$="[[convertShow(userprofile)]]"></a></div></template></dom-repeat></div></div><div class="waiting"><div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div></div></div></template><script>class ModalProfile extends Polymer.Element{static get is(){return"tc-modal-profile"}static get properties(){return{chatroom:{type:Object,observer:"chatroomAssigned"},username:String,userprofile:{type:Object,value:null},isLoading:{type:Boolean,value:!1},isError:{type:Boolean,value:!1},modaloptions:{type:Object,value:{closable:!0,escape:!0}},onkeydownHandler:Object}}constructor(a){super(),this.username=a}get app(){return this.chatroom.app}connectedCallback(){super.connectedCallback();this;this.onkeydownHandler=this.onkeydown.bind(this),document.addEventListener("keydown",this.onkeydownHandler)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.onkeydownHandler)}chatroomAssigned(){let a=this,b=this.app.EventBus;a.isError=!1,a.isLoading=!0;let c=this.$["profile-status-avatar"];this.app.GetProfile(this.username,b=>{a.userprofile=b,a.isLoading=!1,c&&c.setAttribute("stroke-dasharray",Math.ceil(352*b.percentToNextAchieve/100)+", 352")},()=>{a.isError=!0,a.isLoading=!1})}open(){this.modeStyle=this.app.setDarkModeCSSclass(this.app.settings.isDarkMode()),this.parentNode instanceof Modal&&this.parentNode.open(ModalProfile.is)}close(){this.parentNode instanceof Modal&&this.parentNode.close(ModalProfile.is,this)}onkeydown(a){a=a||window.event,(27==a.keyCode||"Escape"==a.key||"Esc"==a.key)&&this.parentNode instanceof Modal&&this.parentNode.isopen(ModalProfile.is)&&this.parentNode.close(ModalProfile.is,this)}giveagiftTap(){this.app.GiveAGift(this.userprofile.username)}earncoinsTap(){this.app.EarnCoins()}tapOnGift(){}onUpgrade(){this.app.UpgradeSub()}convertIsShownNoGifts(a){return!(Array.isArray(a)&&0<a.length)}convertSubType(a,b){var c=TinychatApp.BLL.User.getCssClass(a);return b&&(c+=" wait"),c}convertShow(a){var b="";return a instanceof TinychatApp.DAL.UserProfileEntity&&(b="show"),b}convertGender(a){if("F"==a)return"Female";return"M"==a?"Male":""}convertLoc(a){return"string"==typeof a?a.toUpperCase():a}convertUpgrade(a){if(!(a instanceof TinychatApp.DAL.UserProfileEntity))return"";var b="";return a.handle!==this.chatroom.self_handle||TinychatApp.BLL.User.isSubHighest(a.stype)||(b="pencil"),b}convertUpgradeText(a){if(!(a instanceof TinychatApp.DAL.UserProfileEntity))return" ";var b=TinychatApp.BLL.User.getCssClass(a);return""==b&&(b="upgrade"),b}convertInfo(a){if(!(a instanceof TinychatApp.DAL.UserProfileEntity))return"";let b=[],c=this.convertGender(a.gender),d=this.convertLoc(a.location);return 0<a.age&&b.push(a.age),c.isEmpty()||b.push(c),d.isEmpty()||b.push(d),b.join(" \u2022 ")}}customElements.define(ModalProfile.is,ModalProfile);</script></dom-module><dom-module id="tc-modal-reconnect-style" assetpath="../ui/tc-modal-reconnect/"><template><style>#modal-content-reconnect{width:100%;max-width:540px;margin:0 auto;padding:50px 70px 60px;box-sizing:border-box;border-radius:4px;background-color:#fff;}#modal-content-reconnect[data-mode="dark"]{background-color:#202628;}#modal-content-reconnect > *:focus{outline:none;}#modal-content-reconnect > h1{margin:0;padding-bottom:9px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;}#modal-content-reconnect[data-mode="dark"] > h1{color:#fff;}#modal-content-reconnect > span{display:block;padding-bottom:8px;font-size:12px;font-weight:400;color:#262626;line-height:16px;}#modal-content-reconnect[data-mode="dark"] > span{color:#fff;}#modal-content-reconnect > input[type="submit"]{height:40px;width:100%;margin-top:24px;border:none;font-family:inherit;font-size:12px;font-weight:700;color:#fff;letter-spacing:1px;background-color:#41b7ef;cursor:pointer;transition:.2s;-webkit-appearance:none;-moz-appearance:none;appearance:none;}#modal-content-reconnect > input[type="submit"]:hover{background-color:#54ccf3;}#modal-content-reconnect > input[type="submit"]:active{background-color:#38a8dd;}</style></template></dom-module><dom-module id="tc-modal-reconnect" assetpath="../ui/tc-modal-reconnect/"><template strip-whitespace=""><style include="tc-modal-reconnect-style"></style><form id="modal-content-reconnect" data-mode$="[[modeStyle]]" on-submit="onOK"><dom-if if="[[convertReasonShown()]]"><template strip-whitespace=""><h1>[[lastReason]]</h1></template></dom-if><dom-if if="[[!convertReasonShown()]]"><template strip-whitespace=""><h1>Connection lost</h1></template></dom-if><span id="reconnect-text">Connection to the room was interrupted. Retrying to connect in [[waits]]...</span><dom-if if="[[!isManualReconnectExceeded()]]"><template strip-whitespace=""><input type="submit" value$="[[actionText]]"></template></dom-if></form></template><script>class ModalReconnect extends Polymer.Element{static get is(){return"tc-modal-reconnect"}static get MANUAL_RECONNECT_LIMIT(){return 10}static get properties(){return{chatroom:{type:Object,observer:"chatroomAssigned"},tries:Number,waitms:Number,timems:Number,timerid:Number,waits:{type:String,computed:"format(waitms, timems)"},lastReason:{type:String,computed:"convertReason(chatroom)"},actionText:{type:String,computed:"convertAction(chatroom)"}}}constructor(){super()}get app(){return this.chatroom.app}connectedCallback(){super.connectedCallback()}open(){this.modeStyle=this.app.setDarkModeCSSclass(this.app.settings.isDarkMode()),this.parentNode instanceof Modal&&this.parentNode.open(ModalReconnect.is)}close(){this.parentNode instanceof Modal&&this.parentNode.close(ModalReconnect.is,this),this.stop()}format(a,b){return void 0==b&&(b=0),new String(Math.floor((a-b)/1e3))}onOK(a){if(a.preventDefault(),!this.isManualReconnectExceeded())return this.chatroom.manualReconnectTryouts++,25===this.chatroom.closedLastReasonCode&&this.chatroom.app.UpgradeSub(),3===this.chatroom.closedLastReasonCode?this.chatroom.app.Login(this.chatroom.closedLastReasonCode):this.retry(),!1}retry(){this.stop(),this.chatroom.Reconnect()}start(){let a=this,b=1e3;this.timems=0,this.timerid=setInterval(()=>{a.timems+=b,a.timems+b>=a.waitms&&a.stop()},b)}stop(){clearInterval(this.timerid),this.timerid=0}chatroomAssigned(a){if(!this.convertReasonShown()&&3>a.autoReconnectTryouts){a.autoReconnectTryouts++,a.autoReconnectPeriod*=2;let b=setInterval(()=>{if(window._gaq){clearInterval(b);let c=new Date,d=window._gaq;d.push(["_setCustomVar",5,"Endpoint",a.wsEndpoint,3]),d.push(["_setCustomVar",6,"Datetime",c.toString(),3]),d.push(["_setCustomVar",7,"Room",a.chatroomName(),3]),d.push(["_setCustomVar",8,"User",a.selfUser().username,3]),d.push(["_setCustomVar",9,"Reason",a.packetWorker.tcSocket.closedReasonStr,3]),d.push(["_trackEvent","Connections","Lost"]),this.retry()}},a.autoReconnectPeriod)}a.reconnect_timer?(this.$["reconnect-text"].style.display="",this.start()):this.$["reconnect-text"].style.display="none"}convertReasonShown(){return 0<this.chatroom.closedLastReasonCode}convertReason(a){return TinychatApp.BLL.RoomQuitEvent.ConvertReason(a.closedLastReasonCode)}convertAction(a){return TinychatApp.BLL.RoomQuitEvent.ConvertAction(a.closedLastReasonCode)}isManualReconnectExceeded(){return this.chatroom.manualReconnectTryouts>ModalReconnect.MANUAL_RECONNECT_LIMIT}}customElements.define(ModalReconnect.is,ModalReconnect);</script></dom-module><dom-module id="tc-modal-roomshare-style" assetpath="../ui/tc-modal-roomshare/"><template><style>#modal-content-roomshare{position:relative;width:100%;max-width:540px;margin:0 auto;padding:50px 70px 60px;box-sizing:border-box;border-radius:4px;background-color:#fff;}#modal-content-roomshare[data-mode="dark"]{background-color:#202628;}#modal-content-roomshare > *:focus,
  94. #share > *:focus{outline:none;}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;}#close-button > path{transition:.2s;}#close-button:hover > path{fill:#41b7ef;}#close-button:active > path{fill:#38a8dd;}#modal-content-roomshare > h1{margin:0;padding-bottom:40px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;}#modal-content-roomshare[data-mode="dark"] > h1{color:#fff;}#modal-content-roomshare > #share > input[type="text"]{height:40px;width:100%;margin-right:10px;padding:0 13px;border:1px solid #c5d5dc;box-sizing:border-box;background-color:#fff;font-family:inherit;font-size:16px;font-weight:600;color:#414141;line-height:38px;letter-spacing:.5px;transition:.2s;}#modal-content-roomshare > #share{display:flex;flex-direction:row;align-items:stretch;width:100%;}#button-twitter,
  95. #button-facebook,
  96. #button-copy-link{display:block;height:40px;width:100%;border:1px solid transparent;box-sizing:border-box;font-size:12px;font-weight:700;color:#fff;letter-spacing:1px;line-height:38px;text-align:center;text-transform:uppercase;cursor:pointer;transition:.2s;}#button-copy-link{width:auto;padding:0 16px;border-color:#41b7ef;color:#41b7ef;background-color:#fff;white-space:nowrap;}#button-copy-link:hover{color:#fff;background-color:#41b7ef;}#button-twitter,
  97. #button-facebook{margin-top:24px;}#button-twitter{border-color:#00a2f4;background-color:#00a2f4;}#button-twitter:hover{background-color:#fff;color:#00a2f4;}#button-facebook{border-color:#3f69b4;background-color:#3f69b4;}#button-facebook:hover{background-color:#fff;color:#3f69b4;}@media screen and (max-width: 600px){#modal-content-roomshare{padding-right:30px;padding-left:30px;}#modal-content-roomshare > #share{display:block;}#modal-content-roomshare > #share > input[type="text"]{margin-right:0;}#button-copy-link{width:100%;margin-top:10px;-webkit-appearance:none;-moz-appearance:none;appearance:none;}}</style></template></dom-module><dom-module id="tc-modal-roomshare" assetpath="../ui/tc-modal-roomshare/"><template strip-whitespace=""><style include="tc-modal-roomshare-style"></style><form id="modal-content-roomshare" data-mode$="[[modeStyle]]" on-submit="onOK"><svg id="close-button" on-click="close" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><h1>Invite your friends to this chatroom</h1><div id="share"><input id="input-link" type="text" autocomplete="off" readonly="" value="[[roomshare_url]]"> <button id="button-copy-link" on-click="copy">COPY LINK</button></div></form></template><script>class ModalDialogRoomShare extends Polymer.Element{static get is(){return"tc-modal-roomshare"}static get properties(){return{chatroom:{type:Object,observer:"chatroomAssigned"},roomshare_url:String,onkeydownHandler:Object}}constructor(){super()}get app(){return this.chatroom.app}connectedCallback(){super.connectedCallback();this;this.onkeydownHandler=this.onkeydown.bind(this),document.addEventListener("keydown",this.onkeydownHandler)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.onkeydownHandler)}chatroomAssigned(){let a=this,b=this.chatroom.app.EventBus;a.set("roomshare_url",window.location.href);let c=a.$["input-link"];setTimeout(()=>{a._setTextCursor(c,c.value.length)},0)}_setTextCursor(a,b){var a="string"==typeof a||a instanceof String?document.getElementById(a):a;if(!a)return!1;if(a.setSelectionRange)return a.focus(),a.setSelectionRange(b,b),!0;if(a.createTextRange){a.focus();var c=a.createTextRange();return c.collapse(!0),c.moveStart("character",b),c.moveEnd("character",0),c.select(),!0}return!1}open(){this.modeStyle=this.app.setDarkModeCSSclass(this.app.settings.isDarkMode()),this.parentNode instanceof Modal&&this.parentNode.open(ModalDialogRoomShare.is)}close(){this.parentNode instanceof Modal&&this.parentNode.close(ModalDialogRoomShare.is,this)}onkeydown(a){a=a||window.event,(27==a.keyCode||"Escape"==a.key||"Esc"==a.key)&&this.parentNode instanceof Modal&&this.parentNode.isopen(ModalDialogRoomShare.is)&&this.close()}onOK(a){return a.preventDefault(),!1}copy(){let a=this.$["input-link"];try{a.select();var b=document.execCommand("copy");b?this.app.showToast("Chatroom URL has been copied to clipboard."):this.app.showToastWarn("Oops, unable to copy")}catch(a){this.app.showToastWarn("Oops, unable to copy")}this.close()}facebook(){this.app.showToastWarn("share via facebook is not impl."),this.close()}twitter(){this.app.showToastWarn("share via twitter is not impl."),this.close()}}customElements.define(ModalDialogRoomShare.is,ModalDialogRoomShare);</script></dom-module><dom-module id="tc-modal-settings-style" assetpath="../ui/tc-modal-settings/"><template><style>*{user-select:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;}#modal-content-settings{position:relative;width:100%;max-width:400px;margin:0 auto;padding:50px 70px 60px;box-sizing:border-box;border-radius:4px;background-color:#fff;}#modal-content-settings[data-mode="dark"]{background-color:#202628;}#modal-content-settings *:focus{outline:none;}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;}#close-button > path{transition:.2s;}#close-button:hover > path{fill:#41b7ef;}#close-button:active > path{fill:#38a8dd;}#modal-content-settings > h1{margin:0;padding-bottom:40px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;cursor:default;}#modal-content-settings[data-mode="dark"] > h1{color:#fff;}#modal-content-settings > div{position:relative;width:100%;padding:0 40px 25px 0;box-sizing:border-box;text-align:left;}#modal-content-settings > div > label{display:inline-block;max-width:100%;font-size:12px;font-weight:600;color:#414141;line-height:16px;white-space:nowrap;text-transform:uppercase;text-overflow:ellipsis;overflow:hidden;cursor:pointer;}#modal-content-settings > div > label:before{content:'';position:absolute;display:block;height:16px;width:30px;top:0;right:0;border-radius:8px;background-color:#c2c9cb;transition:.2s;}#modal-content-settings[data-mode="dark"] > div > label{color:#fff;}#modal-content-settings > div > input:checked + label:before{background-color:#41b7ef;}#modal-content-settings > div > label:after{content:'';position:absolute;display:block;height:10px;width:10px;top:3px;right:3px;border-radius:100%;background-color:#fff;transition:.2s;}#modal-content-settings > div > input:checked + label:after{right:17px;}#modal-content-settings > div > input{display:none;}#modal-content-settings > #buttons{display:flex;flex-direction:row;align-items:stretch;width:100%;white-space:nowrap;}#modal-content-settings > #buttons > *:first-child{margin-right:20px;}#buttons > button{display:block;height:40px;width:100%;border:1px solid #41b7ef;box-sizing:border-box;font-size:12px;font-weight:700;color:#41b7ef;background-color:#fff;line-height:38px;text-align:center;text-transform:uppercase;cursor:pointer;transition:.2s;-webkit-appearance:none;-moz-appearance:none;appearance:none;}#buttons > button:hover{background-color:#d6f2ff;}#buttons > button:active{background-color:#c7e8f8;}#buttons > button + button{border-color:transparent;color:#fff;background-color:#41b7ef;}#buttons > button + button:hover{background-color:#54ccf3;}#buttons > button + button:active{background-color:#38a8de;}#modal-content-settings > .modal-content-settings-info{padding:40px 0 0;text-align:center;}#modal-content-settings > .modal-content-settings-info + .modal-content-settings-info{padding-top:24px;}.modal-content-settings-info > button{display:inline-block;margin:0;padding:0;border:0;font-size:12px;font-weight:600;color:#3cafe1;background:none;line-height:16px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;}.modal-content-settings-info > button:hover{text-decoration:underline;}.modal-content-settings-info > span{font-size:12px;color:#262626;line-height:16px;cursor:default;}[data-mode="dark"] .modal-content-settings-info > span{color:#7b868a;}</style></template></dom-module><dom-module id="tc-modal-settings" assetpath="../ui/tc-modal-settings/"><template strip-whitespace=""><style include="tc-modal-settings-style"></style><form id="modal-content-settings" data-mode$="[[modeStyle]]" on-submit="onOK"><svg id="close-button" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" on-click="close"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><h1>Settings</h1><div><input id="input-checkbox-2" type="checkbox" name="play_youtube_videos" on-change="youtubeChange"> <label for="input-checkbox-2">PLAY YOUTUBE VIDEOS</label></div><div><input id="input-checkbox-3" type="checkbox" name="receive_private_message" on-change="privateChange"> <label for="input-checkbox-3">RECEIVE PRIVATE MESSAGE</label></div><div><input id="input-checkbox-sounds" type="checkbox" name="play_sounds" on-change="soundChange"> <label for="input-checkbox-sounds">NOTIFICATION SOUNDS</label></div><div><input id="input-checkbox-darkmode" type="checkbox" name="dark_mode" on-change="darkModeChange"> <label for="input-checkbox-darkmode">DARK MODE</label></div><span id="buttons"><button id="button-cancel" on-click="cancel">CANCEL</button> <button id="button-save" on-click="save">SAVE</button></span><div class="modal-content-settings-info"><button on-click="onWebsettings">Chatroom Privacy Settings</button></div><div class="modal-content-settings-info"><button on-click="onDevnews">Development News</button></div><div class="modal-content-settings-info"><span>[[version]]</span></div></form></template><script>class ModalDialogSettings extends Polymer.Element{static get is(){return"tc-modal-settings"}static get properties(){return{chatroom:{type:Object,observer:"chatroomAssigned"},enablePMs:{type:String,notify:!0},enableYoutube:{type:String,notify:!0},enableSound:{type:String,notify:!0},сonfirmBans:{type:Boolean,notify:!0},rememberVolume:{type:String,notify:!0},enableAcousticEchoCancelation:{type:String,notify:!0},darkMode:{type:String,notify:!0},version:{type:String,value:"v.1.0.0"},settings_before:Object,onkeydownHandler:Object}}constructor(){super()}get app(){return this.chatroom.app}get settings(){return this.app.settings}connectedCallback(){super.connectedCallback();let a=this.settings.getSettings();this.setProperties({settings_before:a,enablePMs:a.enablePMs,enableYoutube:a.enableYoutube,enableSound:a.enableSound,confirmBans:a.confirmBans,rememberVolume:a.rememberVolume,enableAcousticEchoCancelation:a.enableAcousticEchoCancelation,darkMode:a.darkMode}),this.$["input-checkbox-2"].checked=this.enableYoutube,this.$["input-checkbox-3"].checked=this.enablePMs,this.$["input-checkbox-sounds"].checked=this.enableSound,this.$["input-checkbox-darkmode"].checked=this.darkMode,this.onkeydownHandler=this.onkeydown.bind(this),document.addEventListener("keydown",this.onkeydownHandler)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.onkeydownHandler)}chatroomAssigned(){let a=this,b=this.chatroom.app.EventBus;this.modeStyle=this.app.setDarkModeCSSclass(this.app.settings.isDarkMode()),this.version=this.app.version.title(),b.subscribe(TinychatApp.BLL.SettingsChangedEvent.ID,b=>{a.modeStyle=a.app.setDarkModeCSSclass(b.settingsEntity.darkMode)})}open(){this.parentNode instanceof Modal&&this.parentNode.open(ModalDialogSettings.is)}close(){this.parentNode instanceof Modal&&this.parentNode.close(ModalDialogSettings.is,this)}onkeydown(a){a=a||window.event,(27==a.keyCode||"Escape"==a.key||"Esc"==a.key)&&this.parentNode instanceof Modal&&this.parentNode.isopen(ModalDialogSettings.is)&&this.cancel(a)}onOK(a){return a.preventDefault(),!1}onDevnews(a){return a.preventDefault(),this.app.DevNews(),!1}onWebsettings(a){return a.preventDefault(),this.app.WebSettings(),!1}cancel(){this.settings.saveSettings(this.settings_before),this.close()}save(){this.close()}bansChange(a){this.settings.switchConfirmBan(this._str2bool(a))}youtubeChange(a){this.settings.switchYoutube(this._str2bool(a))}privateChange(a){this.settings.switchPrivatemessaging(this._str2bool(a))}soundChange(a){this.settings.switchSound(this._str2bool(a))}echoChange(a){this.settings.switchAcousticEchoCancelation(this._str2bool(a))}volumeChange(a){this.settings.switchRememberVolume(this._str2bool(a))}darkModeChange(a){this.settings.switchDarkMode(this._str2bool(a))}_str2bool(a){let b=a.path?a.path[0]:(a.composedPath&&a.composedPath())[0];return b.checked}}customElements.define(ModalDialogSettings.is,ModalDialogSettings);</script></dom-module><dom-module id="tc-modal-upgrade-style" assetpath="../ui/tc-modal-upgrade/"><template><style>*{user-select:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;}#modal-content-upgrade{position:relative;width:100%;max-width:540px;margin:0 auto;padding:0 0 60px;border-radius:10px 10px 4px 4px;box-sizing:border-box;background-color:#fff;text-align:center;}#modal-content-upgrade[data-mode="dark"]{background-color:#202628;}#modal-content-upgrade *:focus{outline:none;}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;z-index:1;}#close-button > path{transition:.2s;}#close-button:hover > path{fill:#41b7ef;}#close-button:active > path{fill:#38a8dd;}#modal-content-upgrade > h1{position:relative;margin:0;padding:50px;border-radius:4px 4px 0 0;box-sizing:border-box;font-size:24px;font-weight:400;color:#fff;line-height:33px;background-color:#2f373a;cursor:default;overflow:hidden;}#modal-content-upgrade > h1 > span{position:relative;}#pro-1,
  98. #pro-2,
  99. #pro-3,
  100. #pro-4,
  101. #extreme-1,
  102. #extreme-2,
  103. #extreme-3,
  104. #gold-1,
  105. #gold-2,
  106. #gold-3,
  107. #button-pro-1,
  108. #button-pro-2,
  109. #button-extreme-1,
  110. #button-gold-1{position:absolute;display:block;border-radius:100%;}#pro-1,
  111. #pro-2,
  112. #pro-3,
  113. #pro-4,
  114. #button-pro-1,
  115. #button-pro-2{background-color:#2ecb4e;}#extreme-1,
  116. #extreme-2,
  117. #extreme-3,
  118. #button-extreme-1{background-color:#ad6bce;}#gold-1,
  119. #gold-2,
  120. #gold-3,
  121. #button-gold-1{background-color:#efa701;}#pro-1{height:180px;width:180px;top:-40%;left:-25%;}#pro-2{height:16px;width:16px;top:70%;left:28%;}#pro-3{height:200px;width:200px;top:70%;left:40%;}#pro-4{height:90px;width:90px;top:-7%;left:76%;}#extreme-1{height:90px;width:90px;top:77%;left:6%;}#extreme-2{height:65px;width:65px;top:10%;left:20%;}#extreme-3{height:40px;width:40px;top:-11%;left:97%;}#gold-1{height:35px;width:35px;top:-6%;left:12%;}#gold-2{height:20px;width:20px;top:10%;left:44%;}#gold-3{height:180px;width:180px;top:65%;left:83%;}#modal-content-upgrade-content{position:relative;width:100%;padding:40px 70px 0;box-sizing:border-box;}#modal-content-upgrade-content > div{max-width:300px;margin:0 auto 24px;font-size:12px;color:#262626;line-height:16px;}[data-mode="dark"] #modal-content-upgrade-content > div{color:#fff;}#modal-content-upgrade-content > button{position:relative;display:block;height:40px;width:100%;padding:0 30px;border:none;box-sizing:border-box;font-family:'Open Sans';font-size:12px;font-weight:600;letter-spacing:1px;color:#fff;background-color:#2f373a;cursor:pointer;overflow:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none;}#modal-content-upgrade-content > button > span{position:relative;}#button-pro-1{height:60px;width:60px;top:54%;left:5%;}#button-pro-2{height:37px;width:37px;top:-35%;left:83%;}#button-extreme-1{height:16px;width:16px;top:24%;left:69%;}#button-gold-1{height:100px;width:100px;top:-200%;left:15%;}</style></template></dom-module><dom-module id="tc-modal-upgrade" assetpath="../ui/tc-modal-upgrade/"><template strip-whitespace=""><style include="tc-modal-upgrade-style"></style><div id="modal-content-upgrade" data-mode$="[[modeStyle]]"><svg id="close-button" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" on-click="close"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><h1><div id="pro-1"></div><div id="pro-2"></div><div id="pro-3"></div><div id="pro-4"></div><div id="extreme-1"></div><div id="extreme-2"></div><div id="extreme-3"></div><div id="gold-1"></div><div id="gold-2"></div><div id="gold-3"></div><span>Upgrade your Tinychat membership</span></h1><div id="modal-content-upgrade-content"><div>[[msg]]</div><button on-click="upgrade"><div id="button-pro-1"></div><div id="button-pro-2"></div><div id="button-extreme-1"></div><div id="button-gold-1"></div><span>UPGRADE NOW</span></button></div></div></template><script>class ModalDialogUpgrade extends Polymer.Element{static get is(){return"tc-modal-upgrade"}static get properties(){return{chatroom:{type:Object,observer:"chatroomAssigned"},onkeydownHandler:Object,msg:{type:String,value:"Get high quality video, fullscreen, premium membership badges and more!"}}}constructor(){super()}get app(){return this.chatroom.app}get settings(){return this.app.settings}connectedCallback(){super.connectedCallback(),this.onkeydownHandler=this.onkeydown.bind(this),document.addEventListener("keydown",this.onkeydownHandler)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.onkeydownHandler)}chatroomAssigned(){}open(){this.modeStyle=this.app.setDarkModeCSSclass(this.app.settings.isDarkMode()),this.parentNode instanceof Modal&&this.parentNode.open(ModalDialogUpgrade.is)}close(){this.parentNode instanceof Modal&&this.parentNode.close(ModalDialogUpgrade.is,this)}onkeydown(a){a=a||window.event,(27==a.keyCode||"Escape"==a.key||"Esc"==a.key)&&this.parentNode instanceof Modal&&this.parentNode.isopen(ModalDialogUpgrade.is)&&this.cancel(a)}cancel(){this.close()}upgrade(){this.app.UpgradeSub()}}customElements.define(ModalDialogUpgrade.is,ModalDialogUpgrade);</script></dom-module><dom-module id="tc-modal-youtube-style" assetpath="../ui/tc-modal-youtube/"><template><style>#modal-content-youtube-lists{user-select:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;}.on-white-scroll{padding-left:16px;box-sizing:border-box;overflow-x:hidden;overflow-y:scroll;}.on-white-scroll::-webkit-scrollbar{position:absolute;width:15px;cursor:pointer;}.on-white-scroll::-webkit-scrollbar-track{background-color:#fff;}.on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #fff;border-radius:6px/8px;background-color:rgba(0, 0, 0, .2);}.on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}[data-mode="dark"] .on-white-scroll::-webkit-scrollbar-track{background-color:#202628;}[data-mode="dark"] .on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #202628;background-color:rgba(0, 0, 0, .2);}[data-mode="dark"] .on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}#modal-content-youtube{position:relative;width:100%;max-width:800px;margin:0 auto;box-sizing:border-box;border-radius:4px;background-color:#fff;overflow:hidden;}#modal-content-youtube[data-mode="dark"]{background-color:#202628;}*:focus{outline:none;}#input-playlist,
  122. #input-playlist-label-wrapper{display:none;}#modal-content-youtube-form{position:relative;padding:50px 70px 38px;border-bottom:1px solid rgba(0, 0, 0, .1);}[data-mode="dark"] #modal-content-youtube-form{border-bottom-color:#2d373a;}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;}#close-button > path{transition:.2s;}#close-button:hover > path{fill:#41b7ef;}#close-button:active > path{fill:#38a8dd;}#modal-content-youtube > form > h1{margin:0;padding-bottom:40px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;}#modal-content-youtube[data-mode="dark"] > form > h1{color:#fff;}#modal-content-youtube-search{position:relative;}#modal-content-youtube-search > svg{position:absolute;display:block;bottom:12px;left:12px;}#input-search{height:40px;width:100%;padding:0 40px;border:1px solid #c5d5dc;box-sizing:border-box;background-color:#fff;font-family:inherit;font-size:14px;font-weight:400;color:#414141;text-align:center;line-height:38px;letter-spacing:.5px;transition:.2s;}#input-search:hover,
  123. #input-search:active{border-color:#41b7ef;}#input-search[disabled]{border-color:#c5d5dc;color:#c5d5dc;background-color:#f6f6f6;}#modal-content-youtube-lists{position:relative;display:flex;flex-direction:row;height:420px;width:100%;}#modal-content-youtube-popular-wrapper{position:relative;height:100%;width:100%;}#modal-content-youtube-popular-wrapper:after{content:'';position:absolute;height:40px;bottom:0;left:10px;right:15px;background:-moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);background:-webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);background:linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=0 );pointer-events:none;}[data-mode="dark"] #modal-content-youtube-popular-wrapper:after{background:-moz-linear-gradient(top, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);background:-webkit-linear-gradient(top, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);background:linear-gradient(to bottom, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00202628', endColorstr='#202628', GradientType=0);}#modal-content-youtube-popular{height:100%;width:100%;padding-bottom:30px;padding-left:60px;text-align:left;}#modal-content-youtube-popular-header{display:block;height:62px;padding-top:30px;padding-right:5px;box-sizing:border-box;font-size:16px;font-weight:700;text-align:center;cursor:default;}[data-mode="dark"] #modal-content-youtube-popular-header{color:#fff;}#modal-content-youtube-popular-empty{display:none;padding:20px 5px 20px 0;font-size:14px;text-align:center;cursor:default;}[data-mode="dark"] #modal-content-youtube-popular-empty{color:#fff;}#modal-content-youtube-popular-empty:only-of-type{display:block;}.modal-content-youtube-popular-item{display:inline-block;width:120px;padding:10px;}.modal-content-youtube-popular-item-video{position:relative;height:68px;width:100%;}.modal-content-youtube-popular-item-video > img{height:100%;width:100%;border-radius:4px;}.modal-content-youtube-popular-item-video-play{position:absolute;height:100%;width:100%;top:0;left:0;border-radius:4px;background-color:rgba(0, 0, 0, .7);opacity:0;visibility:hidden;transition:.2s;}.modal-content-youtube-popular-item-video-play > svg{position:absolute;top:50%;left:50%;margin:-14px 0 0 -14px;cursor:pointer;opacity:.8;transition:.2s;}.modal-content-youtube-popular-item-video-play > svg:hover{opacity:1;}.modal-content-youtube-popular-item-video > svg{position:absolute;bottom:6px;right:6px;cursor:pointer;opacity:0;visibility:hidden;transition:.2s;}.modal-content-youtube-popular-item-video:hover > .modal-content-youtube-popular-item-video-play{opacity:1;visibility:visible;}.modal-content-youtube-popular-item-video:hover > svg{opacity:.8;visibility:visible;}.modal-content-youtube-popular-item-video:hover > svg:hover{opacity:1;}.modal-content-youtube-popular-item-text{position:relative;width:100%;height:32px;padding-top:6px;text-align:center;cursor:default;overflow:hidden;}.modal-content-youtube-popular-item-text:after{content:'';position:absolute;display:block;height:16px;width:30px;bottom:0;right:0;background:-moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 50%, rgba(255,255,255,1) 100%);background:-webkit-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%,rgba(255,255,255,1) 100%);background:linear-gradient(to right, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%,rgba(255,255,255,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=1 );}[data-mode="dark"] .modal-content-youtube-popular-item-text:after{background:-moz-linear-gradient(top, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);background:-webkit-linear-gradient(top, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);background:linear-gradient(to bottom, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00202628', endColorstr='#202628', GradientType=0);}.modal-content-youtube-popular-item-text > span{font-size:12px;color:#262626;line-height:16px;cursor:default;}#modal-content-youtube-playlist{position:relative;display:flex;flex-direction:column;height:100%;width:300px;min-width:300px;border-radius:0 0 4px 0;background-color:#f6f6f6;overflow:hidden;transition:top .8s;}[data-mode="dark"] #modal-content-youtube-playlist{background-color:#202628;}#modal-content-youtube-playlist:after{content:'';position:absolute;height:40px;bottom:0;left:0;right:15px;background:-moz-linear-gradient(top, rgba(246,246,246,0) 0%, rgba(246,246,246,1) 100%);background:-webkit-linear-gradient(top, rgba(246,246,246,0) 0%,rgba(246,246,246,1) 100%);background:linear-gradient(to bottom, rgba(246,246,246,0) 0%,rgba(246,246,246,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00f6f6f6', endColorstr='#f6f6f6',GradientType=0 );pointer-events:none;}[data-mode="dark"] #modal-content-youtube-playlist:after{background:-moz-linear-gradient(top, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);background:-webkit-linear-gradient(top, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);background:linear-gradient(to bottom, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00202628', endColorstr='#202628', GradientType=0);}#modal-content-youtube-playlist-header{height:62px;min-height:62px;width:100%;font-size:0;background-color:#f6f6f6;}[data-mode="dark"] #modal-content-youtube-playlist-header{background-color:#202628;}#modal-content-youtube-playlist-header > button{position:absolute;height:30px;width:30px;top:16px;left:33.33%;margin-left:-15px;padding:0;border:none;background:none;line-height:30px;text-align:center;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;}#modal-content-youtube-playlist-header > button + button{left:66.66%;}#modal-content-youtube-playlist-header > button > svg{vertical-align:middle;}#modal-content-youtube-playlist-header > button > svg > path{transition:.2s;}#modal-content-youtube-playlist-header > button:hover > svg > path{fill:#cddde4;}#modal-content-youtube-playlist-header > button.active > svg > path{fill:#41b7ef;}#modal-content-youtube-playlist-items{position:relative;height:100%;padding-bottom:22px;}#modal-content-youtube-playlist-empty{display:none;padding:20px 0 20px 15px;font-size:14px;text-align:center;cursor:default;}[data-mode="dark"] #modal-content-youtube-playlist-empty{color:#fff;}#modal-content-youtube-playlist-empty:only-of-type{display:block;}#modal-content-youtube-playlist-items.on-white-scroll{padding-left:0;}#modal-content-youtube-playlist-items.on-white-scroll::-webkit-scrollbar-track{background-color:#f6f6f6;}#modal-content-youtube-playlist-items.on-white-scroll::-webkit-scrollbar-thumb{border-color:#f6f6f6;}[data-mode="dark"] #modal-content-youtube-playlist-items.on-white-scroll::-webkit-scrollbar-track{background-color:#202628;}[data-mode="dark"] #modal-content-youtube-playlist-items.on-white-scroll::-webkit-scrollbar-thumb{border-color:#202628;background-color:rgba(0, 0, 0, .2);}[data-mode="dark"] #modal-content-youtube-playlist-items.on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}.modal-content-youtube-playlist-item{position:relative;height:65px;width:100%;margin-bottom:2px;padding:8px 35px 9px 104px;box-sizing:border-box;line-height:48px;text-align:left;transition:.2s;}.modal-content-youtube-playlist-item:hover{background-color:#fff;}[data-mode="dark"] .modal-content-youtube-playlist-item:hover{background-color:#202628;}.modal-content-youtube-playlist-item-video{position:absolute;height:45px;width:80px;top:10px;left:16px;}.modal-content-youtube-playlist-item-video > img{height:100%;width:100%;border-radius:4px;}.modal-content-youtube-playlist-item-video-play{position:absolute;height:100%;width:100%;top:0;left:0;border-radius:4px;background-color:rgba(0, 0, 0, .7);opacity:0;visibility:hidden;transition:.2s;}.modal-content-youtube-playlist-item-video:hover > .modal-content-youtube-playlist-item-video-play{opacity:1;visibility:visible;}.modal-content-youtube-playlist-item-video-play > svg{position:absolute;top:50%;left:50%;margin:-8px 0 0 -8px;cursor:pointer;opacity:.8;transition:.2s;}.modal-content-youtube-playlist-item-video-play > svg:hover{opacity:1;}.modal-content-youtube-playlist-item-text{display:inline-block;max-height:100%;font-size:12px;color:#262626;line-height:16px;text-align:left;vertical-align:middle;overflow:hidden;cursor:default;}.modal-content-youtube-playlist-item-close{position:absolute;height:100%;width:120px;top:0;right:5px;background:-moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 50%, rgba(255,255,255,1) 100%);background:-webkit-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%,rgba(255,255,255,1) 100%);background:linear-gradient(to right, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%,rgba(255,255,255,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=1 );font-size:0;opacity:0;visibility:hidden;transition:.2s;}[data-mode="dark"] .modal-content-youtube-playlist-item-close{background:-moz-linear-gradient(top, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 50%, rgba(32,38,40,1) 100%);background:-webkit-linear-gradient(top, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 50%, rgba(32,38,40,1) 100%);background:linear-gradient(to bottom, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 50%, rgba(32,38,40,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00202628', endColorstr='#202628', GradientType=0);}.modal-content-youtube-playlist-item:hover > .modal-content-youtube-playlist-item-close{opacity:1;visibility:visible;}.modal-content-youtube-playlist-item-close > button{position:absolute;height:20px;width:20px;top:50%;right:23px;margin:-10px 0 0 0;padding:4px;border:none;box-sizing:border-box;background-color:transparent;line-height:20px;text-align:center;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;}.modal-content-youtube-playlist-item-close > button > svg{vertical-align:top;}#modal-content-youtube-popular-wrapper > .waiting,
  124. #modal-content-youtube-playlist > .waiting{position:absolute;width:auto;top:0;bottom:0;left:0;right:0;border-radius:0 0 0 4px;background-color:#fff;opacity:0;visibility:hidden;transition:.2s;}#modal-content-youtube-playlist > .waiting{border-radius:0 0 4px 0;background-color:#f6f6f6;}[data-mode="dark"] #modal-content-youtube-popular-wrapper > .waiting,
  125. [data-mode="dark"] #modal-content-youtube-playlist > .waiting{background-color:#202628;}#modal-content-youtube-popular-wrapper.wait > .waiting,
  126. #modal-content-youtube-playlist.wait > .waiting{opacity:1;visibility:visible;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #cacece;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite paused;-webkit-animation:waiting 1s ease-in-out 0s infinite paused;}#modal-content-youtube-playlist > .waiting > .waiting-content > span{border-color:#cacece;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}#modal-content-youtube-popular-wrapper.wait > .waiting > .waiting-content > span,
  127. #modal-content-youtube-playlist.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@media screen and (max-width: 815px){#modal-content-youtube-popular-header,
  128. #modal-content-youtube-popular-empty{padding-right:0;}#modal-content-youtube-popular{padding-left:15px;text-align:center;}}@media screen and (max-width: 630px){#modal-content-youtube-form{padding-right:25px;padding-left:25px;}#modal-content-youtube-lists{display:block;padding-bottom:40px;box-sizing:border-box;}#input-playlist-label-wrapper{position:absolute;display:block;height:40px;width:100%;left:0;background-color:#fff;z-index:1;}[data-mode="dark"] #input-playlist-label-wrapper{background-color:#202628;}#input-playlist-label-wrapper > label{position:absolute;height:20px;width:20px;top:10px;left:50%;margin-left:-10px;cursor:pointer;}#input-playlist-label-wrapper > label:before,
  129. #input-playlist-label-wrapper > label:after{content:'';position:absolute;display:block;height:3px;width:100%;top:2px;left:0;border-radius:3px;background-color:#04caff;transform-origin:50% 50%;transition:top .4s ease .4s,
  130. transform .4s ease 0s;}#input-playlist-label-wrapper > label:after{top:16px;}#input-playlist:checked + #input-playlist-label-wrapper > label:before,
  131. #input-playlist:checked + #input-playlist-label-wrapper > label:after{top:9px;transform:rotate(45deg);-webkit-transform:rotate(45deg);transition:top .4s ease 0s,
  132. transform .4s ease .4s;}#input-playlist:checked + #input-playlist-label-wrapper > label:after{transform:rotate(-45deg);-webkit-transform:rotate(-45deg);}#input-playlist-label-wrapper > label > span{position:absolute;display:block;height:3px;width:100%;top:9px;left:0;border-radius:3px;background-color:#04caff;transition:opacity 0s ease .4s;}#input-playlist:checked + #input-playlist-label-wrapper > label > span{opacity:0;}#modal-content-youtube-playlist{position:absolute;height:380px;width:100%;top:380px;}#input-playlist:checked ~ #modal-content-youtube-playlist{top:0;}}</style></template></dom-module><dom-module id="tc-modal-youtube" assetpath="../ui/tc-modal-youtube/"><template strip-whitespace=""><style include="tc-modal-youtube-style"></style><div id="modal-content-youtube" data-mode$="[[modeStyle]]"><form id="modal-content-youtube-form" on-submit="onSearch"><svg id="close-button" on-click="close" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><h1>YouTube Video Selection</h1><div id="modal-content-youtube-search"><svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M12.108 10.75l3.61 3.61a.957.957 0 0 1 0 1.357.963.963 0 0 1-1.357.002l-3.61-3.61a6.723 6.723 0 1 1 1.358-1.36zm-5.385.776a4.802 4.802 0 1 0 0-9.605 4.802 4.802 0 0 0 0 9.606z" fill="#c4d4dc" fill-rule="evenodd"></path></svg> <input id="input-search" type="text" placeholder="Search for videos or enter a YouTube URL" maxlength="150" value="" on-click="onInput"></div></form><div id="modal-content-youtube-lists"><div id="modal-content-youtube-popular-wrapper" class=""><div id="modal-content-youtube-popular" class="on-white-scroll"><span id="modal-content-youtube-popular-header">[[title_results]]</span><div id="modal-content-youtube-popular-empty">List is empty</div><dom-repeat items="[[_queryresult]]"><template strip-whitespace=""><div class="modal-content-youtube-popular-item"><div class="modal-content-youtube-popular-item-video"><img src="[[item.imgurl]]" alt="img"><div class="modal-content-youtube-popular-item-video-play"><svg on-click="onPlayItem" width="28" height="28" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg"><path d="M0 2.67C0 .398 1.608-.62 3.586.394l22.93 11.766c1.98 1.016 1.978 2.664 0 3.68L3.586 27.606c-1.98 1.015-3.586 0-3.586-2.28V2.67z" fill="#fff" fill-rule="evenodd"></path></svg></div><svg on-click="onAdd2Playlist" width="18" height="18" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><path d="M10 8V5H8v3H5v2h3v3h2v-3h3V8h-3zM9 18A9 9 0 1 1 9 0a9 9 0 0 1 0 18z" fill="#fff" fill-rule="evenodd"></path></svg></div><div class="modal-content-youtube-popular-item-text"><span title="[[item.title]]">[[item.title]]</span></div></div></template></dom-repeat></div><div class="waiting"><div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div></div></div><input id="input-playlist" type="checkbox"><div id="input-playlist-label-wrapper"><label for="input-playlist"><span></span></label></div><div id="modal-content-youtube-playlist" class=""><div id="modal-content-youtube-playlist-header"><button id="btnRandom" on-click="onRandomToggle"><svg width="26" height="24" viewBox="0 0 26 24" xmlns="http://www.w3.org/2000/svg"><path d="M25.61 18.846c.233.203.39.49.39.823 0 .332-.154.618-.385.82l-3.188 3.193a1.078 1.078 0 0 1-1.53-.008 1.104 1.104 0 0 1 .008-1.55l1.384-1.388c-3.867-.273-7.564-4.037-11.146-7.692-3.402-3.477-6.923-7.07-10.05-7.07a1.09 1.09 0 0 1-1.08-1.097 1.09 1.09 0 0 1 1.08-1.096c4.03 0 7.87 3.924 11.588 7.72 3.223 3.29 6.548 6.682 9.546 7.036l-1.323-1.324a1.102 1.102 0 0 1-.01-1.55 1.07 1.07 0 0 1 1.53-.008l3.186 3.19zm-11.734-7.8c-.275 0-.55-.105-.76-.316a1.105 1.105 0 0 1-.01-1.55c3.328-3.406 6.186-5.702 9.197-5.906l-1.397-1.4a1.102 1.102 0 0 1-.01-1.548 1.072 1.072 0 0 1 1.53-.01l3.186 3.19c.23.203.387.49.387.824 0 .333-.155.62-.388.822l-3.186 3.193a1.075 1.075 0 0 1-1.53-.008 1.103 1.103 0 0 1 .006-1.55L22.2 5.49c-2.42.312-5.05 2.67-7.553 5.23-.21.22-.49.327-.77.327zM8.45 13.47a1.073 1.073 0 0 1 1.53.014 1.105 1.105 0 0 1-.014 1.55c-2.58 2.562-5.653 5.184-8.884 5.184A1.09 1.09 0 0 1 0 19.12a1.09 1.09 0 0 1 1.082-1.095c2.453 0 5.1-2.303 7.37-4.557z" fill="#c4d4dc"></path></svg></button> <button id="btnCycle" on-click="onCycleToggle"><svg width="28" height="22" viewBox="0 0 28 22" xmlns="http://www.w3.org/2000/svg"><path d="M7.908.008c.385.044.714.313.854.696.14.383.066.816-.19 1.124L6.935 3.872h16.917C26.324 3.872 28 6.037 28 8.268v6.595c.005.397-.19.766-.514.965-.323.2-.723.2-1.046 0-.323-.2-.52-.568-.514-.965V8.268c0-1.142-.692-2.198-2.074-2.198H6.935l1.637 2.027c.242.3.314.715.19 1.087a1.06 1.06 0 0 1-.797.714 1.01 1.01 0 0 1-.98-.376L3.872 5.675a1.15 1.15 0 0 1 0-1.425L6.983.403A1.01 1.01 0 0 1 7.91.008zM1.15 6.053c.534.062.935.547.923 1.116v6.594c0 1.143.692 2.2 2.074 2.2h16.917l-1.637-2.045c-.284-.34-.34-.832-.143-1.235a1.025 1.025 0 0 1 1.034-.587c.273.03.523.17.697.395l3.11 3.847c.33.41.33 1.015 0 1.426l-3.11 3.847a1 1 0 0 1-1.464.126 1.15 1.15 0 0 1-.123-1.553l1.637-2.026H4.148C1.676 18.16 0 15.997 0 13.765V7.17c-.006-.316.116-.62.337-.834a1 1 0 0 1 .814-.282z" fill="#c4d4dc"></path></svg></button></div><div id="modal-content-youtube-playlist-items" class="on-white-scroll"><div id="modal-content-youtube-playlist-empty">List is empty</div><dom-repeat items="[[_playlist]]"><template strip-whitespace=""><div class="modal-content-youtube-playlist-item"><div class="modal-content-youtube-playlist-item-video"><img src="[[item.imgurl]]" alt="img"><div class="modal-content-youtube-playlist-item-video-play"><svg on-click="onPlayItem4Playlist" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M0 1.526c0-1.3.92-1.882 2.05-1.3l13.102 6.722c1.13.58 1.13 1.523 0 2.103L2.05 15.776c-1.133.58-2.05 0-2.05-1.302V1.526z" fill="#fff" fill-rule="evenodd"></path></svg></div></div><div class="modal-content-youtube-playlist-item-text" title="[[item.title]]">[[item.title]]</div><div class="modal-content-youtube-playlist-item-close"><button on-click="onRemove4Playlist"><svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0z" fill="#e53951" fill-rule="evenodd"></path></svg></button></div></div></template></dom-repeat></div><div class="waiting"><div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div></div></div></div></div></template><script>class ModalDialogYoutube extends Polymer.Element{static get is(){return"tc-modal-youtube"}static get properties(){return{chatroom:{type:Object,observer:"chatroomAssigned"},_queryresult:{type:Array,value:[]},_playlist:{type:Array,value:[]},title_results:{type:Array,value:"Most Popular Today"},israndom:{type:Boolean,value:!1,observer:"israndomObserver"},iscycle:{type:Boolean,value:!1,observer:"iscycleObserver"},onkeydownHandler:Object}}constructor(){super()}get _yt_api_key(){return"AIzaSyCPQe4gGZuyVQ78zdqf9O5iEyfVLPaRwZg"}get _api(){return WebAPI.getInstance()}get app(){return this.chatroom.app}get settings(){return this.app.settings}connectedCallback(){super.connectedCallback(),this.onkeydownHandler=this.onkeydown.bind(this),document.addEventListener("keydown",this.onkeydownHandler)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.onkeydownHandler)}chatroomAssigned(a){let b=this,c=this.$["modal-content-youtube-playlist"];c.classList.add("wait"),a.YoutubePlaylistLoad(()=>{b._playlist=Array.from(b.chatroom.youtubelist),b.israndom=b.chatroom.youtubelist_random,b.iscycle=b.chatroom.youtubelist_repeat,c.classList.remove("wait")}),this.onSearch(new Event("most-popular"))}open(){this.modeStyle=this.app.setDarkModeCSSclass(this.app.settings.isDarkMode()),this.parentNode instanceof Modal&&this.parentNode.open(ModalDialogYoutube.is)}close(){this.parentNode instanceof Modal&&this.parentNode.close(ModalDialogYoutube.is,this)}onkeydown(a){a=a||window.event,(27==a.keyCode||"Escape"==a.key||"Esc"==a.key)&&this.parentNode instanceof Modal&&this.parentNode.isopen(ModalDialogYoutube.is)&&this.close(a)}onSearch(a){a.preventDefault();let b=this,c=TinychatApp.DAL.YoutubeItem,d=this.$["modal-content-youtube-popular-wrapper"],e=this.$["input-search"],f=e.value;d.classList.add("wait"),e.classList.remove("error");let g=document.createAttribute("disabled");e.setAttributeNode(g);let h={key:this._yt_api_key,maxResults:50},i="";return f.isEmpty()?(i="https://www.googleapis.com/youtube/v3/videos",h.chart="mostPopular",h.part="snippet,contentDetails,status",h.fields="items(id,snippet(title,thumbnails(medium)),contentDetails(duration),status(embeddable))"):(i="https://www.googleapis.com/youtube/v3/search",h.q=f,h.type="video",h.part="snippet"),this._api.wsj({method:"GET",params:h,src:i}).then(a=>{let g=a.items,h=[];for(let d in g){let a=g[d],e=a.status;if(void 0===e||!0===e.embeddable){let d=new c;d.id="object"===typeof a.id?a.id.videoId:a.id;let e=a.contentDetails;void 0!=e&&(d.duration=b.YTDurationToSeconds(e.duration));let f=a.snippet;d.title=f.title,d.imgurl=f.thumbnails.medium.url,h.push(d)}}b._queryresult=h,d.classList.remove("wait"),e.removeAttribute("disabled"),b.title_results=f.isEmpty()?"Most Popular Today":"Results for '"+f+"'"}).catch(a=>{d.classList.remove("wait"),e.removeAttribute("disabled"),e.classList.add("error"),console.error(a)}),!1}onInput(){let a=this.$["input-search"];a.classList.remove("error")}onPlayItem(a){let b=this,c=TinychatApp.BLL.YoutubeEvent,d=new c(c.YT_PLAY);d.id=a.model.item.id,d.handle=this.chatroom.self_handle,d.title=a.model.item.title,d.duration==void 0?b._get_duration_item(d,a=>{this.chatroom.Youtube(a),setTimeout(()=>{b.close()},150)}):(this.chatroom.Youtube(d),setTimeout(()=>{b.close()},150))}onPlayItem4Playlist(a){let b=this,c=TinychatApp.BLL.YoutubeEvent,d=new c(c.YT_PLAY);d.id=a.model.item.id,d.handle=this.chatroom.self_handle,d.playlist=!0,d.title=a.model.item.title,d.duration==void 0?b._get_duration_item(d,a=>{this.chatroom.Youtube(a),setTimeout(()=>{b.close()},150)}):(this.chatroom.Youtube(d),setTimeout(()=>{b.close()},150))}onAdd2Playlist(a){let b=this,c=a.model.item,d=this._find_playlist_item(c);if(-1===d){let a=a=>{b.chatroom.youtubelist.push(a),b._playlist=Array.from(b.chatroom.youtubelist)};c.duration==void 0?b._get_duration_item(c,c=>{a(c),b.chatroom.YoutubePlaylistAdd(c,()=>{})}):(a(c),b.chatroom.YoutubePlaylistAdd(c,()=>{}))}}onClearPlaylist(){let a=this,b=this.$["modal-content-youtube-playlist"];b.classList.add("wait"),this.chatroom.YoutubePlaylistClear(()=>{a.chatroom.youtubelist=[],a._playlist=Array.from(a.chatroom.youtubelist),b.classList.remove("wait")})}_find_playlist_item(a){for(let b in this._playlist)if(a.id==this._playlist[b].id)return this._playlist.indexOf(this._playlist[b]);return-1}_get_duration_item(a,b){let c=this.$["input-search"],d=this,e={id:a.id,key:this._yt_api_key,part:"snippet,contentDetails,status",fields:"items(id,snippet(title,thumbnails(medium)),contentDetails(duration),status(embeddable))"};this._api.wsj({method:"GET",params:e,src:"https://www.googleapis.com/youtube/v3/videos"}).then(c=>{let e=c.items,f=e[0],g=f.contentDetails;g!=void 0&&(a.duration=d.YTDurationToSeconds(g.duration)),b(a)}).catch(a=>{c.classList.add("error"),console.error(a)})}onRemove4Playlist(a){let b=this._find_playlist_item(a.model.item);if(0<=b){let a=this._playlist.splice(b,1);this._playlist=Array.from(this._playlist),this.chatroom.youtubelist=this._playlist,this.chatroom.YoutubePlaylistRemove(a[0],()=>{})}}onRandomToggle(){this.chatroom.youtubelist_random=!this.chatroom.youtubelist_random,this.israndom=this.chatroom.youtubelist_random,this.chatroom.YoutubePlaylistMode(this.israndom,this.iscycle,()=>{})}onCycleToggle(){this.chatroom.youtubelist_repeat=!this.chatroom.youtubelist_repeat,this.iscycle=this.chatroom.youtubelist_repeat,this.chatroom.YoutubePlaylistMode(this.israndom,this.iscycle,()=>{})}israndomObserver(a){a?this.$.btnRandom.classList.add("active"):this.$.btnRandom.classList.remove("active")}iscycleObserver(a){a?this.$.btnCycle.classList.add("active"):this.$.btnCycle.classList.remove("active")}YTDurationToSeconds(a){let b,c=/^PT(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?$/,d=0,e=0,f=0;if(c.test(a)){let g=c.exec(a);g[1]&&(d=+g[1]),g[2]&&(e=+g[2]),g[3]&&(f=+g[3]),b=3600*d+60*e+f}return b}convertLiClass(a){let b="";return a.isDeleting&&(b+=" hidden"),b}}customElements.define(ModalDialogYoutube.is,ModalDialogYoutube);</script></dom-module><dom-module id="tc-video-preview-style" assetpath="../ui/tc-video-preview/"><template><style>*:focus{outline:none;}.on-white-scroll{padding-left:16px;box-sizing:border-box;overflow-x:hidden;overflow-y:scroll;}.on-white-scroll::-webkit-scrollbar{position:absolute;width:15px;cursor:pointer;}.on-white-scroll::-webkit-scrollbar-track{background-color:#fff;}.on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #fff;border-radius:6px/8px;background-color:rgba(0, 0, 0, .2);}.on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}.video{position:relative;width:100%;padding:0;box-sizing:border-box;font-size:0;overflow:hidden;}.video > div{position:relative;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNjQiIHZpZXdCb3g9IjAgMCA0OCA2NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGZpbGw9IiM1YTYzNjYiIGQ9Ik0xNCAxMy45OTR2MjAuMDEyQzE0IDM5LjUyMyAxOC40NzggNDQgMjQgNDRjNS41MTUgMCAxMC00LjQ4IDEwLTkuOTk0VjEzLjk5NEMzNCA4LjQ3NyAyOS41MjIgNCAyNCA0Yy01LjUxNSAwLTEwIDQuNDgtMTAgOS45OTR6TTI2IDU3LjkydjQuMDgyQTEuOTk0IDEuOTk0IDAgMCAxIDI0IDY0Yy0xLjEwNSAwLTItLjg4Ny0yLTEuOTk4VjU3LjkyQzkuNjk4IDU2LjkyOCAwIDQ2Ljg2IDAgMzQuNTg2YTIgMiAwIDAgMSA0IDBDNCA0NS4yODMgMTIuOTUgNTQgMjQgNTRjMTEuMDYgMCAyMC04LjcwMyAyMC0xOS40MTRhMiAyIDAgMCAxIDQgMGMwIDEyLjI4Ni05LjY5IDIyLjM0NC0yMiAyMy4zMzR6TTEwIDEzLjk5NEMxMCA2LjI3IDE2LjI3NyAwIDI0IDBjNy43MyAwIDE0IDYuMjY3IDE0IDEzLjk5NHYyMC4wMTJDMzggNDEuNzMgMzEuNzIzIDQ4IDI0IDQ4Yy03LjczIDAtMTQtNi4yNjctMTQtMTMuOTk0VjEzLjk5NHoiLz4KPC9zdmc+);background-repeat:no-repeat;background-position:center;background-color:#2a2c2c;background-size:30%;overflow:hidden;}video{width:100%;}.video > div:before{content:'';display:block;width:100%;padding-bottom:75%;}.video:hover > div > svg{top:-24px;left:-24px;transition:.2s ease .2s;}.video:after{}.video:hover > div.pro:after,
  133. .video:hover > div.extreme:after,
  134. .video:hover > div.gold:after{top:-24px;right:-24px;transition:.2s ease .2s;}.video > div > div{position:relative;width:100%;}.video > div > video,
  135. .video > div > iframe{position:absolute;height:100%;top:0;left:0;}.video > div > iframe{width:100%;}.video > div.ratio-16-9 > video,
  136. .video > div.ratio-16-9 > iframe{left:-16.66%;}.video > div.ratio-8-5 > video,
  137. .video > div.ratio-8-5 > iframe{left:-10%;}.video > div.ratio-3-2 > video,
  138. .video > div.ratio-3-2 > iframe{left:-6.25%;}.video > div > .overlay{position:absolute;height:100%;width:100%;top:0;left:0;box-shadow:inset 0 0 0 0 rgba(0, 0, 0, .5);transition:.2s;}.video:hover > div > .overlay{box-shadow:inset 0 0 100px 0 rgba(0, 0, 0, .5);}.icon-visibility,
  139. .icon-resize,
  140. .icon-report,
  141. .icon-close{position:absolute;height:22px;width:22px;top:-22px;padding:0;border:none;background-color:transparent;cursor:pointer;opacity:.9;transition:.2s;}.icon-visibility{left:-22px;}.icon-resize{left:50%;margin-left:-11px;}.icon-report,
  142. .icon-close{right:-22px;}.icon-visibility:hover,
  143. .icon-resize:hover,
  144. .icon-report:hover,
  145. .icon-close:hover{opacity:1;}.video:hover > div > .overlay > .icon-visibility,
  146. .video:hover > div > .overlay > .icon-resize,
  147. .video:hover > div > .overlay > .icon-report,
  148. .video:hover > div > .overlay > .icon-close{top:12px;transition:top .2s ease .2s,
  149. left .2s ease .2s,
  150. right .2s ease .2s,
  151. opacity .2s;}.video:hover > div > .overlay > .icon-visibility{left:14px;}.video:hover > div > .overlay > .icon-report,
  152. .video:hover > div > .overlay > .icon-close{right:14px;}.icon-visibility > svg,
  153. .icon-resize > svg,
  154. .icon-report > svg,
  155. .icon-close > svg{position:absolute;}.video.not-visible > div > .overlay > .icon-visibility > svg,
  156. .icon-visibility > svg{top:4px;left:1px;opacity:0;visibility:hidden;transition:.2s;}.video.not-visible > div > .overlay > .icon-visibility > svg:first-child,
  157. .icon-visibility > svg + svg{opacity:1;visibility:visible;}.video.not-visible > div > iframe{visibility:hidden;}.icon-resize > svg{top:3px;left:3px;}.icon-resize > svg > path{transition:.2s;}.video.large > div > .overlay > .icon-resize > svg > path + path{opacity:0;visibility:hidden;}.icon-report > svg{top:3px;left:3px;}.icon-close > svg{top:4px;left:4px;}.icon-context{position:absolute;height:22px;width:22px;bottom:-22px;right:-22px;padding:0;border:none;background-color:transparent;cursor:pointer;opacity:.9;transition:.2s;}.icon-context:hover{opacity:1;}.video:hover > div > .overlay > .icon-context{bottom:7px;right:16px;transition:bottom .2s ease .2s,
  158. right .2s ease .2s,
  159. opacity .2s;}.icon-context > svg{position:absolute;top:9px;left:1px;}.video-context{position:absolute;display:flex;flex-direction:column;align-content:center;top:0;bottom:0;left:0;right:0;padding-top:10px;padding-bottom:10px;border-radius:4px;border:1px solid rgba(0, 0, 0, .06);box-sizing:border-box;font-size:0;color:#535353;text-align:left;line-height:1;background-color:rgba(0, 0, 0, .7);box-shadow:0 1px 4px 0 rgba(0, 0, 0, .09);z-index:1;opacity:0;visibility:hidden;transition:.2s;}.video-context::-webkit-scrollbar-track{background-color:transparent;}.video-context::-webkit-scrollbar-thumb{border:5px solid transparent;border-radius:6px/8px;background-color:rgba(255, 255, 255, .1);background-clip:content-box;}.video-context::-webkit-scrollbar-thumb:hover{background-color:rgba(255, 255, 255, .2);}.video:hover > div > .overlay > .icon-context:focus + .video-context{opacity:1;visibility:visible;}.video-context-content{margin:0 auto;}.video-context-content > div{text-align:center;}.video-context-content > div + div{padding-top:5px;}.video-context-content > div > button{display:block;width:100%;padding:0 20px;border:none;border-radius:4px;box-sizing:border-box;font-size:13px;font-weight:600;color:#fff;background-color:transparent;line-height:26px;cursor:pointer;transition:.2s;-webkit-appearance:none;-moz-appearance:none;appearance:none;}.video-context-content > div > button:hover{color:#fff;background-color:#04caff;}.icon-volume{position:absolute;height:22px;left:-22px;bottom:-22px;opacity:.9;transition:.2s;}.icon-volume:hover{opacity:1;}.video:hover > div > .overlay > .icon-volume{left:16px;bottom:16px;transition:bottom .2s ease .2s,
  160. left .2s ease .2s,
  161. opacity .2s;}#icon-state > button{position:relative;height:22px;width:22px;padding:0;border:none;background-color:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;}#icon-state > button > svg{position:absolute;display:block;top:2px;left:2px;}#icon-state > button > svg + svg{top:1px;left:2px;transition:.2s;}#icon-state > button > svg{opacity:1;visibility:visible;}#icon-state > button > svg + svg{opacity:0;visibility:hidden;}.video > div > .waiting{position:absolute;height:100%;width:100%;top:0;left:0;background-color:#202628;opacity:0;visibility:hidden;transition:.2s;}.video > div.wait > .waiting{opacity:1;visibility:visible;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #04caff;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite paused;-webkit-animation:waiting 1s ease-in-out 0s infinite paused;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}.video > div.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}.video > div > svg{position:absolute;top:5px;left:5px;filter:drop-shadow(0 0 4px #04caff);-webkit-filter:drop-shadow(0 0 4px #04caff);opacity:0;transition:.2s;}#videos-content > #videos > .video:hover > div > svg{top:-24px;left:-24px;transition:.2s ease .2s;}.video > div > svg > circle{fill:#fff;fill-rule:evenodd;stroke:#fff;stroke-width:0;transition:.2s;}.video > div > svg[data-mic-level="1"]{opacity:.5;}.video > div > svg[data-mic-level="2"]{opacity:.8;}.video > div > svg[data-mic-level="3"],
  162. .video > div > svg[data-mic-level="4"],
  163. .video > div > svg[data-mic-level="5"],
  164. .video > div > svg[data-mic-level="6"],
  165. .video > div > svg[data-mic-level="7"],
  166. .video > div > svg[data-mic-level="8"],
  167. .video > div > svg[data-mic-level="9"],
  168. .video > div > svg[data-mic-level="10"]{opacity:1;}.video > div > svg[data-mic-level="4"] > circle{stroke-width:1;}.video > div > svg[data-mic-level="5"] > circle{stroke-width:2;}.video > div > svg[data-mic-level="6"] > circle{stroke-width:3;}.video > div > svg[data-mic-level="7"] > circle{stroke-width:4;}.video > div > svg[data-mic-level="8"] > circle{stroke-width:5;}.video > div > svg[data-mic-level="9"] > circle{stroke-width:6;}.video > div > svg[data-mic-level="10"] > circle{stroke-width:7;}.video > div > .nickname{position:absolute;display:block;height:15px;left:10px;right:10px;bottom:12px;margin-bottom:-7px;font-size:12px;font-weight:600;color:#fff;text-align:center;text-shadow:0 0 6px rgba(0, 0, 0, .8);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:default;transition:.2s;}.video > div > .nickname > img{position:relative;display:inline-block;height:10px;width:10px;top:2px;margin-right:6px;opacity:1;visibility:visible;transition:.2s;}.video > div > .nickname > img[src=""]{width:0;margin-right:0;overflow:hidden;opacity:0;visibility:hidden;}.video:hover > div > .nickname{bottom:50%;transition:.2s ease .2s;}.video > div.gold:after,
  169. .video > div.extreme:after,
  170. .video > div.pro:after{content:'';position:absolute;display:block;height:24px;width:24px;top:10px;right:10px;background-repeat:no-repeat;transition:.2s;}.video > div.gold:after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+Cgk8Y2lyY2xlIGZpbGw9IiNmZmM2MmMiIGN4PSIxMiIgY3k9IjEyIiByPSIxMiIvPgoJPHBhdGggaWQ9ImJhZGdlLWdvbGQiIGQ9Ik0xNiAxMi41NzZ2LTEuMDE4aC0zLjU5NnYxLjUxaDEuMjZsLS4wMTIuMTA4Yy0uMDcuNjIyLS42MyAxLjAzNC0xLjQyIDEuMDM0LTEuMDY1IDAtMS43NTgtLjg0LTEuNzU4LTIuMjUgMC0xLjM3Ny42MDctMi4xNyAxLjYzOC0yLjE3LjY5OCAwIDEuMjQyLjM3IDEuNDAzLjkzN2gyLjM4OEMxNS43MiA5LjE0IDE0LjE3MyA4IDEyLjEgOCA5LjU1MiA4IDggOS40NTcgOCAxMS45OTIgOCAxNC41NiA5LjU1MiAxNiAxMi4xNzUgMTZjMi40IDAgMy44MjUtMS4zMDcgMy44MjUtMy40MjR6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI2JhZGdlLWdvbGQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgMSkiIGZpbGwtb3BhY2l0eT0iLjIiLz4KCTx1c2UgZmlsbD0iI2ZmZiIgeGxpbms6aHJlZj0iI2JhZGdlLWdvbGQiLz4KPC9zdmc+);}.video > div.extreme:after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPGNpcmNsZSBmaWxsPSIjYWQ2YmNlIiBjeD0iMTIiIGN5PSIxMiIgcj0iMTIiLz4NCgk8cGF0aCBpZD0iYmFkZ2UtZXh0cmVtZSIgZD0iTTE0IDE2SDlWOGg1djEuNzM1aC0yLjcyNXYxLjI1OGgyLjUyM3YxLjczNWgtMi41MjN2MS41MUgxNHoiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI2JhZGdlLWV4dHJlbWUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgMSkiIGZpbGwtb3BhY2l0eT0iLjIiLz4NCgk8dXNlIGZpbGw9IiNmZmYiIHhsaW5rOmhyZWY9IiNiYWRnZS1leHRyZW1lIi8+DQo8L3N2Zz4=);}.video > div.pro:after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPGNpcmNsZSBmaWxsPSIjMzhjZDU3IiBjeD0iMTIiIGN5PSIxMiIgcj0iMTIiLz4NCgk8cGF0aCBpZD0iYmFkZ2UtcHJvIiBkPSJNMTUgMTAuNTQ0YzAgLjg5NC0uMjcyIDEuNTg1LS44MTcgMi4wNzItLjU0NS40ODctMS4zMi43My0yLjMyMi43M2gtLjYyNlYxNkg5VjhoMi44NmMxLjA0NiAwIDEuODMuMjIgMi4zNTQuNjYyLjUyNC40NDIuNzg2IDEuMDcuNzg2IDEuODgyem0tMy43NjYgMS4wNGguNDA3Yy4zMzYgMCAuNjAzLS4wOS44LS4yNzMuMi0uMTgyLjI5OC0uNDM0LjI5OC0uNzU1IDAtLjU0LS4zMS0uODEtLjkyNy0uODFoLS41NzZ2MS44NHoiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI2JhZGdlLXBybyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAxKSIgZmlsbC1vcGFjaXR5PSIuMiIvPg0KCTx1c2UgZmlsbD0iI2ZmZiIgeGxpbms6aHJlZj0iI2JhZGdlLXBybyIvPg0KPC9zdmc+);}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@media screen and (max-width: 600px){#videos{top:12px;right:13px;bottom:12px;left:13px;}.video{padding:2px;}.video:after{border-width:2px;border-radius:4px;}}.video.full-screen:after{border-color:#101314;}</style></template></dom-module><dom-module id="tc-video-preview" assetpath="../ui/tc-video-preview/"><template strip-whitespace=""><style include="tc-video-preview-style"></style><div class$="[[videoItemStyle]]"><div class$="[[convertVideoClass(item, item.progress)]]"><video id="video" autoplay="" volume="[[volume]]" data-video-id$="[[item.handle]]" on-playing="onPlaying" playsinline="">Your browser does not support the video tag...</video><div class="waiting"><div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div></div></div></div></template><script>class ChatroomVideoPreview extends Polymer.Element{static get is(){return"tc-video-preview"}static get properties(){return{item:{type:Object,observer:"itemAssigned"},volume:{type:Number,value:0},videoItemStyle:{type:String,computed:"_videoItemStyleCompute(item.large, item.muted, item.hidden, isFullScreen)"}}}constructor(){super()}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}itemAssigned(a){if(null!==a){let b=this.$.video;b.srcObject=a.mediastream,b.muted=!0,this.internalVolume=a.volume}}_videoItemStyleCompute(a,b,c,d){var e="video";return e+=a?" large":"",e+=b?" muted":"",e+=c?" not-visible":"",e+=d?" full-screen":"",e}convertVideoClass(a,b){var c="ratio-4-3";return c+=b?" wait":"",c}onPlaying(a){this.dispatchEvent(new CustomEvent("video-playing",a))}}customElements.define(ChatroomVideoPreview.is,ChatroomVideoPreview);</script></dom-module><dom-module id="tc-video-moderation-style" assetpath="../ui/tc-video-moderation/"><template><style>#moderatorlist *{outline:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;}#moderatorlist{position:relative;max-height:70px;padding-left:31px;font-size:0;overflow:hidden;transition:.2s;}#moderatorlist:after{content:attr(data-videos-count);position:absolute;display:block;height:20px;width:20px;top:32px;right:0;border-radius:100%;font-size:10px;font-weight:800;color:#2e373a;line-height:20px;text-align:center;background-color:#7b868a;}#moderatorlist.hidden #header,
  171. #moderatorlist.hidden .list-item,
  172. #moderatorlist > .list-item.hidden{height:0;opacity:0;visibility:hidden;}#moderatorlist.show[data-videos-count=""],
  173. #moderatorlist.show[data-videos-count="0"]{max-height:0px;}#moderatorlist.show[data-videos-count="1"],
  174. #moderatorlist.show[data-videos-count="2"]{max-height:155px;}#moderatorlist.show[data-videos-count="3"],
  175. #moderatorlist.show[data-videos-count="4"]{max-height:240px;}#moderatorlist.show[data-videos-count="5"],
  176. #moderatorlist.show[data-videos-count="6"]{max-height:325px;}#moderatorlist.show[data-videos-count="7"],
  177. #moderatorlist.show[data-videos-count="8"]{max-height:410px;}#moderatorlist.show[data-videos-count="9"],
  178. #moderatorlist.show[data-videos-count="10"]{max-height:495px;}#moderatorlist.show[data-videos-count="11"],
  179. #moderatorlist.show[data-videos-count="12"]{max-height:580px;}#moderatorlist > #header{position:relative;height:70px;padding-left:5px;top:33px;font-size:14px;font-weight:600;color:#7b868a;text-transform:uppercase;cursor:default;animation:show-header .5s ease 0s 1;-webkit-animation:show-header .5s ease 0s 1;}@keyframes show-header{0%{height:0;opacity:0;visibility:visible;}100%{height:70px;opacity:1;visibility:visible;}}@-webkit-keyframes show-header{0%{height:0;opacity:0;visibility:visible;}100%{height:70px;opacity:1;visibility:visible;}}#moderatorlist > #header > span > button{position:relative;height:20px;width:20px;top:-1px;right:0;padding:0;border:none;background-color:#2d373a;line-height:20px;text-align:center;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;}#moderatorlist > #header > span > button > svg{display:inline-block;transform:rotate(180deg);transition:.2s;}#moderatorlist.show > #header > span > button > svg{transform:rotate(0deg);}#moderatorlist > #header > span > button:hover > svg > path{fill:#fff;transition:.2s;}#moderatorlist[data-videos-count=""] > #moderatorlist-empty-item,
  180. #moderatorlist[data-videos-count="0"] > #moderatorlist-empty-item{height:30px;width:100%;padding-left:5px;font-size:14px;color:#7b868a;}.video{position:relative;display:inline-block;width:50%;padding:5px;box-sizing:border-box;font-size:0;overflow:hidden;}.video > div{position:relative;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNjQiIHZpZXdCb3g9IjAgMCA0OCA2NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGZpbGw9IiM1YTYzNjYiIGQ9Ik0xNCAxMy45OTR2MjAuMDEyQzE0IDM5LjUyMyAxOC40NzggNDQgMjQgNDRjNS41MTUgMCAxMC00LjQ4IDEwLTkuOTk0VjEzLjk5NEMzNCA4LjQ3NyAyOS41MjIgNCAyNCA0Yy01LjUxNSAwLTEwIDQuNDgtMTAgOS45OTR6TTI2IDU3LjkydjQuMDgyQTEuOTk0IDEuOTk0IDAgMCAxIDI0IDY0Yy0xLjEwNSAwLTItLjg4Ny0yLTEuOTk4VjU3LjkyQzkuNjk4IDU2LjkyOCAwIDQ2Ljg2IDAgMzQuNTg2YTIgMiAwIDAgMSA0IDBDNCA0NS4yODMgMTIuOTUgNTQgMjQgNTRjMTEuMDYgMCAyMC04LjcwMyAyMC0xOS40MTRhMiAyIDAgMCAxIDQgMGMwIDEyLjI4Ni05LjY5IDIyLjM0NC0yMiAyMy4zMzR6TTEwIDEzLjk5NEMxMCA2LjI3IDE2LjI3NyAwIDI0IDBjNy43MyAwIDE0IDYuMjY3IDE0IDEzLjk5NHYyMC4wMTJDMzggNDEuNzMgMzEuNzIzIDQ4IDI0IDQ4Yy03LjczIDAtMTQtNi4yNjctMTQtMTMuOTk0VjEzLjk5NHoiLz4KPC9zdmc+);background-repeat:no-repeat;background-position:center;background-color:#2a2c2c;overflow:hidden;}.video:after{content:'';position:absolute;display:block;height:100%;width:100%;top:0;left:0;border:5px solid #2d373a;border-radius:10px;box-sizing:border-box;pointer-events:none;}.video > div > div{position:relative;width:100%;}.video > div > tc-videoitem,
  181. .video > div > video{position:absolute;height:100%;top:0;left:0;}.video > div.ratio-16-9 > tc-videoitem,
  182. .video > div.ratio-16-9 > video{left:-16.66%;}.video > div.ratio-8-5 > tc-videoitem,
  183. .video > div.ratio-8-5 > video{left:-10%;}.video > div.ratio-3-2 > tc-videoitem,
  184. .video > div.ratio-3-2 > video{left:-6.25%;}.video > div > .overlay{position:absolute;height:100%;width:100%;top:0;left:0;background-color:rgba(0, 0, 0, .7);opacity:0;visibility:hidden;transition:.2s;}.video:hover > div > .overlay{opacity:1;visibility:visible;}.overlay-content{position:absolute;height:38px;width:68px;top:50%;left:50%;margin:-19px 0 0 -34px;}.overlay-content > button{padding:0;border:none;border-radius:100%;background-color:transparent;text-align:center;cursor:pointer;transition:.2s;-webkit-appearance:none;-moz-appearance:none;appearance:none;}.overlay-content > .button-decline{height:22px;width:22px;margin:8px 8px 0 0;border:1px solid #04caff;box-sizing:border-box;line-height:20px;}.overlay-content > .button-decline:hover{border-color:#54ccf3;}.overlay-content > .button-decline:active{border-color:#38a8de;}.button-decline > svg > path{transition:.2s;}.button-decline:hover > svg > path{fill:#54ccf3;}.button-decline:active > svg > path{fill:#38a8de;}.overlay-content > .button-apply{height:38px;width:38px;background-color:#04caff;line-height:40px;}.overlay-content > .button-apply:hover{background-color:#54ccf3;}.overlay-content > .button-apply:active{background-color:#38a8de;}.video:hover > div > .nickname{visibility:hidden;}.video > div > .nickname{position:absolute;display:block;height:15px;left:5px;right:5px;bottom:0;font-size:10px;font-weight:600;color:#fff;text-align:center;text-shadow:0 0 6px rgba(0, 0, 0, .8);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:default;}.video > div > .nickname > img{position:relative;display:inline-block;height:10px;width:10px;top:1px;opacity:1;visibility:visible;transition:.2s;}.video > div > .nickname > img[src=""]{width:0;margin-right:0;overflow:hidden;opacity:0;visibility:hidden;}.video > div > .waiting{position:absolute;height:100%;width:100%;top:0;left:0;background-color:#202628;opacity:0;visibility:hidden;transition:.2s;}.video > div.wait > .waiting{opacity:1;visibility:visible;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #04caff;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite paused;-webkit-animation:waiting 1s ease-in-out 0s infinite paused;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}.video > div.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}</style></template></dom-module><dom-module id="tc-video-moderation" assetpath="../ui/tc-video-moderation/"><template strip-whitespace=""><style include="tc-video-moderation-style"></style><div id="moderatorlist" class$="[[_computeClass(isExpanded)]]" data-videos-count$="[[itemsCount]]"><div id="header"><span>BROADCAST QUEUE <button on-click="onModeratorsShow"><svg width="14" height="8" viewBox="0 0 14 8" xmlns="http://www.w3.org/2000/svg"><path d="M12.205 7.694c.41.408 1.076.408 1.487 0a1.04 1.04 0 0 0 0-1.478L7.744.306a1.056 1.056 0 0 0-1.488 0L.308 6.216a1.04 1.04 0 0 0 0 1.478c.41.408 1.076.408 1.487 0L7 2.522l5.205 5.172z" fill="#7b868a"></path></svg></button></span></div><div id="moderatorlist-empty-item"><span>No videos yet</span></div><dom-repeat items="[[_items]]"><template strip-whitespace=""><div class="video"><div class="ratio-16-9"><tc-video-preview item="[[item]]" on-video-playing="videoPlaying"></tc-video-preview><div class="overlay"><div class="overlay-content"><button class="button-decline" on-click="onClose"><svg width="8" height="8" viewBox="0 0 8 8" xmlns="http://www.w3.org/2000/svg"><path d="M4 2.543L1.758.3A1.03 1.03 0 0 0 .302 1.757l2.242 2.24L.302 6.24a1.03 1.03 0 1 0 1.456 1.455L4 5.455l2.242 2.24A1.03 1.03 0 0 0 7.698 6.24L5.456 3.998l2.242-2.24A1.03 1.03 0 1 0 6.242.3L4 2.543z" fill="#04caff"></path></svg></button> <button class="button-apply" on-click="onAllow"><svg width="12" height="10" viewBox="0 0 12 10" xmlns="http://www.w3.org/2000/svg"><path d="M1.78 3.375a1 1 0 1 0-1.56 1.25l4 5A1 1 0 0 0 5.8 9.6l6-8A1 1 0 1 0 10.2.4L4.975 7.367 1.78 3.375z" fill="#fff"></path></svg></button></div></div><div class="waiting"><div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div></div><span class="nickname" title="[[item.nickname]]">[[item.nickname]]</span></div></div></template></dom-repeat></div></template><script>class VideoModeration extends Polymer.Element{static get is(){return"tc-video-moderation"}static get properties(){return{videolist:{type:Object,observer:"videolistAssigned"},_items:{type:Array,value:[],notify:!0},itemsCount:{type:Number,value:0},isExpanded:{type:Boolean,value:!0}}}constructor(){super()}connectedCallback(){super.connectedCallback()}onModeratorsShow(){this.isExpanded=!this.isExpanded}_computeClass(a){let b="";return a&&(b+=" show"),b}videolistAssigned(){let a=this.videolist.chatroom,b=this,c=a.app.EventBus;c.subscribe(TinychatApp.BLL.VideolistEvent.ID,a=>{a.action===TinychatApp.BLL.VideolistAction.AddModeration?(a.videolistitem.progress=!0,b.splice("_items",a.index,0,a.videolistitem),this.itemsCount++,this.notifyPath("_items")):a.action===TinychatApp.BLL.VideolistAction.RemoveModeration?(b.splice("_items",a.index,1),this.itemsCount--,this.notifyPath("_items")):a.action===TinychatApp.BLL.VideolistAction.UpdateModeration})}videoPlaying(a){try{let b=a.model.item,c=this._items.indexOf(b);b.progress=!1,this.notifyPath("_items."+c+".progress")}catch(a){console.error(a)}}onClose(a){let b=a.model.item.userentity;this.videolist.chatroom.VideoForceClose(b)}onAllow(a){let b=a.model.item.userentity;this.videolist.chatroom.VideoAllow(b)}}customElements.define(VideoModeration.is,VideoModeration);</script></dom-module><dom-module id="tc-sidemenu-style" assetpath="../ui/tc-sidemenu/"><template><style>#sidemenu-content{overflow-x:hidden;overflow-y:scroll;}#sidemenu-content::-webkit-scrollbar{position:absolute;width:15px;cursor:pointer;}#sidemenu-content::-webkit-scrollbar-track{background-color:#2d373a;}#sidemenu-content::-webkit-scrollbar-thumb{border:5px solid #2d373a;border-radius:6px/8px;background-color:#5a6366;}#sidemenu-content::-webkit-scrollbar-thumb:hover{background-color:#6f7b80;}#sidemenu *{user-select:none;-webkit-user-select:none;-moz-user-select:none;}#sidemenu *:focus{outline:none;}#sidemenu{position:fixed;height:100%;min-width:270px;max-width:270px;top:0;left:82px;padding-bottom:80px;box-sizing:border-box;font-family:'Open Sans', sans-serif;background-color:#2d373a;z-index:2;transition:left .8s;}#sidemenu-wider{position:absolute;display:block;height:40px;width:16px;top:50%;right:-8px;margin-top:-20px;border-radius:16px;font-size:0;background-color:#e9eaea;cursor:pointer;transition:.8s;}#sidemenu.wider > #sidemenu-wider{right:-16px;border-radius:0 16px 16px 0;}#sidemenu-wider:before{content:'';position:absolute;display:block;height:0;width:0;top:50%;left:50%;margin:-4px 0 0 -2px;border-width:4px 4px 4px 0;border-style:solid;border-color:transparent #bcc2c2;transition:.8s;}#sidemenu.wider > #sidemenu-wider:before{transform:rotate(180deg);-webkit-transform:rotate(180deg);}#sidemenu.wider{left:-188px;}#sidemenu-content{height:100%;padding-top:20px;box-sizing:border-box;}#close-users{display:none;padding:0 0 6px 21px;box-sizing:border-box;text-align:center;}#close-users > label{display:inline-block;height:20px;width:20px;padding:5px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGQ9Ik03LjgzNyAxMEwuNDUzIDE3LjM4NGMtLjYwNy42MDctLjYgMS41NjgtLjAwMyAyLjE2Ni42MDIuNiAxLjU2OC41OTYgMi4xNjYtLjAwM0wxMCAxMi4xNjNsNy4zODQgNy4zODRjLjYwNy42MDcgMS41NjguNiAyLjE2Ni4wMDMuNi0uNjAyLjU5Ni0xLjU2OC0uMDAzLTIuMTY2TDEyLjE2MyAxMGw3LjM4NC03LjM4NGMuNjA3LS42MDcuNi0xLjU2OC4wMDMtMi4xNjYtLjYwMi0uNi0xLjU2OC0uNTk2LTIuMTY2LjAwM0wxMCA3LjgzNyAyLjYxNi40NTNDMi4wMS0uMTU0IDEuMDQ4LS4xNDcuNDUuNDVjLS42LjYwMi0uNTk2IDEuNTY4LjAwMyAyLjE2Nkw3LjgzNyAxMHoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPgo8L3N2Zz4=);background-repeat:no-repeat;background-position:center center;cursor:pointer;}#top-buttons-wrapper{width:100%;padding-left:20px;padding-right:15px;box-sizing:border-box;}#live-directory{display:inline-block;height:40px;width:100%;border-radius:40px;font-size:16px;font-weight:bold;color:#fff;background-color:#04caff;line-height:40px;text-align:center;text-decoration:none;cursor:pointer;transition:.2s;}#live-directory:before{content:"";position:relative;display:inline-block;height:10px;width:10px;top:-1px;left:0;margin-right:4px;border-width:0 0 2px 2px;border-style:solid;border-color:#fff;box-sizing:border-box;transform:rotate(45deg);-webkit-transform:rotate(45deg);transition:.2s;}#live-directory:hover{background-color:#54ccf3;}#live-directory:active{background-color:#38a8de;}#live-directory:hover:before{left:-4px;}#upgrade{display:inline-block;height:40px;width:100%;margin-top:10px;border-radius:40px;font-size:16px;font-weight:bold;color:#fff;background-color:#efa701;line-height:40px;text-align:center;text-decoration:none;cursor:pointer;transition:.2s;}#upgrade:hover{background-color:#ffb701;}#upgrade:active{background-color:#cf8701;}#user-info{position:absolute;height:80px;width:100%;bottom:0;left:0;padding:20px 30px 20px 20px;border-top:1px solid rgba(0, 0, 0, .1);box-sizing:border-box;background-color:#2d373a;}#user-info > div,
  185. #user-info > a{overflow:hidden;white-space:nowrap;}#user-info > div{line-height:20px;}#user-info > div:before{content:attr(title);font-size:14px;font-weight:700;color:#fff;}#user-info > a{display:inline-block;margin-top:6px;text-decoration:none;}#user-info > a{font-size:14px;font-weight:600;color:#3cafe1;}#user-info > a:hover{color:#3cafe1;text-decoration:underline;}#user-info > button,
  186. #user-info > div:not([title]),
  187. #user-info > div[title=""],
  188. #user-info > div:not([title]) + a,
  189. #user-info > div[title=""] + a{display:none;}#user-info > div:not([title]) ~ button,
  190. #user-info > div[title=""] ~ button{display:block;}#user-info > button{height:40px;width:100%;padding:0;border:none;border-radius:40px;font-family:'Open Sans', sans-serif;font-size:16px;font-weight:700;color:#fff;background-color:#04caff;text-align:center;line-height:40px;cursor:pointer;transition:.2s;-webkit-appearance:none;-moz-appearance:none;appearance:none;}#user-info > button:hover{background-color:#54ccf3;}#user-info > button:active{background-color:#38a8de;}@media screen and (max-width: 1000px){#sidemenu{left:-188px;}#sidemenu.show{left:0;}#sidemenu-wider{opacity:0;visibility:hidden;}#close-users{display:block;}#top-buttons-wrapper{display:none;}}@media screen and (max-width: 600px){#sidemenu,
  191. #sidemenu.wider{height:calc(100% - 44px);width:100%;min-width:100%;max-width:100%;left:0;top:-100%;margin-top:44px;padding-bottom:20px;z-index:3;transition:top .5s;}#sidemenu.show{top:0;}}#sidemenu.full-screen{left:-188px;}#sidemenu.full-screen.show{left:0;}#sidemenu.full-screen > #close-users{display:block;}#sidemenu.full-screen > #top-buttons-wrapper{display:none;}</style></template></dom-module><dom-module id="tc-sidemenu" assetpath="../ui/tc-sidemenu/"><template strip-whitespace=""><style include="tc-sidemenu-style"></style><div id="sidemenu"><dom-if if="[[showCollapseAllow]]"><template strip-whitespace=""><div id="sidemenu-wider" on-click="onCollapse"></div></template></dom-if><div id="sidemenu-content"><div id="close-users" on-click="onClose"><label for="input-users" class="switcher"></label></div><div id="top-buttons-wrapper"><a id="live-directory" href="#live-directory" on-click="livedirectoryTap">Live Directory</a> <a id="upgrade" href="#subscription" on-click="upgrade">Upgrade</a></div><tc-video-moderation videolist="[[chatroom.videolist]]"></tc-video-moderation><tc-chatlist chatlog="[[chatlog]]"></tc-chatlist><tc-userlist userlist="[[userlist]]"></tc-userlist></div><div id="user-info"><div title="[[roomname]]"></div><a href="[[roomnamehref]]" target="_blank">tinychat.com/room/[[roomname]]</a> <button on-click="login">Sign In</button></div></div></template><script>const UI=window.TinychatApp.UI;class ChatroomSideMenu extends Polymer.Element{static get is(){return"tc-sidemenu"}static get properties(){return{userlist:{type:Object,observer:"userlistAssigned"},chatlog:{type:Object,observer:"chatlogAssigned"},chatroom:{type:Object,observer:"chatroomAssigned"},roomname:{type:String},roomnamehref:{type:String,computed:"_roomnamehrefCompute(roomname)"},showCollapseAllow:{type:Boolean,value:!1},onFullscreenHandler:Object,onWindowClickHandler:Object}}constructor(){super()}connectedCallback(){super.connectedCallback(),this.onFullscreenHandler=this.onFullscreen.bind(this),window.fullscreenManager.addEventListener(this.onFullscreenHandler,!1),this.onWindowClickHandler=this.onWindowClick.bind(this),window.addEventListener("click",this.onWindowClickHandler,!1);let a=this;document.addEventListener("side-menu-change",function(b){b.detail.slideout?a.slideout():a.slidein()})}disconnectedCallback(){super.disconnectedCallback(),window.fullscreenManager.removeEventListener(this.onFullscreenHandler,!1),window.removeEventListener("click",this.onWindowClickHandler)}_roomnamecompute(a){let b="",c=a.selfUser();return null!==c&&(b=c.username),b}_roomnamehrefCompute(a){return`${window.TinychatApp.url}/room/${a}`}chatlogAssigned(){}userlistAssigned(){}chatroomAssigned(a){let b=a.app.EventBus;b.subscribe(TinychatApp.BLL.RoomConnected.ID,()=>{this.roomname=this._roomnamecompute(this.chatroom),this.showCollapseAllow=this.chatroom.selfUser().hasSubscriptions})}get app(){return this.userlist.chatroom.app}slideout(){this.$.sidemenu.classList.add("show")}slidein(){this.$.sidemenu.classList.remove("show")}login(){this.app.Login(999)}onClose(){this.slidein(),document.dispatchEvent(new CustomEvent("side-menu-changed",{bubbles:!0,detail:{slideout:!1}}))}onCollapse(a){a.target.parentNode.classList.toggle("wider");let b=new UI.UISideMenuToggle;this.chatroom.app.EventBus.broadcast(UI.UISideMenuToggle.ID,b)}onWindowClick(){}onFullscreen(){let a=window.fullscreenManager.status();a?(this.$.sidemenu.classList.add("full-screen"),this.showCollapseAllow=!1):(this.$.sidemenu.classList.remove("full-screen"),this.showCollapseAllow=this.chatroom.selfUser().hasSubscriptions)}livedirectoryTap(){this.userlist.chatroom.gotoLiveDirectory()}upgrade(){this.app.UpgradeSub()}}customElements.define(ChatroomSideMenu.is,ChatroomSideMenu);</script></dom-module><dom-module id="tc-title-style" assetpath="../ui/tc-title/"><template><style>#room-header *{user-select:none;-webkit-user-select:none;-moz-user-select:none;}#room-header{display:flex;flex-direction:row;align-items:stretch;min-height:140px;max-height:140px;border-bottom:1px solid rgba(0, 0, 0, .1);box-sizing:border-box;background-color:#f6f6f6;text-align:left;}#room-header[data-mode="dark"]{background-color:#202628;}#room-header-mobile-button{display:none;}#room-header-avatar{position:relative;height:100px;min-width:100px;max-width:100px;margin:20px 0 0 30px;border-radius:100%;overflow:hidden;}#room-header-avatar > img{position:absolute;height:100%;top:0;left:-25px;}#room-header-info{width:100%;padding:24px 0 0 20px;box-sizing:border-box;}#room-header-info > h1{position:relative;display:inline-block;width:100%;max-width:170px;margin:0 5px 0 0;padding:0 20px 0 0;font-size:16px;font-weight:700;color:#363636;white-space:nowrap;line-height:normal;overflow:hidden;cursor:default;}#room-header-info > h1:after{content:"";position:absolute;display:block;height:100%;width:20px;top:0;right:0;background:-moz-linear-gradient(left, rgba(246,246,246,0) 0%, rgba(246,246,246,1) 100%);background:-webkit-linear-gradient(left, rgba(246,246,246,0) 0%, rgba(246,246,246,1) 100%);background:linear-gradient(to right, rgba(246,246,246,0) 0%, rgba(246,246,246,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00f6f6f6', endColorstr='#f6f6f6', GradientType=1);}[data-mode="dark"] #room-header-info > h1{color:#fff;}[data-mode="dark"] #room-header-info > h1:after{background:-moz-linear-gradient(top, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);background:-webkit-linear-gradient(top, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);background:linear-gradient(to bottom, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00202628', endColorstr='#202628', GradientType=0);}#room-header-info > span{display:inline-block;margin-left:10px;box-sizing:border-box;font-size:0;text-align:center;cursor:pointer;}#room-header-info-text{position:relative;height:32px;padding-top:6px;font-size:11px;line-height:16px;overflow:hidden;cursor:default;}#room-header-info-text:after{content:"";position:absolute;display:block;height:16px;width:60px;bottom:0;right:0;background:-moz-linear-gradient(left, rgba(246,246,246,0) 0%, rgba(246,246,246,1) 100%);background:-webkit-linear-gradient(left, rgba(246,246,246,0) 0%, rgba(246,246,246,1) 100%);background:linear-gradient(to right, rgba(246,246,246,0) 0%, rgba(246,246,246,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00f6f6f6', endColorstr='#f6f6f6', GradientType=1);}[data-mode="dark"] #room-header-info-text{color:#7b868a;}[data-mode="dark"] #room-header-info-text:after{background:-moz-linear-gradient(top, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);background:-webkit-linear-gradient(top, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);background:linear-gradient(to bottom, rgba(32,38,40,0) 0%, rgba(32,38,40,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00202628', endColorstr='#202628', GradientType=0);}#room-header-info-details{padding-top:3px;font-size:16px;white-space:nowrap;cursor:default;}[data-mode="dark"] #room-header-info-details{color:#fff;}#room-header-info-details > span:after{content:"";position:relative;display:inline-block;height:23px;width:1px;top:7px;margin:0 14px;background-color:#e9e9e9;}[data-mode="dark"] #room-header-info-details > span:after{background-color:rgba(255, 255, 255, .1);}#room-header-info-details > a{color:#3cafe1;cursor:pointer;}#room-header-info-details > a:hover{text-decoration:underline;}#room-header-gifts{display:flex;flex-direction:row;align-items:stretch;padding:30px 20px;box-sizing:border-box;}#room-header-gifts-items{padding:0 11px;border-radius:12px;background-color:#fff;font-size:0;text-align:center;white-space:nowrap;}[data-mode="dark"] #room-header-gifts-items{background-color:#2e373a;}#room-header-gifts-items > a{display:inline-block;height:60px;width:60px;margin:10px 5px;}#room-header-gifts-items > a > img{height:100%;width:100%;border-radius:4px;}#room-header-gifts-buttons{display:inline-block;padding-left:10px;box-sizing:border-box;font-size:0;white-space:nowrap;}#room-header-gifts-buttons > a{display:none;height:35px;width:120px;border-radius:35px;border:1px solid transparent;box-sizing:border-box;font-size:12px;font-weight:700;color:#fff;background-color:#41b7ef;line-height:35px;text-align:center;text-decoration:none;cursor:pointer;transition:.2s;}#room-header-gifts-buttons > #give-gift{display:block;}#room-header-gifts-buttons > #give-gift:hover{background-color:#54ccf3;}#room-header-gifts-buttons > #give-gift:active{background-color:#38a8de;}#room-header-gifts-buttons > #upgrade{display:none;margin-right:6px;background-color:#efa701;}#room-header-gifts-buttons > #upgrade:hover{background-color:#ffb701;}#room-header-gifts-buttons > #upgrade:active{background-color:#cf8701;}#room-header-gifts-buttons > #get-coins{display:inline-block;width:100%;margin-top:10px;border-color:#41b7ef;color:#41b7ef;background-color:#fff;transition:.2s;}#room-header-gifts-buttons > #get-coins:hover{background-color:#d6f2ff;}#room-header-gifts-buttons > #get-coins:active{background-color:#c7e8f8;}[data-mode="dark"] #room-header-gifts-buttons > #get-coins{background-color:#202628;}[data-mode="dark"] #room-header-gifts-buttons > #get-coins:hover{background-color:#d6f2ff;}[data-mode="dark"] #room-header-gifts-buttons > #get-coins:active{background-color:#c7e8f8;}@media screen and (max-width: 1180px){#room-header{min-height:100px;max-height:100px;}#room-header-avatar{height:60px;min-width:60px;max-width:60px;margin:20px 0 0 16px;}#room-header-avatar > img{left:-15px;}#room-header-info{position:relative;padding:22px 60px 0 14px;}#room-header-info > span{position:absolute;top:10px;right:25px;margin:0;}#room-header-info > span + span{top:40px;right:24px;}#room-header-info > span + span + span{top:70px;right:23px;}#room-header-info-text{padding-top:4px;}#room-header-info-details{display:none;}#room-header-gifts{padding:14px 20px;border-left:1px solid rgba(0, 0, 0, .1);}#room-header-gifts-items{padding:0;border-radius:0;background-color:transparent;}[data-mode="dark"] #room-header-gifts-items{background-color:inherit;}#room-header-gifts-items > a{height:72px;width:72px;margin:0 -11px 0 0;padding:11px;border-radius:100%;box-sizing:border-box;background-color:#fff;box-shadow:0 0 6px 0 rgba(0, 0, 0, .1);}#room-header-gifts-buttons{padding-left:21px;}#room-header-gifts-buttons > a{height:30px;line-height:30px;}#room-header-gifts-buttons > a + a,
  192. #room-header-gifts-buttons > a + a:hover{height:30px;margin-top:12px;line-height:30px;}}@media screen and (max-width: 1000px){#room-header-gifts-buttons > #give-gift{width:210px;}#room-header-gifts-buttons > #upgrade,
  193. #room-header-gifts-buttons > #get-coins{display:inline-block;width:102px;}}@media screen and (max-width: 800px){#room-header-info{padding-right:15px;}#room-header-info > h1{display:block;}#room-header-info > span{position:static;margin-top:12px;vertical-align:middle;}#room-header-info > span + span{margin-left:20px;}#room-header-info-text,
  194. #room-header-info-details{display:none;}#room-header-gifts{padding:16px 15px;background-color:#fff;}[data-mode="dark"] #room-header-gifts{background-color:inherit;}#room-header-gifts-items > a{height:60px;width:60px;margin:5px;padding:0;box-shadow:none;}#room-header-gifts-items > a + a{display:none;}#room-header-gifts-buttons{padding-top:1px;padding-left:15px;}#room-header-gifts-buttons > #give-gift{width:190px;}#room-header-gifts-buttons > #upgrade,
  195. #room-header-gifts-buttons > #get-coins{display:inline-block;width:92px;}}@media screen and (max-width: 740px){#room-header-info{padding-right:40px;}#room-header-info > span{margin-right:-10px;}}@media screen and (max-width: 600px){#room-header{position:absolute;display:block;height:54px;min-height:inherit;max-height:inherit;width:100%;max-width:100%;min-width:100%;overflow:hidden;z-index:1;transition:height .2s;}#room-header.show{height:146px;}#room-header-mobile-button{position:absolute;display:block;height:26px;width:26px;top:15px;right:15px;cursor:pointer;}#room-header-mobile-button > span,
  196. #room-header-mobile-button:before,
  197. #room-header-mobile-button:after{content:'';position:absolute;display:block;height:6px;width:6px;top:10px;left:0;border-radius:100%;background-color:#41b7ef;pointer-events:none;transform:rotate(45deg);transition:background-color .2s,
  198. height .3s,
  199. width .3s,
  200. top .3s,
  201. left .3s,
  202. opacity .3s,
  203. border-radius .3s;}#room-header-mobile-button > span{left:10px;}#room-header-mobile-button:after{left:20px;transform:rotate(-45deg);}#room-header-mobile-button:hover > span,
  204. #room-header-mobile-button:hover:before,
  205. #room-header-mobile-button:hover:after{background-color:#54ccf3;}#room-header-mobile-button:hover > span,
  206. #room-header-mobile-button:hover:before,
  207. #room-header-mobile-button:hover:after{background-color:#38a8de;}#room-header.show #room-header-mobile-button:before,
  208. #room-header.show #room-header-mobile-button:after{height:2px;width:16px;top:12px;left:5px;border-radius:1px;}#room-header.show #room-header-mobile-button > span{opacity:0;}#room-header-avatar{display:inline-block;height:24px;min-width:24px;max-width:24px;margin:15px 0 0 15px;}#room-header-avatar > img{left:-6px;}#room-header-info{position:absolute;height:100%;width:auto;top:0;left:39px;right:150px;padding-top:54px;}#room-header-info > h1{position:absolute;height:20px;width:calc(100% + 70px);max-width:inherit;top:18px;left:14px;right:20px;margin:0;padding:0;line-height:20px;}#room-header-info > span{top:65px;}#room-header-info > span + span{top:103px;}#room-header-info-text,
  209. #room-header-info-details{position:relative;width:calc(100% + 38px);left:-38px;}#room-header-info-text{padding-top:8px;}#room-header-info-details{display:block;font-size:13px;overflow:hidden;}#room-header-gifts{position:absolute;width:150px;top:54px;right:0;padding-top:6px;background-color:transparent;}#room-header-gifts-items{display:none;}#room-header-gifts-buttons{padding-left:0;}#room-header-gifts-buttons > #give-gift,
  210. #room-header-gifts-buttons > #get-coins{width:120px;}#room-header-gifts-buttons > #upgrade{display:none;}}</style></template></dom-module><dom-module id="tc-title" assetpath="../ui/tc-title/"><template strip-whitespace=""><style include="tc-title-style"></style><div id="room-header" data-mode$="[[modeStyle]]"><div id="room-header-mobile-button" on-click="onHeaderMobile"><span></span></div><div id="room-header-avatar"><img src="[[avatar]]"></div><div id="room-header-info"><h1>[[title]]</h1><span on-click="shareTap" title="Share room"><svg width="16" height="22" viewBox="0 0 16 22" xmlns="http://www.w3.org/2000/svg"><path fill="#53b6ef" fill-rule="evenodd" d="M9 2.57v10.475H7V2.57L4.682 4.733 3.318 3.268 5.986.782c1.12-1.043 2.91-1.042 4.028 0l2.668 2.486-1.364 1.464L9 2.572zM2 20h12V7.994C14 8 11 8 11 8V6h2.995C15.102 6 16 6.895 16 7.994v12.012c0 1.1-.895 1.994-1.994 1.994H1.994C.894 22 0 21.105 0 20.006V7.994C0 6.894.894 6 2.005 6H5v2H2.005C2.002 8 2 20 2 20z"></path></svg> </span><span on-click="settingsTap" title="Settings"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="#53b6ef" fill-rule="evenodd" d="M12.028 1.632l.002.017-.002-.018zm7.15 4.97l-.012.01.013-.01zM12.03 18.347c0-.006 0-.01.002-.017l-.002.017zm-2.04.02v-.016.018zM2.96 12.84c.007.007.013.016.018.025l-.017-.026zm1.203-.337c.342-.227.51-.64.425-1.04l-.05-.232c-.082-.39-.125-.81-.125-1.23 0-.42.043-.84.126-1.23l.048-.233c.085-.4-.083-.813-.425-1.04l-1.328-.882c.162.11.223.35.102.546l1.246-2.02 1.212.533c.368.162.797.088 1.09-.188l.17-.162c.625-.53 1.39-.95 2.238-1.21l.228-.07c.385-.122.658-.46.697-.86l.146-1.513c-.024.197-.186.33-.355.33h2.778c-.16 0-.332-.147-.356-.35l.147 1.534c.04.4.313.737.696.858l.22.07c.856.26 1.62.68 2.283 1.244l.134.13c.293.275.722.35 1.09.187l1.21-.534 1.247 2.02c-.11-.178-.054-.435.11-.55l-1.336.887c-.34.227-.51.64-.424 1.04l.05.232c.082.39.125.81.125 1.23 0 .42-.042.84-.125 1.23l-.05.233c-.084.4.085.813.426 1.04l1.33.882c-.163-.11-.224-.35-.103-.546l-1.246 2.02-1.21-.533c-.368-.162-.797-.088-1.09.188l-.172.162c-.624.53-1.39.95-2.237 1.21l-.227.07c-.383.122-.657.46-.696.86l-.145 1.513c.023-.197.185-.33.354-.33H9.633c.16 0 .332.147.356.35l-.15-1.534c-.037-.4-.31-.737-.694-.858l-.22-.07c-.856-.26-1.62-.68-2.283-1.244l-.134-.13c-.294-.275-.723-.35-1.09-.187l-1.212.534-1.23-1.995c.077.148.013.416-.156.53l1.34-.892zm-2.87 1.437l1.367 2.22c.437.708 1.316.984 2.087.65l.904-.4c.7.54 1.453.954 2.263 1.25l.085.88c.063.84.78 1.46 1.635 1.46h2.753c.834 0 1.57-.623 1.636-1.48l.083-.86c.82-.298 1.58-.718 2.266-1.248l.898.395c.775.337 1.654.06 2.09-.645l1.402-2.274c.458-.742.22-1.68-.482-2.16l-.786-.523c.06-.394.09-.8.09-1.205 0-.406-.03-.81-.09-1.205l.773-.513c.734-.462.958-1.42.494-2.17l-1.4-2.273c-.438-.708-1.317-.984-2.088-.65l-.904.4c-.698-.54-1.452-.954-2.263-1.25l-.084-.88C13.958.62 13.24 0 12.387 0H9.608c-.833 0-1.57.623-1.636 1.48l-.083.86c-.82.298-1.582.718-2.266 1.248l-.898-.395c-.775-.337-1.654-.06-2.09.645L1.234 6.112c-.458.742-.22 1.68.482 2.16l.787.523c-.06.394-.09.8-.09 1.205 0 .406.03.81.09 1.205l-.766.508c-.765.49-.97 1.48-.444 2.227z"></path><circle fill="#53b6ef" fill-rule="evenodd" cx="11" cy="10" r="2"></circle></svg> </span><span on-click="followTap" title="Follow"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle fill="none" fill-rule="evenodd" stroke="#53b6ef" stroke-width="2" cx="10" cy="10" r="9"></circle><path fill="#53b6ef" fill-rule="evenodd" d="M9 9V7a1 1 0 1 1 2 0v2h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 0v-2H7a1 1 0 0 1 0-2h2z"></path></svg></span><div id="room-header-info-text">[[biography]]</div><div id="room-header-info-details"><span>[[location]]</span><a href="[[website]]" target="_blank">[[website]]</a></div></div><div id="room-header-gifts"><dom-if if="[[recent_gifts_show]]"><template strip-whitespace=""><div id="room-header-gifts-items"><dom-repeat items="[[recent_gifts]]"><template strip-whitespace=""><a href="#"><img src="[[item.giftUrl]]"></a></template></dom-repeat></div></template></dom-if><div id="room-header-gifts-buttons"><a id="give-gift" href="#giveagift" on-click="giveagiftTap">Give a Gift</a> <a id="upgrade" href="#subscription" on-click="upgrade">Upgrade</a> <a id="get-coins" href="#getcoins" on-click="getcoinsTap">Get Coins</a></div></div></div></template><script>class ChatroomTitle extends Polymer.Element{static get is(){return"tc-title"}static get properties(){return{chatroom:{type:Object,observer:"chatroomAssigned"},title:String,biography:String,location:String,website:String,avatar:String,recent_gifts:Object,recent_gifts_show:{type:Boolean,computed:"convertGiftShown(recent_gifts)"},onFullscreenHandler:Object,modeStyle:String}}constructor(){super()}get app(){return this.chatroom.app}connectedCallback(){super.connectedCallback(),this.onFullscreenHandler=this.onFullscreen.bind(this),window.fullscreenManager.addEventListener(this.onFullscreenHandler,!1)}disconnectedCallback(){super.disconnectedCallback(),window.fullscreenManager.removeEventListener(this.onFullscreenHandler,!1)}chatroomAssigned(){this.modeStyle=this.app.setDarkModeCSSclass(this.app.settings.isDarkMode());let a=this,b=this.chatroom.app.EventBus;b.subscribe(TinychatApp.BLL.RoomSettingsEvent.ID,function(b){let c=b.roomSettings;a.setProperties({title:c.name,biography:c.biography,location:c.location,website:c.website,avatar:c.avatar,recent_gifts:c.recent_gifts})}),b.subscribe(TinychatApp.BLL.SettingsChangedEvent.ID,b=>{a.modeStyle=a.app.setDarkModeCSSclass(b.settingsEntity.darkMode)})}convertGiftShown(a){return!!Array.isArray(a)&&0<a.length}onHeaderMobile(){this.$["room-header"].classList.toggle("show")}onFullscreen(){let a=window.fullscreenManager.status();this.setAttribute("style",a?"display:none;":"")}shareTap(){this.app.Share()}settingsTap(){this.app.Settings()}followTap(){return this.chatroom.isLurker()?void this.app.showToastLurker():void this.chatroom.userlist.follow({isInsta:0>this.chatroom.roomSettings.type.indexOf("default"),username:this.chatroom.roomname,nickname:this.chatroom.roomname})}giveagiftTap(){this.app.GiveAGift(this.chatroom.selfUser().username)}getcoinsTap(){this.app.EarnCoins()}upgrade(){this.app.UpgradeSub()}}customElements.define(ChatroomTitle.is,ChatroomTitle);</script></dom-module><dom-module id="tc-toast-style" assetpath="../ui/tc-toast/"><template><style>#toast{position:fixed;display:flex;flex-direction:row;justify-content:center;height:80px;min-height:80px;width:100%;top:-80px;left:0;padding:0 30px;box-sizing:border-box;font-size:0;background-color:rgba(0, 0, 0, .8);text-align:center;z-index:6;transition:top .2s;}#toast.show{top:0;}#toast.error{background-color:#e53951;}#toast.accept{background-color:#38cd57;}#toast.warning{background-color:#f29e1f;}#toast-text{display:inline-block;font-size:16px;font-weight:600;color:#fff;vertical-align:middle;}#toast-text:before,
  211. #toast-buttons:before{content:'';display:inline-block;height:100%;width:0;vertical-align:middle;}#toast-text > span{display:inline-block;max-height:66px;line-height:22px;white-space:normal;vertical-align:middle;overflow:hidden;cursor:default;}#toast-buttons{white-space:nowrap;}#toast-buttons > *{display:inline-block;vertical-align:middle;}#toast-buttons > *:focus{outline:none;}#button-close{margin-left:4px;padding:10px;border:none;background:none;cursor:pointer;}#button-close > svg > path{transition:.2s;}#button-close:hover > svg > path{opacity:.8;}#button-close:active > svg > path{opacity:1;}#button-custom{margin-left:26px;padding:0 24px;border:1px solid #fff;font-size:12px;font-weight:700;color:#fff;line-height:30px;background:transparent;cursor:pointer;transition:background-color .2s,
  212. color .2s;}#button-custom:hover{background-color:rgba(0, 0, 0, .8);}#toast.error #button-custom:hover{background-color:#fff;color:#e53951;}#toast.accept #button-custom:hover{background-color:#fff;color:#38cd57;}#toast.warning #button-custom:hover{background-color:#fff;color:#f29e1f;}</style></template></dom-module><dom-module id="tc-toast" assetpath="../ui/tc-toast/"><template strip-whitespace=""><style include="tc-toast-style"></style><div id="toast"><div id="toast-text"><span>[[text]]</span></div><div id="toast-buttons"><button id="button-close" on-click="close"><svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#fff" fill-rule="evenodd" opacity=".5"></path></svg></button><dom-if if="[[ok_shown]]"><template strip-whitespace=""><button id="button-custom" on-click="onOK">[[ok_text]]</button></template></dom-if></div></div></template><script>class Toast extends Polymer.Element{static get is(){return"tc-toast"}static get properties(){return{type:String,text:String,wait:Number,ok_handler:Object,ok_text:{type:String,value:"RETRY"},ok_shown:{type:Boolean,computed:"ok_shown_func(ok_handler)"},secondsToLogin:Number}}static get TYPE(){return{INFO:"",ERR:"error",CON:"accept",WARN:"warning",TIMEOUT_TO_LOGIN:"timeoutToLogin"}}constructor(){super()}get animationWait(){return 250}connectedCallback(){return super.connectedCallback(),setTimeout(()=>{this.$.toast.classList.add("show")},0),"timeoutToLogin"===this.type?(this.secondsToLogin=this.wait,this.showTimeoutToLoginMsg(),void setInterval(this.showTimeoutToLoginMsg.bind(this),1e3)):void(!this.type.isEmpty()&&this.$.toast.classList.add(this.type),0<this.wait&&setTimeout(this.close.bind(this),this.wait))}disconnectedCallback(){super.disconnectedCallback()}destroy(){this.remove()}close(){this.$.toast.classList.remove("show"),setTimeout(this.destroy.bind(this),this.animationWait)}onOK(a){Object.isFunc(this.ok_handler)&&(this.ok_handler(),this.close(a))}ok_shown_func(a){return Object.isFunc(a)}showTimeoutToLoginMsg(){this.text="We hope you are enjoying a preview of this room. Please register now in "+this.secondsToLogin+" seconds to continue.",this.notifyPath("text"),this.secondsToLogin--}}customElements.define(Toast.is,Toast);</script></dom-module><dom-module id="tc-user-contextmenu-style" assetpath="../ui/tc-user-contextmenu/"><template><style>.context{position:absolute;padding:7px;border-radius:4px;background-color:#fff;text-align:left;opacity:0;visibility:hidden;transition:opacity .2s,
  213. visibility .2s;}.context:before,
  214. .context:after{content:"";position:absolute;display:block;height:0;width:0;left:13px;bottom:-8px;border-width:7px 7px 0 7px;border-style:solid;border-color:rgba(0, 0, 0, .06) transparent;}.context:after{bottom:-7px;border-color:#fff transparent;}.context[data-mode="dark"]{background-color:#202628;}.context[data-mode="dark"]:after{border-color:#202628 transparent;}.context.show{opacity:1;visibility:visible;}.context.down:before,
  215. .context.down:after{top:-8px;bottom:auto;border-width:0 7px 7px 7px;}.context.down:after{top:-7px;}.context > span{position:relative;display:block;height:26px;padding:0 20px;border-radius:4px;font-size:13px;font-weight:600;color:#000;line-height:26px;white-space:nowrap;cursor:pointer;transition:.2s;}.context[data-mode="dark"] > span{color:#fff;}.context > span:hover{background-color:#04caff;color:#fff;}.context[data-mode="dark"] > span:hover{background-color:#2e373a;}.context > span > svg{position:absolute;height:18px;width:18px;top:4px;left:9px;bottom:4px;}.context > span > svg path{transition:.2s;}.context > span:hover > svg path{fill:#fff;}.context[data-mode="dark"] > span:hover > svg path{fill:#2e373a;}</style></template></dom-module><dom-module id="tc-user-contextmenu" assetpath="../ui/tc-user-contextmenu/"><template strip-whitespace=""><style include="tc-user-contextmenu-style"></style><div id="main" class="context" data-mode$="[[modeStyle]]"><dom-if if="[[changenickAllow]]"><template strip-whitespace=""><span on-click="changenick">Change Nickname</span></template></dom-if><dom-if if="[[followAllow]]"><template strip-whitespace=""><span on-click="follow">Follow</span></template></dom-if><dom-if if="[[ignoreAllow]]"><template strip-whitespace=""><span on-click="ignore">Ignore</span></template></dom-if><dom-if if="[[unignoreAllow]]"><template strip-whitespace=""><span on-click="unignore">Unignore</span></template></dom-if><dom-if if="[[openprivateAllow]]"><template strip-whitespace=""><span on-click="openprivate">Private Message</span></template></dom-if><dom-if if="[[profileAllow]]"><template strip-whitespace=""><span on-click="profile">Profile</span></template></dom-if><dom-if if="[[banAllow]]"><template strip-whitespace=""><span on-click="ban">Ban</span></template></dom-if><dom-if if="[[unbanAllow]]"><template strip-whitespace=""><span on-click="unban">Unban</span></template></dom-if><dom-if if="[[kickAllow]]"><template strip-whitespace=""><span on-click="kick">Kick</span></template></dom-if><dom-if if="[[abuseAllow]]"><template strip-whitespace=""><span on-click="abuse">Abuse</span></template></dom-if><dom-if if="[[giveagiftAllow]]"><template strip-whitespace=""><span on-click="giveagift">Send Virtual Gift</span></template></dom-if></div></template><script>class UserContextMenu extends Polymer.Element{static get is(){return"tc-user-contextmenu"}static get properties(){return{userlist:{type:Object,observer:"userlistAssigned"},user:{type:Object,observer:"userAssigned"},chatlist:Boolean,changenickAllow:{type:Boolean,value:!1},followAllow:{type:Boolean,value:!1},ignoreAllow:{type:Boolean,value:!1},unignoreAllow:{type:Boolean,value:!1},openprivateAllow:{type:Boolean,value:!1},profileAllow:{type:Boolean,value:!1},abuseAllow:{type:Boolean,value:!1},kickAllow:{type:Boolean,value:!1},banAllow:{type:Boolean,value:!1},unbanAllow:{type:Boolean,value:!1},giveagiftAllow:{type:Boolean,value:!1},modeStyle:String,onkeydownHandler:Object}}constructor(){super()}get app(){return this.userlist.chatroom.app}get chatroom(){return this.userlist.chatroom}get chatlog(){return this.userlist.chatroom.chatlog}connectedCallback(){super.connectedCallback(),this.onkeydownHandler=this.onkeydown.bind(this),document.addEventListener("keydown",this.onkeydownHandler)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.onkeydownHandler)}userlistAssigned(a){this.modeStyle=this.app.setDarkModeCSSclass(this.app.settings.isDarkMode());let b=this,c=a.chatroom.app.EventBus;c.subscribe(TinychatApp.BLL.IgnorelistUpdateUserEvent.ID,function(a){b.user!==void 0&&b.user.handle===a.userentity.handle&&(b.ignoreAllow=b.userlist.ignoreIsAllowed(b.user),b.unignoreAllow=b.userlist.isIgnored(b.user))}),c.subscribe(TinychatApp.BLL.SettingsChangedEvent.ID,a=>{b.modeStyle=b.app.setDarkModeCSSclass(a.settingsEntity.darkMode)})}userAssigned(a){let b=this;this.changenickAllow=a.isSelf,this.followAllow=this.userlist.followIsAllowed(a),this.ignoreAllow=this.userlist.ignoreIsAllowed(a),this.banAllow=this.userlist.banIsAllowed(a),this.kickAllow=this.userlist.kickIsAllowed(a),this.profileAllow=!0,this.giveagiftAllow=!0,this.openprivateAllow=!a.isSelf&&!this.userlist.chatroom.selfUser().isGuest&&!this.chatlist,this.abuseAllow=!a.isSelf,this.unignoreAllow=this.userlist.isIgnored(a),this.unbanAllow=this.userlist.isBanned(a)}show(a){let b=a.path?a.path[0]:(a.composedPath&&a.composedPath())[0];if(!b&&a.originalTarget&&(b=a.originalTarget),!b){if(b=a.target,"TINYCHAT-WEBRTC-APP"!==b.nodeName)return;let c=b.shadowRoot.getElementById("users").shadowRoot.getElementById("sidemenu-content").getElementsByTagName("tc-userlist")[0].shadowRoot.querySelectorAll(".js-user-list-item");if(!c.length)return;for(let d=0;d<c.length;d++)if(a.offsetY>c[d].offsetTop&&a.offsetY<c[d].offsetTop+c[d].offsetHeight){b=c[d];break}}if(!b)return;let c=this.$.main,d=this.getRootNode().host,e=d.getRootNode().host;var f=!0,g=b.offsetTop;let h=c.clientHeight,i=b.getBoundingClientRect().top-e.getBoundingClientRect().top,j=e.getBoundingClientRect().bottom-b.getBoundingClientRect().bottom;if(f=i>j,f){let a=b.offsetTop-h;0>=a&&(f=!f)}else{let a=b.offsetTop+b.clientHeight+h;a>=e.scrollHeight&&(f=!f)}f?(c.classList.add("up"),c.classList.remove("down"),g=g-c.clientHeight-7):(c.classList.add("down"),c.classList.remove("up"),g=g+b.clientHeight+7),c.style.top=g+"px",c.classList.add("show")}hide(){this.$.main.classList.remove("show")}onkeydown(a){a=a||window.event,(27==a.keyCode||"Escape"==a.key||"Esc"==a.key)&&this.hide()}changenick(){return this.chatroom.isLurker()?void this.app.showToastLurker():void(this.user.isSelf&&this.user.isGuest&&this.app.Login(777),this.userlist.changenick(this.user))}follow(){return this.chatroom.isLurker()?void this.app.showToastLurker():void this.userlist.follow(this.user)}ignore(){return this.chatroom.isLurker()?void this.app.showToastLurker():void(this.userlist.ignore(this.user),this.unignoreAllow=!0,this.ignoreAllow=!this.unignoreAllow)}unignore(){return this.chatroom.isLurker()?void this.app.showToastLurker():void(this.userlist.unignore(this.user),this.ignoreAllow=!0,this.unignoreAllow=!this.ignoreAllow)}openprivate(){return this.chatroom.isLurker()?void this.app.showToastLurker():void this.chatlog.openprivate(this.user)}profile(){this.user.isUsername?this.app.UserProfile(this.user.username):this.app.showToast("["+this.user.nickname+"] is anonymous, therefore has no profile")}abuse(){return this.chatroom.isLurker()?void this.app.showToastLurker():void this.userlist.abuse(this.user)}kick(){return this.chatroom.isLurker()?void this.app.showToastLurker():void this.userlist.kick(this.user)}ban(){return this.chatroom.isLurker()?void this.app.showToastLurker():void this.userlist.ban(this.user)}unban(){return this.chatroom.isLurker()?void this.app.showToastLurker():void this.userlist.unban(this.user)}giveagift(){this.user.isUsername?this.app.GiveAGift(this.user.username):this.app.showToast("["+this.user.nickname+"] is anonymous, virtual gifts for registered users only.")}}customElements.define(UserContextMenu.is,UserContextMenu);</script></dom-module><dom-module id="tc-userlist-style" assetpath="../ui/tc-userlist/"><template><style>#userlist *{outline:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;}#userlist{padding-bottom:20px;font-size:0;}#userlist.hidden #header,
  216. #userlist.hidden .list-item,
  217. .list-item.hidden{height:0;opacity:0;visibility:hidden;}#userlist > div{height:33px;overflow:hidden;opacity:1;visibility:visible;transition:.5s;animation:show-item .5s ease 0s 1;-webkit-animation:show-item .5s ease 0s 1;}@keyframes show-item{0%{height:0;opacity:0;visibility:visible;}100%{height:33px;opacity:1;visibility:visible;}}@-webkit-keyframes show-item{0%{height:0;opacity:0;visibility:visible;}100%{height:33px;opacity:1;visibility:visible;}}#userlist > div > span{position:relative;display:inline-block;height:30px;width:100%;padding-left:36px;border-radius:0 30px 30px 0;box-sizing:border-box;font-size:14px;color:#7b868a;line-height:30px;text-align:left;white-space:nowrap;overflow:hidden;transition:.2s;}#userlist > #header{position:relative;height:70px;top:33px;font-weight:600;text-transform:uppercase;cursor:default;animation:show-header .5s ease 0s 1;-webkit-animation:show-header .5s ease 0s 1;}@keyframes show-header{0%{height:0;opacity:0;visibility:visible;}100%{height:70px;opacity:1;visibility:visible;}}@-webkit-keyframes show-header{0%{height:0;opacity:0;visibility:visible;}100%{height:70px;opacity:1;visibility:visible;}}#button-banlist{position:absolute;display:block;height:24px;top:3px;right:0;padding:0 15px;border:none;border-radius:24px;font-size:12px;font-weight:700;color:#04caff;background-color:#202628;text-transform:none;cursor:pointer;opacity:1;visibility:visible;transition:.2s;-webkit-appearance:none;-moz-appearance:none;appearance:none;}#button-banlist:hover{color:#fff;background-color:#04caff;}#button-banlist:active{color:#fff;background-color:#38a8de;}#button-banlist.hidden{opacity:0;visibility:hidden;}.list-item > span[data-status=""]:hover{color:#fff;}.list-item > span[data-status="gold"]{color:#ffbe00;}.list-item > span[data-status="extreme"]{color:#ad6ed1;}.list-item > span[data-status="pro"]{color:#31ea5d;}.list-item > span[data-status="gold"]:before,
  218. .list-item > span[data-status="extreme"]:before,
  219. .list-item > span[data-status="pro"]:before{content:"";position:absolute;display:inline-block;height:12px;width:12px;top:9px;left:0;background-repeat:no-repeat;}.list-item > span[data-status="gold"]:before{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPHBhdGggZD0iTTAgMGg4LjAwNEMxMC4yMSAwIDEyIDEuNzk3IDEyIDMuOTk2djQuMDA4QzEyIDEwLjIxIDEwLjIwMyAxMiA4LjAwNCAxMkgwVjB6IiBmaWxsPSIjZWZhNzAxIi8+DQoJPHBhdGggaWQ9InN0YXR1cy1nb2xkIiBkPSJNNS45NSA1LjY1NmgyLjQ2NHYzLjA3OGMtLjY3LjIzLTEuNDA1LjM0NC0yLjIwNy4zNDQtLjg4IDAtMS41Ni0uMjU1LTIuMDQtLjc2NXMtLjcyMi0xLjI0LS43MjItMi4xODRjMC0uOTIzLjI2My0xLjY0Ljc5LTIuMTUzLjUyNS0uNTEzIDEuMjYyLS43NyAyLjIxLS43Ny4zNiAwIC43LjAzNCAxLjAxOC4xMDIuMzIuMDY2LjU5Ny4xNTIuODM0LjI1NmwtLjQ4OCAxLjIxYy0uNDEzLS4yMDItLjg2NS0uMzAzLTEuMzU3LS4zMDMtLjQ1IDAtLjguMTQ2LTEuMDQ1LjQ0LS4yNDYuMjkyLS4zNy43MS0uMzcgMS4yNTUgMCAuNTM0LjExMi45NC4zMzUgMS4yMi4yMjMuMjguNTQ0LjQyLjk2My40Mi4yMyAwIC40NC0uMDIyLjYzMy0uMDY2di0uODk0SDUuOTVWNS42NTZ6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4NCgk8dXNlIGZpbGw9IiMwMDAiIHhsaW5rOmhyZWY9IiNzdGF0dXMtZ29sZCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAxKSIgZmlsbC1vcGFjaXR5PSIuMiIvPg0KCTx1c2UgZmlsbD0iI2ZmZiIgeGxpbms6aHJlZj0iI3N0YXR1cy1nb2xkIi8+DQo8L3N2Zz4=);}.list-item > span[data-status="extreme"]:before{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPHBhdGggZD0iTTAgMGg4LjAwNEMxMC4yMSAwIDEyIDEuNzk3IDEyIDMuOTk2djQuMDA4QzEyIDEwLjIxIDEwLjIwMyAxMiA4LjAwNCAxMkgwVjB6IiBmaWxsPSIjYWQ2YmNlIi8+DQoJPHBhdGggaWQ9InN0YXR1cy1leHRyZW1lIiBkPSJNNy44MTMgOWgtMy4zOVYzLjI5aDMuMzl2MS4yMzdINS45NjV2LjloMS43MXYxLjIzN2gtMS43MXYxLjA3OGgxLjg0OHoiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI3N0YXR1cy1leHRyZW1lIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDEpIiBmaWxsLW9wYWNpdHk9Ii4yIi8+DQoJPHVzZSBmaWxsPSIjZmZmIiB4bGluazpocmVmPSIjc3RhdHVzLWV4dHJlbWUiLz4NCjwvc3ZnPg==);}.list-item > span[data-status="pro"]:before{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPHBhdGggZD0iTTAgMGg4LjAwNEMxMC4yMSAwIDEyIDEuNzk3IDEyIDMuOTk2djQuMDA4QzEyIDEwLjIxIDEwLjIwMyAxMiA4LjAwNCAxMkgwVjB6IiBmaWxsPSIjMzhjZDU3Ii8+DQoJPHBhdGggaWQ9InN0YXR1cy1wcm8iIGQ9Ik04LjIzNCA1LjEwNWMwIC42MzgtLjE4OCAxLjEzLS41NjQgMS40OC0uMzc2LjM0Ny0uOTEuNTItMS42MDQuNTJoLS40MzNWOUg0LjA5VjMuMjloMS45NzZjLjcyMiAwIDEuMjYzLjE1NyAxLjYyNS40NzIuMzYzLjMxNS41NDQuNzYzLjU0NCAxLjM0M3ptLTIuNi43NDNoLjI4Yy4yMzIgMCAuNDE2LS4wNjUuNTUzLS4xOTYuMTM3LS4xMy4yMDUtLjMxLjIwNS0uNTQgMC0uMzg0LS4yMTQtLjU3Ny0uNjQtLjU3N2gtLjR2MS4zMTN6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4NCgk8dXNlIGZpbGw9IiMwMDAiIHhsaW5rOmhyZWY9IiNzdGF0dXMtcHJvIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDEpIiBmaWxsLW9wYWNpdHk9Ii4yIi8+DQoJPHVzZSBmaWxsPSIjZmZmIiB4bGluazpocmVmPSIjc3RhdHVzLXBybyIvPg0KPC9zdmc+);}.list-item > span:hover{background-color:#272f31;cursor:pointer;}.list-item > span > img{position:absolute;display:inline-block;height:10px;width:10px;top:10px;left:20px;opacity:1;visibility:visible;transition:.2s;}.list-item > span > img[src=""]{opacity:0;visibility:hidden;}.list-item > span > .nickname{position:relative;display:inline-block;pointer-events:none;}.list-item > span[data-ignore="ignore"] > .nickname:before{content:'';position:absolute;display:block;height:2px;left:-1px;right:-1px;top:50%;border-top:1px solid #7b868a;background-color:#2e373a;transition:.2s;}.list-item > span[data-ignore="ignore"]:hover > .nickname:before{background-color:#272f31;}.list-item > span > span{position:absolute;display:inline-block;height:100%;min-width:0;top:0;right:0;padding:0 10px;background-color:#2d373a;box-shadow:0 0 3px 3px #2d373a;transition:.2s;}.list-item > span:hover > span{background-color:#272f31;box-shadow:0 0 3px 3px #272f31;}.list-item > span:hover > span[data-gift="1"]{min-width:16px;}.list-item > span:hover > span[data-cam="1"][data-gift="1"]{padding-right:30px;}.list-item > span > span[data-moderator="1"],
  220. .list-item > span:hover > span[data-moderator="1"]{min-width:33px;}.list-item > span > span[data-moderator="1"]:before{content:"";position:relative;display:inline-block;height:10px;width:11px;margin-right:8px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTEiIGhlaWdodD0iMTAiIHZpZXdCb3g9IjAgMCAxMSAxMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCA5LjhoMi42NlY0LjJsMi40OTIgMy44MDhoLjA1NmwyLjUwNi0zLjgzNlY5LjhoMi43MDJWMGgtMi44N0w1LjIwOCAzLjc5NCAyLjg3IDBIMCIgZmlsbD0iIzVhNjM2NiIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+);background-repeat:no-repeat;vertical-align:middle;}.list-item > span > span[data-cam="1"]:after{content:"";position:relative;display:inline-block;height:11px;width:14px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTEiIHZpZXdCb3g9IjAgMCAxNCAxMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQgMi43Nzd2NC41YzAgLjgxLS42MjggMS0xIC43NSAwIDAtMS42NjctMS44MzYtMi0yLjI1LS4zMzMtLjQxNC0uNjI3LS44NDcgMC0xLjVzMi0yLjI1IDItMi4yNWMuMzctLjI1IDEtLjA2IDEgLjc1ek0zIC4wMjdsNCAxYzEuMDktLjE3NSAyIDEuMDMgMiAydjNjMCAxLjgtLjkwOCAzLjAyOC0yIDNsLTQgMWMtMS42MDUuMjc0LTMtMS4wOTYtMy0zdi00YzAtMS44MzcgMS40LTMuMjQgMy0zeiIgZmlsbD0iIzVhNjM2NiIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+);background-repeat:no-repeat;vertical-align:middle;}.list-item > span > span > .send-gift{position:absolute;display:inline-block;height:14px;width:0;top:8px;right:0;padding:0;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOC4zMTMgMi4yNmMwLS42MDQuNDktMS4wOTMgMS4wOTMtMS4wOTMuNjA0IDAgMS4wOTQuNDkgMS4wOTQgMS4wOTMgMCAuNjA0LS40OSAxLjA5NC0xLjA5NCAxLjA5NEg3LjU4M2wuNzMuNzNWMi4yNnpNNyAyLjMzM3YyLjMzNGgyLjMzM2MxLjI5IDAgMi4zMzQtMS4wNDUgMi4zMzQtMi4zMzRDMTEuNjY3IDEuMDQ1IDEwLjYyMiAwIDkuMzMzIDAgOC4wNDUgMCA3IDEuMDQ1IDcgMi4zMzN6TTUuNjg4IDIuMjZjMC0uNjA0LS40OS0xLjA5My0xLjA5NC0xLjA5My0uNjA0IDAtMS4wOTQuNDktMS4wOTQgMS4wOTMgMCAuNjA0LjQ5IDEuMDk0IDEuMDk0IDEuMDk0aDEuODIzbC0uNzMuNzNWMi4yNnpNNyAyLjMzM3YyLjMzNEg0LjY2N2MtMS4yOSAwLTIuMzM0LTEuMDQ1LTIuMzM0LTIuMzM0QzIuMzMzIDEuMDQ1IDMuMzc4IDAgNC42NjcgMCA1Ljk1NSAwIDcgMS4wNDUgNyAyLjMzM3oiIGZpbGw9IiMwNGNhZmYiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGQ9Ik0wIDQuMmgxNFY3SDB6TS45MzMgOC40aDEyLjEzM1YxNEguOTMzeiIgZmlsbD0iIzA0Y2FmZiIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+);background-repeat:no-repeat;opacity:0;visibility:hidden;cursor:pointer;transition:.2s;}.list-item > span:hover > span[data-gift="1"] > .send-gift{width:14px;margin:0 8px 0 5px;opacity:1;visibility:visible;}#contextmenu{position:absolute;top:0;left:36px;}</style></template></dom-module><dom-module id="tc-userlist" assetpath="../ui/tc-userlist/"><template strip-whitespace=""><style include="tc-userlist-style"></style><div id="userlist"><div id="header"><span>Room users <button id="button-banlist" class="hidden" on-click="onBanlist">Ban list</button></span></div><dom-repeat items="[[_items]]"><template strip-whitespace=""><div class$="[[convertClass(item)]]"><span class="js-user-list-item" data-user-id$="[[item.handle]]" data-status$="[[convertSubType(item)]]" data-ignore$="[[convertIsIgnored(item)]]"><img src$="[[item.achivementUrl]]"><div class="nickname">[[item.nickname]]</div><span data-cam$="[[convertBool(item.isBroadcasting)]]" data-moderator$="[[convertBool(item.isOperator)]]" data-gift$="[[convertBool(item.isUsername)]]"><span class="send-gift" on-click="sendgiftTap"></span></span></span></div></template></dom-repeat><tc-user-contextmenu id="contextmenu" userlist="[[userlist]]"></tc-user-contextmenu></div></template><script>class ChatroomUserlist extends Polymer.Element{static get is(){return"tc-userlist"}static get properties(){return{userlist:{type:Object,observer:"userlistAssigned"},_items:Array,showContextMenuOnContextHandler:Object,showContextMenuOnClickHandler:Object}}constructor(){super()}connectedCallback(){super.connectedCallback(),this.showContextMenuOnContextHandler=this.showContextMenuOnContext.bind(this),this.showContextMenuOnClickHandler=this.showContextMenuOnClick.bind(this),document.body.addEventListener("contextmenu",this.showContextMenuOnContextHandler),window.addEventListener("click",this.showContextMenuOnClickHandler)}disconnectedCallback(){super.disconnectedCallback(),document.body.removeEventListener("contextmenu",this.showContextMenuOnContextHandler),window.removeEventListener("click",this.showContextMenuOnClickHandler)}get chatroom(){return this.userlist.chatroom}get app(){return this.userlist.chatroom.app}userlistAssigned(){let a=this,b=this.app.EventBus,c=TinychatApp.DAL.UserEntity;b.subscribe(TinychatApp.BLL.RoomConnected.ID,function(){a.chatroom.isOperator()&&a.$["button-banlist"].classList.remove("hidden")}),b.subscribe(TinychatApp.BLL.UserlistUpdateallEvent.ID,function(b){a.set("_items",Array.from(b.users))}),b.subscribe(TinychatApp.BLL.UserlistAddUserEvent.ID,function(b){let d=a._shiftIndex(a._items,b.index);a.splice("_items",d,0,Object.assign(new c,b.userentity))}),b.subscribe(TinychatApp.BLL.UserlistRemoveUserEvent.ID,function(b){let d=a._shiftIndex(a._items,b.index),e=Object.assign(new c,b.userentity);e.isDeleting=!0,a.notifyPath("_items."+d,e),setTimeout(()=>{let c=a._shiftIndex(a._items,b.index);a.splice("_items",c,1)},500)}),b.subscribe(TinychatApp.BLL.UserlistUpdateUserEvent.ID,function(b){if(b.fromIndex==b.toIndex){let d=a._shiftIndex(a._items,b.fromIndex);a.splice("_items",d,1,Object.assign(new c,b.toUserEntity))}else{let d=a._shiftIndex(a._items,b.fromIndex),e=Object.assign(new c,b.fromUserEntity);e.isDeleting=!0,a.notifyPath("_items."+d,e),setTimeout(()=>{let d=a._shiftIndex(a._items,b.fromIndex),e=Object.assign(new c,b.toUserEntity),f=a._shiftIndex(a._items,b.toIndex);a.splice("_items",d,1),a.splice("_items",f,0,e)},500)}}),b.subscribe(TinychatApp.BLL.IgnorelistUpdateUserEvent.ID,function(b){let d=-1;if(Object.keys(a._items).forEach(c=>{let e=a._items[c];if(e.handle===b.userentity.handle)return d=c,!0}),-1<d){let e=Object.assign(new c,b.userentity);a.notifyPath("_items."+d,e)}})}_shiftIndex(a,b){for(var c=b,d=0;d<b;d++)a[d].isDeleting&&(c+=1);return c}convertClass(a){var b="list-item";return a.isDeleting&&(b+=" hidden"),b}convertSubType(a){return TinychatApp.BLL.User.getCssClass(a)}convertIsIgnored(a){return this.userlist.isIgnored(a)?"ignore":""}convertBool(a){return a?"1":"0"}onBanlist(){this.app.Banlist()}sendgiftTap(a){this.userlist.chatroom.gotoGift(a.model.item)}showContextMenuOnContext(a){this.showContextMenu(a)&&a.preventDefault()}showContextMenuOnClick(a){this.showContextMenu(a,!0)&&a.preventDefault()}showContextMenu(a,b){if(void 0!=this.userlist){this.$.contextmenu.hide();var c=!1;let e=a.path?a.path[0]:(a.composedPath&&a.composedPath())[0];var d=parseInt(e.getAttribute("data-user-id"));let f=parseInt(e.getAttribute("data-chat-id"));!0!==b&&f&&(d=f);let g=this.userlist.get(d);if(null!=g&&(this.$.contextmenu.chatlist=d==f,this.$.contextmenu.user=g,c=!0),c){let b=this;setTimeout(()=>{b.$.contextmenu.show(a)},0)}return c}}}customElements.define(ChatroomUserlist.is,ChatroomUserlist);</script></dom-module><dom-module id="tc-volume-control-style" assetpath="../ui/tc-volume-control/"><template><style>*:focus{outline:none;}.icon-volume > button{position:relative;height:22px;width:22px;padding:0;border:none;background-color:transparent;cursor:pointer;}.icon-volume > button > svg{position:absolute;display:block;top:2px;left:4px;transition:.2s;}.icon-volume > button > svg + svg{left:3px;}.icon-volume.muted > button > svg + svg,
  221. .icon-volume > button > svg{opacity:1;visibility:visible;}.icon-volume.muted > button > svg:first-child,
  222. .icon-volume > button > svg + svg{opacity:0;visibility:hidden;}.icon-volume > .seek-wrapper{position:absolute;width:58px;top:6px;left:22px;}#seek-duration{position:absolute;height:22px;left:90px;bottom:0;font-size:12px;font-weight:600;color:#fff;line-height:22px;white-space:nowrap;cursor:default;}.seek-wrapper{height:10px;width:100%;padding:3px 5px;box-sizing:border-box;cursor:pointer;}.seek{position:relative;height:100%;width:100%;border-radius:4px;background-color:#fff;}.seek-text{position:absolute;height:20px;width:70px;top:-24px;margin-left:-35px;line-height:20px;text-align:center;opacity:0;transition:opacity .2s;}.seek-wrapper:hover > .seek > .seek-text{opacity:1;}.seek-text > span{display:inline-block;height:100%;padding:0 10px;border-radius:11px;font-size:12px;font-weight:600;color:#fff;background-color:rgba(0, 0, 0, .5);line-height:20px;}.seek-level{position:absolute;height:100%;top:0;left:0;border-radius:4px;background-color:#41b7ef;}.seek-level > div{position:absolute;display:block;height:4px;width:4px;top:0;right:-2px;border-radius:100%;background-color:#41b7ef;box-shadow:0 0 0 2px #41b7ef;transition:.2s;}.seek-wrapper:hover > .seek > .seek-level > div{box-shadow:0 0 0 3px #41b7ef;}</style></template></dom-module><dom-module id="tc-volume-control" assetpath="../ui/tc-volume-control/"><template strip-whitespace=""><style include="tc-volume-control-style"></style><div class$="[[iconClass]]"><button on-click="onMute"><svg width="14" height="18" viewBox="0 0 14 18" xmlns="http://www.w3.org/2000/svg"><path d="M11.148 15.86c.47.298.852.08.852-.455V2.6c0-.55-.376-.758-.852-.458L5.684 5.588H3.007C2.45 5.588 2 6.036 2 6.595v4.813c0 .556.452 1.007 1.007 1.007h2.677l5.464 3.446zm-8.14-1.44A3.01 3.01 0 0 1 0 11.41V6.595a3.008 3.008 0 0 1 3.007-3.013h2.1L10.085.444C11.88-.688 14 .458 14 2.6v12.806c0 2.123-2.123 3.285-3.916 2.154l-4.976-3.138h-2.1z" fill="#fff"></path></svg> <svg width="18" height="18" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><path d="M1.72 13.365A3.005 3.005 0 0 1 1 11.408V6.595a3.008 3.008 0 0 1 3.007-3.013h2.1L11.085.444C12.88-.688 15 .458 15 2.6v2.47l1.464-.915a1.003 1.003 0 1 1 1.063 1.702l-15.99 9.99a1.003 1.003 0 1 1-1.064-1.702l1.248-.78zM13 6.318v-3.72c0-.548-.376-.756-.852-.456L6.684 5.588H4.007C3.45 5.588 3 6.036 3 6.595v4.813c0 .363.192.68.48.858L13 6.318zM15 9.5v5.905c0 2.123-2.123 3.285-3.916 2.154l-4.47-2.82L8.5 13.56l3.648 2.3c.47.298.852.08.852-.455V10.75l2-1.25z" fill="#fff"></path></svg></button><div id="videos-header-volume" class="seek-wrapper"><div id="videos-header-volume-common" class="seek" style$="background-color: [[color]]" on-mouseleave="volTickTouchEnd" on-mousemove="volTickMouseMove" on-touchmove="volTickTouchMove" on-click="volTickClick" on-wheel="volWheel"><div id="videos-header-volume-level" class="seek-level" style$="width: [[vol]]%"><div on-mousedown="volTickMouseDown" on-touchstart="volTickTouchStart" on-touchend="volTickTouchEnd"></div></div></div></div></div></template><script>class VolumeControl extends Polymer.Element{static get is(){return"tc-volume-control"}static get properties(){return{volTickCaptured:{type:Boolean,value:!1},volume:{type:Number,value:100,observer:"_volTickSetVolumeObserver"},muted:{type:Boolean,value:!1},iconClass:{type:String,computed:"_computeIconClass(volume)"},volumeBefore:{type:Number,value:100},vol:{type:Number,value:100,notify:!0},color:{type:String,value:""}}}constructor(){super()}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}_computeIconClass(a){let b="icon-volume";return 0===a&&(b+=" muted"),b}onMute(){this._volMuteToggle()}volTickTouchStart(a){this.volTickCaptured||(a.preventDefault(),this.volTickCaptured=!0)}volTickTouchEnd(a){this.volTickCaptured&&(a.preventDefault(),this.volTickCaptured=!1)}volTickMouseDown(a){this.volTickCaptured||(a.preventDefault(),this.volTickCaptured=!0)}volTickMouseMove(a){if(this.volTickCaptured){a.preventDefault!==void 0&&a.preventDefault();let b=this.$["videos-header-volume-common"],c=b.getBoundingClientRect(),d=Math.round(100*(a.clientX-c.left)/c.width);100<d?d=100:0>d&&(d=0),this.volume=d}}volTickTouchMove(a){if(1===a.touches.length){a.preventDefault();let b=a.touches[0];this.volTickMouseMove(b)}}volTickClick(a){a.preventDefault();let b=a.target,c=b.getBoundingClientRect();this.volume=Math.round(100*(a.clientX-c.left)/c.width)}volWheel(a){a.preventDefault();let b=-1<navigator.userAgent.toLowerCase().indexOf("firefox")?-100:-10,c=a.target,d=c.getBoundingClientRect(),e=this.volume+Math.round(a.deltaY*b/d.width);100<e?e=100:0>e&&(e=0),this.volume=e}_volTickSetVolumeObserver(a,b){var c=Math.round;let d=c(a);100<d&&(d=100),0>d&&(d=0);let e=c(b);100<e&&(e=100),0>e&&(e=0),this.vol=d;let f=null;0>=e&&0<d?f=!1:0<e&&0>=d&&(f=!0),null!==f&&f!==this.mute&&this._volMuteToggle(f,!1)}_volMuteToggle(a,b){let c=this.muted;a!==c&&(this.muted=!this.muted,void 0!==b||(this.muted?(this.volumeBefore=this.volume,this.volume=0):this.volume=this.volumeBefore))}}customElements.define(VolumeControl.is,VolumeControl);</script></dom-module><dom-module id="tc-video-item-style" assetpath="../ui/tc-video-item/"><template><style>*:focus{outline:none;}.on-white-scroll{padding-left:16px;box-sizing:border-box;overflow-x:hidden;overflow-y:scroll;}.on-white-scroll::-webkit-scrollbar{position:absolute;width:15px;cursor:pointer;}.on-white-scroll::-webkit-scrollbar-track{background-color:#fff;}.on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #fff;border-radius:6px/8px;background-color:rgba(0, 0, 0, .2);}.on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}.video{position:relative;width:100%;padding:5px;box-sizing:border-box;font-size:0;overflow:hidden;}.video > div{position:relative;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNjQiIHZpZXdCb3g9IjAgMCA0OCA2NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGZpbGw9IiM1YTYzNjYiIGQ9Ik0xNCAxMy45OTR2MjAuMDEyQzE0IDM5LjUyMyAxOC40NzggNDQgMjQgNDRjNS41MTUgMCAxMC00LjQ4IDEwLTkuOTk0VjEzLjk5NEMzNCA4LjQ3NyAyOS41MjIgNCAyNCA0Yy01LjUxNSAwLTEwIDQuNDgtMTAgOS45OTR6TTI2IDU3LjkydjQuMDgyQTEuOTk0IDEuOTk0IDAgMCAxIDI0IDY0Yy0xLjEwNSAwLTItLjg4Ny0yLTEuOTk4VjU3LjkyQzkuNjk4IDU2LjkyOCAwIDQ2Ljg2IDAgMzQuNTg2YTIgMiAwIDAgMSA0IDBDNCA0NS4yODMgMTIuOTUgNTQgMjQgNTRjMTEuMDYgMCAyMC04LjcwMyAyMC0xOS40MTRhMiAyIDAgMCAxIDQgMGMwIDEyLjI4Ni05LjY5IDIyLjM0NC0yMiAyMy4zMzR6TTEwIDEzLjk5NEMxMCA2LjI3IDE2LjI3NyAwIDI0IDBjNy43MyAwIDE0IDYuMjY3IDE0IDEzLjk5NHYyMC4wMTJDMzggNDEuNzMgMzEuNzIzIDQ4IDI0IDQ4Yy03LjczIDAtMTQtNi4yNjctMTQtMTMuOTk0VjEzLjk5NHoiLz4KPC9zdmc+);background-repeat:no-repeat;background-position:center;background-color:#2a2c2c;overflow:hidden;}video{width:100%;}.video > div:before{content:'';display:block;width:100%;padding-bottom:75%;}.video:after{content:'';position:absolute;display:block;height:100%;width:100%;top:0;left:0;border:5px solid #fff;border-radius:10px;box-sizing:border-box;pointer-events:none;}.video[data-mode="dark"]:after{border-color:#101314;}.video:not(.blured):hover > div > svg{top:-24px;left:-24px;transition:.2s ease .2s;}.video:after{}.video:not(.blured):hover > div.pro:after,
  223. .video:not(.blured):hover > div.extreme:after,
  224. .video:not(.blured):hover > div.gold:after{top:-24px;right:-24px;transition:.2s ease .2s;}.video > div > div{position:relative;width:100%;}.video > div > video,
  225. .video > div > iframe{position:absolute;height:100%;top:0;left:0;}.video > div > iframe{width:100%;}.video > div.ratio-16-9 > video,
  226. .video > div.ratio-16-9 > iframe{left:-16.66%;}.video > div.ratio-8-5 > video,
  227. .video > div.ratio-8-5 > iframe{left:-10%;}.video > div.ratio-3-2 > video,
  228. .video > div.ratio-3-2 > iframe{left:-6.25%;}.video > div > .overlay{position:absolute;height:100%;width:100%;top:0;left:0;box-shadow:inset 0 0 0 0 rgba(0, 0, 0, .5);transition:.2s;}.video:not(.blured):hover > div > .overlay{box-shadow:inset 0 0 100px 0 rgba(0, 0, 0, .5);}.icon-visibility,
  229. .icon-resize,
  230. .icon-report,
  231. .icon-filter,
  232. .icon-close{position:absolute;height:22px;width:22px;top:-22px;padding:0;border:none;background-color:transparent;cursor:pointer;opacity:.9;transition:.2s;}.icon-visibility{left:-22px;}.icon-resize{left:50%;margin-left:-11px;}.icon-report,
  233. .icon-close{right:-22px;}.icon-filter{width:26px;right:-26px;}.icon-visibility:hover,
  234. .icon-resize:hover,
  235. .icon-report:hover,
  236. .icon-filter:hover,
  237. .icon-close:hover{opacity:1;}.video:not(.blured):hover > div > .overlay > .icon-visibility,
  238. .video:not(.blured):hover > div > .overlay > .icon-resize,
  239. .video:not(.blured):hover > div > .overlay > .icon-report,
  240. .video:not(.blured):hover > div > .overlay > .icon-filter,
  241. .video:not(.blured):hover > div > .overlay > .icon-close{top:12px;transition:top .2s ease .2s,
  242. left .2s ease .2s,
  243. right .2s ease .2s,
  244. opacity .2s;}.video:not(.blured):hover > div > .overlay > .icon-visibility{left:14px;}.video:not(.blured):hover > div > .overlay > .icon-report,
  245. .video:not(.blured):hover > div > .overlay > .icon-close{right:14px;}.video:not(.blured):hover > div > .overlay > .icon-filter{right:12px;}.icon-visibility > svg,
  246. .icon-resize > svg,
  247. .icon-report > svg,
  248. .icon-filter > svg,
  249. .icon-close > svg{position:absolute;}.video.not-visible > div > .overlay > .icon-visibility > svg,
  250. .icon-visibility > svg{top:4px;left:1px;opacity:0;visibility:hidden;transition:.2s;}.video.not-visible > div > .overlay > .icon-visibility > svg:first-child,
  251. .icon-visibility > svg + svg{opacity:1;visibility:visible;}.video.not-visible > div > iframe{visibility:hidden;}.icon-resize > svg{top:3px;left:3px;}.icon-resize > svg > path{transition:.2s;}.video.large > div > .overlay > .icon-resize > svg > path + path{opacity:0;visibility:hidden;}.icon-report > svg{top:3px;left:3px;}.icon-filter > svg{top:1px;left:0;}.icon-close > svg{top:4px;left:4px;}.icon-context{position:absolute;height:22px;width:22px;bottom:-22px;right:-22px;padding:0;border:none;background-color:transparent;cursor:pointer;opacity:.9;transition:.2s;}.icon-context:hover{opacity:1;}.video:not(.blured):hover > div > .overlay > .icon-context{bottom:7px;right:16px;transition:bottom .2s ease .2s,
  252. right .2s ease .2s,
  253. opacity .2s;}.icon-context > svg{position:absolute;top:9px;left:1px;}.video-context{position:absolute;display:flex;flex-direction:column;align-content:center;top:0;bottom:0;left:0;right:0;padding-top:10px;padding-bottom:10px;border-radius:4px;border:1px solid rgba(0, 0, 0, .06);box-sizing:border-box;font-size:0;color:#535353;text-align:left;line-height:1;background-color:rgba(0, 0, 0, .7);box-shadow:0 1px 4px 0 rgba(0, 0, 0, .09);z-index:1;opacity:0;visibility:hidden;transition:.2s;}.video-context::-webkit-scrollbar-track{background-color:transparent;}.video-context::-webkit-scrollbar-thumb{border:5px solid transparent;border-radius:6px/8px;background-color:rgba(255, 255, 255, .1);background-clip:content-box;}.video-context::-webkit-scrollbar-thumb:hover{background-color:rgba(255, 255, 255, .2);}.video:not(.blured):hover > div > .overlay > .icon-context:focus + .video-context{opacity:1;visibility:visible;}.video-context-content{margin:0 auto;}.video-context-content > div{text-align:center;}.video-context-content > div + div{padding-top:5px;}.video-context-content > div > button{display:block;width:100%;padding:0 20px;border:none;border-radius:4px;box-sizing:border-box;font-size:13px;font-weight:600;color:#fff;background-color:transparent;line-height:26px;cursor:pointer;transition:.2s;}.video-context-content > div > button:hover{color:#fff;background-color:#04caff;}.icon-volume{position:absolute;height:22px;left:-22px;bottom:-22px;opacity:.9;transition:.2s;}.icon-volume:hover{opacity:1;}.video:not(.blured):hover > div > .overlay > .icon-volume{left:16px;bottom:16px;transition:bottom .2s ease .2s,
  254. left .2s ease .2s,
  255. opacity .2s;}#icon-state > button{position:relative;height:22px;width:22px;padding:0;border:none;background-color:transparent;cursor:pointer;}#icon-state > button > svg{position:absolute;display:block;top:2px;left:2px;}#icon-state > button > svg + svg{top:1px;left:2px;transition:.2s;}#icon-state > button > svg{opacity:1;visibility:visible;}#icon-state > button > svg + svg{opacity:0;visibility:hidden;}.video > div > .waiting{position:absolute;height:100%;width:100%;top:0;left:0;background-color:#202628;opacity:0;visibility:hidden;transition:.2s;}.video > div.wait > .waiting{opacity:1;visibility:visible;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #04caff;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite paused;-webkit-animation:waiting 1s ease-in-out 0s infinite paused;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}.video > div.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}.video > div > .blured{position:absolute;height:100%;width:100%;top:0;left:0;background-color:rgba(30, 38, 40, .8);font-size:0;white-space:nowrap;z-index:1;opacity:0;visibility:hidden;transition:.2s;}.video.blured > div > .blured{opacity:1;visibility:visible;}.video.blured > div > video{filter:blur(5px);}.video > div > .blured:before{content:'';display:inline-block;height:100%;width:0;vertical-align:middle;}.video > div > .blured > .blured-content{width:100%;display:inline-block;padding:10px;box-sizing:border-box;font-weight:400;font-size:14px;vertical-align:middle;white-space:normal;text-align:center;}.video > div > .blured > .blured-content > div{padding:8px 0 24px;color:#fff;}.video > div > .blured > .blured-content > a{display:inline-block;padding:0 30px;border-radius:15px;box-sizing:border-box;font-size:12px;font-weight:700;color:#fff;line-height:30px;background-color:#04caff;text-align:center;text-decoration:none;cursor:pointer;transition:.2s;}.video > div > .blured > .blured-content > a:hover{background-color:#54ccf3;}.video > div > .blured > .blured-content > a:active{background-color:#38a8de;}.video > div > svg{position:absolute;top:5px;left:5px;filter:drop-shadow(0 0 4px #04caff);-webkit-filter:drop-shadow(0 0 4px #04caff);opacity:0;transition:.2s;}#videos-content > #videos > .video:not(.blured):hover > div > svg{top:-24px;left:-24px;transition:.2s ease .2s;}.video > div > svg > circle{fill:#fff;fill-rule:evenodd;stroke:#fff;stroke-width:0;transition:.2s;}.video > div > svg[data-mic-level="1"]{opacity:.5;}.video > div > svg[data-mic-level="2"]{opacity:.8;}.video > div > svg[data-mic-level="3"],
  256. .video > div > svg[data-mic-level="4"],
  257. .video > div > svg[data-mic-level="5"],
  258. .video > div > svg[data-mic-level="6"],
  259. .video > div > svg[data-mic-level="7"],
  260. .video > div > svg[data-mic-level="8"],
  261. .video > div > svg[data-mic-level="9"],
  262. .video > div > svg[data-mic-level="10"]{opacity:1;}.video > div > svg[data-mic-level="4"] > circle{stroke-width:1;}.video > div > svg[data-mic-level="5"] > circle{stroke-width:2;}.video > div > svg[data-mic-level="6"] > circle{stroke-width:3;}.video > div > svg[data-mic-level="7"] > circle{stroke-width:4;}.video > div > svg[data-mic-level="8"] > circle{stroke-width:5;}.video > div > svg[data-mic-level="9"] > circle{stroke-width:6;}.video > div > svg[data-mic-level="10"] > circle{stroke-width:7;}.video > div > .nickname{position:absolute;display:block;height:15px;left:10px;right:10px;bottom:12px;margin-bottom:-7px;font-size:12px;font-weight:600;color:#fff;text-align:center;text-shadow:0 0 6px rgba(0, 0, 0, .8);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:default;transition:.2s;}.video > div > .nickname > img{position:relative;display:inline-block;height:10px;width:10px;top:2px;margin-right:6px;opacity:1;visibility:visible;transition:.2s;}.video > div > .nickname > img[src=""]{width:0;margin-right:0;overflow:hidden;opacity:0;visibility:hidden;}.video:not(.blured):hover > div > .nickname{bottom:50%;transition:.2s ease .2s;}.video > div.gold:after,
  263. .video > div.extreme:after,
  264. .video > div.pro:after{content:'';position:absolute;display:block;height:24px;width:24px;top:10px;right:10px;background-repeat:no-repeat;transition:.2s;}.video > div.gold:after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+Cgk8Y2lyY2xlIGZpbGw9IiNmZmM2MmMiIGN4PSIxMiIgY3k9IjEyIiByPSIxMiIvPgoJPHBhdGggaWQ9ImJhZGdlLWdvbGQiIGQ9Ik0xNiAxMi41NzZ2LTEuMDE4aC0zLjU5NnYxLjUxaDEuMjZsLS4wMTIuMTA4Yy0uMDcuNjIyLS42MyAxLjAzNC0xLjQyIDEuMDM0LTEuMDY1IDAtMS43NTgtLjg0LTEuNzU4LTIuMjUgMC0xLjM3Ny42MDctMi4xNyAxLjYzOC0yLjE3LjY5OCAwIDEuMjQyLjM3IDEuNDAzLjkzN2gyLjM4OEMxNS43MiA5LjE0IDE0LjE3MyA4IDEyLjEgOCA5LjU1MiA4IDggOS40NTcgOCAxMS45OTIgOCAxNC41NiA5LjU1MiAxNiAxMi4xNzUgMTZjMi40IDAgMy44MjUtMS4zMDcgMy44MjUtMy40MjR6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI2JhZGdlLWdvbGQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgMSkiIGZpbGwtb3BhY2l0eT0iLjIiLz4KCTx1c2UgZmlsbD0iI2ZmZiIgeGxpbms6aHJlZj0iI2JhZGdlLWdvbGQiLz4KPC9zdmc+);}.video > div.extreme:after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPGNpcmNsZSBmaWxsPSIjYWQ2YmNlIiBjeD0iMTIiIGN5PSIxMiIgcj0iMTIiLz4NCgk8cGF0aCBpZD0iYmFkZ2UtZXh0cmVtZSIgZD0iTTE0IDE2SDlWOGg1djEuNzM1aC0yLjcyNXYxLjI1OGgyLjUyM3YxLjczNWgtMi41MjN2MS41MUgxNHoiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI2JhZGdlLWV4dHJlbWUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgMSkiIGZpbGwtb3BhY2l0eT0iLjIiLz4NCgk8dXNlIGZpbGw9IiNmZmYiIHhsaW5rOmhyZWY9IiNiYWRnZS1leHRyZW1lIi8+DQo8L3N2Zz4=);}.video > div.pro:after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPGNpcmNsZSBmaWxsPSIjMzhjZDU3IiBjeD0iMTIiIGN5PSIxMiIgcj0iMTIiLz4NCgk8cGF0aCBpZD0iYmFkZ2UtcHJvIiBkPSJNMTUgMTAuNTQ0YzAgLjg5NC0uMjcyIDEuNTg1LS44MTcgMi4wNzItLjU0NS40ODctMS4zMi43My0yLjMyMi43M2gtLjYyNlYxNkg5VjhoMi44NmMxLjA0NiAwIDEuODMuMjIgMi4zNTQuNjYyLjUyNC40NDIuNzg2IDEuMDcuNzg2IDEuODgyem0tMy43NjYgMS4wNGguNDA3Yy4zMzYgMCAuNjAzLS4wOS44LS4yNzMuMi0uMTgyLjI5OC0uNDM0LjI5OC0uNzU1IDAtLjU0LS4zMS0uODEtLjkyNy0uODFoLS41NzZ2MS44NHoiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI2JhZGdlLXBybyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAxKSIgZmlsbC1vcGFjaXR5PSIuMiIvPg0KCTx1c2UgZmlsbD0iI2ZmZiIgeGxpbms6aHJlZj0iI2JhZGdlLXBybyIvPg0KPC9zdmc+);}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@media screen and (max-width: 600px){#videos{top:12px;right:13px;bottom:12px;left:13px;}.video{padding:2px;}.video:after{border-width:2px;border-radius:4px;}}.video.full-screen:after{border-color:#101314;}</style></template></dom-module><dom-module id="tc-video-item" assetpath="../ui/tc-video-item/"><template strip-whitespace=""><style include="tc-video-item-style"></style><div class$="[[videoItemStyle]]" on-click="onVideoTap" on-change="recalcVideosPosition" data-mode$="[[modeStyle]]"><div class$="[[convertVideoClass(item, item.progress)]]"><video id="video" autoplay="" volume="[[volume]]" data-video-id$="[[item.handle]]" on-playing="onPlaying" playsinline="">Your browser does not support the video tag...</video><div class="overlay"><button on-click="onHide" class="icon-visibility"><svg width="20" height="14" viewBox="0 0 20 14" xmlns="http://www.w3.org/2000/svg"><path d="M10 14C3.285 14 .52 8.65.52 8.65c-.657-.9-.68-2.417-.128-3.362C.392 5.288 2.452 0 10 0c7.545 0 9.594 5.27 9.594 5.27.6.94.51 2.465-.108 3.37 0 0-2.774 5.36-9.487 5.36zm0-2c2.423 0 4.374-.814 5.942-2.185a9.2 9.2 0 0 0 1.386-1.51c.212-.293.338-.5.38-.583l.057-.108.07-.1c.19-.282.217-.94.07-1.17L17.8 6.18l-.072-.184a3.74 3.74 0 0 0-.268-.485 6.67 6.67 0 0 0-1.178-1.393C14.827 2.8 12.798 2 10 2s-4.83.803-6.29 2.125c-.495.45-.887.928-1.182 1.4-.163.26-.25.436-.27.49L2.2 6.16l-.08.137c-.17.29-.15.946.018 1.176l.09.123.07.136c.042.08.168.29.378.58A9.167 9.167 0 0 0 4.06 9.82C5.624 11.187 7.573 12 9.997 12zm0-3a2 2 0 1 1 0-4 2 2 0 0 1 0 4z" fill="#fff" fill-rule="evenodd"></path></svg> <svg width="20" height="14" viewBox="0 0 20 14" xmlns="http://www.w3.org/2000/svg"><path d="M3.63 12.024C1.474 10.5.52 8.65.52 8.65c-.657-.9-.68-2.417-.128-3.362C.392 5.288 2.452 0 10 0c1.94 0 3.52.35 4.79.867l.594-.592a.945.945 0 0 1 1.34.006.953.953 0 0 1 .004 1.34L4.616 13.724a.945.945 0 0 1-1.34-.006.953.953 0 0 1-.004-1.34l.357-.356zm9.598-9.594c-.942-.28-2.013-.43-3.23-.43-2.797 0-4.83.803-6.288 2.125-.496.45-.888.928-1.183 1.4-.163.26-.25.436-.27.49L2.2 6.16l-.08.137c-.17.29-.15.946.017 1.176l.09.123.07.136c.042.08.168.29.378.58A9.167 9.167 0 0 0 4.058 9.82c.32.28.656.535 1.01.766l8.16-8.156zm-6.08 11.222l1.713-1.714c.368.04.747.062 1.14.062 2.423 0 4.374-.814 5.942-2.185a9.2 9.2 0 0 0 1.386-1.51c.212-.293.338-.5.38-.583l.057-.108.07-.1c.19-.282.217-.94.07-1.17L17.8 6.18l-.072-.184a3.74 3.74 0 0 0-.268-.485 6.577 6.577 0 0 0-.972-1.2l1.415-1.414c1.244 1.225 1.69 2.374 1.69 2.374.6.94.512 2.465-.107 3.37 0 0-2.774 5.36-9.487 5.36-1.046 0-1.995-.13-2.853-.348z" fill="#fff" fill-rule="evenodd"></path></svg></button> <button on-click="onVideoResize" class="icon-resize"><svg width="18" height="18" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><path d="M14.37 12.95l3.335 3.336a1.003 1.003 0 1 1-1.42 1.42L12.95 14.37a8.028 8.028 0 1 1 1.42-1.42zm-6.342 1.1a6.02 6.02 0 1 0 0-12.042 6.02 6.02 0 0 0 0 12.042zM6.012 9.032a.996.996 0 0 1-.994-1.004c0-.554.452-1.003.994-1.003h4.033c.55 0 .994.445.994 1.003 0 .555-.454 1.004-.995 1.004H6.012z" fill="#fff" fill-rule="evenodd"></path><path d="M0 .99C0 .445.444 0 1 0a1 1 0 0 1 1 .99v4.02C2 5.555 1.556 6 1 6a1 1 0 0 1-1-.99V.99z" transform="translate(7 5)" fill="#fff" fill-rule="evenodd"></path></svg></button><dom-if if="[[item.abuseAllow]]"><template strip-whitespace=""><button on-click="onAbuse" class="icon-report"><svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M.025.776A.997.997 0 0 1 1.038 0H14.52c1.142 0 1.753.835 1.36 1.877l-.658 1.746c-.39 1.036-.393 2.712 0 3.754l.658 1.746C16.27 10.16 15.66 11 14.52 11H2v4c0 .552-.444 1-1 1-.552 0-1-.445-1-1V.995C0 .92.01.845.025.775zM2.075 9h11.553l-.354-.94c-.56-1.48-.558-3.64 0-5.12l.354-.94H2.074v7z" fill="#fff" fill-rule="evenodd"></path></svg></button></template></dom-if><dom-if if="[[item.filtersAllow]]"><template strip-whitespace=""><button on-click="onFilters" class="icon-filter"><svg width="26" height="20" viewBox="0 0 26 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.6 10.4L18 12l-6.4 1.6L10 20l-1.6-6.4L2 12l6.4-1.6L10 4l1.6 6.4zM22 5l4 1-4 1-1 4-1-4-4-1 4-1 1-4 1 4zM3.6 2.4L6 3l-2.4.6L3 6l-.6-2.4L0 3l2.4-.6L3 0l.6 2.4z" fill="#fff" fill-rule="evenodd"></path></svg></button></template></dom-if><div class="icon-context" tabindex="-1"><svg width="20" height="4" viewBox="0 0 20 4" xmlns="http://www.w3.org/2000/svg"><circle r="2" cx="2" cy="2" fill="#fff" fill-rule="evenodd"></circle><circle r="2" cx="10" cy="2" fill="#fff" fill-rule="evenodd"></circle><circle r="2" cx="18" cy="2" fill="#fff" fill-rule="evenodd"></circle></svg></div><div class="video-context on-white-scroll" onmouseleave="this.previousElementSibling.blur();"><div class="video-context-content"><dom-if if="[[item.videoForceCloseAllow]]"><template strip-whitespace=""><div><button on-click="onVideoForceClose">Close Video</button></div></template></dom-if><dom-if if="[[item.ignoreAllow]]"><template strip-whitespace=""><div><button on-click="onIgnore">Ignore</button></div></template></dom-if><dom-if if="[[item.unignoreAllow]]"><template strip-whitespace=""><div><button on-click="onUnignore">Unignore</button></div></template></dom-if><dom-if if="[[item.followAllow]]"><template strip-whitespace=""><div><button on-click="onFollow">Follow</button></div></template></dom-if><dom-if if="[[item.openprivateAllow]]"><template strip-whitespace=""><div><button on-click="onPrivateMessage">Private Message</button></div></template></dom-if><dom-if if="[[item.profileAllow]]"><template strip-whitespace=""><div><button on-click="onProfile">Profile</button></div></template></dom-if><dom-if if="[[item.banAllow]]"><template strip-whitespace=""><div><button on-click="onBan">Ban</button></div></template></dom-if><dom-if if="[[item.kickAllow]]"><template strip-whitespace=""><div><button on-click="onKick">Kick</button></div></template></dom-if><dom-if if="[[item.abuseAllow]]"><template strip-whitespace=""><div><button on-click="onAbuse">Report (Abuse)</button></div></template></dom-if><dom-if if="[[item.giveagiftAllow]]"><template strip-whitespace=""><div><button on-click="onSendGift">Send Gift</button></div></template></dom-if><dom-if if="[[item.upgradeAllow]]"><template strip-whitespace=""><div><button on-click="onUpgrade">Upgrade</button></div></template></dom-if></div></div><dom-if if="[[item.volumeControlAllow]]"><template strip-whitespace=""><div class="icon-volume"><tc-volume-control vol="{{internalVolume}}"></tc-volume-control></div></template></dom-if></div><div class="waiting"><div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div></div><svg width="20" height="20" viewBox="0 0 24 24" data-mic-level$="[[item.audiolevel]]" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="3"></circle><circle cx="12" cy="12" r="3"></circle></svg> <span class="nickname" title="[[item.nickname]]"><img src$="[[item.achivementUrl]]"> [[item.nickname]]</span><div class="blured"><div class="blured-content"><svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><path fill="#fff" fill-rule="evenodd" opacity=".3" d="M20 40C8.954 40 0 31.046 0 20S8.954 0 20 0s20 8.954 20 20-8.954 20-20 20zm3-22h-6v-1.583C17 14.533 18.346 13 20 13s3 1.533 3 3.417V18zm1.564-.566v-1.675C24.564 13.131 22.521 11 20 11s-4.564 2.13-4.564 4.759v1.675c-.847.401-1.436 1.29-1.436 2.324v5.69c0 1.034.589 1.923 1.436 2.324.308.147.65.228 1.011.228h7.106c.36 0 .703-.081 1.011-.227.847-.401 1.436-1.29 1.436-2.324v-5.691c0-1.033-.589-1.923-1.436-2.324z"></path></svg><div>Upgrade for unlimited video</div><a href="/subscription/intro?utm_source=vidtimeout" target="_self">Upgrade</a></div></div></div></div></template><script>class ChatroomVideoItem extends Polymer.Element{static get is(){return"tc-video-item"}static get properties(){return{item:{type:Object,observer:"itemAssigned"},chatroom:{type:Object},app:{type:Object},videolist:{type:Object},externalVolume:{type:Number,value:100},internalVolume:{type:Number,value:100},volume:{type:Number,computed:"_volumeCompute(internalVolume, externalVolume)"},modeStyle:String,isFullScreen:{type:Boolean,value:!1},onFullscreenHandler:Object,videoItemStyle:{type:String,computed:"_videoItemStyleCompute(item.large, item.muted, item.hidden, isFullScreen, item.blured)"},_timerId:{type:Number,value:-1}}}constructor(){super()}connectedCallback(){super.connectedCallback(),this.onFullscreenHandler=this.onFullscreen.bind(this),window.fullscreenManager.addEventListener(this.onFullscreenHandler,!1),this._timerId=setInterval(this.refreshBlured.bind(this),5e3)}disconnectedCallback(){super.disconnectedCallback(),window.fullscreenManager.removeEventListener(this.onFullscreenHandler,!1),clearInterval(this._timerId)}refreshBlured(){this.notifyPath("item.blured")}itemAssigned(a){let b=this.$.video;b.srcObject=a.mediastream,b.muted=a.muted,this.internalVolume=a.volume,this.modeStyle=this.app.setDarkModeCSSclass(this.app.settings.isDarkMode());let c=this,d=this.app.EventBus;d.subscribe(TinychatApp.BLL.SettingsChangedEvent.ID,a=>{c.modeStyle=c.app.setDarkModeCSSclass(a.settingsEntity.darkMode)})}_volumeCompute(a,b){let c=100;return void 0===a&&void 0!==b?c=b:void 0!==a&&void 0===b?c=a:void 0!==a&&void 0!==b&&(c=b<a?b:a),this.item.volume!==c&&(this.item.volume=c,this.notifyPath("item.volume")),c/100}_videoItemStyleCompute(a,b,c,d,e){let f=["video"];return a&&f.push("large"),b&&f.push("muted"),c&&f.push("not-visible"),d&&f.push("full-screen"),e&&f.push("blured"),f.join(" ")}convertVideoClass(a,b){var c="ratio-4-3";let d=TinychatApp.BLL.User.getCssClass(a.userentity);return c+=""===d?"":` ${d}`,c+=b?" wait":"",c}onPlaying(a){this.dispatchEvent(new CustomEvent("video-playing",a))}onMute(){this.videolist.toggleMuteVW(this.item)}onVideoTap(){}onHide(){this.videolist.toggleHiddenVW(this.item)}onVideoResize(){if(!this.chatroom.selfUser().hasSubscriptions)this.app.Upgrade();else{if(null!=this.ytplayer)return void this.app.showToast("Larger video windows are disabled due Youtube is playing");this.videolist.toggleSizeVW(this.item),this.notifyPath("item.large")}}onBan(){return this.chatroom.isLurker()?void this.app.showToastLurker():void this.chatroom.userlist.ban(this.item.userentity)}onKick(){return this.chatroom.isLurker()?void this.app.showToastLurker():void this.chatroom.userlist.kick(this.item.userentity)}onAbuse(){return this.chatroom.isLurker()?void this.app.showToastLurker():void this.chatroom.Abuse(this.item.userentity)}onFilters(){return this.app.isSafari()?void this.app.showToastWarn("Sorry, your browser doesn't support this feature."):void this.app.MediaFilters()}onFullscreen(){this.isFullScreen=window.fullscreenManager.status()}onVideoForceClose(){this.chatroom.userlist.videoForceClose(this.item.userentity)}onIgnore(){this.chatroom.userlist.ignore(this.item.userentity)}onUnignore(){this.chatroom.userlist.unignore(this.item.userentity)}onFollow(){return this.chatroom.isLurker()?void this.app.showToastLurker():void this.chatroom.userlist.follow(this.item.userentity)}onUnfollow(){return this.chatroom.isLurker()?void this.app.showToastLurker():void this.chatroom.userlist.unfollow(this.item.userentity)}onPrivateMessage(){this.chatroom.chatlog.openprivate(this.item.userentity)}onProfile(){let a=this.item.userentity;a.isUsername?this.app.UserProfile(a.username):this.app.showToast("["+a.nickname+"] is anonymous, therefore has no profile")}onSendGift(){let a=this.item.userentity;a.isUsername?this.app.GiveAGift(a.username):this.app.showToast("["+a.nickname+"] is anonymous, virtual gifts for registered users only.")}onUpgrade(){this.app.UpgradeSub()}onFeatured(){this.videolist.toggleFeatured(this.item)}}customElements.define(ChatroomVideoItem.is,ChatroomVideoItem);</script></dom-module><dom-module id="tc-videolist-style" assetpath="../ui/tc-videolist/"><template><style>#videolist *{user-select:none;-webkit-user-select:none;-moz-user-select:none;}*:focus{outline:none;}.on-white-scroll{padding-left:16px;box-sizing:border-box;overflow-x:hidden;overflow-y:scroll;}.on-white-scroll::-webkit-scrollbar{position:absolute;width:15px;cursor:pointer;}.on-white-scroll::-webkit-scrollbar-track{background-color:#fff;}.on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #fff;border-radius:6px/8px;background-color:rgba(0, 0, 0, .2);}.on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}#ytplayer{pointer-events:auto;}:host,
  265. #videolist{position:relative;display:flex;flex-direction:column;align-items:stretch;height:100%;min-height:250px;width:100%;background-color:#fff;}#videolist[data-mode="dark"]{background-color:#101314;}#lurker{height:0;min-height:0;padding:0 20px;box-sizing:border-box;font-size:14px;font-weight:600;color:#fff;line-height:40px;background-color:#f29e20;text-align:center;white-space:nowrap;overflow:hidden;cursor:default;transition:.2s;}#lurker > *{vertical-align:middle;}#lurker > span{display:inline-block;margin:0 14px 0 10px;line-height:24px;}#lurker > button{display:inline-block;height:24px;padding:0 18px;border:1px solid #fff;font-size:12px;font-weight:700;color:#fff;line-height:24px;background-color:transparent;text-transform:uppercase;cursor:pointer;transition:.2s;-webkit-appearance:none;-moz-appearance:none;appearance:none;}#lurker > button:hover{color:#f29e20;background-color:#fff;}#videolist.lurker > #lurker{height:40px;min-height:40px;}#videos-header{height:50px;min-height:50px;width:100%;top:0;left:0;font-size:0;background-color:#fff;z-index:1;transition:.2s;}[data-mode="dark"] #videos-header{background-color:#101314;}#videolist.hide-header > #videos-header{height:0;min-height:0;}#videos-header{display:flex;flex-direction:row;align-items:stretch;}#videos-header > span.hidden{display:none;}#videos-header > span{display:inline-block;height:100%;width:100%;background-color:inherit;text-align:center;line-height:50px;}#videos-header > span > svg{display:inline-block;vertical-align:middle;cursor:pointer;}#videos-header > span > svg *{pointer-events:none;}#videos-header-sound{position:relative;}#videos-header-sound > svg > path ~ path{display:none;}#videos-header-sound > svg{position:relative;padding:7px 10px;z-index:1;}#videos-header-sound > svg.muted > path ~ path{display:block;}#videos-header-mic > svg{position:relative;padding:5px 10px;z-index:1;}#videos-header-mic > svg > rect{opacity:0;visibility:hidden;transition:.2s;}[data-mode="dark"] #videos-header-mic > svg > path + rect{fill:#101314;}#videos-header-mic.muted > svg > rect{opacity:1;visibility:visible;}.videos-header-volume{position:absolute;height:128px;width:4px;top:2px;left:50%;margin-left:-24px;border-width:50px 22px 22px;border-style:solid;border-color:#fff;border-radius:24px;box-shadow:0 1px 4px 0 rgba(0, 0, 0, .09);opacity:0;visibility:hidden;transition:.2s;}[data-mode="dark"] .videos-header-volume{border-color:#2e373a;}#videos-header > span > svg:hover + .videos-header-volume,
  266. #videos-header > span > .videos-header-volume:hover{opacity:1;visibility:visible;}.videos-header-volume:before{content:'';position:absolute;display:block;height:100%;width:100%;top:0;left:0;border-radius:2px;background-color:#e9eaea;}.videos-header-volume-level{position:absolute;display:block;width:100%;bottom:0;left:0;border-radius:2px;background-color:#41b7ef;}.videos-header-volume-level > div{position:absolute;display:block;height:12px;width:12px;top:-6px;left:-4px;border-radius:100%;background-color:#41b7ef;cursor:pointer;box-shadow:0 0 0 0 #41b7ef;transition:.2s;}.videos-header-volume-level > div:hover{box-shadow:0 0 0 3px #41b7ef;}#videos-header-snapshot > svg{padding:8px 7px 9px;}#videos-header-fullscreen > svg{padding:10px 8px;}#videos-header-fullscreen > svg + svg{display:none;}@media screen and (max-width: 600px){.videos-header-volume{top:auto;bottom:1px;margin-left:-23px;border-width:21px 21px 40px;box-shadow:0 0 4px 0 rgba(0, 0, 0, .09);}#videos-header-mic > .videos-header-volume{bottom:11px;margin-left:-17px;}#videolist.full-screen > #videos-header > span{background-color:#202628;}}#videos-content{position:relative;height:100%;width:100%;min-height:200px;min-width:200px;}#videos{position:absolute;display:flex;flex-direction:row;flex-wrap:wrap;align-content:center;justify-content:center;align-items:center;top:20px;right:25px;bottom:20px;left:25px;box-sizing:border-box;font-size:0;}.videos-items{display:flex;height:100%;width:100%;top:0;left:0;flex-direction:row;flex-wrap:wrap;align-content:center;justify-content:center;align-items:center;box-sizing:border-box;}.videos-items.hidden{display:none;}#videos.row > .videos-items{width:50%;}#videos.row > .videos-items + .videos-items{left:50%;}#videos.column{flex-direction:column;}#videos.column > .videos-items{height:50%;}#videos.row.featured-2 > .videos-items{width:65%;}#videos.row.featured-2 > .videos-items + .videos-items{width:35%;}#videos.column.featured-2 > .videos-items{height:70%;}#videos.column.featured-2 > .videos-items + .videos-items{height:30%;}#videos.row.featured-3 > .videos-items{width:70%;}#videos.row.featured-3 > .videos-items + .videos-items{width:30%;}#videos.column.featured-3 > .videos-items{height:70%;}#videos.column.featured-3 > .videos-items + .videos-items{height:30%;}#youtube.video.hidden{display:none;}.video{position:relative;width:100%;padding:5px;box-sizing:border-box;font-size:0;overflow:hidden;}.video > div{position:relative;overflow:hidden;}#youtube.video > div{overflow:initial;margin-bottom:53px;}#youtube.video{min-height:210px;min-width:277px;}#youtube.video > div:before{content:'';display:block;width:100%;padding-bottom:75%;}.video:after{content:'';position:absolute;display:block;height:100%;width:100%;top:0;left:0;border-radius:10px;box-sizing:border-box;pointer-events:none;}.video > div > div{position:relative;width:100%;}.video > div > video,
  267. .video > div > tc-videoitem,
  268. .video > div > iframe{position:absolute;height:100%;bottom:0;left:0;}.video > div > iframe{width:100%;}.video > div.ratio-16-9 > video,
  269. .video > div.ratio-16-9 > tc-videoitem,
  270. .video > div.ratio-16-9 > iframe{left:-16.66%;}.video > div.ratio-8-5 > video,
  271. .video > div.ratio-8-5 > tc-videoitem,
  272. .video > div.ratio-8-5 > iframe{left:-10%;}.video > div.ratio-3-2 > video,
  273. .video > div.ratio-3-2 > tc-videoitem,
  274. .video > div.ratio-3-2 > iframe{left:-6.25%;}.video > div > .overlay{position:absolute;height:100%;width:100%;top:0;left:0;box-shadow:inset 0 0 0 0 rgba(0, 0, 0, .5);transition:.2s;}.video:hover > div > .overlay{box-shadow:inset 0 0 100px 0 rgba(0, 0, 0, .5);}#youtube.video:hover > div > .overlay{box-shadow:inset 0 0 0 0 rgba(0, 0, 0, .5);}#youtube.video > div > .overlay{position:absolute;height:30px;width:100%;top:100%;left:0;border-radius:0 0 4px 4px;background-color:#2e373a;}#youtube-overlay{position:absolute;height:100%;width:100%;top:0;left:0;opacity:.5;}.icon-visibility,
  275. .icon-resize,
  276. .icon-report,
  277. .icon-close{position:absolute;height:22px;width:22px;top:-22px;padding:0;border:none;background-color:transparent;cursor:pointer;opacity:.9;transition:.2s;}.icon-visibility{left:-22px;}.icon-resize{left:50%;margin-left:-11px;}.icon-report,
  278. .icon-close{right:-22px;}.icon-visibility:hover,
  279. .icon-resize:hover,
  280. .icon-report:hover,
  281. .icon-close:hover{opacity:1;}.video:hover > div > .overlay > .icon-visibility,
  282. .video:hover > div > .overlay > .icon-resize,
  283. .video:hover > div > .overlay > .icon-report,
  284. .video:hover > div > .overlay > .icon-close{top:12px;transition:top .2s ease .2s,
  285. left .2s ease .2s,
  286. right .2s ease .2s,
  287. opacity .2s;}.video:hover > div > .overlay > .icon-visibility{left:14px;}#youtube.video > div > .overlay > .icon-visibility{top:4px;left:16px;}#youtube.video > div > .overlay > .icon-close + .icon-visibility{right:16px;}.video:hover > div > .overlay > .icon-report,
  288. .video:hover > div > .overlay > .icon-close{right:14px;}#youtube.video > div > .overlay > .icon-close{right:16px;top:4px;}.icon-visibility > svg,
  289. .icon-resize > svg,
  290. .icon-report > svg,
  291. .icon-close > svg{position:absolute;}#youtube.video.not-visible{min-height:auto;}.video.not-visible > div > .overlay > .icon-visibility > svg,
  292. .icon-visibility > svg{top:4px;left:1px;opacity:0;visibility:hidden;transition:.2s;}.video.not-visible > div > .overlay > .icon-visibility > svg:first-child,
  293. .icon-visibility > svg + svg{opacity:1;visibility:visible;}.video.not-visible > div > iframe{visibility:hidden;}#youtube.video.not-visible > div:before{padding-bottom:0;}.icon-resize > svg{top:3px;left:3px;}.icon-resize > svg > path{transition:.2s;}.icon-report > svg{top:3px;left:3px;}.icon-close > svg{top:4px;left:4px;}.icon-context{position:absolute;height:22px;width:22px;bottom:-22px;right:-22px;padding:0;border:none;background-color:transparent;cursor:pointer;opacity:.9;transition:.2s;}.icon-context:hover{opacity:1;}.video:hover > div > .overlay > .icon-context{bottom:7px;right:16px;transition:bottom .2s ease .2s,
  294. right .2s ease .2s,
  295. opacity .2s;}.icon-context > svg{position:absolute;top:9px;left:1px;}.video-context{position:absolute;display:flex;flex-direction:column;align-content:center;justify-content:center;top:0;bottom:0;left:0;right:0;padding-top:10px;padding-bottom:10px;border-radius:4px;border:1px solid rgba(0, 0, 0, .06);box-sizing:border-box;font-size:0;color:#535353;text-align:left;line-height:1;background-color:rgba(0, 0, 0, .7);box-shadow:0 1px 4px 0 rgba(0, 0, 0, .09);z-index:1;opacity:0;visibility:hidden;transition:.2s;}.video-context::-webkit-scrollbar-track{background-color:transparent;}.video-context::-webkit-scrollbar-thumb{border:5px solid transparent;border-radius:6px/8px;background-color:rgba(255, 255, 255, .1);background-clip:content-box;}.video-context::-webkit-scrollbar-thumb:hover{background-color:rgba(255, 255, 255, .2);}.video:hover > div > .overlay > .icon-context:focus + .video-context{opacity:1;visibility:visible;}.video-context-content{margin:0 auto;}.video-context-content > div{text-align:center;}.video-context-content > div + div{padding-top:5px;}.video-context-content > div > button{display:block;width:100%;padding:0 20px;border:none;border-radius:4px;box-sizing:border-box;font-size:13px;font-weight:600;color:#fff;background-color:transparent;line-height:26px;cursor:pointer;transition:.2s;-webkit-appearance:none;-moz-appearance:none;appearance:none;}.video-context-content > div > button:hover{color:#fff;background-color:#04caff;}.video > div > .waiting{position:absolute;height:100%;width:100%;top:0;left:0;background-color:#202628;opacity:0;visibility:hidden;transition:.2s;}.video > div.wait > .waiting{opacity:1;visibility:visible;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #04caff;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite paused;-webkit-animation:waiting 1s ease-in-out 0s infinite paused;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}.video > div.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}.video > div > svg{position:absolute;top:5px;left:5px;filter:drop-shadow(0 0 4px #04caff);-webkit-filter:drop-shadow(0 0 4px #04caff);opacity:0;transition:.2s;}#videos-content > #videos > .video:hover > div > svg{top:-24px;left:-24px;transition:.2s ease .2s;}.video > div > svg > circle{fill:#fff;fill-rule:evenodd;stroke:#fff;stroke-width:0;transition:.2s;}.video > div > svg[data-mic-level="1"]{opacity:.5;}.video > div > svg[data-mic-level="2"]{opacity:.8;}.video > div > svg[data-mic-level="3"],
  296. .video > div > svg[data-mic-level="4"],
  297. .video > div > svg[data-mic-level="5"],
  298. .video > div > svg[data-mic-level="6"],
  299. .video > div > svg[data-mic-level="7"],
  300. .video > div > svg[data-mic-level="8"],
  301. .video > div > svg[data-mic-level="9"],
  302. .video > div > svg[data-mic-level="10"]{opacity:1;}.video > div > svg[data-mic-level="4"] > circle{stroke-width:1;}.video > div > svg[data-mic-level="5"] > circle{stroke-width:2;}.video > div > svg[data-mic-level="6"] > circle{stroke-width:3;}.video > div > svg[data-mic-level="7"] > circle{stroke-width:4;}.video > div > svg[data-mic-level="8"] > circle{stroke-width:5;}.video > div > svg[data-mic-level="9"] > circle{stroke-width:6;}.video > div > svg[data-mic-level="10"] > circle{stroke-width:7;}.video > div > .nickname{position:absolute;display:block;height:15px;left:10px;right:10px;bottom:12px;margin-bottom:-7px;font-size:12px;font-weight:600;color:#fff;text-align:center;text-shadow:0 0 6px rgba(0, 0, 0, .8);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:default;transition:.2s;}.video > div > .nickname > img{position:relative;display:inline-block;height:10px;width:10px;top:2px;margin-right:6px;opacity:1;visibility:visible;transition:.2s;}.video > div > .nickname > img[src=""]{width:0;margin-right:0;overflow:hidden;opacity:0;visibility:hidden;}.video:hover > div > .nickname{bottom:50%;transition:.2s ease .2s;}.video > div.gold:after,
  303. .video > div.extreme:after,
  304. .video > div.pro:after{content:'';position:absolute;display:block;height:24px;width:24px;top:10px;right:10px;background-repeat:no-repeat;transition:.2s;}.video > div.gold:after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+Cgk8Y2lyY2xlIGZpbGw9IiNmZmM2MmMiIGN4PSIxMiIgY3k9IjEyIiByPSIxMiIvPgoJPHBhdGggaWQ9ImJhZGdlLWdvbGQiIGQ9Ik0xNiAxMi41NzZ2LTEuMDE4aC0zLjU5NnYxLjUxaDEuMjZsLS4wMTIuMTA4Yy0uMDcuNjIyLS42MyAxLjAzNC0xLjQyIDEuMDM0LTEuMDY1IDAtMS43NTgtLjg0LTEuNzU4LTIuMjUgMC0xLjM3Ny42MDctMi4xNyAxLjYzOC0yLjE3LjY5OCAwIDEuMjQyLjM3IDEuNDAzLjkzN2gyLjM4OEMxNS43MiA5LjE0IDE0LjE3MyA4IDEyLjEgOCA5LjU1MiA4IDggOS40NTcgOCAxMS45OTIgOCAxNC41NiA5LjU1MiAxNiAxMi4xNzUgMTZjMi40IDAgMy44MjUtMS4zMDcgMy44MjUtMy40MjR6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI2JhZGdlLWdvbGQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgMSkiIGZpbGwtb3BhY2l0eT0iLjIiLz4KCTx1c2UgZmlsbD0iI2ZmZiIgeGxpbms6aHJlZj0iI2JhZGdlLWdvbGQiLz4KPC9zdmc+);}.video > div.extreme:after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPGNpcmNsZSBmaWxsPSIjYWQ2YmNlIiBjeD0iMTIiIGN5PSIxMiIgcj0iMTIiLz4NCgk8cGF0aCBpZD0iYmFkZ2UtZXh0cmVtZSIgZD0iTTE0IDE2SDlWOGg1djEuNzM1aC0yLjcyNXYxLjI1OGgyLjUyM3YxLjczNWgtMi41MjN2MS41MUgxNHoiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI2JhZGdlLWV4dHJlbWUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgMSkiIGZpbGwtb3BhY2l0eT0iLjIiLz4NCgk8dXNlIGZpbGw9IiNmZmYiIHhsaW5rOmhyZWY9IiNiYWRnZS1leHRyZW1lIi8+DQo8L3N2Zz4=);}.video > div.pro:after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPGNpcmNsZSBmaWxsPSIjMzhjZDU3IiBjeD0iMTIiIGN5PSIxMiIgcj0iMTIiLz4NCgk8cGF0aCBpZD0iYmFkZ2UtcHJvIiBkPSJNMTUgMTAuNTQ0YzAgLjg5NC0uMjcyIDEuNTg1LS44MTcgMi4wNzItLjU0NS40ODctMS4zMi43My0yLjMyMi43M2gtLjYyNlYxNkg5VjhoMi44NmMxLjA0NiAwIDEuODMuMjIgMi4zNTQuNjYyLjUyNC40NDIuNzg2IDEuMDcuNzg2IDEuODgyem0tMy43NjYgMS4wNGguNDA3Yy4zMzYgMCAuNjAzLS4wOS44LS4yNzMuMi0uMTgyLjI5OC0uNDM0LjI5OC0uNzU1IDAtLjU0LS4zMS0uODEtLjkyNy0uODFoLS41NzZ2MS44NHoiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI2JhZGdlLXBybyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAxKSIgZmlsbC1vcGFjaXR5PSIuMiIvPg0KCTx1c2UgZmlsbD0iI2ZmZiIgeGxpbms6aHJlZj0iI2JhZGdlLXBybyIvPg0KPC9zdmc+);}#videos-content > #videos > .video:hover > div:after{top:-24px;right:-24px;transition:.2s ease .2s;}#videos-footer{display:flex;flex-direction:row;align-items:stretch;height:70px;min-height:70px;width:100%;bottom:0;left:0;padding:0 30px 20px;box-sizing:border-box;font-size:0;}#videos-footer-youtube{height:100%;width:50px;min-width:50px;margin-right:10px;line-height:50px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA25pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDoyMDI3QzRENzE5MjA2ODExODIyQUI5Q0YwOTk5NDQ5MiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyMjAzNUIxQTg4MzQxMUU3QTUxM0VGMjAxMjc0Mjg5QiIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyMjAzNUIxOTg4MzQxMUU3QTUxM0VGMjAxMjc0Mjg5QiIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxNyAoV2luZG93cykiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpmNzI3ZWY2Yy0yOTU1LTkzNGMtOGJlYy02NzliNmE4YTlmNjYiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MjAyN0M0RDcxOTIwNjgxMTgyMkFCOUNGMDk5OTQ0OTIiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5auTHsAAAFJUlEQVR42uxbXWgUVxT+5m42Ro0mriQhm2hiXyJVieKWomIFKbEqWLVi+yYUhUJIEawPeRB9CX0JgpDgQymlfSil0BortgnRJC9FupAI8QcxlWriT0yiDRpNzDq5PSc3Y6aarTvOTJjd2wMfWbI/3PPNufd+37kzhpQSOkcWhoYMtLZKjIwk+0wO4S1ClDA3TfJ6RrhH+Iswc2Jz5gB79gAyHg/JSARcBy9hDaGR8CfBJMg0RC/hW8J7r+SXlQV55w696OwMybIy+5sLCQ2ERJomnQw/EEpe5MkX/e5diJcKo5zQQaienB6ZFR8TfifE7P+0E1BE+I2wJoPXvDLCr4S37QRwRRiErwnLNVj4CwjfWwu6gGFMED6i19s12v0qKecaCEEESBmGaX6hnQBIJGowPp4n0NX1Lvr739GOgEePStHW9oHA+fPvExtCSxnY3FwlMDhYqa0Ovn69QpAEzteWANMMCegchiEtHaBt6F0Bvun9UAjIzgbC4WmQ+5oEv0cC5AU4JiaUXTFNhefPFRKJaYyPq/cCQwD76fXrgdWrgWXLgOJiYPFi8pILgfnzSWjOVZ+xCODE7clP1t/UX8uvMREMiwgr+Wdk70dHgSdPeP8GHj4EaRdy+2T3u7vJ4pDHefp0FgmoqgLq64FVq4JRx9euAbW1QFPTLKwBW7YAZ88GJ3mO5eThTp1SHR5fCcjNBU6eVHM5iNHYqKahbwRs3qzme1CjsJA87XYfCdiwIfj7msMxCsdzLehRUeEjAUuWBJ+AaNTRGpU6AbyvO1xgXolbt4C+Pn8JWLRIaRHPCeAdYMECd4O7cAFYuxY4cUKJGz/C4ThTJ2DePFUFboK/PzgIHDwIrFsHnD7tPQGsPpkEX6YA63s3YT+HvHgR2LkT2LED6Ory0uKqi+U5ATk509rdyzhzRlVDTQ3AR1VeBI/VcwLcXv3/CnZ6DQ1qfTh+XBkfN+FgrKkTIGahdXD/PnDoELBiBdDW5s6Op21DhMuXDVd5ecAaItyg8Dt27QKOHgUqXTaquYfgOQE8T/2KWAw4dsyxkfFirKkTMDamqsBLK1xaqhoZBw6orpFX4WARTT0bbjmxenNDgKUDeJ+urgYOHwYKCrytJm6lcevMcwL4R5kE7ve5CRY+dXXAypX+TCeu1OT3O7kggH+UG5JurtjWrWqh8zMeP1bj9Hwb5JV1YGDWFNobx9CQoyngTAfcvBn8fkBvr2qt+0LApUvBJ+DyZUcfd0ZAe3vwCTh3zkcC4nGgpSW4yXPDpaPDRwJ4bu3fD1y5Erzkb9wA9u1zJIPfzAzdvg1s2qRsKy+KPhxYOrog3GPkA5GNG4GeHh/NkD0ePFC29cgR5dpKSoCiIqUR8vOBvDzVlmLFx1sft6ms02LrhJg7N5ZttR+K2k+FWdQwWNpa+/vwsNrq2DrzxeBGqwPh4w0Bdnl89apCmob2N0j8TwA5NEPb7Cl3QYuSqS0B4fCEQHHxPW0JyM3tF4jF4toSEI12Cmzb1kL79aiG5W9i795mSBIXcunSpgx7Puj1iETa5cAALYLqHr0vNZwAdaQ8pZhqVP5BqNco+a/YOHPudiFUS2jSIPlWwuczKUE++vmE8E0GJ/8jYTdhLJkU5ts2PiWQsUZPBiVOlhGfQT07OPJvN2jMqIS/I/w8xdaH4KesgEJCdpokzF0R8szoJvxC+IkwPLMdTn7oOTJFBIMMPSJQD1KnQ3Al/014rb7JQl+fASFkCj+YkZL5HwEGAHuT4FyotiQlAAAAAElFTkSuQmCC);background-size:100%;background-repeat:no-repeat;cursor:pointer;overflow:hidden;transition:.2s;}#videos-footer-youtube.hidden{width:0;min-width:0;margin-right:0;}#videos-footer-youtube > svg{vertical-align:middle;}#videos-footer-broadcast-wrapper{position:relative;display:flex;flex-direction:row;align-items:stretch;width:100%;}#videos-footer-broadcast{position:relative;display:block;height:50px;width:100%;padding-left:64px;border-radius:11px 0 0 11px;box-sizing:border-box;background-color:#38cd57;font-size:16px;font-weight:700;color:#fff;text-align:center;line-height:50px;cursor:pointer;transition:.2s;}#videos-footer-broadcast:hover{background-color:#13a832;}#videos-footer-broadcast-wrapper.hide-submenu > #videos-footer-broadcast{padding:0;border-radius:11px;}#videos-footer-broadcast-wrapper.hide-submenu > #videos-footer-submenu-button,
  305. #videos-footer-broadcast-wrapper.hide-submenu > #videos-footer-submenu{display:none;}#videos-footer-broadcast-wrapper > .video{position:absolute;display:none;width:63px;top:0;left:0;}#videos-footer-broadcast-wrapper.moderation > .video{display:block;}#videos-footer-broadcast-wrapper.moderation > #videos-footer-broadcast{padding-left:64px;}#videos-footer-broadcast-wrapper > .video:after{border-color:#2d373a;}#videos-footer-broadcast-wrapper > .waiting{position:absolute;top:0;bottom:0;left:0;right:0;border-radius:11px;background-color:#38cd57;opacity:0;visibility:hidden;transition:.2s;}#videos-footer-broadcast-wrapper.show-ptt > .waiting{right:138px;}#videos-footer-broadcast-wrapper.active > .waiting{background-color:#2d373a;}#videos-footer-broadcast-wrapper.wait > .waiting{opacity:1;visibility:visible;}#videos-footer-broadcast-wrapper > .waiting > .waiting-content > span{border-color:#fff;}#videos-footer-broadcast-wrapper.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}#videos-footer-broadcast-wrapper > #videos-footer-submenu-button{position:relative;display:block;height:100%;width:64px;min-width:64px;border-radius:0 11px 11px 0;box-sizing:border-box;background-color:#38cd57;cursor:pointer;transition:.2s;}#videos-footer-broadcast-wrapper > #videos-footer-submenu-button:before{content:'';position:absolute;display:block;height:0;width:0;top:22px;right:27px;border-width:0 5px 6px;border-style:solid;border-color:#fff transparent;opacity:1;visibility:visible;transition:.2s;}#videos-footer-broadcast-wrapper > #videos-footer-submenu-button:hover,
  306. #videos-footer-broadcast-wrapper > #videos-footer-submenu-button:focus{background-color:#13a832;}#videos-footer-broadcast-wrapper > #videos-footer-submenu-button:focus:before{opacity:0;visibility:hidden;}#videos-footer-broadcast-wrapper.active > #videos-footer-broadcast,
  307. #videos-footer-broadcast-wrapper.active > #videos-footer-submenu-button,
  308. #videos-footer-broadcast-wrapper.active > #videos-footer-submenu-button:focus{background-color:#2d373a;}#videos-footer-push-to-talk{height:100%;width:0;min-width:0;margin-left:0;border-radius:11px;line-height:50px;text-align:center;background-color:#38cd57;cursor:pointer;opacity:0;overflow:hidden;transition:.2s;}#videos-footer-push-to-talk:hover{background-color:#13a832;}#videos-footer-broadcast-wrapper.show-ptt > #videos-footer-push-to-talk{width:128px;min-width:128px;margin-left:10px;opacity:1;overflow:visible;}#videos-footer-broadcast-wrapper.active-ptt > #videos-footer-push-to-talk{background-color:#2d373a;}#videos-footer-push-to-talk > svg{vertical-align:middle;pointer-events:none;}#videos-footer-submenu{position:absolute;width:250px;bottom:29px;right:16px;padding:7px;border-radius:4px;background-color:#fff;font-size:14px;color:#000;box-shadow:0 1px 4px 0 rgba(0, 0, 0, .09);opacity:0;visibility:hidden;z-index:2;transition:.2s;}[data-mode="dark"] #videos-footer-submenu{background-color:#2e373a;}#videos-footer-submenu:before,
  309. #videos-footer-submenu:after{content:'';position:absolute;display:block;height:0;width:0;right:9px;bottom:-8px;border-width:7px 7px 0 7px;border-style:solid;border-color:rgba(0, 0, 0, .06) transparent;}#videos-footer-submenu:after{bottom:-7px;border-color:#fff transparent;}[data-mode="dark"] #videos-footer-submenu:after{border-color:#2e373a transparent;}#videos-footer-submenu-button:focus + #videos-footer-submenu{opacity:1;visibility:visible;}#videos-footer-broadcast-wrapper.show-ptt > #videos-footer-submenu{right:154px;}#videos-footer-submenu > *{position:relative;display:block;height:40px;padding:0 15px;border-radius:4px;box-sizing:border-box;font-size:13px;color:#000;line-height:40px;cursor:pointer;text-align:center;transition:.2s;}[data-mode="dark"] #videos-footer-submenu > *{color:#fff;}#videos-footer-submenu > div{padding:0;height:auto;}#videos-footer-submenu > span:hover{background-color:#04caff;color:#fff;}#videos-footer-submenu > span + span{margin-top:5px;}#submenu-icons{display:none;flex-direction:row;align-items:stretch;}#submenu-icons > div{width:100%;margin-top:5px;border-radius:4px;transition:.2s;}#submenu-icons > div:not(.hidden) + div{margin-left:10px;}#submenu-icons > div.submenu-icon > svg{line-height:40px;vertical-align:middle;}#submenu-icons > div.submenu-icon > svg > path{transition:.2s;}#submenu-icons > div.submenu-icon:hover > svg > path{fill:#fff;}#submenu-icons > div.submenu-icon.youtube:hover{background-color:#cc181e;}#submenu-icons > div.submenu-icon.youtube.hidden{display:none;}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@media screen and (max-width: 600px){:host,
  310. #videolist{min-height:285px;}#videos-header{position:absolute;height:50px;width:50%;top:auto;bottom:0;padding:0 2px 10px 15px;box-sizing:border-box;}#videos-header > span{background-color:#f6f6f6;line-height:40px;}[data-mode="dark"] #videos-header > span{background-color:#202628;}#videos-footer-broadcast,
  311. #videos-header > span:first-child{border-radius:8px 0 0 8px;}#videos-footer-submenu-button,
  312. #videos-header > span:last-child{border-radius:0 8px 8px 0;}#videos-footer{position:relative;height:50px;min-height:50px;width:50%;left:50%;padding:0 15px 10px 2px;}#videolist.hide-header > #videos-footer{width:100%;left:0;padding:0 15px 10px;}#videos-footer-broadcast-wrapper.hide-submenu > #videos-footer-broadcast,
  313. #videos-footer-broadcast-wrapper > .waiting,
  314. #videos-footer-push-to-talk,
  315. #videos-footer-broadcast-wrapper.hide-submenu > #videos-footer-broadcast{border-radius:8px;}#videos-footer-broadcast-wrapper.moderation > #videos-footer-broadcast{padding-left:65px;}#videos-footer-broadcast-wrapper > .video{width:50px;padding:3px;}#videos-footer-broadcast-wrapper > .video:after{border-width:3px;border-radius:8px;}#videos-footer-broadcast,
  316. #videos-footer-broadcast-wrapper.hide-submenu > #videos-footer-broadcast{height:40px;padding-left:14px;line-height:40px;text-align:left;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;}#videos-footer-broadcast-wrapper.hide-submenu > #videos-footer-broadcast{padding-right:14px;}#videos-footer-youtube{display:none;}#submenu-icons{display:flex;}#videos{top:12px;right:13px;bottom:12px;left:13px;}.video{padding:2px;}.video:after{border-width:2px;border-radius:4px;}#videos-footer-broadcast-wrapper > #videos-footer-submenu-button{width:48px;min-width:48px;}#videos-footer-broadcast-wrapper > #videos-footer-submenu-button:before{top:17px;right:18px;}#videos-footer-broadcast-wrapper.show-ptt > .waiting{right:58px;}#videos-footer-submenu{right:8px;}#videos-footer-broadcast-wrapper.show-ptt > #videos-footer-submenu{right:66px;}#videos-footer-push-to-talk{line-height:40px;}#videos-footer-broadcast-wrapper.show-ptt > #videos-footer-push-to-talk{width:48px;min-width:48px;}#videos-footer-push-to-talk > svg{height:30px;}}#videolist.full-screen,
  317. #videolist.full-screen > #videos-header,
  318. #videolist.full-screen .videos-header-volume:before{background-color:#101314;}#videolist.full-screen #videos-header-sound > svg.muted > path:nth-child(2){fill:#101314;}#videolist.full-screen #videos-header-fullscreen > svg{display:none;}#videolist.full-screen #videos-header-fullscreen > svg + svg{display:inline-block;}#videolist.full-screen .video:after{border-color:#101314;}#videolist.full-screen .videos-header-volume{border-color:#202628;}#videolist.full-screen #videos-footer-submenu{background-color
Add Comment
Please, Sign In to add comment