// console.log("BareRTC!"); // WebRTC configuration. const configuration = { iceServers: TURN.URLs.map(val => { let row = { urls: val, }; if (val.indexOf('turn:') === 0) { row.username = TURN.Username; row.credential = TURN.Credential; } return row; }) }; const FileUploadMaxSize = 1024 * 1024 * 8; // 8 MB function setModalImage(url) { let $modalImg = document.querySelector("#modalImage"), $modal = document.querySelector("#photo-modal"); $modalImg.src = url; $modal.classList.add("is-active"); return false; } // Popped-out video drag functions. const app = Vue.createApp({ delimiters: ['[[', ']]'], data() { return { // busy: false, // TODO: not used disconnect: false, // don't try to reconnect (e.g. kicked) windowFocused: true, // browser tab is active windowFocusedAt: new Date(), // Disconnect spamming: don't retry too many times. disconnectLimit: 3, disconnectCount: 0, // Website configuration provided by chat.html template. config: { channels: PublicChannels, website: WebsiteURL, permitNSFW: PermitNSFW, webhookURLs: WebhookURLs, fontSizeClasses: [ [ "x-2", "Very small chat room text" ], [ "x-1", "50% smaller chat room text" ], [ "", "Default size" ], [ "x1", "50% larger chat room text" ], [ "x2", "2x larger chat room text" ], [ "x3", "3x larger chat room text" ], [ "x4", "4x larger chat room text" ], ], reportClassifications: [ "It's spam", "It's abusive (racist, homophobic, etc.)", "It's malicious (e.g. link to a malware website)", "It's illegal (e.g. controlled substances)", "It's child porn (CP, CSAM, pedophilia, etc.)", "Other (please describe)", ], sounds: { available: SoundEffects, settings: DefaultSounds, ready: false, audioContext: null, audioTracks: {}, }, reactions: [ ['❤ī¸', '👍', '😂', '😉', 'đŸ˜ĸ', '😡', 'đŸĨ°'], ['😘', '👎', '☚ī¸', '😭', '🤔', '🙄', '🤩'], ['👋', 'đŸ”Ĩ', '😈', '🍑', '🍆', 'đŸ’Ļ', '🍌'], ['😋', '⭐', '😇', '😴', '😱', '👀', '🎃'], ['🤮', 'đŸĨŗ', '🙏', 'đŸ¤Ļ', '💩', 'đŸ¤¯', 'đŸ’¯'], ['😏', '🙈', '🙉', '🙊', '☀ī¸', '🌈', '🎂'], ], // Cached blocklist for the current user sent by your website. CachedBlocklist: CachedBlocklist, }, // User JWT settings if available. jwt: { token: UserJWTToken, valid: UserJWTValid, claims: UserJWTClaims }, channel: "lobby", username: "", //"test", autoLogin: false, // e.g. from JWT auth message: "", typingNotifDebounce: null, status: "online", // away/idle status // Idle detection variables idleTimeout: null, idleThreshold: 300, // number of seconds you must be idle // WebSocket connection. ws: { conn: null, connected: false, }, // Who List for the room. whoList: [], whoTab: 'online', whoSort: 'a-z', whoMap: {}, // map username to wholist entry muted: {}, // muted usernames for client side state // My video feed. webcam: { busy: false, active: false, elem: null, //