stream-chat-angular 4.68.5 → 4.68.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"stream-chat-angular.umd.js","sources":["../../../node_modules/tslib/tslib.es6.js","../../../projects/stream-chat-angular/src/assets/version.ts","../../../projects/stream-chat-angular/src/lib/notification.service.ts","../../../projects/stream-chat-angular/src/lib/chat-client.service.ts","../../../projects/stream-chat-angular/src/lib/get-message-translation.ts","../../../projects/stream-chat-angular/src/lib/message-preview.ts","../../../projects/stream-chat-angular/src/lib/read-by.ts","../../../projects/stream-chat-angular/src/lib/channel.service.ts","../../../projects/stream-chat-angular/src/lib/theme.service.ts","../../../projects/stream-chat-angular/src/lib/is-image-file.ts","../../../projects/stream-chat-angular/src/lib/is-image-attachment.ts","../../../projects/stream-chat-angular/src/lib/attachment.service.ts","../../../projects/stream-chat-angular/src/lib/attachment-configuration.service.ts","../../../projects/stream-chat-angular/src/assets/i18n/en.ts","../../../projects/stream-chat-angular/src/lib/stream-i18n.service.ts","../../../projects/stream-chat-angular/src/lib/avatar/avatar.component.ts","../../../projects/stream-chat-angular/src/lib/avatar/avatar.component.html","../../../projects/stream-chat-angular/src/lib/custom-templates.service.ts","../../../projects/stream-chat-angular/src/lib/avatar-placeholder/avatar-placeholder.component.ts","../../../projects/stream-chat-angular/src/lib/avatar-placeholder/avatar-placeholder.component.html","../../../projects/stream-chat-angular/src/lib/icon/icon.component.ts","../../../projects/stream-chat-angular/src/lib/icon/icon.component.html","../../../projects/stream-chat-angular/src/lib/icon-placeholder/icon-placeholder.component.ts","../../../projects/stream-chat-angular/src/lib/icon-placeholder/icon-placeholder.component.html","../../../projects/stream-chat-angular/src/lib/loading-indicator/loading-indicator.component.ts","../../../projects/stream-chat-angular/src/lib/loading-indicator/loading-indicator.component.html","../../../projects/stream-chat-angular/src/lib/loading-indicator-placeholder/loading-indicator-placeholder.component.ts","../../../projects/stream-chat-angular/src/lib/loading-indicator-placeholder/loading-indicator-placeholder.component.html","../../../projects/stream-chat-angular/src/lib/message-actions.service.ts","../../../projects/stream-chat-angular/src/lib/message-actions-box/message-actions-box.component.ts","../../../projects/stream-chat-angular/src/lib/message-actions-box/message-actions-box.component.html","../../../projects/stream-chat-angular/src/lib/modal/modal.component.ts","../../../projects/stream-chat-angular/src/lib/modal/modal.component.html","../../../projects/stream-chat-angular/src/lib/injection-tokens.ts","../../../projects/stream-chat-angular/src/lib/message-input/textarea.directive.ts","../../../projects/stream-chat-angular/src/lib/message-input/emoji-input.service.ts","../../../projects/stream-chat-angular/src/lib/message-input/message-input-config.service.ts","../../../projects/stream-chat-angular/src/lib/voice-recording/voice-recording-wavebar/voice-recording-wavebar.component.ts","../../../projects/stream-chat-angular/src/lib/voice-recording/voice-recording-wavebar/voice-recording-wavebar.component.html","../../../projects/stream-chat-angular/src/lib/voice-recording/voice-recording.component.ts","../../../projects/stream-chat-angular/src/lib/voice-recording/voice-recording.component.html","../../../projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.ts","../../../projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.html","../../../projects/stream-chat-angular/src/lib/attachment-preview-list/attachment-preview-list.component.ts","../../../projects/stream-chat-angular/src/lib/attachment-preview-list/attachment-preview-list.component.html","../../../projects/stream-chat-angular/src/lib/message-input/message-input.component.ts","../../../projects/stream-chat-angular/src/lib/message-input/message-input.component.html","../../../projects/stream-chat-angular/src/lib/notification/notification.component.ts","../../../projects/stream-chat-angular/src/lib/notification/notification.component.html","../../../projects/stream-chat-angular/src/lib/notification-list/notification-list.component.ts","../../../projects/stream-chat-angular/src/lib/notification-list/notification-list.component.html","../../../projects/stream-chat-angular/src/lib/edit-message-form/edit-message-form.component.ts","../../../projects/stream-chat-angular/src/lib/edit-message-form/edit-message-form.component.html","../../../projects/stream-chat-angular/src/lib/message-bounce-prompt/message-bounce-prompt.component.ts","../../../projects/stream-chat-angular/src/lib/message-bounce-prompt/message-bounce-prompt.component.html","../../../projects/stream-chat-angular/src/lib/channel/channel.component.ts","../../../projects/stream-chat-angular/src/lib/channel/channel.component.html","../../../projects/stream-chat-angular/src/lib/list-users.ts","../../../projects/stream-chat-angular/src/lib/get-channel-display-text.ts","../../../projects/stream-chat-angular/src/lib/channel-list/channel-list-toggle.service.ts","../../../projects/stream-chat-angular/src/lib/channel-header/channel-header.component.ts","../../../projects/stream-chat-angular/src/lib/channel-header/channel-header.component.html","../../../projects/stream-chat-angular/src/lib/is-on-separate-date.ts","../../../projects/stream-chat-angular/src/lib/message.service.ts","../../../projects/stream-chat-angular/src/lib/parse-date.ts","../../../projects/stream-chat-angular/src/lib/date-parser.service.ts","../../../projects/stream-chat-angular/src/lib/channel-preview/channel-preview.component.ts","../../../projects/stream-chat-angular/src/lib/channel-preview/channel-preview.component.html","../../../projects/stream-chat-angular/src/lib/channel-list/channel-list.component.ts","../../../projects/stream-chat-angular/src/lib/channel-list/channel-list.component.html","../../../projects/stream-chat-angular/src/lib/message-reactions.service.ts","../../../projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.ts","../../../projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.html","../../../projects/stream-chat-angular/src/lib/message/message.component.ts","../../../projects/stream-chat-angular/src/lib/message/message.component.html","../../../projects/stream-chat-angular/src/lib/message-input/textarea/textarea.component.ts","../../../projects/stream-chat-angular/src/lib/message-input/textarea/textarea.component.html","../../../projects/stream-chat-angular/src/lib/transliteration.service.ts","../../../projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts","../../../projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.html","../../../projects/stream-chat-angular/src/lib/message-list/group-styles.ts","../../../projects/stream-chat-angular/src/lib/message-list/message-list.component.ts","../../../projects/stream-chat-angular/src/lib/message-list/message-list.component.html","../../../projects/stream-chat-angular/src/lib/message-list/image-load.service.ts","../../../projects/stream-chat-angular/src/lib/thread/thread.component.ts","../../../projects/stream-chat-angular/src/lib/thread/thread.component.html","../../../projects/stream-chat-angular/src/lib/stream-avatar.module.ts","../../../projects/stream-chat-angular/src/lib/stream-chat.module.ts","../../../projects/stream-chat-angular/src/lib/stream-autocomplete-textarea.module.ts","../../../projects/stream-chat-angular/src/lib/stream-textarea.module.ts","../../../projects/stream-chat-angular/src/public-api.ts","../../../projects/stream-chat-angular/src/stream-chat-angular.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","export const version = '4.68.5';\n","import { Injectable, TemplateRef } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { NotificationPayload, NotificationType } from './types';\n\n/**\n * The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](../components/NotificationListComponent.mdx) component displays the currently active notifications.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class NotificationService {\n /**\n * Emits the currently active [notifications](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/notification.service.ts).\n */\n notifications$: Observable<NotificationPayload[]>;\n private notificationsSubject = new BehaviorSubject<NotificationPayload[]>([]);\n\n constructor() {\n this.notifications$ = this.notificationsSubject.asObservable();\n }\n\n /**\n * Displays a notification for the given amount of time.\n * @param content The text of the notification or the HTML template for the notification\n * @param type The type of the notification\n * @param timeout The number of milliseconds while the notification should be visible\n * @param translateParams Translation parameters for the `content` (for text notifications)\n * @param templateContext The input of the notification template (for HTML notifications)\n * @returns A method to clear the notification (before the timeout).\n */\n addTemporaryNotification<T>(\n content: string | TemplateRef<T>,\n type: NotificationType = 'error',\n timeout: number = 5000,\n translateParams?: Object,\n templateContext?: T\n ) {\n const notification = this.createNotification<T>(\n content,\n type,\n translateParams,\n templateContext\n );\n const id = setTimeout(\n () => this.removeNotification(notification.id),\n timeout\n );\n notification.dismissFn = () => {\n clearTimeout(id);\n this.removeNotification(notification.id);\n };\n this.notificationsSubject.next([\n ...this.notificationsSubject.getValue(),\n notification,\n ]);\n\n return notification.dismissFn;\n }\n\n /**\n * Displays a notification, that will be visible until it's removed.\n * @param content The text of the notification or the HTML template for the notification\n * @param type The type of the notification\n * @param translateParams Translation parameters for the `content` (for text notifications)\n * @param templateContext The input of the notification template (for HTML notifications)\n * @returns A method to clear the notification.\n */\n addPermanentNotification<\n T = {\n [key: string]: any;\n dismissFn: () => {};\n }\n >(\n content: string | TemplateRef<T>,\n type: NotificationType = 'error',\n translateParams?: Object,\n templateContext?: T\n ) {\n const notification = this.createNotification<T>(\n content,\n type,\n translateParams,\n templateContext\n );\n this.notificationsSubject.next([\n ...this.notificationsSubject.getValue(),\n notification,\n ]);\n\n return notification.dismissFn;\n }\n\n private createNotification<T>(\n content: string | TemplateRef<T>,\n type: NotificationType,\n translateParams?: Object,\n templateContext?: T\n ) {\n const id = new Date().getTime().toString() + Math.random().toString();\n return {\n id,\n [typeof content === 'string' ? 'text' : 'template']: content,\n type,\n translateParams,\n templateContext,\n dismissFn: () => this.removeNotification(id),\n };\n }\n\n private removeNotification(id: string) {\n const notifications = this.notificationsSubject.getValue();\n const index = notifications.findIndex((n) => n.id === id);\n if (index === -1) {\n return;\n }\n notifications.splice(index, 1);\n this.notificationsSubject.next([...notifications]);\n }\n}\n","import { Injectable, NgZone } from '@angular/core';\nimport { BehaviorSubject, Observable, ReplaySubject } from 'rxjs';\nimport {\n Channel,\n ChannelFilters,\n ChannelResponse,\n ConnectAPIResponse,\n OwnUserResponse,\n StreamChatOptions,\n UserFilters,\n UserResponse,\n} from 'stream-chat';\nimport { AppSettings, Event, StreamChat, TokenOrProvider } from 'stream-chat';\nimport { version } from '../assets/version';\nimport { NotificationService } from './notification.service';\nimport { DefaultStreamChatGenerics } from './types';\nimport { take } from 'rxjs/operators';\n\nexport type ClientEvent<\n T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics\n> = {\n eventType: string;\n event: Event<T>;\n};\n\n/**\n * The `ChatClient` service connects the user to the Stream chat.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ChatClientService<\n T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics\n> {\n /**\n * The [StreamChat client](https://github.com/GetStream/stream-chat-js/blob/master/src/client.ts) instance. In general you shouldn't need to access the client, but it's there if you want to use it.\n */\n chatClient!: StreamChat<T>;\n /**\n * Emits [`ClientEvent`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/chat-client.service.ts) events. The platform documentation covers [the list of client, user presence and notification events](https://getstream.io/chat/docs/javascript/event_object/?language=javascript).\n * :::important\n * For performance reasons this Observable operates outside of the Angular change detection zone. If you subscribe to it, you need to manually reenter Angular's change detection zone, our [Change detection guide](../concepts/change-detection.mdx) explains this in detail.\n * :::\n */\n events$: Observable<ClientEvent<T>>;\n /**\n * Emits the current [application settings](https://getstream.io/chat/docs/javascript/app_setting_overview/?language=javascript). Since getting the application settings is an expensive API call and we don't always need the result, this is not initialized by default, you need to call `getApplicationSettings` to load them.\n */\n appSettings$: Observable<AppSettings | undefined>;\n /**\n * Emits the current connection state of the user (`online` or `offline`)\n */\n connectionState$: Observable<'offline' | 'online'>;\n /**\n * Emits the list of pending invites of the user. It emits every pending invitation during initialization and then extends the list when a new invite is received. More information can be found in the [channel invitations](../code-examples/channel-invites.mdx) guide.\n */\n pendingInvites$: Observable<(ChannelResponse<T> | Channel<T>)[]>;\n /**\n * Emits the current chat user\n */\n user$: Observable<OwnUserResponse<T> | UserResponse<T> | undefined>;\n private notificationSubject = new ReplaySubject<ClientEvent<T>>(1);\n private connectionStateSubject = new ReplaySubject<'offline' | 'online'>(1);\n private appSettingsSubject = new BehaviorSubject<AppSettings | undefined>(\n undefined\n );\n private pendingInvitesSubject = new BehaviorSubject<\n (ChannelResponse<T> | Channel<T>)[]\n >([]);\n private userSubject = new ReplaySubject<\n OwnUserResponse<T> | UserResponse<T> | undefined\n >(1);\n private subscriptions: { unsubscribe: () => void }[] = [];\n private trackPendingChannelInvites = true;\n\n constructor(\n private ngZone: NgZone,\n private notificationService: NotificationService\n ) {\n this.events$ = this.notificationSubject.asObservable();\n this.connectionState$ = this.connectionStateSubject.asObservable();\n this.appSettings$ = this.appSettingsSubject.asObservable();\n this.pendingInvites$ = this.pendingInvitesSubject.asObservable();\n this.user$ = this.userSubject.asObservable();\n }\n\n /**\n * Creates a [`StreamChat`](https://github.com/GetStream/stream-chat-js/blob/668b3e5521339f4e14fc657834531b4c8bf8176b/src/client.ts#L124) instance using the provided `apiKey`, and connects a user with the given meta data and token. More info about [connecting users](https://getstream.io/chat/docs/javascript/init_and_users/?language=javascript) can be found in the platform documentation.\n * @param apiKey\n * @param userOrId you can emit this for anonymous logins\n * @param userTokenOrProvider You can provide:<ul>\n * <li> a token, </li>\n * <li> a token provider, a method that returns `Promise<string>`, which can be called when the previous token expires (recommended setup for production applications)</li>\n * <li> the keyword 'guest' to connect as [guest user](https://getstream.io/chat/docs/javascript/authless_users/?language=javascript#guest-users) </li>\n * <li> the keyword 'anonymous' to connect as [anonymous user](https://getstream.io/chat/docs/javascript/authless_users/?language=javascript#anonymous-users) </li>\n * </ul>\n * @param clientOptions Setting to provide to the Stream client instance\n */\n async init(\n apiKey: string,\n userOrId: string | OwnUserResponse<T> | UserResponse<T> | undefined,\n userTokenOrProvider: TokenOrProvider | 'anonymous' | 'guest',\n clientOptions?: StreamChatOptions & { trackPendingChannelInvites?: boolean }\n ): ConnectAPIResponse<T> {\n this.trackPendingChannelInvites =\n clientOptions?.trackPendingChannelInvites !== false;\n this.chatClient = StreamChat.getInstance<T>(apiKey, clientOptions);\n this.chatClient.recoverStateOnReconnect = false;\n this.chatClient.devToken;\n let result;\n await this.ngZone.runOutsideAngular(async () => {\n const user = typeof userOrId === 'string' ? { id: userOrId } : userOrId;\n try {\n result = await (\n {\n guest: () => this.chatClient.setGuestUser(user!),\n anonymous: () => this.chatClient.connectAnonymousUser(),\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n }[`${userTokenOrProvider}`] ??\n (() => this.chatClient.connectUser(user!, userTokenOrProvider))\n )();\n } catch (error) {\n this.notificationService.addPermanentNotification(\n 'streamChat.Error connecting to chat, refresh the page to try again.',\n 'error'\n );\n throw error;\n }\n this.userSubject.next(\n this.chatClient.user ? { ...this.chatClient.user } : undefined\n );\n const sdkPrefix = 'stream-chat-angular';\n if (!this.chatClient.getUserAgent().includes(sdkPrefix)) {\n this.chatClient.setUserAgent(\n `${sdkPrefix}-${version}-${this.chatClient.getUserAgent()}`\n );\n }\n });\n if (this.chatClient.user?.id && this.trackPendingChannelInvites) {\n const channels = await this.chatClient.queryChannels(\n {\n invite: 'pending',\n members: { $in: [this.chatClient.user?.id] },\n } as any as ChannelFilters<T> // TODO: find out why we need this typecast\n );\n this.pendingInvitesSubject.next(channels);\n }\n this.appSettingsSubject.next(undefined);\n this.subscriptions.push(\n this.chatClient.on((e) => {\n this.updateUser(e);\n this.updatePendingInvites(e);\n this.notificationSubject.next({\n eventType: e.type,\n event: e,\n });\n })\n );\n let removeNotification: undefined | Function;\n this.subscriptions.push(\n this.chatClient.on('connection.changed', (e) => {\n this.ngZone.run(() => {\n const isOnline = e.online;\n if (isOnline) {\n if (removeNotification) {\n removeNotification();\n }\n } else {\n removeNotification =\n this.notificationService.addPermanentNotification(\n 'streamChat.Connection failure, reconnecting now...'\n );\n }\n this.connectionStateSubject.next(isOnline ? 'online' : 'offline');\n });\n })\n );\n return result;\n }\n\n /**\n * Disconnects the current user, and closes the WebSocket connection. Useful when disconnecting a chat user, use in combination with [`reset`](./ChannelService.mdx/#reset).\n */\n async disconnectUser() {\n this.pendingInvitesSubject.next([]);\n await this.chatClient.disconnectUser();\n this.userSubject.next(undefined);\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n /**\n * Loads the current [application settings](https://getstream.io/chat/docs/javascript/app_setting_overview/?language=javascript), if the application settings have already been loaded, it does nothing.\n */\n async getAppSettings() {\n if (this.appSettingsSubject.getValue()) {\n return;\n }\n const settings = await this.chatClient.getAppSettings();\n this.appSettingsSubject.next((settings.app as AppSettings) || {});\n }\n\n /**\n * Flag the message with the given ID. If you want to know [more about flags](https://getstream.io/chat/docs/javascript/moderation/?language=javascript) check out the platform documentation.\n * @param messageId\n */\n async flagMessage(messageId: string) {\n await this.chatClient.flagMessage(messageId);\n }\n\n /**\n * Searches for users in the application that have ID or name matching the provided search term\n * @param searchTerm\n * @returns The users matching the search\n */\n async autocompleteUsers(searchTerm: string) {\n if (!searchTerm) {\n return [];\n }\n const result = await this.chatClient.queryUsers({\n $or: [\n { id: { $autocomplete: searchTerm } },\n { name: { $autocomplete: searchTerm } },\n ],\n id: { $ne: this.chatClient.userID! },\n } as UserFilters<T>); // TODO: find out why we need this typecast\n return result.users;\n }\n\n private updatePendingInvites(e: Event<T>) {\n if (!this.trackPendingChannelInvites) {\n return;\n }\n if (e.member?.user?.id === this.chatClient.user?.id && e.channel) {\n const pendingInvites = this.pendingInvitesSubject.getValue();\n if (e.type === 'notification.invited') {\n this.pendingInvitesSubject.next([...pendingInvites, e.channel]);\n } else if (\n e.type === 'notification.invite_accepted' ||\n e.type === 'notification.invite_rejected'\n ) {\n const index = pendingInvites.findIndex(\n (i) => i?.cid === e.channel?.cid\n );\n if (index !== -1) {\n pendingInvites.splice(index, 1);\n this.pendingInvitesSubject.next([...pendingInvites]);\n }\n }\n }\n }\n\n private updateUser(e: Event<T>) {\n if (typeof e.total_unread_count !== 'undefined') {\n let user: OwnUserResponse<T> | UserResponse<T> | undefined;\n this.userSubject.pipe(take(1)).subscribe((u) => {\n user = u;\n });\n if (user && user.total_unread_count !== e.total_unread_count) {\n this.userSubject.next({\n ...user,\n total_unread_count: e.total_unread_count,\n });\n }\n }\n if (typeof e.unread_channels !== 'undefined') {\n let user: OwnUserResponse<T> | UserResponse<T> | undefined;\n this.userSubject.pipe(take(1)).subscribe((u) => {\n user = u;\n });\n if (user && user.unread_channels !== e.unread_channels) {\n this.userSubject.next({\n ...user,\n unread_channels: e.unread_channels,\n });\n }\n }\n if (typeof e.unread_count !== 'undefined') {\n let user: OwnUserResponse<T> | UserResponse<T> | undefined;\n this.userSubject.pipe(take(1)).subscribe((u) => {\n user = u;\n });\n if (user && user.unread_count !== e.unread_count) {\n this.userSubject.next({\n ...user,\n unread_count: e.unread_count,\n });\n }\n }\n if (\n e.type === 'user.updated' &&\n this.chatClient.user &&\n e.user?.id === this.chatClient.user.id\n ) {\n this.userSubject.next({ ...this.chatClient.user });\n }\n }\n}\n","import {\n Channel,\n FormatMessageResponse,\n MessageResponse,\n TranslationLanguages,\n User,\n} from 'stream-chat';\nimport { DefaultStreamChatGenerics, StreamMessage } from './types';\n\nexport const getMessageTranslation = <\n T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics\n>(\n message?: StreamMessage | MessageResponse | FormatMessageResponse,\n channel?: Channel<T>,\n user?: User\n) => {\n const language =\n user?.language ||\n (channel?.data?.auto_translation_language as TranslationLanguages);\n if (language && message?.i18n && message?.user?.id !== user?.id) {\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n return message.i18n[`${language}_text` as `${TranslationLanguages}_text`];\n } else {\n return undefined;\n }\n};\n","import { Attachment, MessageResponse, UserResponse } from 'stream-chat';\nimport { v4 as uuidv4 } from 'uuid';\nimport { DefaultStreamChatGenerics } from './types';\n\nexport const createMessagePreview = <\n T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics\n>(\n user: UserResponse,\n text: string,\n attachments: Attachment<T>[] = [],\n mentionedUsers: UserResponse<T>[] = [],\n parentId: undefined | string = undefined,\n quotedMessageId: undefined | string = undefined,\n customData: undefined | Partial<T['messageType']>\n) => {\n const clientSideId = `${user.id}-${uuidv4()}`;\n\n return {\n __html: text,\n created_at: new Date(),\n html: text,\n id: clientSideId,\n reactions: [],\n status: 'sending',\n text,\n type: 'regular',\n user,\n attachments,\n mentioned_users: mentionedUsers,\n parent_id: parentId,\n quoted_message_id: quotedMessageId,\n ...customData,\n } as unknown as MessageResponse<T>;\n};\n","import { Channel, FormatMessageResponse, UserResponse } from 'stream-chat';\nimport { DefaultStreamChatGenerics } from './types';\n\nexport const getReadBy = <\n T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics\n>(\n message: FormatMessageResponse<T>,\n channel: Channel<T>\n) => {\n const readBy: UserResponse[] = [];\n Object.keys(channel.state.read).forEach((key) => {\n if (\n channel.state.read[key].last_read.getTime() >=\n message.created_at.getTime() &&\n message.user?.id !== key\n ) {\n readBy.push(channel.state.read[key].user);\n }\n });\n\n return readBy;\n};\n","import { Injectable, NgZone } from '@angular/core';\nimport {\n BehaviorSubject,\n combineLatest,\n Observable,\n ReplaySubject,\n Subscription,\n} from 'rxjs';\nimport { filter, first, map, shareReplay, take } from 'rxjs/operators';\nimport {\n Attachment,\n Channel,\n ChannelFilters,\n ChannelOptions,\n ChannelResponse,\n ChannelSort,\n Event,\n EventTypes,\n FormatMessageResponse,\n Message,\n MessageResponse,\n ReactionResponse,\n UpdatedMessage,\n UserFilters,\n UserResponse,\n} from 'stream-chat';\nimport { ChatClientService, ClientEvent } from './chat-client.service';\nimport { getMessageTranslation } from './get-message-translation';\nimport { createMessagePreview } from './message-preview';\nimport { NotificationService } from './notification.service';\nimport { getReadBy } from './read-by';\nimport {\n AttachmentUpload,\n AttachmentUploadErrorReason,\n ChannelQueryState,\n DefaultStreamChatGenerics,\n MessageInput,\n MessageReactionType,\n NextPageConfiguration,\n StreamMessage,\n} from './types';\n\n/**\n * The `ChannelService` provides data and interaction for the channel list and message list.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ChannelService<\n T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics\n> {\n /**\n * Emits `false` if there are no more pages of channels that can be loaded.\n */\n hasMoreChannels$: Observable<boolean>;\n /**\n * Emits the currently loaded and [watched](https://getstream.io/chat/docs/javascript/watch_channel/?language=javascript) channel list.\n *\n * :::important\n * If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](../concepts/change-detection.mdx) explains this in detail.\n * :::\n *\n * Apart from pagination, the channel list is also updated on the following events:\n *\n * | Event type | Default behavior | Custom handler to override |\n * | ----------------------------------- | ------------------------------------------------------------------ | --------------------------------------------- |\n * | `channel.deleted` | Remove channel from the list | `customChannelDeletedHandler` |\n * | `channel.hidden` | Remove channel from the list | `customChannelHiddenHandler` |\n * | `channel.truncated` | Updates the channel | `customChannelTruncatedHandler` |\n * | `channel.updated` | Updates the channel | `customChannelUpdatedHandler` |\n * | `channel.visible` | Adds the channel to the list | `customChannelVisibleHandler` |\n * | `message.new` | Moves the channel to top of the list | `customNewMessageHandler` |\n * | `notification.added_to_channel` | Adds the new channel to the top of the list and starts watching it | `customAddedToChannelNotificationHandler` |\n * | `notification.message_new` | Adds the new channel to the top of the list and starts watching it | `customNewMessageNotificationHandler` |\n * | `notification.removed_from_channel` | Removes the channel from the list | `customRemovedFromChannelNotificationHandler` |\n *\n * It's important to note that filters don't apply to updates to the list from events.\n *\n * Our platform documentation covers the topic of [channel events](https://getstream.io/chat/docs/javascript/event_object/?language=javascript#events) in depth.\n *\n * By default if an error occurs during channel load, the Observable will emit an error, which will close the stream. Users will have to reload the page to be able to reinitialize the `ChannelService`. If you don't want the streams to be closed, you can pass `options.keepAliveChannels$OnError = true` to the `init` method. In that case the `channelQueryState$` stream will emit the status of the latest channel load request.\n */\n channels$: Observable<Channel<T>[] | undefined>;\n /**\n * The result of the latest channel query request.\n */\n channelQueryState$: Observable<ChannelQueryState | undefined>;\n /**\n * Emits the currently active channel.\n *\n * :::important\n * If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](../concepts/change-detection.mdx) explains this in detail.\n * :::\n *\n * The active channel will always be marked as read when a new message is received\n */\n activeChannel$: Observable<Channel<T> | undefined>;\n /**\n * Emits the list of currently loaded messages of the active channel.\n */\n activeChannelMessages$: Observable<StreamMessage<T>[]>;\n /**\n * Emits the list of pinned messages of the active channel.\n */\n activeChannelPinnedMessages$: Observable<StreamMessage<T>[]>;\n /**\n * Emits the id of the currently selected parent message. If no message is selected, it emits undefined.\n */\n activeParentMessageId$: Observable<string | undefined>;\n /**\n * Emits the list of currently loaded thread replies belonging to the selected parent message. If there is no currently active thread it emits an empty array.\n */\n activeThreadMessages$: Observable<StreamMessage<T>[]>;\n /**\n * Emits the currently selected parent message. If no message is selected, it emits undefined.\n */\n activeParentMessage$: Observable<StreamMessage<T> | undefined>;\n /**\n * Emits the currently selected message to quote\n */\n messageToQuote$: Observable<StreamMessage<T> | undefined>;\n /**\n * Emits the ID of the message the message list should jump to (can be a channel message or thread message)\n */\n jumpToMessage$: Observable<{ id?: string; parentId?: string }>;\n /**\n * Emits the list of users that are currently typing in the channel (current user is not included)\n */\n usersTypingInChannel$: Observable<UserResponse<T>[]>;\n /**\n * Emits the list of users that are currently typing in the active thread (current user is not included)\n */\n usersTypingInThread$: Observable<UserResponse<T>[]>;\n /**\n * Emits a map that contains the date of the latest message sent by the current user by channels (this is used to detect if slow mode countdown should be started)\n */\n latestMessageDateByUserByChannels$: Observable<{ [key: string]: Date }>;\n /**\n * If you're using [semantic filters for moderation](https://getstream.io/automated-moderation/docs/automod_configuration/?q=semantic%20filters) you can set up rules for bouncing messages.\n *\n * If a message is bounced, it will be emitted via this `Observable`. The built-in [`MessageBouncePrompt` component](../../components/MessageBouncePromptComponent) will display the bounce option to the user if a bounced message is clicked.\n */\n bouncedMessage$: BehaviorSubject<StreamMessage<T> | undefined>;\n /**\n * The last read message id of the active channel, it's used by the message list component to display unread UI, and jump to latest read message\n *\n * This property isn't always updated, please use `channel.read` to display up-to-date read information\n */\n activeChannelLastReadMessageId?: string;\n /**\n * The unread count of the active channel, it's used by the message list component to display unread UI\n *\n * This property isn't always updated, please use `channel.read` to display up-to-date read information\n */\n activeChannelUnreadCount?: number;\n /**\n * Custom event handler to call if a new message received from a channel that is not being watched, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customNewMessageNotificationHandler?: (\n clientEvent: ClientEvent,\n channelListSetter: (\n channels: (Channel<T> | ChannelResponse<T>)[],\n shouldStopWatchingRemovedChannels?: boolean\n ) => void\n ) => void;\n /**\n * Custom event handler to call when the user is added to a channel, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customAddedToChannelNotificationHandler?: (\n clientEvent: ClientEvent,\n channelListSetter: (\n channels: (Channel<T> | ChannelResponse<T>)[],\n shouldStopWatchingRemovedChannels?: boolean\n ) => void\n ) => void;\n /**\n * Custom event handler to call when the user is removed from a channel, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customRemovedFromChannelNotificationHandler?: (\n clientEvent: ClientEvent,\n channelListSetter: (\n channels: (Channel<T> | ChannelResponse<T>)[],\n shouldStopWatchingRemovedChannels?: boolean\n ) => void\n ) => void;\n /**\n * Custom event handler to call when a channel is deleted, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customChannelDeletedHandler?: (\n event: Event,\n channel: Channel<T>,\n channelListSetter: (\n channels: (Channel<T> | ChannelResponse<T>)[],\n shouldStopWatchingRemovedChannels?: boolean\n ) => void,\n messageListSetter: (messages: StreamMessage<T>[]) => void,\n threadListSetter: (messages: StreamMessage<T>[]) => void,\n parentMessageSetter: (message: StreamMessage<T> | undefined) => void\n ) => void;\n /**\n * Custom event handler to call when a channel is updated, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customChannelUpdatedHandler?: (\n event: Event,\n channel: Channel<T>,\n channelListSetter: (\n channels: (Channel<T> | ChannelResponse<T>)[],\n shouldStopWatchingRemovedChannels?: boolean\n ) => void,\n messageListSetter: (messages: StreamMessage[]) => void,\n threadListSetter: (messages: StreamMessage[]) => void,\n parentMessageSetter: (message: StreamMessage | undefined) => void\n ) => void;\n /**\n * Custom event handler to call when a channel is truncated, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customChannelTruncatedHandler?: (\n event: Event,\n channel: Channel<T>,\n channelListSetter: (\n channels: (Channel<T> | ChannelResponse<T>)[],\n shouldStopWatchingRemovedChannels?: boolean\n ) => void,\n messageListSetter: (messages: StreamMessage<T>[]) => void,\n threadListSetter: (messages: StreamMessage<T>[]) => void,\n parentMessageSetter: (message: StreamMessage<T> | undefined) => void\n ) => void;\n /**\n * Custom event handler to call when a channel becomes hidden, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customChannelHiddenHandler?: (\n event: Event,\n channel: Channel<T>,\n channelListSetter: (\n channels: (Channel<T> | ChannelResponse<T>)[],\n shouldStopWatchingRemovedChannels?: boolean\n ) => void,\n messageListSetter: (messages: StreamMessage<T>[]) => void,\n threadListSetter: (messages: StreamMessage<T>[]) => void,\n parentMessageSetter: (message: StreamMessage<T> | undefined) => void\n ) => void;\n /**\n * Custom event handler to call when a channel becomes visible, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customChannelVisibleHandler?: (\n event: Event,\n channel: Channel<T>,\n channelListSetter: (\n channels: (Channel<T> | ChannelResponse<T>)[],\n shouldStopWatchingRemovedChannels?: boolean\n ) => void,\n messageListSetter: (messages: StreamMessage<T>[]) => void,\n threadListSetter: (messages: StreamMessage<T>[]) => void,\n parentMessageSetter: (message: StreamMessage<T> | undefined) => void\n ) => void;\n /**\n * Custom event handler to call if a new message received from a channel that is being watched, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customNewMessageHandler?: (\n event: Event,\n channel: Channel<T>,\n channelListSetter: (\n channels: (Channel<T> | ChannelResponse<T>)[],\n shouldStopWatchingRemovedChannels?: boolean\n ) => void,\n messageListSetter: (messages: StreamMessage<T>[]) => void,\n threadListSetter: (messages: StreamMessage<T>[]) => void,\n parentMessageSetter: (message: StreamMessage<T> | undefined) => void\n ) => void;\n /**\n * You can override the default file upload request - you can use this to upload files to your own CDN\n */\n customFileUploadRequest?: (\n file: File,\n channel: Channel<T>\n ) => Promise<{ file: string }>;\n /**\n * You can override the default image upload request - you can use this to upload images to your own CDN\n */\n customImageUploadRequest?: (\n file: File,\n channel: Channel<T>\n ) => Promise<{ file: string }>;\n /**\n * You can override the default file delete request - override this if you use your own CDN\n */\n customFileDeleteRequest?: (url: string, channel: Channel<T>) => Promise<void>;\n /**\n * You can override the default image delete request - override this if you use your own CDN\n */\n customImageDeleteRequest?: (\n url: string,\n channel: Channel<T>\n ) => Promise<void>;\n /**\n * The provided method will be called before deleting a message. If the returned Promise resolves to `true` to deletion will go ahead. If `false` is returned, the message won't be deleted.\n */\n messageDeleteConfirmationHandler?: (\n message: StreamMessage<T>\n ) => Promise<boolean>;\n /**\n * The provided method will be called before a new message is sent to Stream's API. You can use this hook to tranfrom or enrich the message being sent.\n */\n beforeSendMessage?: (\n input: MessageInput<T>\n ) => MessageInput<T> | Promise<MessageInput<T>>;\n /**\n * The provided method will be called before a message is sent to Stream's API for update. You can use this hook to tranfrom or enrich the message being updated.\n */\n beforeUpdateMessage?: (\n message: StreamMessage<T>\n ) => StreamMessage<T> | Promise<StreamMessage<T>>;\n /**\n * By default the SDK uses an offset based pagination, you can change/extend this by providing your own custom paginator method.\n *\n * The method will be called with the result of the latest channel query.\n *\n * You can return either an offset, or a filter using the [`$lte`/`$gte` operator](https://getstream.io/chat/docs/javascript/query_syntax_operators/). If you return a filter, it will be merged with the filter provided for the `init` method.\n */\n customPaginator?: (channelQueryResult: Channel<T>[]) => NextPageConfiguration;\n /**\n * @internal\n */\n static readonly MAX_MESSAGE_COUNT_IN_MESSAGE_LIST = 250;\n /**\n * @internal\n */\n static readonly MAX_MESSAGE_REACTIONS_TO_FETCH = 1200;\n private channelsSubject = new BehaviorSubject<Channel<T>[] | undefined>(\n undefined\n );\n private activeChannelSubject = new BehaviorSubject<Channel<T> | undefined>(\n undefined\n );\n private activeChannelMessagesSubject = new BehaviorSubject<\n (StreamMessage<T> | MessageResponse<T> | FormatMessageResponse<T>)[]\n >([]);\n private activeChannelPinnedMessagesSubject = new BehaviorSubject<\n StreamMessage[]\n >([]);\n private hasMoreChannelsSubject = new ReplaySubject<boolean>(1);\n private activeChannelSubscriptions: { unsubscribe: () => void }[] = [];\n private channelSubscriptions: { [key: string]: () => void } = {};\n private activeParentMessageIdSubject = new BehaviorSubject<\n string | undefined\n >(undefined);\n private activeThreadMessagesSubject = new BehaviorSubject<\n (StreamMessage<T> | MessageResponse<T> | FormatMessageResponse<T>)[]\n >([]);\n private jumpToMessageSubject = new BehaviorSubject<{\n id?: string;\n parentId?: string;\n }>({ id: undefined, parentId: undefined });\n private latestMessageDateByUserByChannelsSubject = new BehaviorSubject<{\n [key: string]: Date;\n }>({});\n private filters: ChannelFilters<T> | undefined;\n private sort: ChannelSort<T> | undefined;\n private options:\n | (ChannelOptions & { keepAliveChannels$OnError?: boolean })\n | undefined;\n private readonly messagePageSize = 25;\n private messageToQuoteSubject = new BehaviorSubject<\n StreamMessage<T> | undefined\n >(undefined);\n private usersTypingInChannelSubject = new BehaviorSubject<UserResponse<T>[]>(\n []\n );\n private usersTypingInThreadSubject = new BehaviorSubject<UserResponse<T>[]>(\n []\n );\n private _shouldMarkActiveChannelAsRead = true;\n private shouldSetActiveChannel: boolean | undefined;\n private clientEventsSubscription: Subscription | undefined;\n private isStateRecoveryInProgress = false;\n private channelQueryStateSubject = new BehaviorSubject<\n ChannelQueryState | undefined\n >(undefined);\n\n private channelListSetter = (\n channels: (Channel<T> | ChannelResponse<T>)[],\n shouldStopWatchingRemovedChannels = true\n ) => {\n const currentChannels = this.channelsSubject.getValue() || [];\n const newChannels = channels.filter(\n (c) => !currentChannels.find((channel) => channel.cid === c.cid)\n );\n const deletedChannels = currentChannels.filter(\n (c) => !channels?.find((channel) => channel.cid === c.cid)\n );\n void this.addChannelsFromNotification(newChannels as ChannelResponse<T>[]);\n this.removeChannelsFromChannelList(\n deletedChannels.map((c) => c.cid),\n shouldStopWatchingRemovedChannels\n );\n };\n\n private messageListSetter = (messages: StreamMessage<T>[]) => {\n this.activeChannelMessagesSubject.next(messages);\n };\n\n private threadListSetter = (messages: StreamMessage<T>[]) => {\n this.activeThreadMessagesSubject.next(messages);\n };\n\n private parentMessageSetter = (message: StreamMessage<T> | undefined) => {\n this.activeParentMessageIdSubject.next(message?.id);\n };\n private dismissErrorNotification?: Function;\n private nextPageConfiguration?: NextPageConfiguration;\n private areReadEventsPaused = false;\n private markReadThrottleTime = 1050;\n private markReadTimeout?: ReturnType<typeof setTimeout>;\n private scheduledMarkReadRequest?: () => void;\n\n constructor(\n private chatClientService: ChatClientService<T>,\n private ngZone: NgZone,\n private notificationService: NotificationService\n ) {\n this.channels$ = this.channelsSubject.asObservable().pipe(shareReplay(1));\n this.activeChannel$ = this.activeChannelSubject\n .asObservable()\n .pipe(shareReplay(1));\n this.activeChannelMessages$ = this.activeChannelMessagesSubject.pipe(\n map((messages) => {\n const channel = this.activeChannelSubject.getValue()!;\n return messages.map((message) =>\n this.transformToStreamMessage(message, channel)\n );\n }),\n shareReplay(1)\n );\n this.bouncedMessage$ = new BehaviorSubject<StreamMessage<T> | undefined>(\n undefined\n );\n this.hasMoreChannels$ = this.hasMoreChannelsSubject\n .asObservable()\n .pipe(shareReplay(1));\n this.activeParentMessageId$ = this.activeParentMessageIdSubject\n .asObservable()\n .pipe(shareReplay(1));\n this.activeThreadMessages$ = this.activeThreadMessagesSubject.pipe(\n map((messages) => {\n const channel = this.activeChannelSubject.getValue()!;\n return messages.map((message) =>\n this.transformToStreamMessage(message, channel)\n );\n }),\n shareReplay(1)\n );\n this.activeParentMessage$ = combineLatest([\n this.activeChannelMessages$,\n this.activeParentMessageId$,\n ]).pipe(\n map(\n ([messages, parentMessageId]: [\n StreamMessage[],\n string | undefined\n ]) => {\n if (!parentMessageId) {\n return undefined;\n } else {\n const message = messages.find((m) => m.id === parentMessageId);\n if (!message) {\n void this.setAsActiveParentMessage(undefined);\n return undefined;\n } else {\n return message;\n }\n }\n }\n ),\n shareReplay(1)\n );\n this.messageToQuote$ = this.messageToQuoteSubject\n .asObservable()\n .pipe(shareReplay(1));\n this.jumpToMessage$ = this.jumpToMessageSubject\n .asObservable()\n .pipe(shareReplay(1));\n\n this.usersTypingInChannel$ = this.usersTypingInChannelSubject\n .asObservable()\n .pipe(shareReplay(1));\n this.usersTypingInThread$ = this.usersTypingInThreadSubject\n .asObservable()\n .pipe(shareReplay(1));\n this.latestMessageDateByUserByChannels$ =\n this.latestMessageDateByUserByChannelsSubject\n .asObservable()\n .pipe(shareReplay(1));\n this.activeChannelPinnedMessages$ = this.activeChannelPinnedMessagesSubject\n .asObservable()\n .pipe(shareReplay(1));\n this.channelQueryState$ = this.channelQueryStateSubject\n .asObservable()\n .pipe(shareReplay(1));\n }\n\n /**\n * internal\n */\n removeOldMessageFromMessageList() {\n const channel = this.activeChannelSubject.getValue();\n const channelMessages = channel?.state.latestMessages;\n const targetLength = Math.ceil(\n ChannelService.MAX_MESSAGE_COUNT_IN_MESSAGE_LIST / 2\n );\n if (\n !channel ||\n !channelMessages ||\n channelMessages !== channel?.state.latestMessages ||\n channelMessages.length <= targetLength\n ) {\n return;\n }\n const messages = channelMessages;\n messages.splice(0, messages.length - targetLength);\n this.activeChannelMessagesSubject.next(messages);\n }\n\n /**\n * If set to false, read events won't be sent as new messages are received. If set to true active channel (if any) will immediately be marked as read.\n */\n get shouldMarkActiveChannelAsRead() {\n return this._shouldMarkActiveChannelAsRead;\n }\n\n /**\n * If set to false, read events won't be sent as new messages are received. If set to true active channel (if any) will immediately be marked as read.\n */\n set shouldMarkActiveChannelAsRead(shouldMarkActiveChannelAsRead: boolean) {\n if (!this._shouldMarkActiveChannelAsRead && shouldMarkActiveChannelAsRead) {\n const activeChannel = this.activeChannelSubject.getValue();\n if (activeChannel && this.canSendReadEvents) {\n void activeChannel.markRead();\n }\n }\n this._shouldMarkActiveChannelAsRead = shouldMarkActiveChannelAsRead;\n }\n\n /**\n * Sets the given `channel` as active and marks it as read.\n * If the channel wasn't previously part of the channel, it will be added to the beginning of the list.\n *\n * @param channel\n */\n setAsActiveChannel(channel: Channel<T>) {\n const prevActiveChannel = this.activeChannelSubject.getValue();\n if (prevActiveChannel?.cid === channel.cid) {\n return;\n }\n this.stopWatchForActiveChannelEvents(prevActiveChannel);\n this.flushMarkReadQueue();\n this.areReadEventsPaused = false;\n const readState =\n channel.state.read[this.chatClientService.chatClient.user?.id || ''];\n this.activeChannelLastReadMessageId = readState?.last_read_message_id;\n if (\n channel.state.latestMessages[channel.state.latestMessages.length - 1]\n ?.id === this.activeChannelLastReadMessageId\n ) {\n this.activeChannelLastReadMessageId = undefined;\n }\n this.activeChannelUnreadCount = readState?.unread_messages || 0;\n this.watchForActiveChannelEvents(channel);\n this.addChannel(channel);\n this.activeChannelSubject.next(channel);\n const channelStateLength = channel.state.latestMessages.length;\n if (channelStateLength > 2 * this.messagePageSize) {\n channel.state.latestMessages = channel.state.latestMessages.slice(\n channelStateLength - 2 * this.messagePageSize\n );\n }\n this.setChannelState(channel);\n }\n\n /**\n * Deselects the currently active (if any) channel\n */\n deselectActiveChannel() {\n const activeChannel = this.activeChannelSubject.getValue();\n if (!activeChannel) {\n return;\n }\n this.stopWatchForActiveChannelEvents(activeChannel);\n this.flushMarkReadQueue();\n this.activeChannelMessagesSubject.next([]);\n this.activeChannelSubject.next(undefined);\n this.activeParentMessageIdSubject.next(undefined);\n this.activeThreadMessagesSubject.next([]);\n this.latestMessageDateByUserByChannelsSubject.next({});\n this.selectMessageToQuote(undefined);\n this.jumpToMessageSubject.next({ id: undefined, parentId: undefined });\n this.activeChannelPinnedMessagesSubject.next([]);\n this.usersTypingInChannelSubject.next([]);\n this.usersTypingInThreadSubject.next([]);\n this.activeChannelLastReadMessageId = undefined;\n this.activeChannelUnreadCount = undefined;\n this.areReadEventsPaused = false;\n }\n\n /**\n * Sets the given `message` as an active parent message. If `undefined` is provided, it will deleselect the current parent message.\n * @param message\n * @param loadMessagesForm\n */\n async setAsActiveParentMessage(\n message: StreamMessage<T> | undefined,\n loadMessagesForm: 'request' | 'state' = 'request'\n ) {\n const messageToQuote = this.messageToQuoteSubject.getValue();\n if (messageToQuote && !!messageToQuote.parent_id) {\n this.messageToQuoteSubject.next(undefined);\n }\n if (!message) {\n this.activeParentMessageIdSubject.next(undefined);\n this.activeThreadMessagesSubject.next([]);\n const messageToJumpTo = this.jumpToMessageSubject.getValue();\n if (messageToJumpTo && !!messageToJumpTo.parentId) {\n this.jumpToMessageSubject.next({ id: undefined, parentId: undefined });\n }\n } else {\n this.activeParentMessageIdSubject.next(message.id);\n const activeChannel = this.activeChannelSubject.getValue();\n if (loadMessagesForm === 'request') {\n const result = await activeChannel?.getReplies(message.id, {\n limit: this.options?.message_limit,\n });\n this.activeThreadMessagesSubject.next(result?.messages || []);\n } else {\n this.activeThreadMessagesSubject.next(\n activeChannel?.state.threads[message.id] || []\n );\n }\n }\n }\n\n /**\n * Loads the next page of messages of the active channel. The page size can be set in the [query option](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript#query-options) object.\n * @param direction\n */\n loadMoreMessages(direction: 'older' | 'newer' = 'older') {\n const activeChnannel = this.activeChannelSubject.getValue();\n const messages = this.activeChannelMessagesSubject.getValue();\n const lastMessageId =\n messages[direction === 'older' ? 0 : messages.length - 1]?.id;\n if (\n direction === 'newer' &&\n activeChnannel?.state?.latestMessages === activeChnannel?.state?.messages\n ) {\n // If we are on latest message set, activeChannelMessages$ will be refreshed by WS events, no need for a request\n return false;\n }\n return activeChnannel\n ?.query({\n messages: {\n limit: this.options?.message_limit,\n [direction === 'older' ? 'id_lt' : 'id_gt']: lastMessageId,\n },\n members: { limit: 0 },\n watchers: { limit: 0 },\n })\n .then((res) => {\n if (\n activeChnannel?.data?.id ===\n this.activeChannelSubject.getValue()?.data?.id\n ) {\n this.activeChannelMessagesSubject.next([\n ...activeChnannel.state.messages,\n ]);\n }\n\n return res;\n });\n }\n\n /**\n * Loads the next page of messages of the active thread. The page size can be set in the [query option](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript#query-options) object.\n * @param direction\n */\n async loadMoreThreadReplies(direction: 'older' | 'newer' = 'older') {\n if (direction === 'newer') {\n // Thread replies aren't broke into different message sets, activeThreadMessages$ will be refreshed by WS events, no need for a request\n return;\n }\n const activeChnannel = this.activeChannelSubject.getValue();\n const parentMessageId = this.activeParentMessageIdSubject.getValue();\n if (!parentMessageId) {\n return;\n }\n const threadMessages = this.activeThreadMessagesSubject.getValue();\n const lastMessageId =\n threadMessages[direction === 'older' ? 0 : threadMessages.length - 1]?.id;\n await activeChnannel?.getReplies(parentMessageId, {\n limit: this.options?.message_limit,\n [direction === 'older' ? 'id_lt' : 'id_gt']: lastMessageId,\n });\n this.activeThreadMessagesSubject.next(\n activeChnannel?.state.threads[parentMessageId] || []\n );\n }\n\n /**\n * Queries the channels with the given filters, sorts and options. More info about [channel querying](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript) can be found in the platform documentation. By default the first channel in the list will be set as active channel and will be marked as read.\n * @param filters\n * @param sort\n * @param options\n * @param shouldSetActiveChannel Decides if the first channel in the result should be made as an active channel, or no channel should be marked as active\n * @returns the list of channels found by the query\n */\n async init(\n filters: ChannelFilters<T>,\n sort?: ChannelSort<T>,\n options?: ChannelOptions & { keepAliveChannels$OnError?: boolean },\n shouldSetActiveChannel: boolean = true\n ) {\n this.filters = filters;\n this.options = {\n limit: 25,\n state: true,\n presence: true,\n watch: true,\n message_limit: this.messagePageSize,\n ...options,\n };\n this.sort = sort || { last_message_at: -1 };\n this.shouldSetActiveChannel = shouldSetActiveChannel;\n this.clientEventsSubscription = this.chatClientService.events$.subscribe(\n (notification) => void this.handleNotification(notification)\n );\n try {\n const result = await this.queryChannels(this.shouldSetActiveChannel);\n return result;\n } catch (error) {\n this.dismissErrorNotification =\n this.notificationService.addPermanentNotification(\n 'streamChat.Error loading channels',\n 'error'\n );\n throw error;\n }\n }\n\n /**\n * Resets the `activeChannel$`, `channels$` and `activeChannelMessages$` Observables. Useful when disconnecting a chat user, use in combination with [`disconnectUser`](./ChatClientService.mdx/#disconnectuser).\n */\n reset() {\n this.deselectActiveChannel();\n this.channelsSubject.next(undefined);\n this.channelQueryStateSubject.next(undefined);\n this.clientEventsSubscription?.unsubscribe();\n this.dismissErrorNotification?.();\n this.dismissErrorNotification = undefined;\n Object.keys(this.channelSubscriptions).forEach((cid) => {\n this.channelSubscriptions[cid]();\n });\n this.channelSubscriptions = {};\n this.nextPageConfiguration = undefined;\n }\n\n /**\n * Loads the next page of channels. The page size can be set in the [query option](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript#query-options) object.\n */\n async loadMoreChannels() {\n await this.queryChannels(false);\n }\n\n /**\n * Adds a reaction to a message.\n * @param messageId The id of the message to add the reaction to\n * @param reactionType The type of the reaction\n * @param customData\n */\n async addReaction(\n messageId: string,\n reactionType: MessageReactionType,\n customData?: T['reactionType']\n ) {\n await this.activeChannelSubject.getValue()?.sendReaction(messageId, {\n type: reactionType,\n ...customData,\n });\n }\n\n /**\n * Removes a reaction from a message.\n * @param messageId The id of the message to remove the reaction from\n * @param reactionType Thr type of reaction to remove\n */\n async removeReaction(messageId: string, reactionType: MessageReactionType) {\n await this.activeChannelSubject\n .getValue()\n ?.deleteReaction(messageId, reactionType);\n }\n\n /**\n * Sends a message to the active channel. The message is immediately added to the message list, if an error occurs and the message can't be sent, the error is indicated in `state` of the message.\n * @param text The text of the message\n * @param attachments The attachments\n * @param mentionedUsers Mentioned users\n * @param parentId Id of the parent message (if sending a thread reply)\n * @param quotedMessageId Id of the message to quote (if sending a quote reply)\n * @param customData\n */\n async sendMessage(\n text: string,\n attachments: Attachment<T>[] = [],\n mentionedUsers: UserResponse<T>[] = [],\n parentId: string | undefined = undefined,\n quotedMessageId: string | undefined = undefined,\n customData: undefined | Partial<T['messageType']> = undefined\n ) {\n let input: MessageInput<T> = {\n text,\n attachments,\n mentionedUsers,\n parentId,\n quotedMessageId,\n customData,\n };\n if (this.beforeSendMessage) {\n input = await this.beforeSendMessage(input);\n }\n const preview = createMessagePreview(\n this.chatClientService.chatClient.user!,\n input.text,\n input.attachments,\n input.mentionedUsers,\n input.parentId,\n input.quotedMessageId,\n input.customData\n );\n const channel = this.activeChannelSubject.getValue()!;\n preview.readBy = [];\n channel.state.addMessageSorted(preview, true);\n const response = await this.sendMessageRequest(preview, input.customData);\n return response;\n }\n\n /**\n * Resends the given message to the active channel\n * @param message The message to resend\n */\n async resendMessage(message: StreamMessage) {\n const channel = this.activeChannelSubject.getValue()!;\n channel.state.addMessageSorted(\n {\n ...(message as any as MessageResponse<T>),\n errorStatusCode: undefined,\n status: 'sending',\n },\n true\n );\n return this.sendMessageRequest(message, undefined, true);\n }\n\n /**\n * Updates the message in the active channel\n * @param message Mesage to be updated\n */\n async updateMessage(message: StreamMessage<T>) {\n let messageToUpdate = { ...message };\n delete messageToUpdate.i18n;\n if (this.beforeUpdateMessage) {\n messageToUpdate = await this.beforeUpdateMessage(messageToUpdate);\n }\n if (message.moderation_details) {\n return this.resendMessage(message);\n }\n const response = await this.chatClientService.chatClient.updateMessage(\n messageToUpdate as any as UpdatedMessage<T>\n );\n\n const channel = this.channelsSubject\n .getValue()\n ?.find((c) => c.cid === message.cid);\n\n if (\n response.message.type === 'error' &&\n response.message.moderation_details\n ) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.This message did not meet our content guidelines'\n );\n return message;\n }\n\n return this.transformToStreamMessage(response.message, channel);\n }\n\n /**\n * Deletes the message from the active channel\n * @param message Message to be deleted\n * @param isLocalDelete set this `true` if you want to delete a message that's only part of the local state, not yet saved on the backend\n */\n async deleteMessage(message: StreamMessage, isLocalDelete = false) {\n if (isLocalDelete && this.activeChannel) {\n const result = this.activeChannel.state.removeMessage({\n id: message.id,\n parent_id: message.parent_id,\n });\n if (result) {\n message.parent_id\n ? this.activeThreadMessagesSubject.next(\n this.activeChannel.state.threads[message.parent_id]\n )\n : this.activeChannelMessagesSubject.next(\n this.activeChannel.state.messages\n );\n }\n return;\n }\n if (this.messageDeleteConfirmationHandler) {\n const result = await this.messageDeleteConfirmationHandler(message);\n if (result) {\n await this.chatClientService.chatClient.deleteMessage(message.id);\n }\n } else {\n await this.chatClientService.chatClient.deleteMessage(message.id);\n }\n }\n\n /**\n * Uploads files to the channel. If you want to know more about [file uploads](https://getstream.io/chat/docs/javascript/file_uploads/?language=javascript) check out the platform documentation.\n * @param uploads the attachments to upload (output of the [`AttachmentService`](./AttachmentService.mdx))\n * @returns the result of file upload requests\n */\n async uploadAttachments(\n uploads: AttachmentUpload[]\n ): Promise<AttachmentUpload[]> {\n const result: AttachmentUpload[] = [];\n const channel = this.activeChannelSubject.getValue()!;\n const uploadResults = await Promise.allSettled(\n uploads.map((upload) =>\n upload.type === 'image'\n ? this.customImageUploadRequest\n ? this.customImageUploadRequest(upload.file, channel)\n : channel.sendImage(upload.file, upload.file.name, upload.file.type)\n : this.customFileUploadRequest\n ? this.customFileUploadRequest(upload.file, channel)\n : channel.sendFile(upload.file, upload.file.name, upload.file.type)\n )\n );\n uploadResults.forEach((uploadResult, i) => {\n const file = uploads[i].file;\n const type = uploads[i].type;\n if (uploadResult.status === 'fulfilled') {\n result.push({\n file,\n type,\n state: 'success',\n url: uploadResult.value.file,\n /* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access */\n thumb_url: (uploadResult.value as any).thumb_url,\n });\n } else {\n let reason: AttachmentUploadErrorReason = 'unknown';\n let extraData: { param: string } | undefined;\n /* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment */\n const message: string | undefined =\n /* eslint-disable-next-line @typescript-eslint/no-unsafe-member-access */\n uploadResult.reason.response?.data?.message;\n /* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment */\n const code: number | undefined =\n /* eslint-disable-next-line @typescript-eslint/no-unsafe-member-access */\n uploadResult.reason.response?.data?.code;\n if (code === 22) {\n reason = 'file-size';\n extraData = { param: /\\d+MB/.exec(message || '')?.[0] || '100MB' };\n } else if (\n code === 4 &&\n message?.toLowerCase()?.includes('file extension')\n ) {\n reason = 'file-extension';\n extraData = { param: /\\.\\w+/.exec(message)?.[0] || '' };\n }\n result.push({\n file,\n type,\n state: 'error',\n errorReason: reason,\n errorExtraInfo: extraData ? [extraData] : undefined,\n });\n }\n });\n\n return result;\n }\n\n /**\n * Deletes an uploaded file by URL. If you want to know more about [file uploads](https://getstream.io/chat/docs/javascript/file_uploads/?language=javascript) check out the platform documentation\n * @param attachmentUpload Attachment to be deleted (output of the [`AttachmentService`](./AttachmentService.mdx))\n */\n async deleteAttachment(attachmentUpload: AttachmentUpload) {\n const channel = this.activeChannelSubject.getValue()!;\n await (attachmentUpload.type === 'image'\n ? this.customImageDeleteRequest\n ? this.customImageDeleteRequest(attachmentUpload.url!, channel)\n : channel.deleteImage(attachmentUpload.url!)\n : this.customFileDeleteRequest\n ? this.customFileDeleteRequest(attachmentUpload.url!, channel)\n : channel.deleteFile(attachmentUpload.url!));\n }\n\n /**\n * Returns the autocomplete options for current channel members. If the channel has less than 100 members, it returns the channel members, otherwise sends a [search request](https://getstream.io/chat/docs/javascript/query_members/?language=javascript#pagination-and-ordering) with the given search term.\n * @param searchTerm Text to search for in the names of members\n * @returns The list of members matching the search filter\n */\n async autocompleteMembers(searchTerm: string) {\n const activeChannel = this.activeChannelSubject.getValue();\n if (!activeChannel) {\n return [];\n }\n if (Object.keys(activeChannel.state.members).length < 100) {\n return Object.values(activeChannel.state.members).filter(\n (m) => m.user?.id !== this.chatClientService.chatClient.userID!\n );\n } else {\n if (!searchTerm) {\n return [];\n }\n const result = await activeChannel.queryMembers({\n name: { $autocomplete: searchTerm },\n id: { $ne: this.chatClientService.chatClient.userID! },\n } as UserFilters<T>); // TODO: find out why we need typecast here\n return Object.values(result.members);\n }\n }\n\n /**\n * [Runs a message action](https://getstream.io/chat/docs/rest/#messages-runmessageaction) in the current channel. Updates the message list based on the action result (if no message is returned, the message will be removed from the message list).\n * @param messageId\n * @param formData\n * @param parentMessageId\n */\n async sendAction(\n messageId: string,\n formData: Record<string, string>,\n parentMessageId?: string\n ) {\n const channel = this.activeChannelSubject.getValue()!;\n const response = await channel.sendAction(messageId, formData);\n if (response?.message) {\n channel.state.addMessageSorted({\n ...response.message,\n status: 'received',\n });\n const isThreadReply = !!response.message.parent_id;\n isThreadReply\n ? this.activeThreadMessagesSubject.next([\n ...channel.state.threads[response.message.parent_id!],\n ])\n : this.activeChannelMessagesSubject.next([...channel.state.messages]);\n } else {\n channel.state.removeMessage({\n id: messageId,\n parent_id: parentMessageId,\n });\n if (parentMessageId) {\n this.activeThreadMessagesSubject.next(\n channel.state.threads[this.activeParentMessageIdSubject.getValue()!]\n );\n } else {\n this.activeChannelMessagesSubject.next([...channel.state.messages]);\n }\n }\n }\n\n /**\n * Selects or deselects the current message to quote reply to\n * @param message The message to select, if called with `undefined`, it deselects the message\n */\n selectMessageToQuote(message: StreamMessage | undefined) {\n this.messageToQuoteSubject.next(message);\n }\n\n /**\n * Add a new channel to the channel list\n * The channel will be added to the beginning of the channel list\n * @param channel\n */\n addChannel(channel: Channel<T>) {\n if (!this.channels.find((c) => c.cid === channel.cid)) {\n this.channelsSubject.next([channel, ...this.channels]);\n this.watchForChannelEvents(channel);\n }\n }\n\n private async sendMessageRequest(\n preview: MessageResponse<T> | StreamMessage<T>,\n customData?: Partial<T['messageType']>,\n isResend = false\n ) {\n const channel = this.activeChannelSubject.getValue()!;\n const isThreadReply = !!preview.parent_id;\n isThreadReply\n ? this.activeThreadMessagesSubject.next([\n ...channel.state.threads[preview.parent_id!],\n ])\n : this.activeChannelMessagesSubject.next([...channel.state.messages]);\n try {\n const response = await channel.sendMessage({\n id: preview.id,\n text: preview.text,\n attachments: preview.attachments,\n mentioned_users: preview.mentioned_users?.map((u) => u.id),\n parent_id: preview.parent_id,\n quoted_message_id: preview.quoted_message_id,\n ...customData,\n } as Message<T>); // TODO: find out why we need typecast here\n channel.state.addMessageSorted(\n {\n ...response.message,\n status: 'received',\n },\n true\n );\n isThreadReply\n ? this.activeThreadMessagesSubject.next([\n ...channel.state.threads[preview.parent_id!],\n ])\n : this.activeChannelMessagesSubject.next([...channel.state.messages]);\n let messages!: StreamMessage<T>[];\n (isThreadReply ? this.activeThreadMessages$ : this.activeChannelMessages$)\n .pipe(take(1))\n .subscribe((m) => (messages = m));\n const newMessage = messages[messages.length - 1]!;\n return newMessage;\n } catch (error: any) {\n const stringError = JSON.stringify(error);\n const parsedError: {\n status?: number;\n code?: number;\n response?: { data?: { message?: string } };\n } = stringError ? (JSON.parse(stringError) as { status?: number }) : {};\n\n let isAlreadyExists = false;\n if (isResend) {\n if (\n parsedError.status === 400 &&\n parsedError.code === 4 &&\n parsedError?.response?.data?.message?.includes('already exists')\n ) {\n isAlreadyExists = true;\n }\n }\n\n channel.state.addMessageSorted(\n {\n ...(preview as MessageResponse<T>),\n errorStatusCode: isAlreadyExists\n ? undefined\n : parsedError.status || undefined,\n status: isAlreadyExists ? 'received' : 'failed',\n },\n true\n );\n isThreadReply\n ? this.activeThreadMessagesSubject.next([\n ...channel.state.threads[preview.parent_id!],\n ])\n : this.activeChannelMessagesSubject.next([...channel.state.messages]);\n let messages!: StreamMessage<T>[];\n (isThreadReply ? this.activeThreadMessages$ : this.activeChannelMessages$)\n .pipe(take(1))\n .subscribe((m) => (messages = m));\n const newMessage = messages[messages.length - 1]!;\n return newMessage;\n }\n }\n\n /**\n * Jumps to the selected message inside the message list, if the message is not yet loaded, it'll load the message (and it's surroundings) from the API.\n * @param messageId The ID of the message to be loaded, 'latest' means jump to the latest messages\n * @param parentMessageId The ID of the parent message if we want to load a thread message\n */\n async jumpToMessage(messageId: string, parentMessageId?: string) {\n const activeChannel = this.activeChannelSubject.getValue();\n try {\n await activeChannel?.state.loadMessageIntoState(\n messageId,\n parentMessageId\n );\n const messages = activeChannel?.state.messages || [];\n this.activeChannelMessagesSubject.next([...messages]);\n if (parentMessageId) {\n const parentMessage = messages.find((m) => m.id === parentMessageId);\n void this.setAsActiveParentMessage(parentMessage, 'state');\n }\n this.jumpToMessageSubject.next({\n id: messageId,\n parentId: parentMessageId,\n });\n } catch (error) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Message not found'\n );\n throw error;\n }\n }\n\n /**\n * Clears the currently selected message to jump\n */\n clearMessageJump() {\n this.jumpToMessageSubject.next({ id: undefined, parentId: undefined });\n }\n\n /**\n * Pins the given message in the channel\n * @param message\n */\n async pinMessage(message: StreamMessage<DefaultStreamChatGenerics>) {\n try {\n await this.chatClientService.chatClient?.pinMessage(message);\n this.notificationService.addTemporaryNotification(\n 'streamChat.Message pinned',\n 'success'\n );\n } catch (error) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error pinning message'\n );\n throw error;\n }\n }\n\n /**\n * Removes the given message from pinned messages\n * @param message\n */\n async unpinMessage(message: StreamMessage<DefaultStreamChatGenerics>) {\n try {\n await this.chatClientService.chatClient?.unpinMessage(message);\n this.notificationService.addTemporaryNotification(\n 'streamChat.Message unpinned',\n 'success'\n );\n } catch (error) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error removing message pin'\n );\n throw error;\n }\n }\n\n private handleNotification(clientEvent: ClientEvent<T>) {\n switch (clientEvent.eventType) {\n case 'connection.recovered': {\n void this.ngZone.run(async () => {\n if (this.isStateRecoveryInProgress) {\n return;\n }\n this.isStateRecoveryInProgress = true;\n try {\n this.nextPageConfiguration = undefined;\n // If channel list is not inited, we set the active channel\n const shoulSetActiveChannel =\n this.shouldSetActiveChannel &&\n !this.activeChannelSubject.getValue();\n await this.queryChannels(shoulSetActiveChannel || false, true);\n if (this.activeChannelSubject.getValue()) {\n // Thread messages are not refetched so active thread gets deselected to avoid displaying stale messages\n void this.setAsActiveParentMessage(undefined);\n // Update and reselect message to quote\n const messageToQuote = this.messageToQuoteSubject.getValue();\n this.setChannelState(this.activeChannelSubject.getValue()!);\n let messages!: StreamMessage<T>[];\n this.activeChannelMessages$\n .pipe(take(1))\n .subscribe((m) => (messages = m));\n const updatedMessageToQuote = messages.find(\n (m) => m.id === messageToQuote?.id\n );\n if (updatedMessageToQuote) {\n this.selectMessageToQuote(updatedMessageToQuote);\n }\n }\n this.isStateRecoveryInProgress = false;\n } catch {\n this.isStateRecoveryInProgress = false;\n }\n });\n break;\n }\n case 'notification.message_new': {\n this.ngZone.run(() => {\n if (this.customNewMessageNotificationHandler) {\n this.customNewMessageNotificationHandler(\n clientEvent,\n this.channelListSetter\n );\n } else {\n this.handleNewMessageNotification(clientEvent);\n }\n });\n break;\n }\n case 'notification.added_to_channel': {\n this.ngZone.run(() => {\n if (this.customAddedToChannelNotificationHandler) {\n this.customAddedToChannelNotificationHandler(\n clientEvent,\n this.channelListSetter\n );\n } else {\n this.handleAddedToChannelNotification(clientEvent);\n }\n });\n break;\n }\n case 'notification.removed_from_channel': {\n this.ngZone.run(() => {\n if (this.customRemovedFromChannelNotificationHandler) {\n this.customRemovedFromChannelNotificationHandler(\n clientEvent,\n this.channelListSetter\n );\n } else {\n this.handleRemovedFromChannelNotification(clientEvent);\n }\n });\n break;\n }\n case 'user.updated': {\n this.ngZone.run(() => {\n const updatedChannels = this.channelsSubject.getValue()?.map((c) => {\n if (this.chatClientService.chatClient.activeChannels[c.cid]) {\n return this.chatClientService.chatClient.activeChannels[c.cid];\n } else {\n return c;\n }\n });\n this.channelsSubject.next(updatedChannels);\n const activeChannel = this.activeChannelSubject.getValue();\n if (activeChannel) {\n this.activeChannelSubject.next(\n this.chatClientService.chatClient.activeChannels[\n activeChannel.cid\n ] || activeChannel\n );\n this.activeChannelMessagesSubject.next(\n activeChannel.state.messages.map((m) => {\n m.readBy = getReadBy(m, activeChannel);\n return { ...m };\n })\n );\n const activeParentMessage =\n this.activeParentMessageIdSubject.getValue();\n if (activeParentMessage) {\n const messages = activeChannel.state.threads[activeParentMessage];\n this.activeThreadMessagesSubject.next([...messages]);\n }\n this.activeChannelPinnedMessagesSubject.next([\n ...activeChannel.state.pinnedMessages,\n ]);\n }\n });\n break;\n }\n }\n }\n\n private handleRemovedFromChannelNotification(clientEvent: ClientEvent<T>) {\n const channelIdToBeRemoved = clientEvent.event.channel!.cid;\n this.removeChannelsFromChannelList([channelIdToBeRemoved], true);\n }\n\n private handleNewMessageNotification(clientEvent: ClientEvent<T>) {\n if (clientEvent.event.channel) {\n void this.addChannelsFromNotification([clientEvent.event.channel]);\n }\n }\n\n private handleAddedToChannelNotification(clientEvent: ClientEvent<T>) {\n if (clientEvent.event.channel) {\n void this.addChannelsFromNotification([clientEvent.event.channel]);\n }\n }\n\n private async addChannelsFromNotification(\n channelResponses: ChannelResponse<T>[]\n ) {\n let newChannels: Channel<T>[] = [];\n const watchRequests: Promise<any>[] = [];\n channelResponses.forEach((channelResponse) => {\n const channel = this.chatClientService.chatClient.channel(\n channelResponse.type,\n channelResponse.id\n );\n watchRequests.push(channel.watch());\n newChannels.push(channel);\n });\n await Promise.all(watchRequests);\n const currentChannels = this.channelsSubject.getValue() || [];\n newChannels = newChannels.filter(\n (newChannel) => !currentChannels.find((c) => c.cid === newChannel.cid)\n );\n if (newChannels.length > 0) {\n newChannels.forEach((c) => this.watchForChannelEvents(c));\n this.channelsSubject.next([...newChannels, ...currentChannels]);\n }\n }\n\n private removeChannelsFromChannelList(\n cids: string[],\n shouldStopWatching: boolean\n ) {\n const channels = this.channels.filter((c) => !cids.includes(c.cid || ''));\n if (shouldStopWatching) {\n cids.forEach((cid) => {\n if (this.channelSubscriptions[cid]) {\n this.channelSubscriptions[cid]();\n delete this.channelSubscriptions.cid;\n }\n void this.chatClientService.chatClient.activeChannels[\n cid\n ]?.stopWatching();\n });\n }\n if (channels.length < this.channels.length) {\n this.channelsSubject.next(channels);\n if (cids.includes(this.activeChannelSubject.getValue()?.cid || '')) {\n if (channels.length > 0) {\n this.setAsActiveChannel(channels[0]);\n } else {\n this.activeChannelSubject.next(undefined);\n }\n }\n }\n }\n\n private watchForActiveChannelEvents(channel: Channel<T>) {\n this.activeChannelSubscriptions.push(\n channel.on('message.new', (event) => {\n this.ngZone.run(() => {\n event.message && event.message.parent_id\n ? event.message.parent_id ===\n this.activeParentMessageIdSubject.getValue()\n ? this.activeThreadMessagesSubject.next([\n ...channel.state.threads[event.message.parent_id],\n ])\n : null\n : this.activeChannelMessagesSubject.next([\n ...channel.state.messages,\n ]);\n this.activeChannel$.pipe(first()).subscribe((c) => {\n if (c) {\n this.markRead(c);\n }\n });\n this.updateLatestMessages(event);\n });\n })\n );\n this.activeChannelSubscriptions.push(\n channel.on('message.updated', (event) => this.messageUpdated(event))\n );\n this.activeChannelSubscriptions.push(\n channel.on('message.deleted', (event) => this.messageUpdated(event))\n );\n this.activeChannelSubscriptions.push(\n channel.on('reaction.new', (e) => this.messageReactionEventReceived(e))\n );\n this.activeChannelSubscriptions.push(\n channel.on('reaction.deleted', (e) =>\n this.messageReactionEventReceived(e)\n )\n );\n this.activeChannelSubscriptions.push(\n channel.on('reaction.updated', (e) =>\n this.messageReactionEventReceived(e)\n )\n );\n this.activeChannelSubscriptions.push(\n channel.on('message.read', (e) => {\n this.ngZone.run(() => {\n let latestMessage!: StreamMessage;\n let messages!: StreamMessage[];\n this.activeChannelMessages$.pipe(first()).subscribe((m) => {\n messages = m;\n latestMessage = messages[messages.length - 1];\n });\n if (!latestMessage || !e.user) {\n return;\n }\n if (latestMessage.readBy) {\n latestMessage.readBy.splice(0, latestMessage.readBy.length);\n } else {\n latestMessage.readBy = [];\n }\n latestMessage.readBy.push(...getReadBy(latestMessage, channel));\n messages[messages.length - 1] = { ...latestMessage };\n\n this.activeChannelMessagesSubject.next([...messages]);\n });\n })\n );\n this.activeChannelSubscriptions.push(\n this.chatClientService.events$\n .pipe(\n filter(\n (e) =>\n e.eventType === 'notification.mark_unread' &&\n e.event.channel_id === channel.id\n ),\n map((e) => e.event)\n )\n .subscribe((e) => {\n this.ngZone.run(() => {\n this.activeChannelLastReadMessageId = e.last_read_message_id;\n this.activeChannelUnreadCount = e.unread_messages;\n this.activeChannelSubject.next(this.activeChannel);\n });\n })\n );\n this.activeChannelSubscriptions.push(\n channel.on('typing.start', (e) =>\n this.ngZone.run(() => this.handleTypingStartEvent(e))\n )\n );\n this.activeChannelSubscriptions.push(\n channel.on('typing.stop', (e) =>\n this.ngZone.run(() => this.handleTypingStopEvent(e))\n )\n );\n }\n\n /**\n * Call this method if user started typing in the active channel\n * @param parentId The id of the parent message, if user is typing in a thread\n */\n async typingStarted(parentId?: string) {\n const activeChannel = this.activeChannelSubject.getValue();\n await activeChannel?.keystroke(parentId);\n }\n\n /**\n * Call this method if user stopped typing in the active channel\n * @param parentId The id of the parent message, if user were typing in a thread\n */\n async typingStopped(parentId?: string) {\n const activeChannel = this.activeChannelSubject.getValue();\n await activeChannel?.stopTyping(parentId);\n }\n\n /**\n * The current list of channels\n */\n get channels() {\n return this.channelsSubject.getValue() || [];\n }\n\n /**\n * The current active channel\n */\n get activeChannel() {\n return this.activeChannelSubject.getValue() || undefined;\n }\n\n /**\n * The current active channel messages\n */\n get activeChannelMessages() {\n return this.activeChannelMessagesSubject.getValue() || [];\n }\n\n /**\n * Get the last 1200 reactions of a message in the current active channel. If you need to fetch more reactions please use the [following endpoint](https://getstream.io/chat/docs/javascript/send_reaction/?language=javascript#paginating-reactions).\n * @param messageId\n * @returns all reactions of a message\n */\n async getMessageReactions(messageId: string) {\n const reactions: ReactionResponse<T>[] = [];\n const limit = 300;\n let offset = 0;\n const reactionsLimit = ChannelService.MAX_MESSAGE_REACTIONS_TO_FETCH;\n let lastPageSize = limit;\n\n while (lastPageSize === limit && reactions.length < reactionsLimit) {\n try {\n const response = await this.activeChannel?.getReactions(messageId, {\n offset,\n limit,\n });\n lastPageSize = response?.reactions?.length || 0;\n if (lastPageSize > 0) {\n reactions.push(...response!.reactions);\n }\n offset += lastPageSize;\n } catch (e) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error loading reactions'\n );\n throw e;\n }\n }\n return reactions;\n }\n\n /**\n * Marks the channel from the given message as unread\n * @param messageId\n * @returns the result of the request\n */\n async markMessageUnread(messageId: string) {\n if (!this.activeChannel) {\n return;\n }\n\n try {\n const response = await this.activeChannel.markUnread({\n message_id: messageId,\n });\n this.areReadEventsPaused = true;\n return response;\n } catch (e: any) {\n const error: {\n response?: {\n data?: { code?: number; message?: string; StatusCode?: number };\n };\n } = JSON.parse(JSON.stringify(e)) as {\n response?: {\n data?: { code?: number; message?: string; StatusCode?: number };\n };\n };\n const data = error?.response?.data;\n if (\n data &&\n data.code === 4 &&\n data.StatusCode === 400 &&\n data.message?.includes('it is older than last')\n ) {\n const count = /\\d+ channel messages/\n .exec(data.message)?.[0]\n .match(/\\d+/)?.[0];\n if (count) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error, only the first {{count}} message can be marked as unread',\n undefined,\n undefined,\n { count }\n );\n throw e;\n }\n }\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error marking message as unread'\n );\n throw e;\n }\n }\n\n private messageUpdated(event: Event<T>) {\n this.ngZone.run(() => {\n const isThreadReply = event.message && event.message.parent_id;\n const channel = this.activeChannelSubject.getValue();\n if (!channel) {\n return;\n }\n // Get messages from state as message order could change, and message could've been deleted\n const messages: FormatMessageResponse<T>[] = isThreadReply\n ? channel.state.threads[event?.message?.parent_id || '']\n : channel.state.messages;\n if (!messages) {\n return;\n }\n const messageIndex = messages.findIndex(\n (m) => m.id === event?.message?.id\n );\n if (messageIndex !== -1) {\n isThreadReply\n ? this.activeThreadMessagesSubject.next([...messages])\n : this.activeChannelMessagesSubject.next([...messages]);\n this.activeChannelPinnedMessagesSubject.next([\n ...channel.state.pinnedMessages,\n ]);\n }\n });\n }\n\n private messageReactionEventReceived(e: Event<T>) {\n this.ngZone.run(() => {\n const isThreadMessage = e.message && e.message.parent_id;\n let messages!: StreamMessage[];\n (isThreadMessage\n ? this.activeThreadMessages$\n : this.activeChannelMessages$\n )\n .pipe(first())\n .subscribe((m) => (messages = m));\n const messageIndex = messages.findIndex((m) => m.id === e?.message?.id);\n if (messageIndex === -1) {\n return;\n }\n const message = messages[messageIndex];\n message.reaction_counts = { ...e.message?.reaction_counts };\n message.reaction_scores = { ...e.message?.reaction_scores };\n message.latest_reactions = [...(e.message?.latest_reactions || [])];\n message.own_reactions = [...(e.message?.own_reactions || [])];\n\n messages[messageIndex] = { ...message };\n isThreadMessage\n ? this.activeThreadMessagesSubject.next([...messages])\n : this.activeChannelMessagesSubject.next([...messages]);\n });\n }\n\n private formatMessage(message: MessageResponse<T>) {\n const m = message as any as FormatMessageResponse<T>;\n m.pinned_at = message.pinned_at ? new Date(message.pinned_at) : null;\n m.created_at = message.created_at\n ? new Date(message.created_at)\n : new Date();\n m.updated_at = message.updated_at\n ? new Date(message.updated_at)\n : new Date();\n message.status = message.status || 'received';\n\n return m;\n }\n\n private isStreamMessage(\n message: StreamMessage | FormatMessageResponse | MessageResponse\n ): message is StreamMessage {\n return !!message.readBy;\n }\n\n private isFormatMessageResponse(\n message: StreamMessage | FormatMessageResponse | MessageResponse\n ): message is FormatMessageResponse {\n return message.created_at instanceof Date;\n }\n\n private stopWatchForActiveChannelEvents(channel: Channel<T> | undefined) {\n if (!channel) {\n return;\n }\n this.activeChannelSubscriptions.forEach((s) => s.unsubscribe());\n this.activeChannelSubscriptions = [];\n }\n\n private async queryChannels(\n shouldSetActiveChannel: boolean,\n recoverState = false\n ) {\n try {\n this.channelQueryStateSubject.next({ state: 'in-progress' });\n let filters: ChannelFilters<T>;\n let options: ChannelOptions;\n if (this.nextPageConfiguration) {\n if (this.nextPageConfiguration.type === 'filter') {\n filters = {\n ...this.filters!,\n ...this.nextPageConfiguration.paginationFilter,\n };\n options = this.options as ChannelOptions;\n } else {\n options = {\n ...this.options,\n offset: this.nextPageConfiguration.offset,\n };\n filters = this.filters!;\n }\n } else {\n filters = this.filters!;\n options = this.options as ChannelOptions;\n }\n const channels = await this.chatClientService.chatClient.queryChannels(\n filters,\n this.sort || {},\n options\n );\n this.setNextPageConfiguration(channels);\n channels.forEach((c) => this.watchForChannelEvents(c));\n const prevChannels = recoverState\n ? []\n : this.channelsSubject.getValue() || [];\n const filteredChannels = channels.filter(\n (channel) =>\n !prevChannels.find(\n (existingChannel) => existingChannel.cid === channel.cid\n )\n );\n let currentActiveChannel = this.activeChannelSubject.getValue();\n let isCurrentActiveChannelDeselected = false;\n const nextChannels = [...prevChannels, ...filteredChannels];\n if (\n recoverState &&\n currentActiveChannel &&\n !filteredChannels.find((c) => c.cid === currentActiveChannel?.cid)\n ) {\n try {\n await currentActiveChannel.watch();\n nextChannels.unshift(currentActiveChannel);\n } catch (e) {\n isCurrentActiveChannelDeselected = true;\n }\n }\n this.channelsSubject.next(nextChannels);\n if (isCurrentActiveChannelDeselected) {\n this.deselectActiveChannel();\n }\n if (\n filteredChannels.length > 0 &&\n !currentActiveChannel &&\n shouldSetActiveChannel\n ) {\n this.setAsActiveChannel(filteredChannels[0]);\n currentActiveChannel = this.activeChannelSubject.getValue();\n }\n this.hasMoreChannelsSubject.next(channels.length >= this.options!.limit!);\n this.channelQueryStateSubject.next({ state: 'success' });\n if (\n this.options?.keepAliveChannels$OnError &&\n this.dismissErrorNotification\n ) {\n this.dismissErrorNotification();\n }\n return channels;\n } catch (error) {\n if (!this.options?.keepAliveChannels$OnError) {\n this.channelsSubject.error(error);\n }\n this.channelQueryStateSubject.next({\n state: 'error',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n error,\n });\n throw error;\n }\n }\n\n private watchForChannelEvents(channel: Channel<T>) {\n const unsubscribe = channel.on((event: Event<T>) => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const type = event.type as EventTypes | 'capabilities.changed';\n switch (type) {\n case 'message.new': {\n this.ngZone.run(() => {\n if (this.customNewMessageHandler) {\n this.customNewMessageHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleNewMessage(event, channel);\n }\n });\n break;\n }\n case 'channel.hidden': {\n this.ngZone.run(() => {\n if (this.customChannelHiddenHandler) {\n this.customChannelHiddenHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleChannelHidden(event);\n }\n });\n break;\n }\n case 'channel.deleted': {\n this.ngZone.run(() => {\n if (this.customChannelDeletedHandler) {\n this.customChannelDeletedHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleChannelDeleted(event);\n }\n });\n break;\n }\n case 'channel.visible': {\n this.ngZone.run(() => {\n if (this.customChannelVisibleHandler) {\n this.customChannelVisibleHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleChannelVisible(event, channel);\n }\n });\n break;\n }\n case 'channel.updated': {\n this.ngZone.run(() => {\n if (this.customChannelUpdatedHandler) {\n this.customChannelUpdatedHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleChannelUpdate(event);\n }\n });\n break;\n }\n case 'channel.truncated': {\n this.ngZone.run(() => {\n if (this.customChannelTruncatedHandler) {\n this.customChannelTruncatedHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleChannelTruncate(event);\n }\n });\n break;\n }\n case 'capabilities.changed': {\n this.ngZone.run(() => {\n const cid = event.cid;\n if (cid) {\n const currentChannels = this.channelsSubject.getValue();\n const index = currentChannels?.findIndex((c) => c.cid === cid);\n if (index !== -1 && index !== undefined) {\n this.channelsSubject.next([...currentChannels!]);\n if (cid === this.activeChannelSubject.getValue()?.cid) {\n this.activeChannelSubject.next(\n this.activeChannelSubject.getValue()\n );\n }\n }\n }\n });\n break;\n }\n }\n });\n this.channelSubscriptions[channel.cid] = unsubscribe.unsubscribe;\n }\n\n private handleNewMessage(_: Event, channel: Channel<T>) {\n const channelIndex = this.channels.findIndex((c) => c.cid === channel.cid);\n this.channels.splice(channelIndex, 1);\n this.channelsSubject.next([channel, ...this.channels]);\n }\n\n private handleChannelHidden(event: Event) {\n this.removeChannelsFromChannelList([event.channel!.cid], false);\n }\n\n private handleChannelDeleted(event: Event) {\n this.removeChannelsFromChannelList([event.channel!.cid], false);\n }\n\n private handleChannelVisible(event: Event, channel: Channel<T>) {\n if (!this.channels.find((c) => c.cid === event.cid)) {\n this.ngZone.run(() =>\n this.channelsSubject.next([...this.channels, channel])\n );\n }\n }\n\n private handleChannelUpdate(event: Event<T>) {\n const channelIndex = this.channels.findIndex(\n (c) => c.cid === event.channel!.cid\n );\n if (channelIndex !== -1) {\n const channel = this.channels[channelIndex];\n const notIncludedProperies = {\n hidden: channel.data?.hidden || false,\n own_capabilities: channel.data?.own_capabilities || [],\n };\n channel.data = {\n ...event.channel!,\n ...notIncludedProperies,\n };\n this.channelsSubject.next([...this.channels]);\n if (event.channel?.cid === this.activeChannelSubject.getValue()?.cid) {\n this.activeChannelSubject.next(channel);\n }\n }\n }\n\n private handleChannelTruncate(event: Event) {\n const channelIndex = this.channels.findIndex(\n (c) => c.cid === event.channel!.cid\n );\n if (channelIndex !== -1) {\n this.channels[channelIndex].state.messages = [];\n this.channelsSubject.next([...this.channels]);\n if (event.channel?.cid === this.activeChannelSubject.getValue()?.cid) {\n const channel = this.activeChannelSubject.getValue()!;\n channel.state.messages = [];\n this.activeChannelSubject.next(channel);\n this.activeChannelMessagesSubject.next([]);\n this.activeParentMessageIdSubject.next(undefined);\n this.activeThreadMessagesSubject.next([]);\n }\n }\n }\n\n private get canSendReadEvents() {\n const channel = this.activeChannelSubject.getValue();\n if (!channel) {\n return false;\n }\n const capabilites = channel.data?.own_capabilities as string[];\n return capabilites.indexOf('read-events') !== -1;\n }\n\n private transformToStreamMessage(\n message: StreamMessage<T> | MessageResponse<T> | FormatMessageResponse<T>,\n channel?: Channel<T>\n ) {\n const isThreadMessage = !!message.parent_id;\n if (\n this.isStreamMessage(message) &&\n this.isFormatMessageResponse(message)\n ) {\n if (message.quoted_message) {\n message.quoted_message.translation = getMessageTranslation(\n message.quoted_message,\n channel,\n this.chatClientService.chatClient.user\n );\n }\n message.translation = getMessageTranslation(\n message,\n channel,\n this.chatClientService.chatClient.user\n );\n return message;\n } else {\n if (message.quoted_message) {\n message.quoted_message.translation = getMessageTranslation(\n message.quoted_message,\n channel,\n this.chatClientService.chatClient.user\n );\n }\n if (this.isFormatMessageResponse(message)) {\n message.readBy = isThreadMessage\n ? []\n : channel\n ? getReadBy(message, channel)\n : [];\n message.translation = getMessageTranslation(\n message,\n channel,\n this.chatClientService.chatClient.user\n );\n\n return message;\n } else {\n message = this.formatMessage(message);\n message.readBy = isThreadMessage\n ? []\n : channel\n ? getReadBy(message, channel)\n : [];\n message.translation = getMessageTranslation(\n message,\n channel,\n this.chatClientService.chatClient.user\n );\n return message;\n }\n }\n }\n\n private handleTypingStartEvent(event: Event) {\n if (event.user?.id === this.chatClientService.chatClient.user?.id) {\n return;\n }\n const isTypingInThread = !!event.parent_id;\n if (\n isTypingInThread &&\n event.parent_id !== this.activeParentMessageIdSubject.getValue()\n ) {\n return;\n }\n const subject = isTypingInThread\n ? this.usersTypingInThreadSubject\n : this.usersTypingInChannelSubject;\n const users: UserResponse[] = subject.getValue();\n const user = event.user;\n if (user && !users.find((u) => u.id === user.id)) {\n users.push(user);\n subject.next([...users]);\n }\n }\n\n private handleTypingStopEvent(event: Event) {\n const usersTypingInChannel = this.usersTypingInChannelSubject.getValue();\n const usersTypingInThread = this.usersTypingInThreadSubject.getValue();\n const user = event.user;\n if (user && usersTypingInChannel.find((u) => u.id === user.id)) {\n usersTypingInChannel.splice(\n usersTypingInChannel.findIndex((u) => u.id === user.id),\n 1\n );\n this.usersTypingInChannelSubject.next([...usersTypingInChannel]);\n return;\n }\n if (user && usersTypingInThread.find((u) => u.id === user.id)) {\n usersTypingInThread.splice(\n usersTypingInThread.findIndex((u) => u.id === user.id),\n 1\n );\n this.usersTypingInThreadSubject.next([...usersTypingInThread]);\n return;\n }\n }\n\n private updateLatestMessages(event: Event) {\n if (\n event.message?.user?.id !== this.chatClientService?.chatClient.user?.id\n ) {\n return;\n }\n const latestMessages =\n this.latestMessageDateByUserByChannelsSubject.getValue();\n if (!event.message?.created_at) {\n return;\n }\n const channelId = event?.message?.cid;\n if (!channelId) {\n return;\n }\n const messageDate = new Date(event.message.created_at);\n if (\n !latestMessages[channelId] ||\n latestMessages[channelId]?.getTime() < messageDate.getTime()\n ) {\n latestMessages[channelId] = messageDate;\n this.latestMessageDateByUserByChannelsSubject.next({\n ...latestMessages,\n });\n }\n }\n\n private setChannelState(channel: Channel<T>) {\n channel.state.messages.forEach((m) => {\n m.readBy = getReadBy(m, channel);\n m.translation = getMessageTranslation(\n m,\n channel,\n this.chatClientService.chatClient.user\n );\n if (m.quoted_message) {\n m.quoted_message.translation = getMessageTranslation(\n m.quoted_message,\n channel,\n this.chatClientService.chatClient.user\n );\n }\n });\n this.markRead(channel);\n this.activeChannelMessagesSubject.next([...channel.state.messages]);\n this.activeChannelPinnedMessagesSubject.next([\n ...channel.state.pinnedMessages,\n ]);\n this.activeParentMessageIdSubject.next(undefined);\n this.activeThreadMessagesSubject.next([]);\n this.messageToQuoteSubject.next(undefined);\n this.usersTypingInChannelSubject.next([]);\n this.usersTypingInThreadSubject.next([]);\n }\n\n private markRead(channel: Channel<T>, isThrottled = true) {\n if (\n this.canSendReadEvents &&\n this.shouldMarkActiveChannelAsRead &&\n !this.areReadEventsPaused\n ) {\n if (isThrottled) {\n this.markReadThrottled(channel);\n } else {\n void channel.markRead();\n }\n }\n }\n\n private markReadThrottled(channel: Channel<T>) {\n if (!this.markReadTimeout) {\n this.markRead(channel, false);\n this.markReadTimeout = setTimeout(() => {\n this.flushMarkReadQueue();\n }, this.markReadThrottleTime);\n } else {\n clearTimeout(this.markReadTimeout);\n this.scheduledMarkReadRequest = () => this.markRead(channel, false);\n this.markReadTimeout = setTimeout(() => {\n this.flushMarkReadQueue();\n }, this.markReadThrottleTime);\n }\n }\n\n private flushMarkReadQueue() {\n this.scheduledMarkReadRequest?.();\n this.scheduledMarkReadRequest = undefined;\n clearTimeout(this.markReadTimeout);\n this.markReadTimeout = undefined;\n }\n\n private setNextPageConfiguration(channelQueryResult: Channel<T>[]) {\n if (this.customPaginator) {\n this.nextPageConfiguration = this.customPaginator(channelQueryResult);\n } else {\n this.nextPageConfiguration = {\n type: 'offset',\n offset:\n (this.nextPageConfiguration?.type === 'offset'\n ? this.nextPageConfiguration.offset\n : 0) + channelQueryResult.length,\n };\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\nexport type Theme = 'light' | 'dark';\n\n/**\n * The `ThemeService` can be used to change the theme of the chat UI and to customize the theme. Our [theming guide](../theming/introduction.mdx) gives a complete overview about the topic.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ThemeService {\n /**\n * A Subject that can be used to get or set the currently active theme.\n */\n theme$ = new BehaviorSubject<Theme | string>('light');\n /**\n * Stream chat theme version - this is used internally by some UI components of the SDK, integrators shouldn't need to use this variable\n */\n themeVersion: '1' | '2';\n private _customLightThemeVariables: { [key: string]: string } | undefined;\n private _customDarkThemeVariables: { [key: string]: string } | undefined;\n private defaultDarkModeVariables = {\n '--bg-gradient-end': '#101214',\n '--bg-gradient-start': '#070a0d',\n '--black': '#ffffff',\n '--blue-alice': '#00193d',\n '--border': '#141924',\n '--button-background': '#ffffff',\n '--button-text': '#005fff',\n '--grey': '#7a7a7a',\n '--grey-gainsboro': '#2d2f2f',\n '--grey-whisper': '#1c1e22',\n '--modal-shadow': '#000000',\n '--overlay': '#00000066', // 66 = 40% opacity\n '--overlay-dark': '#ffffffcc', // CC = 80% opacity\n '--shadow-icon': '#00000080', // 80 = 50% opacity\n '--targetedMessageBackground': '#302d22',\n '--transparent': 'transparent',\n '--white': '#101418',\n '--white-smoke': '#13151b',\n '--white-snow': '#070a0d',\n };\n private variablesToDelete: { [key: string]: string }[] = [];\n\n constructor() {\n this.theme$.subscribe((theme) => {\n const darkVariables = this.customDarkThemeVariables\n ? { ...this.defaultDarkModeVariables, ...this.customDarkThemeVariables }\n : this.defaultDarkModeVariables;\n const lightVariables = this.customLightThemeVariables\n ? this.customLightThemeVariables\n : {};\n this.variablesToDelete.forEach((variables) =>\n this.deleteVariables(variables)\n );\n if (theme === 'dark') {\n this.deleteVariables(lightVariables);\n this.setVariables(darkVariables);\n } else {\n this.deleteVariables(darkVariables);\n this.setVariables(lightVariables);\n }\n });\n\n this.themeVersion = (getComputedStyle(document.documentElement)\n .getPropertyValue('--str-chat__theme-version')\n .replace(' ', '') || '1') as '1' | '2';\n }\n\n /**\n * A getter that returns the currently set custom light theme variables.\n * @deprecated Only use with [theme v1](../concepts/theming-and-css.mdx)\n * @returns An object where the keys are theme variables, and the values are the currently set CSS values.\n */\n get customLightThemeVariables() {\n return this._customLightThemeVariables;\n }\n\n /**\n * A setter that can be used to overwrite the values of the CSS theme variables of the light theme.\n * @deprecated Only use with [theme v1](../concepts/theming-and-css.mdx)\n * @param variables An object where the keys are theme variables, and the values are CSS values.\n */\n set customLightThemeVariables(\n variables: { [key: string]: string } | undefined\n ) {\n const prevVariables = this.customLightThemeVariables;\n if (prevVariables) {\n this.variablesToDelete.push(prevVariables);\n }\n this._customLightThemeVariables = variables;\n if (this.theme$.getValue() === 'light') {\n this.theme$.next('light');\n }\n }\n\n /**\n * A getter that returns the currently set custom dark theme variables.\n * @deprecated Only use with [theme v1](../concepts/theming-and-css.mdx)\n * @returns An object where the keys are theme variables, and the values are the currently set CSS values.\n */\n get customDarkThemeVariables() {\n return this._customDarkThemeVariables;\n }\n\n /**\n * A setter that can be used to overwrite the values of the CSS theme variables of the dark theme.\n * @deprecated Only use with [theme v1](../concepts/theming-and-css.mdx)\n * @param variables An object where the keys are theme variables, and the values are CSS values.\n */\n set customDarkThemeVariables(\n variables: { [key: string]: string } | undefined\n ) {\n const prevVariables = this.customDarkThemeVariables;\n if (prevVariables) {\n this.variablesToDelete.push(prevVariables);\n }\n this._customDarkThemeVariables = variables;\n if (this.theme$.getValue() === 'dark') {\n this.theme$.next('dark');\n }\n }\n\n private deleteVariables(variables: { [key: string]: string } | undefined) {\n if (!variables) {\n return;\n }\n Object.keys(variables).forEach((key) =>\n document.documentElement.style.setProperty(key, null)\n );\n }\n\n private setVariables(variables: { [key: string]: string } | undefined) {\n if (!variables) {\n return;\n }\n Object.keys(variables).forEach((key) =>\n document.documentElement.style.setProperty(key, variables[key])\n );\n }\n}\n","export const isImageFile = (file: File) => {\n // photoshop files begin with 'image/'\n return file.type.startsWith('image/') && !file.type.endsWith('.photoshop');\n};\n","import { Attachment } from 'stream-chat';\n\nexport const isImageAttachment = (attachment: Attachment) => {\n return (\n attachment.type === 'image' &&\n !attachment.title_link &&\n !attachment.og_scrape_url\n );\n};\n","import { Injectable } from '@angular/core';\nimport { isImageFile } from './is-image-file';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { Attachment } from 'stream-chat';\nimport { ChannelService } from './channel.service';\nimport { isImageAttachment } from './is-image-attachment';\nimport { NotificationService } from './notification.service';\nimport { AttachmentUpload, DefaultStreamChatGenerics } from './types';\n\n/**\n * The `AttachmentService` manages the uploads of a message input.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class AttachmentService<\n T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics\n> {\n /**\n * Emits the number of uploads in progress.\n */\n attachmentUploadInProgressCounter$: Observable<number>;\n /**\n * Emits the state of the uploads ([`AttachmentUpload[]`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/types.ts)), it adds a state (`success`, `error` or `uploading`) to each file the user selects for upload. It is used by the [`AttachmentPreviewList`](../components/AttachmentPreviewListComponent.mdx) to display the attachment previews.\n */\n attachmentUploads$: Observable<AttachmentUpload[]>;\n private attachmentUploadInProgressCounterSubject =\n new BehaviorSubject<number>(0);\n private attachmentUploadsSubject = new BehaviorSubject<AttachmentUpload[]>(\n []\n );\n\n constructor(\n private channelService: ChannelService,\n private notificationService: NotificationService\n ) {\n this.attachmentUploadInProgressCounter$ =\n this.attachmentUploadInProgressCounterSubject.asObservable();\n this.attachmentUploads$ = this.attachmentUploadsSubject.asObservable();\n }\n\n /**\n * Resets the attachments uploads (for example after the message with the attachments sent successfully)\n */\n resetAttachmentUploads() {\n this.attachmentUploadsSubject.next([]);\n }\n\n /**\n * Uploads the selected files, and creates preview for image files. The result is propagated throught the `attachmentUploads$` stream.\n * @param fileList The files selected by the user\n * @returns A promise with the result\n */\n async filesSelected(fileList: FileList | null) {\n if (!fileList) {\n return;\n }\n const imageFiles: File[] = [];\n const dataFiles: File[] = [];\n const videoFiles: File[] = [];\n\n Array.from(fileList).forEach((file) => {\n if (isImageFile(file)) {\n imageFiles.push(file);\n } else if (file.type.startsWith('video/')) {\n videoFiles.push(file);\n } else {\n dataFiles.push(file);\n }\n });\n imageFiles.forEach((f) => this.createPreview(f));\n const newUploads = [\n ...imageFiles.map((file) => ({\n file,\n state: 'uploading' as 'uploading',\n type: 'image' as 'image',\n })),\n ...videoFiles.map((file) => ({\n file,\n state: 'uploading' as 'uploading',\n type: 'video' as 'video',\n })),\n ...dataFiles.map((file) => ({\n file,\n state: 'uploading' as 'uploading',\n type: 'file' as 'file',\n })),\n ];\n this.attachmentUploadsSubject.next([\n ...this.attachmentUploadsSubject.getValue(),\n ...newUploads,\n ]);\n await this.uploadAttachments(newUploads);\n }\n\n /**\n * You can add custom `image`, `video` and `file` attachments using this method.\n *\n * Note: If you just want to use your own CDN for file uploads, you don't necessary need this method, you can just specify you own upload function in the [`ChannelService`](./ChannelService.mdx)\n *\n * @param attachment\n */\n addAttachment(attachment: Attachment<T>) {\n attachment.isCustomAttachment = true;\n this.createFromAttachments([attachment]);\n }\n\n /**\n * Retries to upload an attachment.\n * @param file\n * @returns A promise with the result\n */\n async retryAttachmentUpload(file: File) {\n const attachmentUploads = this.attachmentUploadsSubject.getValue();\n const upload = attachmentUploads.find((u) => u.file === file);\n if (!upload) {\n return;\n }\n upload.state = 'uploading';\n this.attachmentUploadsSubject.next([...attachmentUploads]);\n await this.uploadAttachments([upload]);\n }\n\n /**\n * Deletes an attachment, the attachment can have any state (`error`, `uploading` or `success`).\n * @param upload\n */\n async deleteAttachment(upload: AttachmentUpload) {\n const attachmentUploads = this.attachmentUploadsSubject.getValue();\n let result!: AttachmentUpload[];\n if (\n upload.state === 'success' &&\n !upload.fromAttachment?.isCustomAttachment\n ) {\n try {\n await this.channelService.deleteAttachment(upload);\n result = [...attachmentUploads];\n const index = attachmentUploads.indexOf(upload);\n result.splice(index, 1);\n } catch (error) {\n result = attachmentUploads;\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error deleting attachment'\n );\n }\n } else {\n result = [...attachmentUploads];\n const index = attachmentUploads.indexOf(upload);\n result.splice(index, 1);\n }\n this.attachmentUploadsSubject.next([...result]);\n }\n\n /**\n * Maps the current uploads to a format that can be sent along with the message to the Stream API.\n * @returns the attachments\n */\n mapToAttachments() {\n const attachmentUploads = this.attachmentUploadsSubject.getValue();\n return attachmentUploads\n .filter((r) => r.state === 'success')\n .map((r) => {\n const attachment: Attachment = {\n type: r.type,\n };\n if (r.fromAttachment) {\n return r.fromAttachment;\n } else {\n attachment.mime_type = r.file?.type;\n if (r.type === 'image') {\n attachment.fallback = r.file?.name;\n attachment.image_url = r.url;\n } else {\n attachment.asset_url = r.url;\n attachment.title = r.file?.name;\n attachment.file_size = r.file?.size;\n attachment.thumb_url = r.thumb_url;\n }\n }\n\n return attachment;\n });\n }\n\n /**\n * Maps attachments received from the Stream API to uploads. This is useful when editing a message.\n * @param attachments Attachemnts received with the message\n */\n createFromAttachments(attachments: Attachment<T>[]) {\n const attachmentUploads: AttachmentUpload[] = [];\n attachments.forEach((attachment) => {\n if (isImageAttachment(attachment)) {\n attachmentUploads.push({\n url: (attachment.img_url ||\n attachment.thumb_url ||\n attachment.image_url) as string,\n state: 'success',\n type: 'image',\n file: {\n name: attachment.fallback,\n type: attachment.mime_type,\n } as File,\n fromAttachment: attachment,\n });\n } else if (attachment.type === 'file' || attachment.type === 'video') {\n attachmentUploads.push({\n url: attachment.asset_url,\n state: 'success',\n file: {\n name: attachment.title,\n size: attachment.file_size,\n type: attachment.mime_type,\n } as File,\n type: attachment.type,\n thumb_url: attachment.thumb_url,\n fromAttachment: attachment,\n });\n }\n });\n\n if (attachmentUploads.length > 0) {\n this.attachmentUploadsSubject.next([\n ...this.attachmentUploadsSubject.getValue(),\n ...attachmentUploads,\n ]);\n }\n }\n\n private createPreview(file: File) {\n const reader = new FileReader();\n reader.onload = (event) => {\n const attachmentUploads = this.attachmentUploadsSubject.getValue();\n const upload = attachmentUploads.find((upload) => upload.file === file);\n if (!upload) {\n return;\n }\n upload.previewUri = event.target?.result || undefined;\n this.attachmentUploadsSubject.next([...attachmentUploads]);\n };\n reader.readAsDataURL(file as Blob);\n }\n\n private async uploadAttachments(uploads: AttachmentUpload[]) {\n this.attachmentUploadInProgressCounterSubject.next(\n this.attachmentUploadInProgressCounterSubject.getValue() + 1\n );\n const result = await this.channelService.uploadAttachments(uploads);\n const attachmentUploads = this.attachmentUploadsSubject.getValue();\n result.forEach((r) => {\n const upload = attachmentUploads.find((upload) => upload.file === r.file);\n if (!upload) {\n if (r.url) {\n void this.channelService.deleteAttachment(r);\n }\n return;\n }\n upload.state = r.state;\n upload.url = r.url;\n upload.thumb_url = r.thumb_url;\n if (upload.state === 'error') {\n upload.errorReason = r.errorReason;\n upload.errorExtraInfo = r.errorExtraInfo;\n let errorKey;\n const translateParams: { name: string; ext?: string; limit?: string } =\n { name: upload.file.name };\n switch (upload.errorReason) {\n case 'file-extension':\n errorKey =\n 'streamChat.Error uploading file, extension not supported';\n translateParams.ext = upload.errorExtraInfo?.[0]?.param;\n break;\n case 'file-size':\n errorKey =\n 'streamChat.Error uploading file, maximum file size exceeded';\n translateParams.limit = upload.errorExtraInfo?.[0]?.param;\n break;\n default:\n errorKey = 'streamChat.Error uploading file';\n }\n this.notificationService.addTemporaryNotification(\n errorKey,\n 'error',\n undefined,\n translateParams\n );\n }\n });\n this.attachmentUploadInProgressCounterSubject.next(\n this.attachmentUploadInProgressCounterSubject.getValue() - 1\n );\n this.attachmentUploadsSubject.next([...attachmentUploads]);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Attachment } from 'stream-chat';\nimport {\n AttachmentConfigration,\n DefaultStreamChatGenerics,\n ImageAttachmentConfiguration,\n VideoAttachmentConfiguration,\n} from './types';\n\n/**\n * The `AttachmentConfigurationService` provides customization for certain attributes of attachments displayed inside the message component. If you're using your own CDN, you can integrate resizing features of it by providing your own handlers.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class AttachmentConfigurationService<\n T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics\n> {\n /**\n * A custom handler can be provided to override the default image attachment (images uploaded from files) configuration. By default the SDK uses fixed image height (a size that's known before image is loaded), if you override that with dynamic image height (for example: height: 100%) the scrolling logic inside the message list can break.\n */\n customImageAttachmentConfigurationHandler?: (\n a: Attachment<T>,\n type: 'gallery' | 'single' | 'carousel',\n containerElement: HTMLElement\n ) => ImageAttachmentConfiguration;\n /**\n * A custom handler can be provided to override the default video attachment (videos uploaded from files) configuration. By default the SDK uses fixed height (a size that's known before video is loaded), if you override that with dynamic height (for example: height: 100%) the scrolling logic inside the message list can break.\n */\n customVideoAttachmentConfigurationHandler?: (\n a: Attachment<T>,\n containerElement: HTMLElement\n ) => VideoAttachmentConfiguration;\n /**\n * A custom handler can be provided to override the default giphy attachment (GIFs sent with the /giphy command) configuration. By default the SDK uses fixed height (a size that's known before the GIF is loaded), if you override that with dynamic height (for example: height: 100%) the scrolling logic inside the message list can break.\n */\n customGiphyAttachmentConfigurationHandler?: (\n a: Attachment<T>\n ) => AttachmentConfigration;\n /**\n * A custom handler can be provided to override the default scraped image attachment (images found in links inside messages) configuration. By default the SDK uses fixed height (a size that's known before image is loaded), if you override that with dynamic height (for example: height: 100%) the scrolling logic inside the message list can break.\n */\n customScrapedImageAttachmentConfigurationHandler?: (\n a: Attachment<T>\n ) => AttachmentConfigration;\n /**\n * You can turn on/off thumbnail generation for video attachments\n */\n shouldGenerateVideoThumbnail = true;\n\n /**\n * Handles the configuration for image attachments, it's possible to provide your own function to override the default logic\n * @param attachment The attachment to configure\n * @param location Specifies where the image is being displayed\n * @param element The default resizing logics reads the height/max-height and max-width propperties of this element and reduces file size based on the given values. File size reduction is done by Stream's CDN.\n */\n getImageAttachmentConfiguration(\n attachment: Attachment<T>,\n location: 'gallery' | 'single' | 'carousel',\n element: HTMLElement\n ): ImageAttachmentConfiguration {\n if (this.customImageAttachmentConfigurationHandler) {\n return this.customImageAttachmentConfigurationHandler(\n attachment,\n location,\n element\n );\n }\n\n const defaultOriginalDimension = 1000000;\n const urlString = (attachment.img_url ||\n attachment.thumb_url ||\n attachment.image_url ||\n '') as string;\n let url: URL;\n try {\n url = new URL(urlString);\n } catch (error) {\n return {\n url: urlString,\n width: '', // Not set to respect responsive width\n height: '', // Set from CSS\n originalHeight: defaultOriginalDimension,\n originalWidth: defaultOriginalDimension,\n };\n }\n const originalHeight =\n Number(url.searchParams.get('oh')) > 1\n ? Number(url.searchParams.get('oh'))\n : defaultOriginalDimension;\n const originalWidth =\n Number(url.searchParams.get('ow')) > 1\n ? Number(url.searchParams.get('ow'))\n : defaultOriginalDimension;\n const displayWarning = location === 'gallery' || location === 'single';\n const sizeRestriction = this.getSizingRestrictions(\n url,\n element,\n displayWarning\n );\n\n if (sizeRestriction) {\n // Apply 2x for retina displays\n sizeRestriction.height *= 2;\n sizeRestriction.width *= 2;\n this.addResizingParamsToUrl(sizeRestriction, url);\n }\n\n return {\n url: url.href,\n width: '', // Not set to respect responsive width\n height: '', // Set from CSS\n originalHeight,\n originalWidth,\n };\n }\n\n /**\n * Handles the configuration for video attachments, it's possible to provide your own function to override the default logic\n * @param attachment The attachment to configure\n * @param element The default resizing logics reads the height/max-height and max-width propperties of this element and reduces file size based on the given values. File size reduction is done by Stream's CDN.\n */\n getVideoAttachmentConfiguration(\n attachment: Attachment<T>,\n element: HTMLElement\n ): VideoAttachmentConfiguration {\n if (this.customVideoAttachmentConfigurationHandler) {\n return this.customVideoAttachmentConfigurationHandler(\n attachment,\n element\n );\n }\n\n let thumbUrl: string | undefined = undefined;\n let originalHeight = 1000000;\n let originalWidth = 1000000;\n if (attachment.thumb_url && this.shouldGenerateVideoThumbnail) {\n let url: URL;\n try {\n url = new URL(attachment.thumb_url);\n\n originalHeight =\n Number(url.searchParams.get('oh')) > 1\n ? Number(url.searchParams.get('oh'))\n : originalHeight;\n originalWidth =\n Number(url.searchParams.get('ow')) > 1\n ? Number(url.searchParams.get('ow'))\n : originalWidth;\n const displayWarning = true;\n const sizeRestriction = this.getSizingRestrictions(\n url,\n element,\n displayWarning\n );\n if (sizeRestriction) {\n sizeRestriction.height *= 2;\n sizeRestriction.width *= 2;\n this.addResizingParamsToUrl(sizeRestriction, url);\n }\n thumbUrl = url.href;\n } catch {\n thumbUrl = attachment.thumb_url;\n }\n }\n return {\n url: attachment.asset_url || '',\n width: '', // Not set to respect responsive width\n height: '', // Set from CSS\n thumbUrl: thumbUrl,\n originalHeight,\n originalWidth,\n };\n }\n\n /**\n * Handles the configuration for giphy attachments, it's possible to provide your own function to override the default logic\n * @param attachment The attachment to configure\n */\n getGiphyAttachmentConfiguration(\n attachment: Attachment<T>\n ): AttachmentConfigration {\n if (this.customGiphyAttachmentConfigurationHandler) {\n return this.customGiphyAttachmentConfigurationHandler(attachment);\n }\n\n const giphy = attachment.giphy?.fixed_height_downsampled;\n\n return {\n url: giphy?.url || attachment.image_url || attachment.thumb_url || '',\n height: giphy?.height ? `${giphy?.height}px` : '300px',\n width: giphy?.width ? `${giphy?.width}px` : '',\n };\n }\n\n /**\n * Handles the configuration for scraped image attachments, it's possible to provide your own function to override the default logic\n * @param attachment The attachment to configure\n */\n getScrapedImageAttachmentConfiguration(\n attachment: Attachment<T>\n ): AttachmentConfigration {\n if (this.customScrapedImageAttachmentConfigurationHandler) {\n return this.customScrapedImageAttachmentConfigurationHandler(attachment);\n }\n\n return {\n url: attachment.image_url || attachment.thumb_url || '',\n width: '',\n height: '', // Set from CSS\n };\n }\n\n private addResizingParamsToUrl(\n sizeRestriction: { width: number; height: number },\n url: URL\n ) {\n url.searchParams.set('h', sizeRestriction.height.toString());\n url.searchParams.set('w', sizeRestriction.width.toString());\n }\n\n private getSizingRestrictions(\n url: URL,\n htmlElement: HTMLElement,\n displayWarning = false\n ) {\n const urlParams = url.searchParams;\n const originalHeight = Number(urlParams.get('oh')) || 1;\n const originalWidth = Number(urlParams.get('ow')) || 1;\n const cssSizeRestriction = this.getCSSSizeRestriction(htmlElement);\n let sizeRestriction: { width: number; height: number } | undefined;\n\n if (\n (cssSizeRestriction.maxHeight || cssSizeRestriction.height) &&\n cssSizeRestriction.maxWidth\n ) {\n sizeRestriction = this.getSizeRestrictions(\n originalHeight,\n originalWidth,\n (cssSizeRestriction.maxHeight || cssSizeRestriction.height)!,\n cssSizeRestriction.maxWidth\n );\n } else {\n sizeRestriction = undefined;\n if (displayWarning) {\n console.warn(\n `Invalid value set for height/max-height and/or max-width for HTML element, this can cause scrolling issues inside the message list, more info https://getstream.io/chat/docs/sdk/angular/components/AttachmentListComponent/#image-and-video-sizing, attachment URL: ${url.toString()}`\n );\n }\n }\n\n return sizeRestriction;\n }\n\n private getSizeRestrictions(\n originalHeight: number,\n originalWidth: number,\n maxHeight: number,\n maxWidth: number\n ) {\n return {\n height: Math.round(\n Math.max(maxHeight, (maxWidth / originalWidth) * originalHeight)\n ),\n width: Math.round(\n Math.max(maxHeight, (maxWidth / originalHeight) * originalWidth)\n ),\n };\n }\n\n private getCSSSizeRestriction(htmlElement: HTMLElement) {\n const computedStylesheet = getComputedStyle(htmlElement);\n const height = this.getValueRepresentationOfCSSProperty(\n computedStylesheet.getPropertyValue('height')\n );\n const maxHeight = this.getValueRepresentationOfCSSProperty(\n computedStylesheet.getPropertyValue('max-height')\n );\n const maxWidth = this.getValueRepresentationOfCSSProperty(\n computedStylesheet.getPropertyValue('max-width')\n );\n\n return { height, maxHeight, maxWidth };\n }\n\n private getValueRepresentationOfCSSProperty(property: string) {\n return Number(property.replace('px', '')) || undefined;\n }\n}\n","export const en = {\n streamChat: {\n '1 reply': '1 reply',\n 'Attach files': 'Attach files',\n Cancel: 'Cancel',\n 'Channel Missing': 'Channel Missing',\n Close: 'Close',\n 'Close emoji picker': 'Close emoji picker',\n 'Commands matching': 'Commands matching',\n 'Connection failure, reconnecting now...':\n 'Connection failure, reconnecting now...',\n Delete: 'Delete',\n Delivered: 'Delivered',\n 'Edit Message': 'Edit Message',\n 'Edit message request failed': 'Edit message request failed',\n 'Emoji matching': 'Emoji matching',\n 'Empty message...': 'Empty message...',\n 'Error adding flag': 'Error adding flag',\n 'Error connecting to chat, refresh the page to try again.':\n 'Error connecting to chat, refresh the page to try again',\n 'Error deleting message': 'Error deleting message',\n 'Error loading reactions': 'Error loading reactions',\n 'Error muting a user ...': 'Error muting a user ...',\n 'Error pinning message': 'Error pinning message',\n 'Error removing message pin': 'Error removing message pin',\n 'Error unmuting a user ...': 'Error unmuting a user ...',\n 'Error uploading file': 'Error uploading file \"{{ name }}\"',\n 'Error uploading file, maximum file size exceeded':\n 'Error uploading \"{{ name }}\", maximum file size {{ limit }} exceeded',\n 'Error uploading file, extension not supported':\n 'Error uploading \"{{ name }}\", type {{ ext }} not supported',\n 'Error deleting attachment': 'Error deleting attachment',\n 'Error · Unsent': \"Message couldn't be sent\",\n 'Error: {{ errorMessage }}': 'Error: {{ errorMessage }}',\n Flag: 'Flag',\n 'Message Failed': 'Message Failed',\n 'Message Failed · Unauthorized': 'Unauthorized to send message',\n 'Message Failed · Click to try again':\n \"Message couldn't be sent, click to try again\",\n 'Message deleted': 'Message deleted',\n 'Message has been successfully flagged':\n 'Message has been successfully flagged',\n 'Message pinned': 'Message pinned',\n 'Message unpinned': 'Message unpinned',\n Mute: 'Mute',\n New: 'New',\n 'New Messages!': 'New Messages!',\n 'No results found': 'No results found',\n 'Nothing yet...': 'Nothing yet...',\n 'Only visible to you': 'Only visible to you',\n 'Open emoji picker': 'Open emoji picker',\n 'People matching': 'People matching',\n 'Pick your emoji': 'Pick your emoji',\n Pin: 'Pin',\n 'Pinned by': 'Pinned by',\n Reply: 'Reply',\n 'Reply to Message': 'Reply to Message',\n Search: 'Search',\n 'Searching...': 'Searching...',\n Send: 'Send',\n 'Send message request failed': 'Send message request failed',\n 'Sending...': 'Sending...',\n 'Slow Mode ON': 'Slow Mode ON',\n 'Start of a new thread': 'Start of a new thread',\n 'This message was deleted...': 'This message was deleted...',\n Thread: 'Thread reply',\n 'Type your message': 'Type your message',\n Unmute: 'Unmute',\n Unpin: 'Unpin',\n 'Wait until all attachments have uploaded':\n 'Wait until all attachments have uploaded',\n 'You have no channels currently': 'You have no channels currently',\n \"You've reached the maximum number of files\":\n \"You've reached the maximum number of files\",\n live: 'live',\n 'this content could not be displayed':\n 'this content could not be displayed',\n '{{ commaSeparatedUsers }} and {{ moreCount }} more':\n '{{ commaSeparatedUsers }} and {{ moreCount }} more',\n '{{ commaSeparatedUsers }}, and {{ lastUser }}':\n '{{ commaSeparatedUsers }}, and {{ lastUser }}',\n '{{ firstUser }} and {{ secondUser }}':\n '{{ firstUser }} and {{ secondUser }}',\n '{{ imageCount }} more': '{{ imageCount }} more',\n '{{ memberCount }} members': '{{ memberCount }} members',\n '{{ replyCount }} replies': '{{ replyCount }} replies',\n '{{ user }} has been muted': '{{ user }} has been muted',\n '{{ user }} has been unmuted': '{{ user }} has been unmuted',\n '{{ watcherCount }} online': '{{ watcherCount }} online',\n '🏙 Attachment...': '🏙 Attachment...',\n 'Connection error': 'Connection error',\n 'Load more': 'Load more',\n failed: 'failed',\n retry: 'retry',\n test: 'success',\n 'Sending links is not allowed in this conversation':\n 'Sending links is not allowed in this conversation',\n \"You can't send messages in this channel\":\n \"You can't send messages in this channel\",\n \"You can't send thread replies in this channel\":\n \"You can't send thread replies in this channel\",\n 'Message not found': 'Message not found',\n 'No chats here yet…': 'No chats here yet…',\n 'user is typing': '{{ user }} is typing',\n 'users are typing': '{{ users }} are typing',\n 'Error loading channels': 'Error loading channels',\n 'See original (automatically translated)':\n 'See original (automatically translated)',\n 'See translation': 'See translation',\n 'Mark as unread': 'Mark as unread',\n 'Error marking message as unread': 'Error marking message as unread',\n 'Error, only the first {{count}} message can be marked as unread':\n 'Error, only the first {{count}} message can be marked as unread',\n 'Unread messages': 'Unread messages',\n '{{count}} unread messages': '{{count}} unread messages',\n '{{count}} unread message': '{{count}} unread message',\n 'This message did not meet our content guidelines':\n 'This message did not meet our content guidelines',\n 'Send Anyway': 'Send Anyway',\n Edited: 'Edited',\n 'Error playing audio': 'Error playing audio',\n },\n};\n","import { Injectable } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { en } from '../assets/i18n/en';\n\n/**\n * The `StreamI18nService` can be used to customize the labels of the chat UI. Our [translation guide](../concepts/translation.mdx) covers this topic in detail.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class StreamI18nService {\n constructor(private translteService: TranslateService) {}\n\n /**\n * Registers the translation to the [ngx-translate](https://github.com/ngx-translate/core) TranslateService.\n * @param lang The language key to register the translation to\n * @param overrides An object which keys are translation keys, and the values are custom translations\n */\n setTranslation(lang = 'en', overrides?: { [key: string]: string }) {\n if (!this.translteService.defaultLang) {\n this.translteService.defaultLang = lang;\n }\n this.translteService.setTranslation(\n lang,\n { streamChat: { ...en.streamChat, ...overrides } },\n true\n );\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n SimpleChanges,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { filter } from 'rxjs/operators';\nimport { Channel, User } from 'stream-chat';\nimport { ChatClientService } from '../chat-client.service';\nimport {\n AvatarLocation,\n AvatarType,\n DefaultStreamChatGenerics,\n} from '../types';\n\n/**\n * The `Avatar` component displays the provided image, with fallback to the first letter of the optional name input.\n */\n@Component({\n selector: 'stream-avatar',\n templateUrl: './avatar.component.html',\n styleUrls: ['./avatar.component.scss'],\n})\nexport class AvatarComponent\n implements OnChanges, OnInit, OnChanges, AfterViewInit, OnDestroy\n{\n /**\n * An optional name of the image, used for fallback image or image title (if `imageUrl` is provided)\n */\n @Input() name: string | undefined;\n /**\n * The URL of the image to be displayed. If the image can't be displayed the first letter of the name input is displayed.\n */\n @Input() imageUrl: string | undefined;\n /**\n * The size in pixels of the avatar image.\n */\n @Input() size = 32;\n /**\n * The location the avatar will be displayed in\n */\n @Input() location: AvatarLocation | undefined;\n /**\n * The channel the avatar belongs to (if avatar of a channel is displayed)\n */\n @Input() channel?: Channel<DefaultStreamChatGenerics>;\n /**\n * The user the avatar belongs to (if avatar of a user is displayed)\n */\n @Input() user?: User<DefaultStreamChatGenerics>;\n /**\n * The type of the avatar: channel if channel avatar is displayed, user if user avatar is displayed\n */\n @Input() type: AvatarType | undefined;\n /**\n * If a channel avatar is displayed, and if the channel has exactly two members a green dot is displayed if the other member is online. Set this flag to `false` to turn off this behavior.\n */\n @Input() showOnlineIndicator = true;\n /**\n * If channel/user image isn't provided the initials of the name of the channel/user is shown instead, you can choose how the initals should be computed\n */\n @Input() initialsType:\n | 'first-letter-of-first-word'\n | 'first-letter-of-each-word' = 'first-letter-of-first-word';\n isError = false;\n isOnline = false;\n private isOnlineSubscription?: Subscription;\n initials: string = '';\n fallbackChannelImage: string | undefined;\n private userId?: string;\n private isViewInited = false;\n private subscriptions: Subscription[] = [];\n\n constructor(\n private chatClientService: ChatClientService,\n private ngZone: NgZone,\n private cdRef: ChangeDetectorRef\n ) {}\n\n ngOnInit(): void {\n this.subscriptions.push(\n this.chatClientService.user$.subscribe((u) => {\n if (u?.id !== this.userId) {\n this.userId = u?.id;\n if (this.type || this.channel || this.name) {\n this.setInitials();\n this.setFallbackChannelImage();\n this.updateIsOnlineSubscription();\n }\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n })\n );\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes['channel']) {\n this.updateIsOnlineSubscription();\n }\n if (changes.type || changes.name || changes.channel) {\n this.setInitials();\n }\n\n if (changes.type || changes.channel) {\n this.setFallbackChannelImage();\n }\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n private setFallbackChannelImage() {\n if (this.type !== 'channel') {\n this.fallbackChannelImage = undefined;\n } else {\n const otherMember = this.getOtherMemberIfOneToOneChannel();\n if (otherMember) {\n this.fallbackChannelImage = otherMember.image;\n } else {\n this.fallbackChannelImage = undefined;\n }\n }\n }\n\n private setInitials() {\n let result: string = '';\n if (this.type === 'user') {\n result = this.name?.toString() || '';\n } else if (this.type === 'channel') {\n if (this.channel?.data?.name) {\n result = this.channel?.data?.name;\n } else {\n const otherMember = this.getOtherMemberIfOneToOneChannel();\n if (otherMember) {\n result = otherMember.name || otherMember.id || '';\n } else {\n result = '#';\n }\n }\n }\n\n const words = result.split(' ');\n let initials: string;\n if (this.initialsType === 'first-letter-of-each-word') {\n initials = words.map((w) => w.charAt(0) || '').join('');\n } else {\n initials = words[0].charAt(0) || '';\n }\n this.initials = initials;\n }\n\n private updateIsOnlineSubscription() {\n if (this.channel) {\n const otherMember = this.getOtherMemberIfOneToOneChannel();\n if (otherMember) {\n this.isOnline = otherMember.online || false;\n this.isOnlineSubscription = this.chatClientService.events$\n .pipe(filter((e) => e.eventType === 'user.presence.changed'))\n .subscribe((event) => {\n if (event.event.user?.id === otherMember.id) {\n this.ngZone.run(() => {\n this.isOnline = event.event.user?.online || false;\n });\n }\n });\n } else {\n this.isOnline = false;\n this.isOnlineSubscription?.unsubscribe();\n }\n } else {\n this.isOnline = false;\n this.isOnlineSubscription?.unsubscribe();\n }\n }\n\n ngAfterViewInit(): void {\n this.isViewInited = true;\n }\n\n private getOtherMemberIfOneToOneChannel() {\n const otherMembers = Object.values(\n this.channel?.state?.members || {}\n ).filter((m) => m.user_id !== this.userId);\n if (otherMembers.length === 1) {\n return otherMembers[0].user;\n } else {\n return undefined;\n }\n }\n}\n","<div\n class=\"str-chat__avatar str-chat__avatar--circle stream-chat__avatar--{{\n location\n }}\"\n title=\"{{ name }}\"\n [ngStyle]=\"{\n flexBasis: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',\n fontSize:\n initialsType === 'first-letter-of-first-word'\n ? 'calc(var(--str-chat__spacing-px, 1px) * ' + size / 2 + ')'\n : 'calc(var(--str-chat__spacing-px, 1px) * ' + size / 3 + ')',\n height: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',\n lineHeight: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',\n width: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')'\n }\"\n>\n <img\n *ngIf=\"(imageUrl || fallbackChannelImage) && !isError; else fallback\"\n class=\"str-chat__avatar-image str-chat__avatar-image\"\n src=\"{{ imageUrl || fallbackChannelImage }}\"\n alt=\"{{ initials }}\"\n data-testid=\"avatar-img\"\n (error)=\"isError = true\"\n [ngStyle]=\"{\n flexBasis: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',\n height: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',\n objectFit: 'cover',\n width: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')'\n }\"\n fetchpriority=\"high\"\n />\n <ng-template #fallback>\n <div data-testid=\"fallback-img\" class=\"str-chat__avatar-fallback\">\n {{ initials }}\n </div>\n </ng-template>\n <div\n data-testid=\"online-indicator\"\n *ngIf=\"isOnline && showOnlineIndicator\"\n class=\"str-chat__avatar--online-indicator\"\n ></div>\n</div>\n","import { Injectable, TemplateRef } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport {\n AttachmentContext,\n AttachmentListContext,\n AttachmentPreviewListContext,\n AvatarContext,\n ChannelActionsContext,\n ChannelHeaderInfoContext,\n ChannelPreviewContext,\n ChannelPreviewInfoContext,\n CommandAutocompleteListItemContext,\n CustomAttachmentUploadContext,\n CustomMetadataContext,\n DateSeparatorContext,\n DefaultStreamChatGenerics,\n DeliveredStatusContext,\n EmojiPickerContext,\n IconContext,\n LoadingIndicatorContext,\n MentionAutcompleteListItemContext,\n MentionTemplateContext,\n MessageActionBoxItemContext,\n MessageActionsBoxContext,\n MessageContext,\n MessageInputContext,\n MessageReactionsContext,\n ModalContext,\n NotificationContext,\n ReadStatusContext,\n SendingStatusContext,\n SystemMessageContext,\n ThreadHeaderContext,\n TypingIndicatorContext,\n UnreadMessagesIndicatorContext,\n UnreadMessagesNotificationContext,\n} from './types';\n\n/**\n * A central location for registering your custom templates to override parts of the chat application.\n *\n * For code examples to the different customizations see our [customizations example application](https://github.com/GetStream/stream-chat-angular/tree/master/projects/customizations-example), specifically the [AppComponent](https://github.com/GetStream/stream-chat-angular/tree/master/projects/customizations-example/src/app) (see [README](https://github.com/GetStream/stream-chat-angular/blob/master/README.md#customization-examples) for instructions on how to start the application).\n *\n * You can find the type definitions of the context that is provided for each template [on GitHub](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angu)\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class CustomTemplatesService<\n T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics\n> {\n /**\n * The autocomplete list item template for mentioning users (used in the [`AutocompleteTextareaComponent`](../components/AutocompleteTextareaComponent.mdx))\n */\n mentionAutocompleteItemTemplate$ = new BehaviorSubject<\n TemplateRef<MentionAutcompleteListItemContext> | undefined\n >(undefined);\n /**\n * The autocomplete list item template for commands (used in the [`AutocompleteTextareaComponent`](../components/AutocompleteTextareaComponent.mdx))\n */\n commandAutocompleteItemTemplate$ = new BehaviorSubject<\n TemplateRef<CommandAutocompleteListItemContext> | undefined\n >(undefined);\n /**\n * Template used to display an item in the [channel list](../components/ChannelListComponent.mdx) (instead of the default [channal list item](../components/ChannelPreviewComponent.mdx))\n *\n */\n channelPreviewTemplate$ = new BehaviorSubject<\n TemplateRef<ChannelPreviewContext> | undefined\n >(undefined);\n /**\n * The message input template used when editing a message (instead of the [default message input](../components/MessageInputComponent.mdx))\n *\n */\n messageInputTemplate$ = new BehaviorSubject<\n TemplateRef<MessageInputContext> | undefined\n >(undefined);\n /**\n * The template used for displaying a [mention inside a message](../code-examples/mention-actions.mdx)\n *\n */\n mentionTemplate$ = new BehaviorSubject<\n TemplateRef<MentionTemplateContext> | undefined\n >(undefined);\n /**\n * The template for [emoji picker](../code-examples/emoji-picker.mdx)\n *\n */\n emojiPickerTemplate$ = new BehaviorSubject<\n TemplateRef<EmojiPickerContext> | undefined\n >(undefined);\n /**\n * The typing indicator template used in the [message list](../components/MessageListComponent.mdx)\n *\n */\n typingIndicatorTemplate$ = new BehaviorSubject<\n TemplateRef<TypingIndicatorContext> | undefined\n >(undefined);\n /**\n * The template used to display a message in the [message list](../components/MessageListComponent.mdx) (instead of the [default message component](../components/MessageComponent.mdx))\n *\n */\n messageTemplate$ = new BehaviorSubject<\n TemplateRef<MessageContext> | undefined\n >(undefined);\n /**\n * The template for channel actions displayed in the [channel header](../components/ChannelHeaderComponent.mdx) (by default no channel action is displayed)\n *\n */\n channelActionsTemplate$ = new BehaviorSubject<\n TemplateRef<ChannelActionsContext> | undefined\n >(undefined);\n /**\n * The template used to display attachments of a [message](../components/MessageComponent.mdx) (instead of the [default attachment list](../components/AttachmentListComponent.mdx))\n *\n */\n attachmentListTemplate$ = new BehaviorSubject<\n TemplateRef<AttachmentListContext> | undefined\n >(undefined);\n /**\n * The template used to display attachments in the [message input](../components/MessageInputComponent.mdx) component (instead of the [default attachment preview](../components/AttachmentPreviewListComponent.mdx))\n *\n */\n attachmentPreviewListTemplate$ = new BehaviorSubject<\n TemplateRef<AttachmentPreviewListContext> | undefined\n >(undefined);\n /**\n * The template used to display avatars for channels and users (instead of the [default avatar](../components/AvatarComponent.mdx))\n *\n */\n avatarTemplate$ = new BehaviorSubject<TemplateRef<AvatarContext> | undefined>(\n undefined\n );\n /**\n * Template for displaying icons (instead of the [default icon component](../components/IconComponent.mdx))\n *\n */\n iconTemplate$ = new BehaviorSubject<TemplateRef<IconContext> | undefined>(\n undefined\n );\n /**\n * Template for displaying the loading indicator (instead of the [default loading indicator](../components/LoadingIndicatorComponent.mdx))\n *\n */\n loadingIndicatorTemplate$ = new BehaviorSubject<\n TemplateRef<LoadingIndicatorContext> | undefined\n >(undefined);\n /**\n * Template for displaying the message actions box (instead of the [default message actions box](../components/MessageActionsBoxComponent.mdx))\n *\n */\n messageActionsBoxTemplate$ = new BehaviorSubject<\n TemplateRef<MessageActionsBoxContext> | undefined\n >(undefined);\n /**\n * The template used for displaying an item in the [message actions box](../components/MessageActionsBoxComponent.mdx)\n *\n */\n messageActionsBoxItemTemplate$ = new BehaviorSubject<\n TemplateRef<MessageActionBoxItemContext> | undefined\n >(undefined);\n /**\n * The template used to display the reactions of a [message](../components/MessageComponent.mdx), and the selector to add a reaction to a message (instead of the [default message reactions component](../components/MessageReactionsComponent.mdx))\n *\n */\n messageReactionsTemplate$ = new BehaviorSubject<\n TemplateRef<MessageReactionsContext> | undefined\n >(undefined);\n /**\n * The template used to display a modal window (instead of the [default modal](../components/ModalComponent.mdx))\n *\n */\n modalTemplate$ = new BehaviorSubject<TemplateRef<ModalContext> | undefined>(\n undefined\n );\n /**\n * The template used to override the [default notification component](../components/NotificationComponent.mdx)\n *\n */\n notificationTemplate$ = new BehaviorSubject<\n TemplateRef<NotificationContext> | undefined\n >(undefined);\n /**\n * The template used for header of a [thread](../components/ThreadComponent.mdx)\n *\n */\n threadHeaderTemplate$ = new BehaviorSubject<\n TemplateRef<ThreadHeaderContext> | undefined\n >(undefined);\n /**\n * The template used for displaying the delivered state of the message inside the [message component](../components/MessageComponent.mdx)\n *\n * Displayed for the last message sent by the current user, if the message isn't yet read by anyone\n *\n */\n deliveredStatusTemplate$ = new BehaviorSubject<\n TemplateRef<DeliveredStatusContext> | undefined\n >(undefined);\n /**\n * The template used for displaying the sending state of the message inside the [message component](../components/MessageComponent.mdx)\n *\n * Displayed for the last message sent by the current user, if the message is currently being sent\n *\n */\n sendingStatusTemplate$ = new BehaviorSubject<\n TemplateRef<SendingStatusContext> | undefined\n >(undefined);\n /**\n * The template used for displaying the sent state of the message inside the [message component](../components/MessageComponent.mdx)\n *\n * Displayed for the last message sent by the current user, if the message is read at least by one user\n *\n */\n readStatusTemplate$ = new BehaviorSubject<\n TemplateRef<ReadStatusContext> | undefined\n >(undefined);\n /**\n * Template to display custom metadata inside [message component](../components/MessageComponent.mdx)\n *\n */\n customMessageMetadataTemplate$ = new BehaviorSubject<\n TemplateRef<CustomMetadataContext<T>> | undefined\n >(undefined);\n /**\n * The template used to display additional information about a channel under the channel name inside the [channel header component](../components/ChannelHeaderComponent.mdx)\n *\n */\n channelHeaderInfoTemplate$ = new BehaviorSubject<\n TemplateRef<ChannelHeaderInfoContext> | undefined\n >(undefined);\n /**\n * The template used for displaying file upload/attachment selector inside the [message input](../components/MessageInputComponent.mdx)\n *\n */\n customAttachmentUploadTemplate$ = new BehaviorSubject<\n TemplateRef<CustomAttachmentUploadContext> | undefined\n >(undefined);\n /**\n * The template that can be used to override how a single image attachment is displayed inside the [attachment list](../components/AttachmentListComponent.mdx)\n */\n imageAttachmentTemplate$ = new BehaviorSubject<\n TemplateRef<AttachmentContext> | undefined\n >(undefined);\n /**\n * The template that can be used to override how a voice recording attachment is displayed inside the [attachment list](../components/AttachmentListComponent.mdx), by default the [voice recording component](../components/VoiceRecordingComponent.mdx) is used\n */\n voiceRecordingAttachmentTemplate$ = new BehaviorSubject<\n TemplateRef<AttachmentContext> | undefined\n >(undefined);\n /**\n * The template that can be used to override how a video attachment is displayed inside the [attachment list](../components/AttachmentListComponent.mdx)\n */\n videoAttachmentTemplate$ = new BehaviorSubject<\n TemplateRef<AttachmentContext> | undefined\n >(undefined);\n /**\n * The template that can be used to override how image gallery is displayed inside the [attachment list](../components/AttachmentListComponent.mdx)\n */\n galleryAttachmentTemplate$ = new BehaviorSubject<\n TemplateRef<AttachmentContext> | undefined\n >(undefined);\n /**\n * The template that can be used to override how a file attachment is displayed inside the [attachment list](../components/AttachmentListComponent.mdx)\n */\n fileAttachmentTemplate$ = new BehaviorSubject<\n TemplateRef<AttachmentContext> | undefined\n >(undefined);\n /**\n * The template that can be used to override how a card attachment is displayed inside the [attachment list](../components/AttachmentListComponent.mdx)\n */\n cardAttachmentTemplate$ = new BehaviorSubject<\n TemplateRef<AttachmentContext> | undefined\n >(undefined);\n /**\n * The template that can be used to override how attachment actions are displayed inside the [attachment list](../components/AttachmentListComponent.mdx)\n */\n attachmentActionsTemplate$ = new BehaviorSubject<\n TemplateRef<AttachmentContext> | undefined\n >(undefined);\n /**\n * The template used to display [system messages](https://getstream.io/chat/docs/javascript/silent_messages/?language=javascript&q=system) indise the [message component](../components/MessageComponent.mdx)\n */\n systemMessageTemplate$ = new BehaviorSubject<\n TemplateRef<SystemMessageContext> | undefined\n >(undefined);\n /**\n * The template used to display the date separator inside the [message list](../components/MessageListComponent.mdx)\n */\n dateSeparatorTemplate$ = new BehaviorSubject<\n TemplateRef<DateSeparatorContext> | undefined\n >(undefined);\n /**\n * The template used to display unread messages indicator inside the [message list](../components/MessageListComponent.mdx) when the channel is opened\n *\n * This UI element is used to separate unread messages from read messages\n */\n newMessagesIndicatorTemplate$ = new BehaviorSubject<\n TemplateRef<UnreadMessagesIndicatorContext> | undefined\n >(undefined);\n /**\n * The template used to display unread messages notification inside the [message list](../components/MessageListComponent.mdx) when the channel is opened\n *\n * Users can use this notification to jump to the first unread message when it's clicked\n */\n newMessagesNotificationTemplate$ = new BehaviorSubject<\n TemplateRef<UnreadMessagesNotificationContext> | undefined\n >(undefined);\n /**\n * The template to show if the main message list is empty\n */\n emptyMainMessageListPlaceholder$ = new BehaviorSubject<\n TemplateRef<void> | undefined\n >(undefined);\n /**\n * The template to show if the thread message list is empty\n */\n emptyThreadMessageListPlaceholder$ = new BehaviorSubject<\n TemplateRef<void> | undefined\n >(undefined);\n /**\n * The template used to display the [edit message form](../components/EditMessageFormComponent.mdx)\n */\n editMessageFormTemplate$ = new BehaviorSubject<TemplateRef<void> | undefined>(\n undefined\n );\n /**\n * The template used to display the [message bounce prompt](../components/MessageBouncePromptComponent.mdx)\n */\n messageBouncePromptTemplate$ = new BehaviorSubject<\n TemplateRef<void> | undefined\n >(undefined);\n /**\n * Template used to display the channel information inside the [channel list item](../components/ChannelPreviewComponent.mdx)\n *\n */\n channelPreviewInfoTemplate$ = new BehaviorSubject<\n TemplateRef<ChannelPreviewInfoContext> | undefined\n >(undefined);\n constructor() {}\n}\n","import { Component, Input, OnChanges } from '@angular/core';\nimport { Channel, User } from 'stream-chat';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport {\n AvatarContext,\n AvatarLocation,\n AvatarType,\n DefaultStreamChatGenerics,\n} from '../types';\n\n/**\n * The `AvatarPlaceholder` component displays the [default avatar](./AvatarComponent.mdx) unless a [custom template](../services/CustomTemplatesService.mdx) is provided. This component is used by the SDK internally, you likely won't need to use it.\n */\n@Component({\n selector: 'stream-avatar-placeholder',\n templateUrl: './avatar-placeholder.component.html',\n styles: [],\n})\nexport class AvatarPlaceholderComponent implements OnChanges {\n /**\n * An optional name of the image, used for fallback image or image title (if `imageUrl` is provided)\n */\n @Input() name: string | undefined;\n /**\n * The URL of the image to be displayed. If the image can't be displayed the first letter of the name input is displayed.\n */\n @Input() imageUrl: string | undefined;\n /**\n * The size in pixels of the avatar image.\n */\n @Input() size = 32;\n /**\n * The location the avatar will be displayed in\n */\n @Input() location: AvatarLocation | undefined;\n /**\n * The channel the avatar belongs to (if avatar of a channel is displayed)\n */\n @Input() channel?: Channel<DefaultStreamChatGenerics>;\n /**\n * The user the avatar belongs to (if avatar of a user is displayed)\n */\n @Input() user?: User<DefaultStreamChatGenerics>;\n /**\n * The type of the avatar: channel if channel avatar is displayed, user if user avatar is displayed\n */\n @Input() type: AvatarType | undefined;\n /**\n * If channel/user image isn't provided the initials of the name of the channel/user is shown instead, you can choose how the initals should be computed\n */\n @Input() initialsType:\n | 'first-letter-of-first-word'\n | 'first-letter-of-each-word' = 'first-letter-of-first-word';\n /**\n * If a channel avatar is displayed, and if the channel has exactly two members a green dot is displayed if the other member is online. Set this flag to `false` to turn off this behavior.\n */\n @Input() showOnlineIndicator = true;\n context: AvatarContext = {\n name: undefined,\n imageUrl: undefined,\n size: undefined,\n location: undefined,\n channel: undefined,\n user: undefined,\n type: undefined,\n initialsType: undefined,\n showOnlineIndicator: undefined,\n };\n constructor(public customTemplatesService: CustomTemplatesService) {}\n\n ngOnChanges(): void {\n this.context = {\n name: this.name,\n imageUrl: this.imageUrl,\n size: this.size,\n location: this.location,\n type: this.type,\n user: this.user,\n channel: this.channel,\n initialsType: this.initialsType,\n showOnlineIndicator: this.showOnlineIndicator,\n };\n }\n}\n","<ng-template\n #defaultAvatar\n let-name=\"name\"\n let-imageUrl=\"imageUrl\"\n let-size=\"size\"\n let-type=\"type\"\n let-channel=\"channel\"\n let-user=\"user\"\n let-location=\"location\"\n let-initialsType=\"initialsType\"\n let-showOnlineIndicator=\"showOnlineIndicator\"\n>\n <stream-avatar\n [name]=\"name\"\n [imageUrl]=\"imageUrl\"\n [size]=\"size\"\n [type]=\"type\"\n [channel]=\"channel\"\n [user]=\"user\"\n [location]=\"location\"\n [initialsType]=\"initialsType\"\n [showOnlineIndicator]=\"showOnlineIndicator\"\n ></stream-avatar>\n</ng-template>\n<ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.avatarTemplate$ | async) || defaultAvatar;\n context: context\n \"\n></ng-container>\n","import { Component, Input } from '@angular/core';\n\nexport type Icon =\n | 'action-icon'\n | 'delivered-icon'\n | 'read-icon'\n | 'reaction-icon'\n | 'connection-error'\n | 'send'\n | 'file-upload'\n | 'retry'\n | 'close'\n | 'file'\n | 'audio-file'\n | 'reply'\n | 'close-no-outline'\n | 'reply-in-thread'\n | 'arrow-left'\n | 'arrow-right'\n | 'menu'\n | 'arrow-up'\n | 'arrow-down'\n | 'chat-bubble'\n | 'attach'\n | 'unspecified-filetype'\n | 'download'\n | 'error'\n | 'play'\n | 'pause';\n\n/**\n * The `Icon` component can be used to display different icons (i. e. message delivered icon).\n */\n@Component({\n selector: 'stream-icon',\n templateUrl: './icon.component.html',\n styles: [],\n})\nexport class IconComponent {\n /**\n * The icon to display, the list of [supported icons](https://github.com/GetStream/stream-chat-angular/tree/master/projects/stream-chat-angular/src/lib/icon/icon.component.ts) can be found on GitHub.\n */\n @Input() icon: Icon | undefined;\n /**\n * The size of the icon (in pixels)\n */\n @Input() size: number | undefined;\n constructor() {}\n}\n","<svg\n data-testid=\"action-icon\"\n *ngIf=\"icon === 'action-icon'\"\n height=\"4\"\n viewBox=\"0 0 11 4\"\n width=\"11\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M1.5 3a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm4 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm4 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'delivered-icon'\"\n data-testid=\"delivered-icon\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M8.9999 16.2L4.7999 12L3.3999 13.4L8.9999 19L20.9999 6.99998L19.5999 5.59998L8.9999 16.2Z\"\n fill=\"black\"\n />\n</svg>\n\n<svg\n *ngIf=\"icon === 'reaction-icon'\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n width=\"12\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"reaction-icon\"\n>\n <g clipRule=\"evenodd\" fillRule=\"evenodd\">\n <path\n d=\"M6 1.2C3.3 1.2 1.2 3.3 1.2 6c0 2.7 2.1 4.8 4.8 4.8 2.7 0 4.8-2.1 4.8-4.8 0-2.7-2.1-4.8-4.8-4.8zM0 6c0-3.3 2.7-6 6-6s6 2.7 6 6-2.7 6-6 6-6-2.7-6-6z\"\n ></path>\n <path\n d=\"M5.4 4.5c0 .5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9zM8.4 4.5c0 .5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9zM3.3 6.7c.3-.2.6-.1.8.1.3.4.8.9 1.5 1 .6.2 1.4.1 2.4-1 .2-.2.6-.3.8 0 .2.2.3.6 0 .8-1.1 1.3-2.4 1.7-3.5 1.5-1-.2-1.8-.9-2.2-1.5-.2-.3-.1-.7.2-.9z\"\n ></path>\n </g>\n</svg>\n<svg\n data-testid=\"connection-error\"\n *ngIf=\"icon === 'connection-error'\"\n width=\"78px\"\n height=\"78px\"\n viewBox=\"0 0 78 78\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n>\n <!-- Generator: Sketch 52.6 (67491) - http://www.bohemiancoding.com/sketch -->\n <title>Combined Shape</title>\n <desc>Created with Sketch.</desc>\n <g\n id=\"Interactions\"\n stroke=\"none\"\n stroke-width=\"1\"\n fill=\"none\"\n fill-rule=\"evenodd\"\n >\n <g\n id=\"Connection-Error-_-Connectivity\"\n transform=\"translate(-270.000000, -30.000000)\"\n fill=\"#CF1F25\"\n >\n <g\n id=\"109-network-connection\"\n transform=\"translate(270.000000, 30.000000)\"\n >\n <path\n d=\"M66.4609744,11.414231 C81.6225232,26.5757798 81.6225232,51.157545 66.4609744,66.3188467 C51.2994256,81.4803954 26.7176604,81.4803954 11.5563587,66.3188467 C-3.60519004,51.1572979 -3.60519004,26.5755327 11.5563587,11.414231 C26.7179075,-3.74731776 51.2996727,-3.74731776 66.4609744,11.414231 Z M54.7853215,45.8823776 L54.7853215,40.5882574 C54.7853215,39.613638 53.9952341,38.8235506 53.0206147,38.8235506 L44.9576695,38.8235506 L41.428256,42.3529641 L51.255555,42.3529641 L51.255555,45.8823776 L54.7853215,45.8823776 Z M40.6659027,43.1153174 L37.8988425,45.8823776 L40.6659027,45.8823776 L40.6659027,43.1153174 Z M51.1764962,56.4702653 L58.2353232,56.4702653 C59.2099355,56.4702653 60.00003,55.6801708 60.00003,54.7055585 L60.00003,51.176145 C60.00003,50.2015327 59.2099355,49.4114382 58.2353232,49.4114382 L51.1764962,49.4114382 C50.2018839,49.4114382 49.4117894,50.2015327 49.4117894,51.176145 L49.4117894,54.7055585 C49.4117894,55.6801708 50.2018839,56.4702653 51.1764962,56.4702653 Z M35.2941353,56.4702653 L42.3529624,56.4702653 C43.3275746,56.4702653 44.1176691,55.6801708 44.1176691,54.7055585 L44.1176691,51.176145 C44.1176691,50.2015327 43.3275746,49.4114382 42.3529624,49.4114382 L35.2941353,49.4114382 C34.319523,49.4114382 33.5294285,50.2015327 33.5294285,51.176145 L33.5294285,54.7055585 C33.5294285,55.6801708 34.319523,56.4702653 35.2941353,56.4702653 Z M56.6964989,19.0874231 C56.007381,18.3985134 54.8903216,18.3985134 54.2012036,19.087423 L45.882376,27.4062507 L45.882376,19.4117761 C45.882376,18.4371568 45.0922885,17.6470693 44.1176692,17.6470693 L33.5294286,17.6470693 C32.5548092,17.6470694 31.7647218,18.4371568 31.7647218,19.4117761 L31.7647218,30.0000167 C31.7647219,30.9746363 32.5548092,31.7647237 33.5294285,31.7647237 L41.5239031,31.7647237 L34.4650761,38.8235508 L24.7058947,38.8235508 C23.7312753,38.8235508 22.9411879,39.6136382 22.9411879,40.5882575 L22.9411879,45.8823778 L26.4706014,45.8823778 L26.4706014,42.3529643 L30.9356624,42.3529643 L23.8768354,49.4117914 L19.4117743,49.4117914 C18.4371549,49.4117914 17.6470675,50.2018788 17.6470675,51.1764981 L17.6470675,54.7059117 C17.6504049,54.9674302 17.7129076,55.2248042 17.8298886,55.4587302 L16.4456526,56.8429662 C15.7446193,57.5200453 15.7252005,58.6372282 16.4022825,59.3382615 C17.0793616,60.0392948 18.1965445,60.0587136 18.8975778,59.3816316 C18.9122847,59.3674273 18.9267436,59.3529684 18.940948,59.3382615 L56.6964963,21.5830662 C57.3856425,20.8939094 57.3856425,19.7765747 56.6964963,19.0874179 Z\"\n id=\"Combined-Shape\"\n ></path>\n </g>\n </g>\n </g>\n</svg>\n<svg\n *ngIf=\"icon === 'send'\"\n data-testid=\"send\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <title translate>streamChat.Send</title>\n <path\n d=\"M4.00952 22L24 12L4.00952 2L4 9.77778L18.2857 12L4 14.2222L4.00952 22Z\"\n fill=\"black\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'file-upload'\"\n data-testid=\"file-upload\"\n height=\"14\"\n width=\"14\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <title translate>streamChat.Attach files</title>\n <path\n d=\"M1.667.333h10.666c.737 0 1.334.597 1.334 1.334v10.666c0 .737-.597 1.334-1.334 1.334H1.667a1.333 1.333 0 0 1-1.334-1.334V1.667C.333.93.93.333 1.667.333zm2 1.334a1.667 1.667 0 1 0 0 3.333 1.667 1.667 0 0 0 0-3.333zm-2 9.333v1.333h10.666v-4l-2-2-4 4-2-2L1.667 11z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'retry'\"\n data-testid=\"retry\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M17.6449 6.35C16.1949 4.9 14.2049 4 11.9949 4C7.57488 4 4.00488 7.58 4.00488 12C4.00488 16.42 7.57488 20 11.9949 20C15.7249 20 18.8349 17.45 19.7249 14H17.6449C16.8249 16.33 14.6049 18 11.9949 18C8.68488 18 5.99488 15.31 5.99488 12C5.99488 8.69 8.68488 6 11.9949 6C13.6549 6 15.1349 6.69 16.2149 7.78L12.9949 11H19.9949V4L17.6449 6.35Z\"\n fill=\"black\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'close'\"\n data-testid=\"close\"\n width=\"28\"\n height=\"28\"\n viewBox=\"0 0 28 28\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <rect width=\"28\" height=\"28\" rx=\"14\" fill=\"#72767E\" />\n <circle cx=\"14\" cy=\"14\" r=\"12\" fill=\"#72767E\" />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M28 14C28 21.732 21.732 28 14 28C6.26801 28 0 21.732 0 14C0 6.26801 6.26801 0 14 0C21.732 0 28 6.26801 28 14ZM26 14C26 20.6274 20.6274 26 14 26C7.37258 26 2 20.6274 2 14C2 7.37258 7.37258 2 14 2C20.6274 2 26 7.37258 26 14ZM19.59 7L21 8.41L15.41 14L21 19.59L19.59 21L14 15.41L8.41 21L7 19.59L12.59 14L7 8.41L8.41 7L14 12.59L19.59 7Z\"\n fill=\"white\"\n />\n</svg>\n\n<svg\n *ngIf=\"icon === 'file'\"\n data-testid=\"file\"\n className=\"rfu-file-icon--small fa-file-fallback\"\n [attr.height]=\"size || 20\"\n [attr.width]=\"size || 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 384 512\"\n>\n <path\n d=\"M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48z\"\n fill=\"#414D54\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'unspecified-filetype'\"\n data-testid=\"unspecified-filetype\"\n width=\"34\"\n height=\"40\"\n viewBox=\"0 0 34 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M0 3C0 1.34315 1.34315 0 3 0H23L34 11V37C34 38.6569 32.6569 40 31 40H3C1.34315 40 0 38.6569 0 37V3Z\"\n fill=\"url(#paint0_linear)\"\n />\n <path d=\"M34 11L26 11C24.3431 11 23 9.65685 23 8V0L34 11Z\" fill=\"#DBDBDB\" />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M8 13H23V15H8V13Z\"\n fill=\"#CFCFCF\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M8 17H18V19H8V17Z\"\n fill=\"#CFCFCF\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M8 21H23V23H8V21Z\"\n fill=\"#CFCFCF\"\n />\n <defs>\n <linearGradient\n id=\"paint0_linear\"\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"40\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stop-color=\"white\" />\n <stop offset=\"1\" stop-color=\"#DBDBDB\" />\n </linearGradient>\n </defs>\n</svg>\n<svg\n *ngIf=\"icon === 'reply'\"\n data-testid=\"reply\"\n height=\"15\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M.56 10.946H.06l-.002-.498L.025.92a.5.5 0 1 1 1-.004l.032 9.029H9.06v-4l9 4.5-9 4.5v-4H.56z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n data-testid=\"close-no-outline\"\n *ngIf=\"icon === 'close-no-outline'\"\n viewBox=\"0 0 24 24\"\n width=\"24\"\n height=\"24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z\"\n fill=\"black\"\n />\n</svg>\n<svg\n height=\"10\"\n width=\"14\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"reply-in-thread\"\n *ngIf=\"icon === 'reply-in-thread'\"\n>\n <path\n d=\"M8.516 3c4.78 0 4.972 6.5 4.972 6.5-1.6-2.906-2.847-3.184-4.972-3.184v2.872L3.772 4.994 8.516.5V3zM.484 5l4.5-4.237v1.78L2.416 5l2.568 2.125v1.828L.484 5z\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'arrow-left'\"\n data-testid=\"arrow-left\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M15.7049 7.41L14.2949 6L8.29492 12L14.2949 18L15.7049 16.59L11.1249 12L15.7049 7.41Z\"\n fill=\"var(--black)\"\n />\n</svg>\n\n<svg\n *ngIf=\"icon === 'arrow-right'\"\n data-testid=\"arrow-right\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M9.70492 6L8.29492 7.41L12.8749 12L8.29492 16.59L9.70492 18L15.7049 12L9.70492 6Z\"\n fill=\"var(--black)\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'menu'\"\n data-testid=\"menu\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M3 8V6H21V8H3ZM3 13H21V11H3V13ZM3 18H21V16H3V18Z\"\n fill=\"black\"\n />\n</svg>\n\n<svg\n data-testid=\"arrow-up\"\n *ngIf=\"icon === 'arrow-up'\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M16.59 15.7051L12 11.1251L7.41 15.7051L6 14.2951L12 8.29508L18 14.2951L16.59 15.7051Z\"\n fill=\"var(--primary-color)\"\n />\n</svg>\n<svg\n data-testid=\"arrow-down\"\n *ngIf=\"icon === 'arrow-down'\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M7.41 8.29504L12 12.875L16.59 8.29504L18 9.70504L12 15.705L6 9.70504L7.41 8.29504Z\"\n fill=\"var(--primary-color)\"\n />\n</svg>\n<svg\n data-testid=\"chat-bubble\"\n *ngIf=\"icon === 'chat-bubble'\"\n viewBox=\"0 0 136 136\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M106 24.5H30C24.775 24.5 20.5 28.775 20.5 34V119.5L39.5 100.5H106C111.225 100.5 115.5 96.225 115.5 91V34C115.5 28.775 111.225 24.5 106 24.5ZM106 91H39.5L30 100.5V34H106V91Z\"\n fill=\"#B4B7BB\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'attach'\"\n data-testid=\"attach\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <g clip-path=\"url(#clip0_10878_5)\">\n <path\n d=\"M12.9997 6.99993L10.9997 6.99993L10.9997 10.9999L6.99972 10.9999L6.99972 12.9999L10.9997 12.9999L10.9997 16.9999L12.9997 16.9999L12.9997 12.9999L16.9997 12.9999L16.9997 10.9999L12.9997 10.9999L12.9997 6.99993ZM11.9997 1.99992C6.47972 1.99992 1.99972 6.47993 1.99972 11.9999C1.99972 17.5199 6.47972 21.9999 11.9997 21.9999C17.5197 21.9999 21.9997 17.5199 21.9997 11.9999C21.9997 6.47993 17.5197 1.99992 11.9997 1.99992ZM11.9997 19.9999C7.58972 19.9999 3.99972 16.4099 3.99972 11.9999C3.99972 7.58993 7.58972 3.99993 11.9997 3.99993C16.4097 3.99993 19.9997 7.58993 19.9997 11.9999C19.9997 16.4099 16.4097 19.9999 11.9997 19.9999Z\"\n fill=\"black\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_10878_5\">\n <rect width=\"24\" height=\"24\" fill=\"white\" />\n </clipPath>\n </defs>\n</svg>\n<svg\n *ngIf=\"icon === 'download'\"\n data-testid=\"download\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04ZM19 18H6C3.79 18 2 16.21 2 14C2 11.95 3.53 10.24 5.56 10.03L6.63 9.92L7.13 8.97C8.08 7.14 9.94 6 12 6C14.62 6 16.88 7.86 17.39 10.43L17.69 11.93L19.22 12.04C20.78 12.14 22 13.45 22 15C22 16.65 20.65 18 19 18ZM13.45 10H10.55V13H8L12 17L16 13H13.45V10Z\"\n fill=\"black\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'error'\"\n data-testid=\"error\"\n [attr.width]=\"size ?? 24\"\n [attr.height]=\"size ?? 24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n id=\"background\"\n d=\"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2Z\"\n fill=\"var(--str-chat__message-error-message-color)\"\n />\n <path d=\"M13 17H11V15H13V17ZM13 13H11V7H13V13Z\" fill=\"white\" />\n</svg>\n<svg\n *ngIf=\"icon === 'play'\"\n fill=\"none\"\n viewBox=\"0 0 12 14\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path d=\"M0.5 0V14L11.5 7L0.5 0Z\" fill=\"#080707\" />\n</svg>\n<svg\n *ngIf=\"icon === 'pause'\"\n fill=\"none\"\n viewBox=\"0 0 12 14\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path d=\"M0 14H4V0H0V14ZM8 0V14H12V0H8Z\" fill=\"#080707\" />\n</svg>\n\n<svg\n *ngIf=\"icon === 'audio-file'\"\n class=\"rfu-file-audio\"\n fill=\"none\"\n [attr.height]=\"size || 20\"\n [attr.width]=\"size || 20\"\n viewBox=\"0 0 34 40\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n clip-rule=\"evenodd\"\n d=\"M17.7168 33.172C18.2348 33.172 18.4238 33.655 18.4238 34.18C18.4238 34.642 18.2978 35.195 17.7168 35.195C17.1708 35.195 16.9888 34.642 16.9888 34.145C16.9888 33.683 17.1708 33.172 17.7168 33.172ZM19.5718 31.002H18.3818V32.7589H18.3678C18.1228 32.43 17.7798 32.262 17.3318 32.262C16.3028 32.262 15.7988 33.158 15.7988 34.103C15.7988 35.125 16.2818 36.1049 17.4228 36.1049C17.8428 36.1049 18.1928 35.923 18.4238 35.58H18.4378V36H19.5718V31.002ZM12.7095 34.1872C12.7095 33.7252 12.8775 33.1722 13.4305 33.1722C13.9835 33.1722 14.1585 33.7252 14.1585 34.1872C14.1585 34.6492 13.9835 35.1952 13.4305 35.1952C12.8775 35.1952 12.7095 34.6492 12.7095 34.1872ZM11.5195 34.1872C11.5195 35.2792 12.3035 36.1052 13.4305 36.1052C14.5575 36.1052 15.3485 35.2792 15.3485 34.1872C15.3485 33.0952 14.5575 32.2622 13.4305 32.2622C12.3035 32.2622 11.5195 33.0952 11.5195 34.1872ZM21.839 32.3671H22.574V33.1371H21.839V34.7891C21.839 35.0761 22.007 35.1391 22.266 35.1391C22.3142 35.1391 22.364 35.1357 22.4147 35.1323C22.4672 35.1287 22.5206 35.1251 22.574 35.1251V36.0001C22.481 36.0031 22.388 36.0099 22.295 36.0168C22.171 36.0259 22.047 36.0351 21.923 36.0351C20.908 36.0351 20.649 35.7411 20.649 34.7541V33.1371H20.047V32.3671H20.649V31.2681H21.839V32.3671Z\"\n fill=\"white\"\n fill-rule=\"evenodd\"\n ></path>\n <path\n d=\"M0 28H34V37C34 38.6569 32.6569 40 31 40H3C1.34315 40 0 38.6569 0 37V28Z\"\n fill=\"#2727B0\"\n ></path>\n <path d=\"M0 3C0 1.34315 1.34315 0 3 0H23L34 11V28H0V3Z\" fill=\"#F5F5F5\"></path>\n <path\n d=\"M34 11L26 11C24.3431 11 23 9.65685 23 8V0L34 11Z\"\n fill=\"#DBDBDB\"\n ></path>\n <path\n clip-rule=\"evenodd\"\n d=\"M8.87912 21.941H12.298L16.9521 24.7493C17.0307 24.8138 17.1293 24.849 17.2311 24.849C17.4738 24.8488 17.6705 24.6519 17.6703 24.4092V12.4399C17.6704 12.3381 17.6352 12.2396 17.5707 12.1609C17.4168 11.9732 17.1398 11.9457 16.9521 12.0996L12.298 14.908H8.87912C8.3936 14.908 8 15.3016 8 15.7871V21.0619C8 21.5474 8.3936 21.941 8.87912 21.941ZM12.9258 16.6664L15.9122 15.2224V21.6268L12.9258 20.1829H9.7583V16.6664H12.9258ZM19.8511 16.3517C19.474 16.4092 19.2397 16.6637 19.3283 16.9191L19.3262 16.92C19.5295 17.4995 19.6305 18.098 19.6284 18.6953C19.6305 19.2975 19.5237 19.9014 19.3196 20.4909C19.229 20.7462 19.4682 20.9996 19.8474 21.06C19.9008 21.0683 19.9542 21.072 20.0076 21.072C20.3259 21.072 20.6156 20.9234 20.6922 20.7057C20.9194 20.0451 21.0337 19.37 21.0374 18.6953C21.0349 18.0251 20.9211 17.3575 20.6955 16.7035C20.6053 16.4477 20.229 16.2908 19.8511 16.3517ZM22.1605 14.6028C22.5252 14.5163 22.9259 14.6454 23.055 14.8938C23.6891 16.1157 24 17.4042 24 18.6923C24.0004 19.9895 23.6796 21.2839 23.0521 22.5153C22.9503 22.7123 22.6763 22.8344 22.3828 22.8344C22.3071 22.8344 22.2301 22.8261 22.1543 22.8092C21.7863 22.7251 21.5914 22.4536 21.7185 22.2077C22.2988 21.0761 22.5922 19.8836 22.5931 18.6919C22.5931 17.5056 22.3054 16.3222 21.7276 15.2025C21.6001 14.9563 21.795 14.686 22.1605 14.6028Z\"\n fill=\"#2727B0\"\n fill-rule=\"evenodd\"\n ></path>\n</svg>\n<svg\n *ngIf=\"icon === 'read-icon'\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M15.7071 7.29289C16.0976 7.68342 16.0976 8.31658 15.7071 8.70711L11.4142 13L13 14.5858L20.2929 7.29289C20.6834 6.90237 21.3166 6.90237 21.7071 7.29289C22.0976 7.68342 22.0976 8.31658 21.7071 8.70711L13.7071 16.7071C13.3166 17.0976 12.6834 17.0976 12.2929 16.7071L10 14.4142L7.70711 16.7071C7.31658 17.0976 6.68342 17.0976 6.29289 16.7071L6.29206 16.7063L2.29289 12.7071C1.90237 12.3166 1.90237 11.6834 2.29289 11.2929C2.68342 10.9024 3.31658 10.9024 3.70711 11.2929L7 14.5858L9.29214 12.2936L9.29289 12.2929L9.29364 12.2921L14.2929 7.29289C14.6834 6.90237 15.3166 6.90237 15.7071 7.29289Z\"\n fill=\"black\"\n />\n</svg>\n","import { Component, Input, OnChanges } from '@angular/core';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { Icon } from '../icon/icon.component';\nimport { IconContext } from '../types';\n\n/**\n * The `IconPlaceholder` component displays the [default icons](./IconComponent.mdx) unless a [custom template](../services/CustomTemplatesService.mdx) is provided. This component is used by the SDK internally, you likely won't need to use it.\n */\n@Component({\n selector: 'stream-icon-placeholder',\n templateUrl: './icon-placeholder.component.html',\n styles: [],\n})\nexport class IconPlaceholderComponent implements OnChanges {\n /**\n * The icon to display, the list of [supported icons](https://github.com/GetStream/stream-chat-angular/tree/master/projects/stream-chat-angular/src/lib/icon/icon.component.ts) can be found on GitHub.\n */\n @Input() icon: Icon | undefined;\n /**\n * The size of the icon (in pixels)\n */\n @Input() size: number | undefined;\n iconContext: IconContext = { icon: undefined, size: undefined };\n\n constructor(public customTemplatesService: CustomTemplatesService) {}\n\n ngOnChanges(): void {\n this.iconContext = {\n icon: this.icon,\n size: this.size,\n };\n }\n}\n","<ng-template #defaultIcon let-icon=\"icon\" let-size=\"size\">\n <stream-icon [icon]=\"icon\" [size]=\"size\"></stream-icon>\n</ng-template>\n<ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.iconTemplate$ | async) || defaultIcon;\n context: iconContext\n \"\n></ng-container>\n","import { Component, Input } from '@angular/core';\nimport { v4 as uuidv4 } from 'uuid';\n\n/**\n * The `LoadingIndicator` component displays a spinner to indicate that an action is in progress.\n */\n@Component({\n selector: 'stream-loading-indicator',\n templateUrl: './loading-indicator.component.html',\n styles: [],\n})\nexport class LoadingIndicatorComponent {\n /**\n * The size of the indicator (in pixels)\n */\n @Input() size = 15;\n /**\n * The color of the indicator\n */\n @Input()\n color = `var(--str-chat__loading-indicator-color, var(--str-chat__primary-color, '#006CFF'))`;\n\n linearGradientId = uuidv4();\n\n constructor() {}\n}\n","<div class=\"str-chat__loading-indicator\">\n <svg\n [attr.height]=\"size\"\n viewBox=\"0 0 30 30\"\n [attr.width]=\"size\"\n data-testid=\"loading-indicator\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <linearGradient\n id=\"{{ linearGradientId }}\"\n x1=\"50%\"\n x2=\"50%\"\n y1=\"0%\"\n y2=\"100%\"\n >\n <stop offset=\"0%\" stop-color=\"#FFF\" stop-opacity=\"0\" />\n <stop\n data-testid=\"stop-color\"\n offset=\"100%\"\n [attr.stop-color]=\"color\"\n stop-opacity=\"1\"\n [ngStyle]=\"{ stopColor: color }\"\n />\n </linearGradient>\n </defs>\n <path\n d=\"M2.518 23.321l1.664-1.11A12.988 12.988 0 0 0 15 28c7.18 0 13-5.82 13-13S22.18 2 15 2V0c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-5.206 0-9.792-2.652-12.482-6.679z\"\n [attr.fill]=\"'url(#' + linearGradientId + ')'\"\n fillRule=\"evenodd\"\n />\n </svg>\n</div>\n","import { Component, Input } from '@angular/core';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { LoadingIndicatorContext } from '../types';\n\n/**\n * The `LoadingInficatorPlaceholder` component displays the [default loading indicator](./LoadingIndicatorComponent.mdx) unless a [custom template](../services/CustomTemplatesService.mdx) is provided. This component is used by the SDK internally, you likely won't need to use it.\n */\n@Component({\n selector: 'stream-loading-indicator-placeholder',\n templateUrl: './loading-indicator-placeholder.component.html',\n styles: [],\n})\nexport class LoadingIndicatorPlaceholderComponent {\n /**\n * The size of the indicator (in pixels)\n */\n @Input() size = 15;\n /**\n * The color of the indicator\n */\n @Input()\n color = `var(--str-chat__loading-indicator-color, var(--str-chat__primary-color, '#006CFF'))`;\n\n constructor(public customTemplatesService: CustomTemplatesService) {}\n\n getLoadingIndicatorContext(): LoadingIndicatorContext {\n return {\n size: this.size,\n color: this.color,\n };\n }\n}\n","<ng-template #defaultLoadingIndicator let-size=\"size\" let-color=\"color\">\n <stream-loading-indicator\n [size]=\"size\"\n [color]=\"color\"\n ></stream-loading-indicator>\n</ng-template>\n<ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.loadingIndicatorTemplate$ | async) ||\n defaultLoadingIndicator;\n context: getLoadingIndicatorContext()\n \"\n></ng-container>\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport {\n CustomMessageActionItem,\n DefaultStreamChatGenerics,\n MessageActionItem,\n MessageActionsClickDetails,\n StreamMessage,\n} from './types';\nimport { ChatClientService } from './chat-client.service';\nimport { NotificationService } from './notification.service';\nimport { ChannelService } from './channel.service';\n\n/**\n * The message actions service provides customization options for the [message actions](../../components/MessageActionsBoxComponent)\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MessageActionsService<\n T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics\n> {\n /**\n * Default actions - these are the actions that are handled by the built-in component\n */\n readonly defaultActions: MessageActionItem<T>[] = [\n {\n actionName: 'mark-unread',\n actionLabelOrTranslationKey: 'streamChat.Mark as unread',\n actionHandler: (message: StreamMessage<T>) =>\n this.channelService.markMessageUnread(message.id),\n isVisible: (\n enabledActions: string[],\n isMine: boolean,\n message: StreamMessage<T>\n ) => enabledActions.indexOf('read-events') !== -1 && !message.parent_id,\n },\n {\n actionName: 'quote',\n actionLabelOrTranslationKey: 'streamChat.Reply',\n actionHandler: (message: StreamMessage<T>) =>\n this.channelService.selectMessageToQuote(message),\n isVisible: (enabledActions: string[]) =>\n enabledActions.indexOf('quote-message') !== -1,\n },\n {\n actionName: 'pin',\n actionLabelOrTranslationKey: (message: StreamMessage<T>) =>\n message.pinned ? 'streamChat.Unpin' : 'streamChat.Pin',\n actionHandler: (message: StreamMessage<T>) =>\n message.pinned\n ? this.channelService.unpinMessage(message)\n : this.channelService.pinMessage(message),\n isVisible: (enabledActions: string[]) =>\n enabledActions.indexOf('pin-message') !== -1,\n },\n {\n actionName: 'flag',\n actionLabelOrTranslationKey: 'streamChat.Flag',\n actionHandler: async (message: StreamMessage<T>) => {\n try {\n await this.chatClientService.flagMessage(message.id);\n this.notificationService.addTemporaryNotification(\n 'streamChat.Message has been successfully flagged',\n 'success'\n );\n } catch (err) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error adding flag'\n );\n }\n },\n isVisible: (enabledActions: string[], isMine: boolean) =>\n enabledActions.indexOf('flag-message') !== -1 && !isMine,\n },\n {\n actionName: 'edit',\n actionLabelOrTranslationKey: 'streamChat.Edit Message',\n actionHandler: (message: StreamMessage<T>) => {\n this.messageToEdit$.next(message);\n },\n isVisible: (enabledActions: string[], isMine: boolean) =>\n (enabledActions.indexOf('update-own-message') !== -1 && isMine) ||\n enabledActions.indexOf('update-any-message') !== -1,\n },\n {\n actionName: 'delete',\n actionLabelOrTranslationKey: 'streamChat.Delete',\n actionHandler: async (message: StreamMessage<T>) => {\n try {\n await this.channelService.deleteMessage(message);\n } catch (error) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error deleting message'\n );\n }\n },\n isVisible: (enabledActions: string[], isMine: boolean) =>\n ((enabledActions.indexOf('delete') !== -1 ||\n enabledActions.indexOf('delete-own-message') !== -1) &&\n isMine) ||\n enabledActions.indexOf('delete-any') !== -1 ||\n enabledActions.indexOf('delete-any-message') !== -1,\n },\n ];\n /**\n * The built-in components will handle changes to this observable.\n */\n messageToEdit$ = new BehaviorSubject<StreamMessage<T> | undefined>(undefined);\n /**\n * You can pass your own custom actions that will be displayed inside the built-in message actions component\n */\n customActions$ = new BehaviorSubject<CustomMessageActionItem[]>([]);\n /**\n * By default the [`MessageComponent`](../../components/MessageComponent) will display the [`MessageActionsBoxComponent`](../../components/MessageActionsBoxComponent). You can override that behavior by providing your own event handler.\n */\n customActionClickHandler?: (details: MessageActionsClickDetails<T>) => void;\n\n constructor(\n private chatClientService: ChatClientService,\n private notificationService: NotificationService,\n private channelService: ChannelService\n ) {}\n\n /**\n * This method returns how many authorized actions are available to the given message\n *\n * @param message\n * @param enabledActions\n * @returns the count\n */\n getAuthorizedMessageActionsCount(\n message: StreamMessage<T>,\n enabledActions: string[]\n ) {\n const customActions = this.customActions$.getValue() || [];\n const allActions = [...this.defaultActions, ...customActions];\n const currentUserId = this.chatClientService.chatClient.user?.id;\n const isMine = message.user_id === currentUserId;\n\n return allActions.filter((item) =>\n item.isVisible(enabledActions, isMine, message)\n ).length;\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n TemplateRef,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport {\n CustomMessageActionItem,\n MessageActionBoxItemContext,\n MessageActionItem,\n MessageInputContext,\n StreamMessage,\n} from '../types';\nimport { MessageActionsService } from '../message-actions.service';\n/**\n * The `MessageActionsBox` component displays a list of message actions (i.e edit), that can be opened or closed. You can find the [list of the supported actions](../concepts/message-interactions.mdx) in the message interaction guide.\n */\n@Component({\n selector: 'stream-message-actions-box',\n templateUrl: './message-actions-box.component.html',\n styles: [],\n})\nexport class MessageActionsBoxComponent\n implements OnInit, OnChanges, OnDestroy, AfterViewInit\n{\n /**\n * Indicates if the list should be opened or closed. Adding a UI element to open and close the list is the parent's component responsibility.\n * @deprecated No need for this since [theme-v2](../theming/introduction.mdx)\n */\n @Input() isOpen = false;\n /**\n * Indicates if the message actions are belonging to a message that was sent by the current user or not.\n */\n @Input() isMine = false;\n /**\n * The message the actions will be executed on\n */\n @Input() message: StreamMessage | undefined;\n /**\n * The list of [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) that are enabled for the current user, the list of [supported interactions](../concepts/message-interactions.mdx) can be found in our message interaction guide. Unathorized actions won't be displayed on the UI.\n */\n @Input() enabledActions: string[] = [];\n /**\n * A list of custom message actions to be displayed in the action box\n *\n * In the next major release this will be released with `messageReactionsService.customActions$`\n *\n * More information: https://getstream.io/chat/docs/sdk/angular/services/MessageActionsService\n */\n @Input() customActions: CustomMessageActionItem[] = [];\n /**\n * The number of authorized actions (it can be less or equal than the number of enabled actions)\n *\n * @deprecated components should use `messageReactionsService.getAuthorizedMessageActionsCount` method\n *\n * More information: https://getstream.io/chat/docs/sdk/angular/services/MessageActionsService\n */\n @Output() readonly displayedActionsCount = new EventEmitter<number>();\n /**\n * An event which emits `true` if the edit message modal is open, and `false` when it is closed.\n *\n * @deprecated components should use `messageReactionsService.messageToEdit$` Observable\n *\n * More information: https://getstream.io/chat/docs/sdk/angular/services/MessageActionsService\n */\n @Output() readonly isEditing = new EventEmitter<boolean>();\n messageInputTemplate: TemplateRef<MessageInputContext> | undefined;\n messageActionItemTemplate:\n | TemplateRef<MessageActionBoxItemContext>\n | undefined;\n visibleMessageActionItems: (MessageActionItem | CustomMessageActionItem)[] =\n [];\n isEditModalOpen = false;\n private readonly messageActionItems: MessageActionItem[];\n private subscriptions: Subscription[] = [];\n private isViewInited = false;\n constructor(\n public readonly customTemplatesService: CustomTemplatesService,\n private messageActionsService: MessageActionsService,\n private cdRef: ChangeDetectorRef\n ) {\n this.messageActionItems = this.messageActionsService.defaultActions;\n }\n\n ngOnInit(): void {\n this.subscriptions.push(\n this.messageActionsService.messageToEdit$.subscribe((m) => {\n let isEditModalOpen = false;\n if (m && m.id === this.message?.id) {\n isEditModalOpen = true;\n }\n if (isEditModalOpen !== this.isEditModalOpen) {\n this.isEditModalOpen = isEditModalOpen;\n this.isEditing.emit(this.isEditModalOpen);\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n })\n );\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (\n changes.isMine ||\n changes.enabledActions ||\n changes.message ||\n changes.customActions\n ) {\n this.setVisibleActions();\n }\n }\n\n ngAfterViewInit(): void {\n this.isViewInited = true;\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n getActionLabel(\n actionLabelOrTranslationKey: ((message: StreamMessage) => string) | string\n ) {\n return typeof actionLabelOrTranslationKey === 'string'\n ? actionLabelOrTranslationKey\n : actionLabelOrTranslationKey(this.message!);\n }\n\n getMessageActionTemplateContext(\n item: MessageActionItem | CustomMessageActionItem\n ): MessageActionBoxItemContext<any> {\n return {\n actionHandler: item.actionHandler,\n isMine: this.isMine,\n actionName: item.actionName,\n message: this.message,\n actionLabelOrTranslationKey: item.actionLabelOrTranslationKey,\n };\n }\n\n trackByActionName(\n _: number,\n item: MessageActionItem | CustomMessageActionItem\n ) {\n return item.actionName;\n }\n\n private setVisibleActions() {\n this.visibleMessageActionItems = [\n ...this.messageActionItems,\n ...this.customActions,\n ].filter((item) =>\n item.isVisible(this.enabledActions, this.isMine, this.message!)\n );\n this.displayedActionsCount.emit(this.visibleMessageActionItems.length);\n }\n}\n","<div\n #actionBox\n data-testid=\"action-box\"\n class=\"str-chat__message-actions-box str-chat__message-actions-box-angular\"\n [class.str-chat__message-actions-box--open]=\"true\"\n>\n <ul class=\"str-chat__message-actions-list\">\n <ng-container\n *ngFor=\"let item of visibleMessageActionItems; trackBy: trackByActionName\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageActionsBoxItemTemplate$ | async) ||\n defaultMessageActionItem;\n context: getMessageActionTemplateContext(item)\n \"\n ></ng-container>\n </ng-container>\n </ul>\n</div>\n\n<ng-template\n #defaultMessageActionItem\n let-actionName=\"actionName\"\n let-actionHandler=\"actionHandler\"\n let-actionLabelOrTranslationKey=\"actionLabelOrTranslationKey\"\n>\n <button\n class=\"str-chat__message-actions-list-item-button\"\n [attr.data-testid]=\"actionName + '-action'\"\n (click)=\"actionHandler(message, isMine)\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ getActionLabel(actionLabelOrTranslationKey) | translate }}\n </li>\n </button>\n</ng-template>\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\n\n/**\n * The `Modal` component displays its content in an overlay. The modal can be closed with a close button, if the user clicks outside of the modal content, or if the escape button is pressed. The modal can also be closed from outside.\n */\n@Component({\n selector: 'stream-modal',\n templateUrl: './modal.component.html',\n styles: [],\n})\nexport class ModalComponent implements OnChanges {\n /**\n * If `true` the modal will be displayed, if `false` the modal will be hidden\n */\n @Input() isOpen = false;\n /**\n * The content of the modal (can also be provided using `ng-content`)\n */\n @Input() content: TemplateRef<void> | undefined;\n /**\n * Emits `true` if the modal becomes visible, and `false` if the modal is closed.\n */\n @Output() readonly isOpenChange = new EventEmitter<boolean>();\n @ViewChild('modalInner') private innerContainer:\n | ElementRef<HTMLElement>\n | undefined;\n\n constructor() {}\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.isOpen) {\n if (this.isOpen) {\n window.addEventListener('keyup', this.watchForEscPress);\n setTimeout(\n () => window.addEventListener('click', this.watchForOutsideClicks),\n 0\n );\n } else {\n this.stopWatchForOutsideClicks();\n this.stopWatchForEscPress();\n }\n }\n }\n\n close() {\n this.isOpen = false;\n this.isOpenChange.emit(false);\n this.stopWatchForOutsideClicks();\n this.stopWatchForEscPress();\n }\n\n private watchForEscPress = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n this.close();\n }\n };\n\n private stopWatchForEscPress = () => {\n window.removeEventListener('keyup', this.watchForEscPress);\n };\n\n private watchForOutsideClicks = (event: Event) => {\n if (!this.innerContainer?.nativeElement.contains(event.target as Node)) {\n this.close();\n }\n };\n\n private stopWatchForOutsideClicks() {\n window.removeEventListener('click', this.watchForOutsideClicks);\n }\n}\n","<div\n data-testid=\"modal\"\n class=\"str-chat__modal str-chat__modal--{{ isOpen ? 'open' : 'close' }}\"\n>\n <div\n data-testid=\"close\"\n class=\"str-chat__modal__close-button\"\n (click)=\"close()\"\n (keyup.enter)=\"close()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </div>\n <div class=\"str-chat__modal__inner\" #modalInner>\n <ng-container *ngIf=\"content; else elseContent\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </ng-container>\n <ng-template #elseContent>\n <ng-content></ng-content>\n </ng-template>\n </div>\n</div>\n","import { InjectionToken, Type } from '@angular/core';\nimport { TextareaInterface } from './message-input/textarea.interface';\n\nexport const textareaInjectionToken = new InjectionToken<\n Type<TextareaInterface>\n>('textareaInjectionToken');\n","import {\n ComponentRef,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n ViewContainerRef,\n} from '@angular/core';\nimport { Directive } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { UserResponse } from 'stream-chat';\nimport { TextareaInterface } from './textarea.interface';\n\n@Directive({\n selector: '[streamTextarea]',\n})\nexport class TextareaDirective implements OnChanges {\n @Input() componentRef:\n | ComponentRef<TextareaInterface & Partial<OnChanges>>\n | undefined;\n @Input() areMentionsEnabled: boolean | undefined;\n @Input() mentionScope?: 'channel' | 'application';\n @Input() inputMode!: 'mobile' | 'desktop';\n @Input() value = '';\n @Input() placeholder: string | undefined;\n @Input() autoFocus!: boolean;\n @Output() readonly valueChange = new EventEmitter<string>();\n @Output() readonly send = new EventEmitter<void>();\n @Output() readonly userMentions = new EventEmitter<UserResponse[]>();\n private subscriptions: Subscription[] = [];\n private unpropagatedChanges: SimpleChanges[] = [];\n constructor(public viewContainerRef: ViewContainerRef) {}\n\n ngOnChanges(changes: SimpleChanges): void {\n this.unpropagatedChanges.push(changes);\n if (!this.componentRef) {\n return;\n }\n if (changes.componentRef) {\n this.subscriptions.forEach((s) => s.unsubscribe());\n if (this.componentRef) {\n this.subscriptions.push(\n this.componentRef.instance.valueChange.subscribe((value) =>\n this.valueChange.next(value)\n )\n );\n this.subscriptions.push(\n this.componentRef.instance.send.subscribe((value) =>\n this.send.next(value)\n )\n );\n if (this.componentRef.instance.userMentions) {\n this.subscriptions.push(\n this.componentRef.instance.userMentions.subscribe((value) =>\n this.userMentions.next(value)\n )\n );\n }\n this.componentRef.instance.areMentionsEnabled = this.areMentionsEnabled;\n this.componentRef.instance.mentionScope = this.mentionScope;\n this.componentRef.instance.value = this.value;\n this.componentRef.instance.placeholder = this.placeholder;\n this.componentRef.instance.inputMode = this.inputMode;\n this.componentRef.instance.autoFocus = this.autoFocus;\n }\n }\n if (changes.areMentionsEnabled) {\n this.componentRef.instance.areMentionsEnabled = this.areMentionsEnabled;\n }\n if (changes.mentionScope) {\n this.componentRef.instance.mentionScope = this.mentionScope;\n }\n if (changes.value) {\n this.componentRef.instance.value = this.value;\n }\n if (changes.placeholder) {\n this.componentRef.instance.placeholder = this.placeholder;\n }\n if (changes.inputMode) {\n this.componentRef.instance.inputMode = this.inputMode;\n }\n if (changes.autoFocus) {\n this.componentRef.instance.autoFocus = this.autoFocus;\n }\n // ngOnChanges not called for dynamic components since we don't use template binding\n let changesToPropagate = {};\n this.unpropagatedChanges.forEach(\n (c) => (changesToPropagate = { ...changesToPropagate, ...c })\n );\n // eslint-disable-next-line @angular-eslint/no-lifecycle-call\n this.componentRef.instance.ngOnChanges?.(changesToPropagate);\n this.unpropagatedChanges = [];\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n/**\n * If you have an emoji picker in your application, you can propagate the selected emoji to the textarea using this service, more info can be found in [custom emoji picker guide](../code-examples/emoji-picker.mdx)\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class EmojiInputService {\n /**\n * If you have an emoji picker in your application, you can propagate the selected emoji to the textarea using this Subject, more info can be found in [custom emoji picker guide](../code-examples/emoji-picker.mdx)\n */\n emojiInput$ = new Subject<string>();\n\n constructor() {}\n}\n","import { Injectable } from '@angular/core';\n\n/**\n * The `MessageInputConfigService` is used to keep a consistent configuration among the different [`MessageInput`](../components/MessageInputComponent.mdx) components if your UI has more than one input component.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MessageInputConfigService {\n /**\n * If file upload is enabled, the user can open a file selector from the input. Please note that the user also needs to have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).\n */\n isFileUploadEnabled: boolean | undefined = true;\n /**\n * If true, users can mention other users in messages. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work.\n */\n areMentionsEnabled: boolean | undefined = true;\n /**\n * If `false`, users can only upload one attachment per message\n */\n isMultipleFileUploadEnabled: boolean | undefined = true;\n /**\n * The scope for user mentions, either members of the current channel of members of the application\n */\n mentionScope: 'channel' | 'application' | undefined = 'channel';\n\n /**\n * In `desktop` mode the `Enter` key will trigger message sending, in `mobile` mode the `Enter` key will insert a new line to the message input.\n */\n inputMode: 'desktop' | 'mobile' = 'desktop';\n\n constructor() {}\n}\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n NgZone,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\n\n/**\n * This component can be used to visualize the wave bar of a voice recording\n */\n@Component({\n selector: 'stream-voice-recording-wavebar',\n templateUrl: './voice-recording-wavebar.component.html',\n styles: [],\n})\nexport class VoiceRecordingWavebarComponent\n implements OnInit, OnChanges, AfterViewInit\n{\n /**\n * The audio element that plays the voice recording\n */\n @Input() audioElement?: HTMLAudioElement;\n /**\n * The waveform data to visualize\n */\n @Input() waveFormData: number[] = [];\n /**\n * The duration of the voice recording in seconds\n */\n @Input() duration?: number;\n resampledWaveFormData: number[] = [];\n progress: number = 0;\n isDragging = false;\n private sampleSize: number = 40;\n @ViewChild('container', { static: true })\n private container?: ElementRef<HTMLElement>;\n private isViewInited = false;\n\n constructor(private ngZone: NgZone, private cdRef: ChangeDetectorRef) {}\n\n ngOnInit(): void {\n this.containerSizeChanged();\n if (this.container?.nativeElement) {\n this.ngZone.runOutsideAngular(() => {\n new ResizeObserver(() => {\n this.containerSizeChanged();\n }).observe(this.container!.nativeElement);\n });\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.waveFormData) {\n this.resampledWaveFormData =\n this.waveFormData.length > this.sampleSize\n ? this.downsample()\n : this.upsample();\n }\n if (changes.audioElement) {\n this.ngZone.runOutsideAngular(() => {\n this.audioElement?.addEventListener('timeupdate', () => {\n const progress =\n (this.audioElement?.currentTime || 0) / (this.duration || 0) || 0;\n if (Math.abs(progress - this.progress) >= 0.02) {\n this.ngZone.run(() => {\n this.progress = progress;\n this.cdRef.detectChanges();\n });\n }\n });\n });\n }\n }\n\n ngAfterViewInit(): void {\n this.isViewInited = true;\n }\n\n seek(event: any) {\n const containerWidth =\n this.container?.nativeElement?.getBoundingClientRect().width || 0;\n const containerStart =\n this.container?.nativeElement?.getBoundingClientRect()?.x || 0;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const progress = (event.x - containerStart) / containerWidth;\n\n if (!isNaN(progress) && this.audioElement) {\n const duration = this.duration || 0;\n const time = duration * progress;\n this.audioElement.currentTime = time;\n }\n }\n\n trackByIndex(index: number) {\n return index;\n }\n\n private containerSizeChanged() {\n if (!this.container?.nativeElement) {\n return;\n }\n const containerWidth = this.container.nativeElement.clientWidth;\n if (containerWidth === 0) {\n return;\n }\n const barWidth = +getComputedStyle(this.container.nativeElement)\n .getPropertyValue('--str-chat__voice-recording-amplitude-bar-width')\n .replace('px', '');\n const barGap = +getComputedStyle(this.container.nativeElement)\n .getPropertyValue('--str-chat__voice-recording-amplitude-bar-gap-width')\n .replace('px', '');\n if (!isNaN(barWidth) && !isNaN(barGap)) {\n const sampleSize = Math.floor(containerWidth / (barWidth + barGap));\n if (\n sampleSize !== this.sampleSize &&\n !isNaN(sampleSize) &&\n sampleSize !== Infinity\n ) {\n this.ngZone.run(() => {\n this.sampleSize = sampleSize;\n this.resampledWaveFormData =\n this.waveFormData.length > this.sampleSize\n ? this.downsample()\n : this.upsample();\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n });\n }\n }\n }\n\n private downsample() {\n if (this.waveFormData.length <= this.sampleSize) {\n return this.waveFormData;\n }\n\n if (this.sampleSize === 1) return [this.mean(this.waveFormData)];\n\n const result: number[] = [];\n // bucket size adjusted due to the fact that the first and the last item in the original data array is kept in target output\n const bucketSize = (this.waveFormData.length - 2) / (this.sampleSize - 2);\n let lastSelectedPointIndex = 0;\n result.push(this.waveFormData[lastSelectedPointIndex]); // Always add the first point\n let maxAreaPoint, maxArea, triangleArea;\n\n for (\n let bucketIndex = 1;\n bucketIndex < this.sampleSize - 1;\n bucketIndex++\n ) {\n const previousBucketRefPoint = this.waveFormData[lastSelectedPointIndex];\n const nextBucketMean = this.getNextBucketMean(\n this.waveFormData,\n bucketIndex,\n bucketSize\n );\n\n const currentBucketStartIndex =\n Math.floor((bucketIndex - 1) * bucketSize) + 1;\n const nextBucketStartIndex = Math.floor(bucketIndex * bucketSize) + 1;\n const countUnitsBetweenAtoC =\n 1 + nextBucketStartIndex - currentBucketStartIndex;\n\n maxArea = triangleArea = -1;\n\n for (\n let currentPointIndex = currentBucketStartIndex;\n currentPointIndex < nextBucketStartIndex;\n currentPointIndex++\n ) {\n const countUnitsBetweenAtoB =\n Math.abs(currentPointIndex - currentBucketStartIndex) + 1;\n const countUnitsBetweenBtoC =\n countUnitsBetweenAtoC - countUnitsBetweenAtoB;\n const currentPointValue = this.waveFormData[currentPointIndex];\n\n triangleArea = this.triangleAreaHeron(\n this.triangleBase(\n Math.abs(previousBucketRefPoint - currentPointValue),\n countUnitsBetweenAtoB\n ),\n this.triangleBase(\n Math.abs(currentPointValue - nextBucketMean),\n countUnitsBetweenBtoC\n ),\n this.triangleBase(\n Math.abs(previousBucketRefPoint - nextBucketMean),\n countUnitsBetweenAtoC\n )\n );\n\n if (triangleArea > maxArea) {\n maxArea = triangleArea;\n maxAreaPoint = this.waveFormData[currentPointIndex];\n lastSelectedPointIndex = currentPointIndex;\n }\n }\n\n if (typeof maxAreaPoint !== 'undefined') result.push(maxAreaPoint);\n }\n\n result.push(this.waveFormData[this.waveFormData.length - 1]); // Always add the last point\n\n return result;\n }\n\n private upsample = () => {\n if (this.sampleSize === this.waveFormData.length) return this.waveFormData;\n\n // eslint-disable-next-line prefer-const\n let [bucketSize, remainder] = this.divMod(\n this.sampleSize,\n this.waveFormData.length\n );\n const result: number[] = [];\n\n for (let i = 0; i < this.waveFormData.length; i++) {\n const extra = remainder && remainder-- ? 1 : 0;\n result.push(...Array(bucketSize + extra).fill(this.waveFormData[i]));\n }\n return result;\n };\n\n private getNextBucketMean = (\n data: number[],\n currentBucketIndex: number,\n bucketSize: number\n ) => {\n const nextBucketStartIndex =\n Math.floor(currentBucketIndex * bucketSize) + 1;\n let nextNextBucketStartIndex =\n Math.floor((currentBucketIndex + 1) * bucketSize) + 1;\n nextNextBucketStartIndex =\n nextNextBucketStartIndex < data.length\n ? nextNextBucketStartIndex\n : data.length;\n\n return this.mean(\n data.slice(nextBucketStartIndex, nextNextBucketStartIndex)\n );\n };\n\n private mean = (values: number[]) =>\n values.reduce((acc, value) => acc + value, 0) / values.length;\n\n private triangleAreaHeron = (a: number, b: number, c: number) => {\n const s = (a + b + c) / 2;\n return Math.sqrt(s * (s - a) * (s - b) * (s - c));\n };\n\n private triangleBase = (a: number, b: number) =>\n Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n\n private divMod = (num: number, divisor: number) => {\n return [Math.floor(num / divisor), num % divisor];\n };\n}\n","<div\n class=\"str-chat__wave-progress-bar__track\"\n #container\n data-testid=\"wave-progress-bar-track\"\n (mousedown)=\"isDragging = true\"\n (mouseup)=\"isDragging = false\"\n (mouseleave)=\"isDragging = false\"\n (mousemove)=\"isDragging ? seek($event) : null\"\n (click)=\"seek($event)\"\n (keyup.enter)=\"seek($event)\"\n role=\"progressbar\"\n>\n <div\n *ngFor=\"\n let dataPoint of resampledWaveFormData;\n let i = index;\n trackBy: trackByIndex\n \"\n class=\"str-chat__wave-progress-bar__amplitude-bar\"\n [class.str-chat__wave-progress-bar__amplitude-bar--active]=\"\n progress > i / resampledWaveFormData.length\n \"\n [style.--str-chat__wave-progress-bar__amplitude-bar-height]=\"\n dataPoint ? dataPoint * 100 + '%' : '0%'\n \"\n ></div>\n <div\n class=\"str-chat__wave-progress-bar__progress-indicator\"\n data-testid=\"wave-progress-bar-progress-indicator\"\n [ngStyle]=\"{ 'inset-inline-start': progress * 100 + '%' }\"\n ></div>\n</div>\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n NgZone,\n OnChanges,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\nimport { Attachment } from 'stream-chat';\nimport { DefaultStreamChatGenerics } from '../types';\nimport prettybytes from 'pretty-bytes';\n\n/**\n * This component can be used to display an attachment with type `voiceRecording`. The component allows playing the attachment inside the browser.\n */\n@Component({\n selector: 'stream-voice-recording',\n templateUrl: './voice-recording.component.html',\n styles: [],\n})\nexport class VoiceRecordingComponent implements OnChanges, AfterViewInit {\n /**\n * The voice recording attachment\n */\n @Input() attachment?: Attachment<DefaultStreamChatGenerics>;\n fileSize: string = '';\n secondsElapsedFormatted: string;\n durationFormatted: string = '';\n secondsElapsed = 0;\n isError = false;\n @ViewChild('audioElement')\n private audioElement?: ElementRef<HTMLAudioElement>;\n\n constructor(private ngZone: NgZone, private cdRef: ChangeDetectorRef) {\n this.secondsElapsedFormatted = this.getFormattedDuration(\n this.secondsElapsed\n );\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.attachment) {\n this.fileSize = this.getFileSize();\n this.durationFormatted = this.getFormattedDuration(\n this.attachment?.duration\n );\n }\n }\n\n ngAfterViewInit(): void {\n // timeupdate fired frequntly so we optimize change detections\n this.ngZone.runOutsideAngular(() => {\n this.audioElement?.nativeElement.addEventListener('timeupdate', () => {\n const secondsElapsed = this.audioElement?.nativeElement?.ended\n ? this.attachment?.duration || 0\n : Math.round(this.audioElement?.nativeElement?.currentTime || 0);\n if (this.secondsElapsed !== secondsElapsed) {\n this.ngZone.run(() => {\n this.secondsElapsed = secondsElapsed;\n this.secondsElapsedFormatted = this.getFormattedDuration(\n this.secondsElapsed\n );\n this.cdRef.detectChanges();\n });\n }\n });\n });\n }\n\n async togglePlay() {\n if (!this.audioElement || !this.attachment?.asset_url) {\n return;\n }\n try {\n this.audioElement?.nativeElement.paused\n ? await this.audioElement.nativeElement.play()\n : this.audioElement.nativeElement.pause();\n this.isError = false;\n } catch (e) {\n this.isError = true;\n }\n }\n\n setPlaybackRate() {\n if (!this.audioElement?.nativeElement) {\n return;\n }\n let playbackRate = this.audioElement?.nativeElement?.playbackRate + 0.5;\n if (playbackRate > 2) {\n playbackRate = 1;\n }\n this.audioElement.nativeElement.playbackRate = playbackRate;\n }\n\n private getFormattedDuration(duration?: number) {\n if (duration === undefined || duration <= 0) return '00:00';\n\n const [hours, hoursLeftover] = this.divMod(duration, 3600);\n const [minutes, seconds] = this.divMod(hoursLeftover, 60);\n const roundedSeconds = Math.ceil(seconds);\n\n const prependHrsZero = hours.toString().length === 1 ? '0' : '';\n const prependMinZero = minutes.toString().length === 1 ? '0' : '';\n const prependSecZero = roundedSeconds.toString().length === 1 ? '0' : '';\n const minSec = `${prependMinZero}${minutes}:${prependSecZero}${roundedSeconds}`;\n\n return hours ? `${prependHrsZero}${hours}:` + minSec : minSec;\n }\n\n private getFileSize() {\n if (\n this.attachment?.file_size === undefined ||\n this.attachment?.file_size === null\n ) {\n return '';\n }\n return prettybytes(Number(this.attachment.file_size || 0));\n }\n\n private divMod(num: number, divisor: number) {\n return [Math.floor(num / divisor), num % divisor];\n }\n}\n","<div\n class=\"str-chat__message-attachment__voice-recording-widget\"\n [class.str-chat__message-attachment__voice-recording-widget--error]=\"isError\"\n data-testid=\"voice-recording-widget\"\n>\n <!-- Empty event handlers to trigger change detection -->\n <audio\n #audioElement\n (play)=\"(null)\"\n (pause)=\"(null)\"\n (ended)=\"(null)\"\n (error)=\"isError = true\"\n (abort)=\"isError = true\"\n >\n <source\n data-testid=\"audio-source\"\n [src]=\"attachment?.asset_url\"\n [type]=\"attachment?.mime_type\"\n />\n </audio>\n <button\n class=\"str-chat__message-attachment-audio-widget--play-button\"\n data-testid=\"play-button\"\n (click)=\"togglePlay()\"\n >\n <stream-icon-placeholder\n [icon]=\"audioElement?.paused ? 'play' : 'pause'\"\n ></stream-icon-placeholder>\n </button>\n <div class=\"str-chat__message-attachment__voice-recording-widget__metadata\">\n <div class=\"str-chat__message-attachment-voice-recording-widget--first-row\">\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__title\"\n data-testid=\"voice-recording-title\"\n [title]=\"attachment?.title\"\n >\n {{ attachment?.title }}\n </div>\n </div>\n\n <ng-container *ngIf=\"isError; else state\">\n <div\n class=\"\n str-chat__message-attachment__voice-recording-widget__error-message\n \"\n >\n <stream-icon-placeholder\n [size]=\"20\"\n icon=\"error\"\n ></stream-icon-placeholder>\n <span data-testid=\"error-message\">{{\n \"streamChat.Error playing audio\" | translate\n }}</span>\n </div>\n </ng-container>\n <ng-template #state>\n <div\n class=\"\n str-chat__message-attachment__voice-recording-widget__audio-state\n \"\n >\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__timer\"\n >\n <span\n data-testid=\"duration\"\n *ngIf=\"!!attachment?.duration; else fileSizeTemplate\"\n >\n {{\n secondsElapsed > 0 || !audioElement.paused\n ? secondsElapsedFormatted\n : durationFormatted\n }}</span\n >\n <ng-template #fileSizeTemplate>\n <span\n class=\"str-chat__message-attachment-file--item-size\"\n data-testid=\"file-size-indicator\"\n >\n {{ fileSize }}\n </span>\n </ng-template>\n </div>\n <stream-voice-recording-wavebar\n *ngIf=\"attachment?.waveform_data && attachment?.duration\"\n [waveFormData]=\"attachment?.waveform_data || []\"\n [duration]=\"attachment?.duration\"\n [audioElement]=\"audioElement\"\n ></stream-voice-recording-wavebar>\n </div>\n </ng-template>\n </div>\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__right-section\"\n >\n <button\n *ngIf=\"!audioElement?.paused; else fileIcon\"\n class=\"str-chat__message_attachment__playback-rate-button\"\n data-testid=\"playback-rate-button\"\n (click)=\"setPlaybackRate()\"\n >\n {{ audioElement?.playbackRate | number: \"1.1-1\" }}x\n </button>\n <ng-template #fileIcon>\n <stream-icon-placeholder\n icon=\"audio-file\"\n [size]=\"40\"\n ></stream-icon-placeholder>\n </ng-template>\n </div>\n</div>\n","import {\n Component,\n EventEmitter,\n HostBinding,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { Action, Attachment } from 'stream-chat';\nimport {\n ModalContext,\n DefaultStreamChatGenerics,\n AttachmentConfigration,\n VideoAttachmentConfiguration,\n ImageAttachmentConfiguration,\n AttachmentContext,\n} from '../types';\nimport prettybytes from 'pretty-bytes';\nimport { isImageAttachment } from '../is-image-attachment';\nimport { ChannelService } from '../channel.service';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { AttachmentConfigurationService } from '../attachment-configuration.service';\nimport { ThemeService } from '../theme.service';\n\n/**\n * The `AttachmentList` component displays the attachments of a message\n */\n@Component({\n selector: 'stream-attachment-list',\n templateUrl: './attachment-list.component.html',\n styles: [],\n})\nexport class AttachmentListComponent implements OnChanges {\n /**\n * The id of the message the attachments belong to\n */\n @Input() messageId: string | undefined;\n /**\n * The parent id of the message the attachments belong to\n */\n @Input() parentMessageId: string | undefined;\n /**\n * The attachments to display\n */\n @Input() attachments: Attachment<DefaultStreamChatGenerics>[] = [];\n /**\n * Emits the state of the image carousel window\n */\n @Output() readonly imageModalStateChange = new EventEmitter<\n 'opened' | 'closed'\n >();\n @HostBinding() class = 'str-chat__attachment-list-angular-host';\n orderedAttachments: Attachment<DefaultStreamChatGenerics>[] = [];\n imagesToView: Attachment<DefaultStreamChatGenerics>[] = [];\n imagesToViewCurrentIndex = 0;\n themeVersion: '1' | '2';\n @ViewChild('modalContent', { static: true })\n private modalContent!: TemplateRef<void>;\n private attachmentConfigurations: Map<\n Attachment,\n | AttachmentConfigration\n | VideoAttachmentConfiguration\n | ImageAttachmentConfiguration\n > = new Map();\n\n constructor(\n public readonly customTemplatesService: CustomTemplatesService,\n private channelService: ChannelService,\n private attachmentConfigurationService: AttachmentConfigurationService,\n themeService: ThemeService\n ) {\n this.themeVersion = themeService.themeVersion;\n }\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.attachments) {\n const images = this.attachments.filter(this.isImage);\n const containsGallery = images.length >= 2;\n this.orderedAttachments = [\n ...(containsGallery ? this.createGallery(images) : images),\n ...this.attachments.filter((a) => this.isVideo(a)),\n ...this.attachments.filter((a) => this.isVoiceMessage(a)),\n ...this.attachments.filter((a) => this.isFile(a)),\n ];\n this.attachmentConfigurations = new Map();\n // Display link attachments only if there are no other attachments\n // Giphy-s always sent without other attachments\n if (this.orderedAttachments.length === 0) {\n this.orderedAttachments.push(\n ...this.attachments.filter((a) => this.isCard(a))\n );\n }\n }\n }\n\n trackByUrl(_: number, attachment: Attachment) {\n return (\n attachment.image_url ||\n attachment.img_url ||\n attachment.asset_url ||\n attachment.thumb_url\n );\n }\n\n isImage(attachment: Attachment) {\n return isImageAttachment(attachment);\n }\n\n isSvg(attachment: Attachment) {\n const filename = attachment.fallback || '';\n return !!filename.toLowerCase().endsWith('.svg');\n }\n\n isFile(attachment: Attachment) {\n return attachment.type === 'file';\n }\n\n isGallery(attachment: Attachment) {\n return attachment.type === 'gallery';\n }\n\n isVideo(attachment: Attachment) {\n return (\n attachment.type === 'video' &&\n attachment.asset_url &&\n !attachment.og_scrape_url // links from video share services (such as YouTube or Facebook) are can't be played\n );\n }\n\n isCard(attachment: Attachment) {\n return (\n !attachment.type ||\n (attachment.type === 'image' && !this.isImage(attachment)) ||\n attachment.type === 'giphy'\n );\n }\n\n isVoiceMessage(attachment: Attachment) {\n return attachment.type === 'voiceRecording';\n }\n\n hasFileSize(attachment: Attachment<DefaultStreamChatGenerics>) {\n return (\n attachment.file_size && Number.isFinite(Number(attachment.file_size))\n );\n }\n\n getFileSize(attachment: Attachment<DefaultStreamChatGenerics>) {\n return prettybytes(Number(attachment.file_size!));\n }\n\n getModalContext(): ModalContext {\n return {\n isOpen: this.imagesToView && this.imagesToView.length > 0,\n isOpenChangeHandler: (isOpen) => (isOpen ? null : this.closeImageModal()),\n content: this.modalContent,\n };\n }\n\n trimUrl(url?: string | null) {\n if (url !== undefined && url !== null) {\n const [trimmedUrl] = url\n .replace(/^(?:https?:\\/\\/)?(?:www\\.)?/i, '')\n .split('/');\n\n return trimmedUrl;\n }\n return null;\n }\n\n sendAction(action: Action) {\n void this.channelService.sendAction(\n this.messageId!,\n {\n [action.name!]: action.value!,\n },\n this.parentMessageId\n );\n }\n\n trackByActionValue(_: number, item: Action) {\n return item.value;\n }\n\n openImageModal(attachments: Attachment[], selectedIndex = 0) {\n this.imageModalStateChange.next('opened');\n this.imagesToView = attachments;\n this.imagesToViewCurrentIndex = selectedIndex;\n }\n\n stepImages(dir: -1 | 1) {\n this.imagesToViewCurrentIndex += dir * 1;\n }\n\n trackByImageUrl(_: number, item: Attachment) {\n return item.image_url || item.img_url || item.thumb_url;\n }\n\n getAttachmentContext(\n attachment: Attachment<DefaultStreamChatGenerics>\n ): AttachmentContext {\n return { attachment };\n }\n\n getImageAttachmentConfiguration(\n attachment: Attachment,\n type: 'gallery' | 'single',\n element: HTMLElement\n ): ImageAttachmentConfiguration {\n const existingConfiguration = this.attachmentConfigurations.get(attachment);\n if (existingConfiguration) {\n return existingConfiguration as ImageAttachmentConfiguration;\n }\n const configuration =\n this.attachmentConfigurationService.getImageAttachmentConfiguration(\n attachment,\n type,\n element\n );\n this.attachmentConfigurations.set(attachment, configuration);\n return configuration;\n }\n\n getCarouselImageAttachmentConfiguration(\n attachment: Attachment,\n element: HTMLElement\n ) {\n return this.attachmentConfigurationService.getImageAttachmentConfiguration(\n attachment,\n 'carousel',\n element\n );\n }\n\n getVideoAttachmentConfiguration(\n attachment: Attachment,\n element: HTMLElement\n ): VideoAttachmentConfiguration {\n const existingConfiguration = this.attachmentConfigurations.get(attachment);\n if (existingConfiguration) {\n return existingConfiguration as VideoAttachmentConfiguration;\n }\n const configuration =\n this.attachmentConfigurationService.getVideoAttachmentConfiguration(\n attachment,\n element\n );\n this.attachmentConfigurations.set(attachment, configuration);\n return configuration;\n }\n\n getCardAttachmentConfiguration(attachment: Attachment) {\n const existingConfiguration = this.attachmentConfigurations.get(attachment);\n if (existingConfiguration) {\n return existingConfiguration;\n }\n if (attachment.type === 'giphy') {\n return this.attachmentConfigurationService.getGiphyAttachmentConfiguration(\n attachment\n );\n } else {\n const configuration =\n this.attachmentConfigurationService.getScrapedImageAttachmentConfiguration(\n attachment\n );\n this.attachmentConfigurations.set(attachment, configuration);\n return configuration;\n }\n }\n\n get isImageModalPrevButtonVisible() {\n return this.imagesToViewCurrentIndex !== 0;\n }\n\n get isImageModalNextButtonVisible() {\n return this.imagesToViewCurrentIndex !== this.imagesToView.length - 1;\n }\n\n private createGallery(images: Attachment[]) {\n return [\n {\n type: 'gallery',\n images,\n },\n ];\n }\n\n private closeImageModal() {\n this.imageModalStateChange.next('closed');\n this.imagesToView = [];\n }\n}\n","<div *ngIf=\"orderedAttachments.length > 0\" class=\"str-chat__attachment-list\">\n <ng-container\n *ngFor=\"let attachment of orderedAttachments; trackBy: trackByUrl\"\n >\n <div\n data-testclass=\"attachment-container\"\n class=\"str-chat__message-attachment str-chat__message-attachment--{{\n attachment.type\n }} str-chat__message-attachment-dynamic-size\"\n [class.str-chat__message-attachment--card]=\"isCard(attachment)\"\n [class.str-chat-angular__message-attachment-file-single]=\"\n isFile(attachment)\n \"\n [class.str-chat__message-attachment--voice-recording]=\"\n isVoiceMessage(attachment)\n \"\n [class.str-chat__message-attachment-with-actions]=\"\n attachment.actions && attachment.actions.length > 0\n \"\n [class.str-chat__message-attachment--svg-image]=\"isSvg(attachment)\"\n >\n <ng-container *ngIf=\"isImage(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.imageAttachmentTemplate$ | async) ||\n defaultImage;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultImage let-attachmentContext=\"attachment\">\n <img\n #imgElement\n class=\"str-chat__message-attachment--img\"\n data-testclass=\"image\"\n [src]=\"\n getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).url\n \"\n [alt]=\"attachmentContext?.fallback\"\n (click)=\"openImageModal([attachmentContext])\"\n (keyup.enter)=\"openImageModal([attachmentContext])\"\n [style.--original-height]=\"\n getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).originalHeight\n \"\n [style.--original-width]=\"\n getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).originalWidth\n \"\n [ngStyle]=\"{\n height: getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).height,\n width: getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).width\n }\"\n />\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isGallery(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.galleryAttachmentTemplate$ | async) ||\n defaultGallery;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultGallery let-attachmentContext=\"attachment\">\n <div\n class=\"str-chat__gallery\"\n data-testid=\"image-gallery\"\n [class.str-chat__gallery--square]=\"\n (attachmentContext?.images)!.length > 3\n \"\n [class.str-chat__gallery-two-rows]=\"\n (attachmentContext?.images)!.length > 2\n \"\n >\n <ng-container\n *ngFor=\"\n let galleryImage of attachmentContext.images;\n let index = index;\n let isLast = last;\n trackBy: trackByImageUrl\n \"\n >\n <button\n *ngIf=\"index < 3 || (index === 3 && isLast)\"\n class=\"str-chat__gallery-image\"\n data-testclass=\"gallery-image\"\n (click)=\"openImageModal(attachmentContext.images!, index)\"\n (keyup.enter)=\"openImageModal(attachmentContext.images!, index)\"\n [class.str-chat__message-attachment--svg-image]=\"\n isSvg(galleryImage)\n \"\n >\n <img\n fetchpriority=\"low\"\n loading=\"lazy\"\n #imgElement\n [src]=\"\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).url\n \"\n [alt]=\"galleryImage.fallback\"\n [style.--original-height]=\"\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).originalHeight\n \"\n [style.--original-width]=\"\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).originalWidth\n \"\n [ngStyle]=\"{\n height: getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).height,\n width: getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).width\n }\"\n />\n </button>\n <button\n #element\n *ngIf=\"index === 3 && !isLast\"\n class=\"str-chat__gallery-placeholder\"\n data-testclass=\"gallery-image\"\n data-testid=\"more-image-button\"\n (click)=\"openImageModal(attachmentContext.images!, index)\"\n (keyup.enter)=\"openImageModal(attachmentContext.images!, index)\"\n [class.str-chat__message-attachment--svg-image]=\"\n isSvg(galleryImage)\n \"\n [style.--original-height]=\"\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).originalHeight\n \"\n [style.--original-width]=\"\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).originalWidth\n \"\n [ngStyle]=\"{\n 'background-image':\n 'url(' +\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).url +\n ')',\n height: getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).height,\n width: getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).width\n }\"\n >\n <p\n [innerHTML]=\"\n 'streamChat.{{ imageCount }} more'\n | translate\n : { imageCount: attachmentContext!.images!.length - 4 }\n \"\n ></p>\n </button>\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isVideo(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.videoAttachmentTemplate$ | async) ||\n defaultVideo;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultVideo let-attachmentContext=\"attachment\">\n <div\n class=\"str-chat__player-wrapper\"\n data-testclass=\"video-attachment-parent\"\n [style.--original-height]=\"\n getVideoAttachmentConfiguration(attachmentContext, videoElement)\n .originalHeight\n \"\n [style.--original-width]=\"\n getVideoAttachmentConfiguration(attachmentContext, videoElement)\n .originalWidth\n \"\n [ngStyle]=\"{\n height: getVideoAttachmentConfiguration(\n attachmentContext,\n videoElement\n ).height,\n width: getVideoAttachmentConfiguration(\n attachmentContext,\n videoElement\n ).width\n }\"\n >\n <video\n #videoElement\n class=\"str-chat__video-angular\"\n controls\n data-testclass=\"video-attachment\"\n [src]=\"\n getVideoAttachmentConfiguration(attachmentContext, videoElement)\n .url\n \"\n [poster]=\"\n getVideoAttachmentConfiguration(attachmentContext, videoElement)\n .thumbUrl\n \"\n ></video>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isFile(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.fileAttachmentTemplate$ | async) ||\n defaultFile;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultFile let-attachmentContext=\"attachment\">\n <div\n class=\"\n str-chat__message-attachment-file--item\n str-chat-angular__message-attachment-file-single\n \"\n >\n <stream-icon-placeholder\n *ngIf=\"themeVersion === '1'\"\n icon=\"file\"\n [size]=\"30\"\n ></stream-icon-placeholder>\n <stream-icon-placeholder\n *ngIf=\"themeVersion === '2'\"\n icon=\"unspecified-filetype\"\n [size]=\"30\"\n ></stream-icon-placeholder>\n <div class=\"str-chat__message-attachment-file--item-text\">\n <a\n class=\"str-chat__message-attachment-file--item-first-row\"\n data-testclass=\"file-link\"\n href=\"{{ attachmentContext.asset_url }}\"\n target=\"_blank\"\n >\n <div\n data-testclass=\"file-title\"\n class=\"str-chat__message-attachment-file--item-name\"\n >\n {{ attachmentContext.title }}\n </div>\n <stream-icon-placeholder\n class=\"str-chat__message-attachment-download-icon\"\n icon=\"download\"\n ></stream-icon-placeholder>\n </a>\n <span\n class=\"str-chat__message-attachment-file--item-size\"\n data-testclass=\"size\"\n *ngIf=\"hasFileSize(attachmentContext)\"\n >{{ getFileSize(attachmentContext) }}</span\n >\n </div>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isVoiceMessage(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.voiceRecordingAttachmentTemplate$\n | async) || defaultRecording;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultRecording>\n <stream-voice-recording\n data-testclass=\"voice-recording\"\n [attachment]=\"attachment\"\n ></stream-voice-recording>\n </ng-template>\n </ng-container>\n <ng-container\n *ngIf=\"\n isCard(attachment) &&\n getCardAttachmentConfiguration(attachment) as attachmentConfiguration\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.cardAttachmentTemplate$ | async) ||\n defaultCard;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultCard let-attachmentContext=\"attachment\">\n <div\n class=\"str-chat__message-attachment-card str-chat__message-attachment-card--{{\n attachmentContext.type\n }}\"\n >\n <div\n *ngIf=\"attachmentConfiguration.url\"\n class=\"str-chat__message-attachment-card--header\"\n >\n <img\n fetchpriority=\"low\"\n loading=\"lazy\"\n data-testclass=\"card-img\"\n alt=\"{{ attachmentConfiguration.url }}\"\n src=\"{{ attachmentConfiguration.url }}\"\n [ngStyle]=\"{\n height: attachmentConfiguration.height,\n width: attachmentConfiguration.width\n }\"\n />\n </div>\n <div class=\"str-chat__message-attachment-card--content\">\n <div class=\"str-chat__message-attachment-card--flex\">\n <div\n *ngIf=\"attachmentContext.title\"\n data-testclass=\"card-title\"\n class=\"str-chat__message-attachment-card--title\"\n >\n {{ attachmentContext.title }}\n </div>\n <div\n *ngIf=\"attachmentContext.text\"\n class=\"str-chat__message-attachment-card--text\"\n data-testclass=\"card-text\"\n >\n {{ attachmentContext.text }}\n </div>\n <a\n class=\"str-chat__message-attachment-card--url\"\n *ngIf=\"\n attachmentContext.title_link ||\n attachmentContext.og_scrape_url\n \"\n data-testclass=\"url-link\"\n noopener\n noreferrer\n href=\"{{\n attachmentContext.title_link ||\n attachmentContext.og_scrape_url\n }}\"\n target=\"_blank\"\n >\n {{\n trimUrl(\n attachmentContext.title_link ||\n attachmentContext.og_scrape_url\n )\n }}\n </a>\n </div>\n </div>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"attachment.actions && attachment.actions.length > 0\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.attachmentActionsTemplate$ | async) ||\n defaultActions;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultActions let-attachmentContext=\"attachment\">\n <div class=\"str-chat__message-attachment-actions\">\n <div class=\"str-chat__message-attachment-actions-form\">\n <button\n *ngFor=\"\n let action of attachmentContext.actions;\n trackBy: trackByActionValue\n \"\n class=\"str-chat__message-attachment-actions-button str-chat__message-attachment-actions-button--{{\n action.style\n }}\"\n data-testclass=\"attachment-action\"\n (click)=\"sendAction(action)\"\n (keyup.enter)=\"sendAction(action)\"\n >\n {{ action.text }}\n </button>\n </div>\n </div>\n </ng-template>\n </ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"imagesToView && imagesToView.length > 0\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: getModalContext()\n \"\n ></ng-container>\n </ng-container>\n</div>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n class=\"stream-chat-angular__image-modal-host\"\n [isOpen]=\"isOpen\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n [content]=\"content\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #modalContent>\n <div class=\"stream-chat-angular__image-modal str-chat__image-carousel\">\n <img\n #imgElement\n class=\"\n stream-chat-angular__image-modal-image\n str-chat__image-carousel-image\n \"\n data-testid=\"modal-image\"\n [src]=\"\n getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).url\n \"\n [style.--original-height]=\"\n getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).originalHeight\n \"\n [style.--original-width]=\"\n getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).originalWidth\n \"\n [alt]=\"imagesToView[imagesToViewCurrentIndex].fallback\"\n [ngStyle]=\"{\n width: getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).width,\n height: getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).height\n }\"\n />\n <div>\n <button\n class=\"\n stream-chat-angular__image-modal-stepper\n str-chat__image-carousel-stepper str-chat__image-carousel-stepper-prev\n \"\n [ngStyle]=\"{\n visibility: isImageModalPrevButtonVisible ? 'visible' : 'hidden'\n }\"\n data-testid=\"image-modal-prev\"\n type=\"button\"\n (click)=\"stepImages(-1)\"\n (keyup.enter)=\"stepImages(-1)\"\n >\n <stream-icon-placeholder icon=\"arrow-left\"></stream-icon-placeholder>\n </button>\n <button\n class=\"\n stream-chat-angular__image-modal-stepper\n str-chat__image-carousel-stepper str-chat__image-carousel-stepper-next\n \"\n type=\"button\"\n [ngStyle]=\"{\n visibility: isImageModalNextButtonVisible ? 'visible' : 'hidden'\n }\"\n data-testid=\"image-modal-next\"\n (click)=\"stepImages(1)\"\n (keyup.enter)=\"stepImages(1)\"\n >\n <stream-icon-placeholder icon=\"arrow-right\"></stream-icon-placeholder>\n </button>\n </div>\n </div>\n</ng-template>\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { ThemeService } from '../theme.service';\nimport { AttachmentUpload } from '../types';\n\n/**\n * The `AttachmentPreviewList` component displays a preview of the attachments uploaded to a message. Users can delete attachments using the preview component, or retry upload if it failed previously.\n */\n@Component({\n selector: 'stream-attachment-preview-list',\n templateUrl: './attachment-preview-list.component.html',\n styles: [],\n})\nexport class AttachmentPreviewListComponent {\n /**\n * A stream that emits the current file uploads and their states\n */\n @Input() attachmentUploads$: Observable<AttachmentUpload[]> | undefined;\n /**\n * An output to notify the parent component if the user tries to retry a failed upload\n */\n @Output() readonly retryAttachmentUpload = new EventEmitter<File>();\n /**\n * An output to notify the parent component if the user wants to delete a file\n */\n @Output() readonly deleteAttachment = new EventEmitter<AttachmentUpload>();\n themeVersion: '1' | '2';\n\n constructor(themeService: ThemeService) {\n this.themeVersion = themeService.themeVersion;\n }\n\n attachmentUploadRetried(file: File) {\n this.retryAttachmentUpload.emit(file);\n }\n\n attachmentDeleted(upload: AttachmentUpload) {\n this.deleteAttachment.emit(upload);\n }\n\n trackByFile(_: number, item: AttachmentUpload) {\n return item.file;\n }\n}\n","<div\n class=\"rfu-image-previewer\"\n *ngIf=\"(attachmentUploads$ | async)?.length && themeVersion === '1'\"\n>\n <ng-container\n *ngFor=\"\n let attachmentUpload of attachmentUploads$ | async;\n trackBy: trackByFile\n \"\n >\n <div\n *ngIf=\"attachmentUpload.type === 'image'\"\n class=\"rfu-image-previewer__image\"\n [class.rfu-image-previewer__image--loaded]=\"\n attachmentUpload.state === 'success'\n \"\n data-testclass=\"attachment-image-preview\"\n >\n <div\n *ngIf=\"attachmentUpload.state === 'error'\"\n class=\"rfu-image-previewer__retry\"\n (click)=\"attachmentUploadRetried(attachmentUpload.file)\"\n (keyup.enter)=\"attachmentUploadRetried(attachmentUpload.file)\"\n data-testclass=\"upload-retry\"\n >\n <stream-icon-placeholder icon=\"retry\"></stream-icon-placeholder>\n </div>\n <div class=\"rfu-thumbnail__wrapper\">\n <div class=\"rfu-thumbnail__overlay\">\n <div\n class=\"rfu-icon-button\"\n data-testclass=\"file-delete\"\n role=\"button\"\n (click)=\"attachmentDeleted(attachmentUpload)\"\n (keyup.enter)=\"attachmentDeleted(attachmentUpload)\"\n >\n <stream-icon-placeholder\n icon=\"close-no-outline\"\n ></stream-icon-placeholder>\n </div>\n </div>\n <img\n *ngIf=\"attachmentUpload.url || attachmentUpload.previewUri\"\n src=\"{{\n attachmentUpload.url\n ? attachmentUpload.url\n : attachmentUpload.previewUri\n }}\"\n alt=\"{{ attachmentUpload.file.name }}\"\n class=\"rfu-thumbnail__image\"\n data-testclass=\"attachment-image\"\n />\n </div>\n <stream-loading-indicator-placeholder\n data-testclass=\"loading-indicator\"\n color=\"rgba(255,255,255,0.7)\"\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n ></stream-loading-indicator-placeholder>\n </div>\n <div\n class=\"rfu-file-previewer\"\n *ngIf=\"\n attachmentUpload.type === 'file' || attachmentUpload.type === 'video'\n \"\n data-testclass=\"attachment-file-preview\"\n >\n <ol>\n <li\n class=\"rfu-file-previewer__file\"\n [class.rfu-file-previewer__file--uploading]=\"\n attachmentUpload.state === 'uploading'\n \"\n [class.rfu-file-previewer__file--failed]=\"\n attachmentUpload.state === 'error'\n \"\n >\n <stream-icon-placeholder icon=\"file\"></stream-icon-placeholder>\n\n <a\n data-testclass=\"file-download-link\"\n href=\"{{ attachmentUpload.url }}\"\n (click)=\"attachmentUpload.url ? null : $event.preventDefault()\"\n (keyup.enter)=\"\n attachmentUpload.url ? null : $event.preventDefault()\n \"\n download\n >\n {{ attachmentUpload.file.name }}\n <ng-container *ngIf=\"attachmentUpload.state === 'error'\">\n <div\n data-testclass=\"upload-retry\"\n class=\"rfu-file-previewer__failed\"\n (click)=\"attachmentUploadRetried(attachmentUpload.file)\"\n (keyup.enter)=\"attachmentUploadRetried(attachmentUpload.file)\"\n translate\n >\n streamChat.failed\n </div>\n <div\n class=\"rfu-file-previewer__retry\"\n (click)=\"attachmentUploadRetried(attachmentUpload.file)\"\n (keyup.enter)=\"attachmentUploadRetried(attachmentUpload.file)\"\n translate\n >\n streamChat.retry\n </div>\n </ng-container>\n </a>\n\n <span\n data-testclass=\"file-delete\"\n class=\"rfu-file-previewer__close-button\"\n (click)=\"attachmentDeleted(attachmentUpload)\"\n (keyup.enter)=\"attachmentDeleted(attachmentUpload)\"\n >\n <stream-icon-placeholder\n icon=\"close-no-outline\"\n ></stream-icon-placeholder>\n </span>\n <div\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n class=\"rfu-file-previewer__loading-indicator\"\n >\n <stream-loading-indicator-placeholder></stream-loading-indicator-placeholder>\n </div>\n </li>\n </ol>\n </div>\n </ng-container>\n</div>\n\n<div\n class=\"str-chat__attachment-preview-list\"\n *ngIf=\"(attachmentUploads$ | async)?.length && themeVersion === '2'\"\n>\n <div class=\"str-chat__attachment-list-scroll-container\">\n <ng-container\n *ngFor=\"\n let attachmentUpload of attachmentUploads$ | async;\n trackBy: trackByFile\n \"\n >\n <div\n *ngIf=\"attachmentUpload.type === 'image'\"\n class=\"str-chat__attachment-preview-image\"\n data-testclass=\"attachment-image-preview\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n deleteButton;\n context: { attachmentUpload: attachmentUpload }\n \"\n ></ng-container>\n <div\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n class=\"str-chat__attachment-preview-image-loading\"\n >\n <stream-loading-indicator-placeholder\n data-testclass=\"loading-indicator\"\n [size]=\"18\"\n ></stream-loading-indicator-placeholder>\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n retryButton;\n context: { attachmentUpload: attachmentUpload }\n \"\n ></ng-container>\n <img\n *ngIf=\"attachmentUpload.url || attachmentUpload.previewUri\"\n src=\"{{\n attachmentUpload.url\n ? attachmentUpload.url\n : attachmentUpload.previewUri\n }}\"\n alt=\"{{ attachmentUpload.file.name }}\"\n class=\"str-chat__attachment-preview-thumbnail\"\n data-testclass=\"attachment-image\"\n />\n </div>\n <div\n class=\"str-chat__attachment-preview-file\"\n *ngIf=\"\n attachmentUpload.type === 'file' || attachmentUpload.type === 'video'\n \"\n data-testclass=\"attachment-file-preview\"\n >\n <stream-icon-placeholder\n icon=\"unspecified-filetype\"\n ></stream-icon-placeholder>\n\n <div class=\"str-chat__attachment-preview-file-end\">\n <div class=\"str-chat__attachment-preview-file-name\">\n {{ attachmentUpload.file.name }}\n </div>\n <a\n *ngIf=\"attachmentUpload.state === 'success'\"\n class=\"str-chat__attachment-preview-file-download\"\n data-testclass=\"file-download-link\"\n href=\"{{ attachmentUpload.url }}\"\n (click)=\"attachmentUpload.url ? null : $event.preventDefault()\"\n (keyup.enter)=\"\n attachmentUpload.url ? null : $event.preventDefault()\n \"\n download\n >\n <stream-icon-placeholder icon=\"download\"></stream-icon-placeholder>\n </a>\n <stream-loading-indicator-placeholder\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n data-testclass=\"loading-indicator\"\n [size]=\"18\"\n ></stream-loading-indicator-placeholder>\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n deleteButton;\n context: { attachmentUpload: attachmentUpload }\n \"\n ></ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n retryButton;\n context: { attachmentUpload: attachmentUpload }\n \"\n ></ng-container>\n </div>\n </ng-container>\n </div>\n</div>\n\n<ng-template #deleteButton let-attachmentUpload=\"attachmentUpload\">\n <div\n class=\"str-chat__attachment-preview-delete\"\n data-testclass=\"file-delete\"\n role=\"button\"\n (click)=\"attachmentDeleted(attachmentUpload)\"\n (keyup.enter)=\"attachmentDeleted(attachmentUpload)\"\n >\n <stream-icon-placeholder icon=\"close-no-outline\"></stream-icon-placeholder>\n </div>\n</ng-template>\n\n<ng-template #retryButton let-attachmentUpload=\"attachmentUpload\">\n <div\n *ngIf=\"attachmentUpload.state === 'error'\"\n class=\"str-chat__attachment-preview-error str-chat__attachment-preview-error-{{\n attachmentUpload.type === 'image' ? 'image' : 'file'\n }}\"\n (click)=\"attachmentUploadRetried(attachmentUpload.file)\"\n (keyup.enter)=\"attachmentUploadRetried(attachmentUpload.file)\"\n data-testclass=\"upload-retry\"\n >\n <stream-icon-placeholder icon=\"retry\"></stream-icon-placeholder>\n </div>\n</ng-template>\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ComponentFactoryResolver,\n ComponentRef,\n ElementRef,\n EventEmitter,\n HostBinding,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n TemplateRef,\n Type,\n ViewChild,\n} from '@angular/core';\nimport { ChatClientService } from '../chat-client.service';\nimport { combineLatest, Observable, Subject, Subscription, timer } from 'rxjs';\nimport { first, map, take, tap } from 'rxjs/operators';\nimport { AppSettings, Channel, UserResponse } from 'stream-chat';\nimport { AttachmentService } from '../attachment.service';\nimport { ChannelService } from '../channel.service';\nimport { textareaInjectionToken } from '../injection-tokens';\nimport { NotificationService } from '../notification.service';\nimport {\n AttachmentPreviewListContext,\n AttachmentUpload,\n CustomAttachmentUploadContext,\n DefaultStreamChatGenerics,\n EmojiPickerContext,\n StreamMessage,\n} from '../types';\nimport { MessageInputConfigService } from './message-input-config.service';\nimport { TextareaDirective } from './textarea.directive';\nimport { TextareaInterface } from './textarea.interface';\nimport { isImageFile } from '../is-image-file';\nimport { EmojiInputService } from './emoji-input.service';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { ThemeService } from '../theme.service';\nimport { v4 as uuidv4 } from 'uuid';\n\n/**\n * The `MessageInput` component displays an input where users can type their messages and upload files, and sends the message to the active channel. The component can be used to compose new messages or update existing ones. To send messages, the chat user needs to have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).\n */\n@Component({\n selector: 'stream-message-input',\n templateUrl: './message-input.component.html',\n styles: [],\n providers: [AttachmentService, EmojiInputService],\n})\nexport class MessageInputComponent\n implements OnInit, OnChanges, OnDestroy, AfterViewInit\n{\n /**\n * If file upload is enabled, the user can open a file selector from the input. Please note that the user also needs to have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript). If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() isFileUploadEnabled: boolean | undefined;\n /**\n * If true, users can mention other users in messages. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work. If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() areMentionsEnabled: boolean | undefined;\n /**\n * The scope for user mentions, either members of the current channel of members of the application. If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() mentionScope: 'channel' | 'application' | undefined;\n /**\n * Determines if the message is being dispalyed in a channel or in a [thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript).\n */\n @Input() mode: 'thread' | 'main' = 'main';\n /**\n * If true, users can select multiple files to upload. If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() isMultipleFileUploadEnabled: boolean | undefined;\n /**\n * The message to edit\n */\n @Input() message: StreamMessage | undefined;\n /**\n * An observable that can be used to trigger message sending from the outside\n */\n @Input() sendMessage$: Observable<void> | undefined;\n /**\n * In `desktop` mode the `Enter` key will trigger message sending, in `mobile` mode the `Enter` key will insert a new line to the message input. If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() inputMode: 'desktop' | 'mobile';\n /**\n * Enables or disables auto focus on the textarea element\n */\n @Input() autoFocus = true;\n /**\n * Emits when a message was successfuly sent or updated\n */\n @Output() readonly messageUpdate = new EventEmitter<{\n message: StreamMessage;\n }>();\n @HostBinding() class = 'str-chat__message-input-angular-host';\n isFileUploadAuthorized: boolean | undefined;\n canSendLinks: boolean | undefined;\n canSendMessages: boolean | undefined;\n attachmentUploads$: Observable<AttachmentUpload[]>;\n attachmentUploadInProgressCounter$: Observable<number>;\n textareaValue = '';\n textareaRef: ComponentRef<TextareaInterface & Partial<OnChanges>> | undefined;\n mentionedUsers: UserResponse[] = [];\n quotedMessage: undefined | StreamMessage;\n typingStart$ = new Subject<void>();\n cooldown$: Observable<number> | undefined;\n isCooldownInProgress = false;\n emojiPickerTemplate: TemplateRef<EmojiPickerContext> | undefined;\n customAttachmentUploadTemplate:\n | TemplateRef<CustomAttachmentUploadContext>\n | undefined;\n attachmentPreviewListTemplate:\n | TemplateRef<AttachmentPreviewListContext>\n | undefined;\n textareaPlaceholder: string;\n themeVersion: '1' | '2';\n fileInputId = uuidv4();\n @ViewChild('fileInput') private fileInput!: ElementRef<HTMLInputElement>;\n @ViewChild(TextareaDirective, { static: false })\n private textareaAnchor!: TextareaDirective;\n private subscriptions: Subscription[] = [];\n private hideNotification: Function | undefined;\n private isViewInited = false;\n private appSettings: AppSettings | undefined;\n private channel: Channel<DefaultStreamChatGenerics> | undefined;\n private sendMessageSubcription: Subscription | undefined;\n private readonly defaultTextareaPlaceholder = 'streamChat.Type your message';\n private readonly slowModeTextareaPlaceholder = 'streamChat.Slow Mode ON';\n constructor(\n private channelService: ChannelService,\n private notificationService: NotificationService,\n private attachmentService: AttachmentService,\n private configService: MessageInputConfigService,\n @Inject(textareaInjectionToken)\n private textareaType: Type<TextareaInterface>,\n private componentFactoryResolver: ComponentFactoryResolver,\n private cdRef: ChangeDetectorRef,\n private chatClient: ChatClientService,\n private emojiInputService: EmojiInputService,\n private customTemplatesService: CustomTemplatesService,\n themeService: ThemeService\n ) {\n this.themeVersion = themeService.themeVersion;\n this.textareaPlaceholder = this.defaultTextareaPlaceholder;\n this.subscriptions.push(\n this.attachmentService.attachmentUploadInProgressCounter$.subscribe(\n (counter) => {\n if (counter === 0 && this.hideNotification) {\n this.hideNotification();\n this.hideNotification = undefined;\n }\n }\n )\n );\n this.subscriptions.push(\n this.channelService.activeChannel$.subscribe((channel) => {\n if (channel && this.channel && channel.id !== this.channel.id) {\n this.textareaValue = '';\n this.attachmentService.resetAttachmentUploads();\n }\n const capabilities = channel?.data?.own_capabilities as string[];\n if (capabilities) {\n this.isFileUploadAuthorized =\n capabilities.indexOf('upload-file') !== -1;\n this.canSendLinks = capabilities.indexOf('send-links') !== -1;\n this.channel = channel;\n this.setCanSendMessages();\n }\n })\n );\n this.subscriptions.push(\n this.chatClient.appSettings$.subscribe(\n (appSettings) => (this.appSettings = appSettings)\n )\n );\n this.subscriptions.push(\n this.channelService.messageToQuote$.subscribe((m) => {\n const isThreadReply = m && m.parent_id;\n if (\n (this.mode === 'thread' && isThreadReply) ||\n (this.mode === 'thread' && this.quotedMessage && !m) ||\n (this.mode === 'main' && !isThreadReply)\n ) {\n this.quotedMessage = m;\n }\n })\n );\n this.attachmentUploads$ = this.attachmentService.attachmentUploads$;\n this.attachmentUploadInProgressCounter$ =\n this.attachmentService.attachmentUploadInProgressCounter$;\n this.isFileUploadEnabled = this.configService.isFileUploadEnabled;\n this.isMultipleFileUploadEnabled =\n this.configService.isMultipleFileUploadEnabled;\n this.areMentionsEnabled = this.configService.areMentionsEnabled;\n this.mentionScope = this.configService.mentionScope;\n this.inputMode = this.configService.inputMode;\n\n this.subscriptions.push(\n this.typingStart$.subscribe(\n () => void this.channelService.typingStarted(this.parentMessageId)\n )\n );\n\n this.subscriptions.push(\n combineLatest([\n this.channelService.latestMessageDateByUserByChannels$,\n this.channelService.activeChannel$,\n ])\n .pipe(\n map(\n ([latestMessages, channel]): [\n Date | undefined,\n Channel<DefaultStreamChatGenerics> | undefined\n ] => [latestMessages[channel?.cid || ''], channel!]\n )\n )\n .subscribe(([latestMessageDate, channel]) => {\n const cooldown =\n (channel?.data?.cooldown as number) &&\n latestMessageDate &&\n Math.round(\n (channel?.data?.cooldown as number) -\n (new Date().getTime() - latestMessageDate.getTime()) / 1000\n );\n if (\n cooldown &&\n cooldown > 0 &&\n (channel?.data?.own_capabilities as string[]).includes('slow-mode')\n ) {\n this.startCooldown(cooldown);\n } else if (this.isCooldownInProgress) {\n this.stopCooldown();\n }\n })\n );\n }\n\n ngOnInit(): void {\n this.subscriptions.push(\n this.customTemplatesService.emojiPickerTemplate$.subscribe((template) => {\n this.emojiPickerTemplate = template;\n this.cdRef.detectChanges();\n })\n );\n this.subscriptions.push(\n this.customTemplatesService.attachmentPreviewListTemplate$.subscribe(\n (template) => {\n this.attachmentPreviewListTemplate = template;\n this.cdRef.detectChanges();\n }\n )\n );\n this.subscriptions.push(\n this.customTemplatesService.customAttachmentUploadTemplate$.subscribe(\n (template) => {\n this.customAttachmentUploadTemplate = template;\n this.cdRef.detectChanges();\n }\n )\n );\n }\n\n ngAfterViewInit(): void {\n this.isViewInited = true;\n this.initTextarea();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.message) {\n this.attachmentService.resetAttachmentUploads();\n if (this.isUpdate) {\n this.attachmentService.createFromAttachments(\n this.message!.attachments || []\n );\n this.textareaValue = this.message!.text || '';\n }\n }\n if (changes.isFileUploadEnabled) {\n this.configService.isFileUploadEnabled = this.isFileUploadEnabled;\n }\n if (changes.isMultipleFileUploadEnabled) {\n this.configService.isMultipleFileUploadEnabled =\n this.isMultipleFileUploadEnabled;\n }\n if (changes.areMentionsEnabled) {\n this.configService.areMentionsEnabled = this.areMentionsEnabled;\n }\n if (changes.mentionScope) {\n this.configService.mentionScope = this.mentionScope;\n }\n if (changes.mode) {\n this.setCanSendMessages();\n }\n if (changes.inputMode) {\n this.configService.inputMode = this.inputMode;\n }\n if (changes.sendMessage$) {\n if (this.sendMessageSubcription) {\n this.sendMessageSubcription.unsubscribe();\n }\n if (this.sendMessage$) {\n this.sendMessageSubcription = this.sendMessage$.subscribe(\n () => void this.messageSent()\n );\n }\n }\n }\n\n ngOnDestroy(): void {\n if (this.sendMessageSubcription) {\n this.sendMessageSubcription.unsubscribe();\n }\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n async messageSent() {\n if (this.isCooldownInProgress) {\n return;\n }\n let attachmentUploadInProgressCounter!: number;\n this.attachmentService.attachmentUploadInProgressCounter$\n .pipe(first())\n .subscribe((counter) => (attachmentUploadInProgressCounter = counter));\n if (attachmentUploadInProgressCounter > 0) {\n if (!this.hideNotification) {\n this.hideNotification =\n this.notificationService.addPermanentNotification(\n 'streamChat.Wait until all attachments have uploaded'\n );\n }\n return;\n }\n const attachments = this.attachmentService.mapToAttachments();\n let text = this.textareaValue;\n text = text.replace(/^\\n+/g, ''); // leading empty lines\n text = text.replace(/\\n+$/g, ''); // ending empty lines\n const textContainsOnlySpaceChars = !text.replace(/ /g, ''); //spcae\n if (\n (!text || textContainsOnlySpaceChars) &&\n (!attachments || attachments.length === 0)\n ) {\n return;\n }\n if (textContainsOnlySpaceChars) {\n text = '';\n }\n if (this.containsLinks && !this.canSendLinks) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Sending links is not allowed in this conversation'\n );\n return;\n }\n if (!this.isUpdate) {\n this.textareaValue = '';\n }\n try {\n const message = await (this.isUpdate\n ? this.channelService.updateMessage({\n ...this.message!,\n text: text,\n attachments: attachments,\n })\n : this.channelService.sendMessage(\n text,\n attachments,\n this.mentionedUsers,\n this.parentMessageId,\n this.quotedMessage?.id\n ));\n this.messageUpdate.emit({ message });\n if (!this.isUpdate) {\n this.attachmentService.resetAttachmentUploads();\n }\n } catch (error) {\n if (this.isUpdate) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Edit message request failed'\n );\n }\n }\n void this.channelService.typingStopped(this.parentMessageId);\n if (this.quotedMessage) {\n this.deselectMessageToQuote();\n }\n }\n\n get containsLinks() {\n return /(?:(?:https?|ftp):\\/\\/)?[\\w/\\-?=%.]+\\.[\\w/\\-&?=%.]+/.test(\n this.textareaValue\n );\n }\n\n get quotedMessageAttachments() {\n const originalAttachments = this.quotedMessage?.attachments;\n return originalAttachments && originalAttachments.length\n ? [originalAttachments[0]]\n : [];\n }\n\n get disabledTextareaText() {\n if (!this.canSendMessages) {\n return this.mode === 'thread'\n ? \"streamChat.You can't send thread replies in this channel\"\n : \"streamChat.You can't send messages in this channel\";\n }\n return '';\n }\n\n async filesSelected(fileList: FileList | null) {\n if (!(await this.areAttachemntsValid(fileList))) {\n return;\n }\n await this.attachmentService.filesSelected(fileList);\n this.clearFileInput();\n }\n\n deselectMessageToQuote() {\n this.channelService.selectMessageToQuote(undefined);\n }\n\n getEmojiPickerContext(): EmojiPickerContext {\n return {\n emojiInput$: this.emojiInputService.emojiInput$,\n };\n }\n\n getAttachmentPreviewListContext(): AttachmentPreviewListContext {\n return {\n attachmentUploads$: this.attachmentService.attachmentUploads$,\n deleteUploadHandler: this.deleteUpload.bind(this),\n retryUploadHandler: this.retryUpload.bind(this),\n };\n }\n\n getAttachmentUploadContext(): CustomAttachmentUploadContext {\n return {\n isMultipleFileUploadEnabled: this.isMultipleFileUploadEnabled,\n attachmentService: this.attachmentService,\n };\n }\n\n private deleteUpload(upload: AttachmentUpload) {\n if (this.isUpdate) {\n // Delay delete to avoid modal detecting this click as outside click\n setTimeout(() => {\n void this.attachmentService.deleteAttachment(upload);\n });\n } else {\n void this.attachmentService.deleteAttachment(upload);\n }\n }\n\n private retryUpload(file: File) {\n void this.attachmentService.retryAttachmentUpload(file);\n }\n\n private clearFileInput() {\n this.fileInput.nativeElement.value = '';\n }\n\n private get isUpdate() {\n return !!this.message;\n }\n\n private initTextarea() {\n // cleanup previously built textarea\n if (!this.canSendMessages) {\n this.textareaRef = undefined;\n }\n\n if (!this.canSendMessages || this.textareaRef || !this.textareaAnchor) {\n return;\n }\n\n const componentFactory =\n this.componentFactoryResolver.resolveComponentFactory(this.textareaType);\n this.textareaRef =\n this.textareaAnchor.viewContainerRef.createComponent<any>(\n componentFactory\n );\n this.cdRef.detectChanges();\n }\n\n private async areAttachemntsValid(fileList: FileList | null) {\n if (!fileList) {\n return true;\n }\n if (!this.appSettings) {\n await this.chatClient.getAppSettings();\n }\n let isValid = true;\n Array.from(fileList).forEach((f) => {\n let hasBlockedExtension: boolean;\n let hasBlockedMimeType: boolean;\n let hasNotAllowedExtension: boolean;\n let hasNotAllowedMimeType: boolean;\n if (isImageFile(f)) {\n hasBlockedExtension =\n !!this.appSettings?.image_upload_config?.blocked_file_extensions?.find(\n (ext) => f.name.endsWith(ext)\n );\n hasBlockedMimeType =\n !!this.appSettings?.image_upload_config?.blocked_mime_types?.find(\n (type) => f.type === type\n );\n hasNotAllowedExtension =\n !!this.appSettings?.image_upload_config?.allowed_file_extensions\n ?.length &&\n !this.appSettings?.image_upload_config?.allowed_file_extensions?.find(\n (ext) => f.name.endsWith(ext)\n );\n hasNotAllowedMimeType =\n !!this.appSettings?.image_upload_config?.allowed_mime_types?.length &&\n !this.appSettings?.image_upload_config?.allowed_mime_types?.find(\n (type) => f.type === type\n );\n } else {\n hasBlockedExtension =\n !!this.appSettings?.file_upload_config?.blocked_file_extensions?.find(\n (ext) => f.name.endsWith(ext)\n );\n hasBlockedMimeType =\n !!this.appSettings?.file_upload_config?.blocked_mime_types?.find(\n (type) => f.type === type\n );\n hasNotAllowedExtension =\n !!this.appSettings?.file_upload_config?.allowed_file_extensions\n ?.length &&\n !this.appSettings?.file_upload_config?.allowed_file_extensions?.find(\n (ext) => f.name.endsWith(ext)\n );\n hasNotAllowedMimeType =\n !!this.appSettings?.file_upload_config?.allowed_mime_types?.length &&\n !this.appSettings?.file_upload_config?.allowed_mime_types?.find(\n (type) => f.type === type\n );\n }\n if (\n hasBlockedExtension ||\n hasBlockedMimeType ||\n hasNotAllowedExtension ||\n hasNotAllowedMimeType\n ) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error uploading file, extension not supported',\n undefined,\n undefined,\n { name: f.name, ext: f.type }\n );\n isValid = false;\n }\n });\n return isValid;\n }\n\n private setCanSendMessages() {\n const capabilities = this.channel?.data?.own_capabilities as string[];\n if (!capabilities) {\n this.canSendMessages = false;\n } else {\n this.canSendMessages =\n capabilities.indexOf(\n this.mode === 'main' ? 'send-message' : 'send-reply'\n ) !== -1;\n }\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n this.initTextarea();\n }\n }\n\n private get parentMessageId() {\n let parentMessageId: string | undefined = undefined;\n if (this.mode === 'thread') {\n this.channelService.activeParentMessageId$\n .pipe(first())\n .subscribe((id) => (parentMessageId = id));\n }\n\n return parentMessageId;\n }\n\n private startCooldown(cooldown: number) {\n this.textareaPlaceholder = this.slowModeTextareaPlaceholder;\n this.isCooldownInProgress = true;\n this.cooldown$ = timer(0, 1000).pipe(\n take(cooldown + 1),\n map((v) => cooldown - v),\n tap((v) => {\n if (v === 0) {\n this.stopCooldown();\n }\n })\n );\n }\n\n private stopCooldown() {\n this.cooldown$ = undefined;\n this.isCooldownInProgress = false;\n this.textareaPlaceholder = this.defaultTextareaPlaceholder;\n }\n}\n","<div\n *ngIf=\"themeVersion !== '2'\"\n class=\"{{\n mode === 'main' ? 'str-chat__input-flat' : 'str-chat__small-message-input'\n }}\"\n [class.str-chat__input-flat-has-attachments]=\"\n (attachmentUploads$ | async)!.length > 0\n \"\n [class.str-chat__input-flat-quoted]=\"!!quotedMessage\"\n>\n <div class=\"quoted-message-preview\" *ngIf=\"quotedMessage\">\n <div class=\"quoted-message-preview-header\">\n <div>{{ \"streamChat.Reply to Message\" | translate }}</div>\n <button\n class=\"str-chat__square-button\"\n data-testid=\"remove-quote\"\n (click)=\"deselectMessageToQuote()\"\n (keyup.enter)=\"deselectMessageToQuote()\"\n >\n <stream-icon-placeholder\n icon=\"close-no-outline\"\n ></stream-icon-placeholder>\n </button>\n </div>\n <div class=\"quoted-message-preview-content\">\n <stream-avatar-placeholder\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"quotedMessage?.user?.image\"\n [name]=\"quotedMessage?.user?.name || quotedMessage?.user?.id\"\n [size]=\"20\"\n type=\"user\"\n location=\"quoted-message-sender\"\n [user]=\"quotedMessage?.user || undefined\"\n ></stream-avatar-placeholder>\n <div class=\"quoted-message-preview-content-inner\">\n <stream-attachment-list\n *ngIf=\"\n quotedMessage?.attachments && quotedMessage?.attachments?.length\n \"\n [attachments]=\"quotedMessageAttachments\"\n [messageId]=\"quotedMessage?.id\"\n ></stream-attachment-list>\n <div\n data-testid=\"quoted-message-text\"\n [innerHTML]=\"\n message?.quoted_message?.translation ||\n quotedMessage?.html ||\n quotedMessage?.text\n \"\n ></div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__input-flat-wrapper\">\n <div\n class=\"{{\n mode === 'main'\n ? 'str-chat__input-flat--textarea-wrapper'\n : 'str-chat__small-message-input--textarea-wrapper'\n }}\"\n >\n <ng-template\n #defaultAttachmentsPreview\n let-attachmentUploads$=\"attachmentUploads$\"\n let-retryUploadHandler=\"retryUploadHandler\"\n let-deleteUploadHandler=\"deleteUploadHandler\"\n >\n <stream-attachment-preview-list\n [attachmentUploads$]=\"attachmentUploads$\"\n (retryAttachmentUpload)=\"retryUploadHandler($event)\"\n (deleteAttachment)=\"deleteUploadHandler($event)\"\n class=\"rfu-image-previewer-angular-host\"\n ></stream-attachment-preview-list>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n attachmentPreviewListTemplate || defaultAttachmentsPreview;\n context: getAttachmentPreviewListContext()\n \"\n ></ng-container>\n <div class=\"rta str-chat__textarea str-chat-angular__textarea\">\n <ng-container *ngIf=\"emojiPickerTemplate\" data-testid=\"emoji-picker\">\n <div\n class=\"\n str-chat__input-flat-emojiselect\n str-chat-angular__emojiselect\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n emojiPickerTemplate;\n context: getEmojiPickerContext()\n \"\n ></ng-container>\n </div>\n </ng-container>\n <ng-container *ngIf=\"canSendMessages; else disabledTextarea\">\n <ng-container\n streamTextarea\n [(value)]=\"textareaValue\"\n (valueChange)=\"typingStart$.next()\"\n (send)=\"messageSent()\"\n [componentRef]=\"textareaRef\"\n (userMentions)=\"mentionedUsers = $event\"\n [areMentionsEnabled]=\"areMentionsEnabled\"\n [mentionScope]=\"mentionScope\"\n [placeholder]=\"textareaPlaceholder\"\n [inputMode]=\"inputMode\"\n [autoFocus]=\"autoFocus\"\n ></ng-container>\n </ng-container>\n <ng-template #disabledTextarea>\n <textarea\n disabled\n rows=\"1\"\n [value]=\"disabledTextareaText | translate\"\n class=\"rta__textarea str-chat__textarea__textarea\"\n data-testid=\"disabled-textarea\"\n ></textarea>\n </ng-template>\n </div>\n <ng-container\n *ngIf=\"isFileUploadEnabled && isFileUploadAuthorized && canSendMessages\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n customAttachmentUploadTemplate || defaultAttachmentUpload;\n context: getAttachmentUploadContext()\n \"\n ></ng-container>\n <ng-template #defaultAttachmentUpload>\n <div\n class=\"str-chat__fileupload-wrapper\"\n data-testid=\"file-upload-button\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Attach files\" | translate }}\n </div>\n <div class=\"rfu-file-upload-button\">\n <label>\n <input\n #fileInput\n type=\"file\"\n class=\"rfu-file-input\"\n data-testid=\"file-input\"\n [multiple]=\"isMultipleFileUploadEnabled\"\n (change)=\"filesSelected(fileInput.files)\"\n />\n <span class=\"str-chat__input-flat-fileupload\">\n <stream-icon-placeholder\n icon=\"file-upload\"\n ></stream-icon-placeholder>\n </span>\n </label>\n </div>\n </div>\n </ng-template>\n </ng-container>\n </div>\n <button\n *ngIf=\"canSendMessages && !isCooldownInProgress\"\n data-testid=\"send-button\"\n class=\"str-chat__send-button\"\n (click)=\"messageSent()\"\n (keyup.enter)=\"messageSent()\"\n >\n <stream-icon-placeholder\n class=\"str-chat__send-button-angular\"\n icon=\"send\"\n ></stream-icon-placeholder>\n </button>\n <div\n class=\"str-chat__input-flat-cooldown\"\n *ngIf=\"isCooldownInProgress\"\n data-testid=\"cooldown-timer\"\n >\n <div class=\"str-chat__message-input-cooldown-text\">\n {{ cooldown$ | async }}\n </div>\n </div>\n </div>\n</div>\n\n<div\n *ngIf=\"themeVersion === '2'\"\n class=\"str-chat__message-input str-chat-angular__message-input\"\n>\n <div *ngIf=\"quotedMessage\" class=\"str-chat__quoted-message-preview-header\">\n <div class=\"str-chat__quoted-message-reply-to-message\">\n {{ \"streamChat.Reply to Message\" | translate }}\n </div>\n <button\n class=\"str-chat__quoted-message-remove\"\n data-testid=\"remove-quote\"\n (click)=\"deselectMessageToQuote()\"\n (keyup.enter)=\"deselectMessageToQuote()\"\n >\n <stream-icon-placeholder\n icon=\"close-no-outline\"\n ></stream-icon-placeholder>\n </button>\n </div>\n <ng-container *ngIf=\"canSendMessages; else notAllowed\">\n <div\n class=\"\n str-chat__message-input-inner\n str-chat-angular__message-input-inner\n \"\n >\n <ng-container\n *ngIf=\"isFileUploadEnabled && isFileUploadAuthorized && canSendMessages\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n customAttachmentUploadTemplate || defaultAttachmentUpload;\n context: getAttachmentUploadContext()\n \"\n ></ng-container>\n <ng-template #defaultAttachmentUpload>\n <div\n class=\"str-chat__file-input-container\"\n data-testid=\"file-upload-button\"\n >\n <input\n #fileInput\n type=\"file\"\n class=\"str-chat__file-input\"\n data-testid=\"file-input\"\n [multiple]=\"isMultipleFileUploadEnabled\"\n (change)=\"filesSelected(fileInput.files)\"\n id=\"{{ fileInputId }}\"\n />\n <label class=\"str-chat__file-input-label\" for=\"{{ fileInputId }}\">\n <stream-icon-placeholder icon=\"attach\"></stream-icon-placeholder>\n </label>\n </div>\n </ng-template>\n </ng-container>\n <div class=\"str-chat__message-textarea-container\">\n <div\n data-testid=\"quoted-message-container\"\n class=\"str-chat__quoted-message-preview\"\n *ngIf=\"quotedMessage\"\n >\n <stream-avatar-placeholder\n data-testid=\"qouted-message-avatar\"\n class=\"\n str-chat-angular__avatar-host\n str-chat__message-sender-avatar\n \"\n [imageUrl]=\"quotedMessage?.user?.image\"\n [name]=\"quotedMessage?.user?.name || quotedMessage?.user?.id\"\n [size]=\"20\"\n type=\"user\"\n location=\"quoted-message-sender\"\n [user]=\"quotedMessage?.user || undefined\"\n ></stream-avatar-placeholder>\n <div\n class=\"\n quoted-message-preview-content-inner\n str-chat__quoted-message-bubble\n \"\n >\n <stream-attachment-list\n *ngIf=\"\n quotedMessage?.attachments && quotedMessage?.attachments?.length\n \"\n [attachments]=\"quotedMessageAttachments\"\n [messageId]=\"quotedMessage?.id\"\n ></stream-attachment-list>\n <div\n class=\"str-chat__quoted-message-text\"\n data-testid=\"quoted-message-text\"\n [innerHTML]=\"\n quotedMessage?.translation ||\n quotedMessage?.html ||\n quotedMessage?.text\n \"\n ></div>\n </div>\n </div>\n <ng-template\n #defaultAttachmentsPreview\n let-attachmentUploads$=\"attachmentUploads$\"\n let-retryUploadHandler=\"retryUploadHandler\"\n let-deleteUploadHandler=\"deleteUploadHandler\"\n >\n <stream-attachment-preview-list\n [attachmentUploads$]=\"attachmentUploads$\"\n (retryAttachmentUpload)=\"retryUploadHandler($event)\"\n (deleteAttachment)=\"deleteUploadHandler($event)\"\n class=\"str-chat__attachment-preview-list-angular-host\"\n ></stream-attachment-preview-list>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n attachmentPreviewListTemplate || defaultAttachmentsPreview;\n context: getAttachmentPreviewListContext()\n \"\n ></ng-container>\n <div class=\"str-chat__message-textarea-with-emoji-picker\">\n <ng-container\n streamTextarea\n [(value)]=\"textareaValue\"\n (valueChange)=\"typingStart$.next()\"\n (send)=\"messageSent()\"\n [componentRef]=\"textareaRef\"\n (userMentions)=\"mentionedUsers = $event\"\n [areMentionsEnabled]=\"areMentionsEnabled\"\n [mentionScope]=\"mentionScope\"\n [inputMode]=\"inputMode\"\n [autoFocus]=\"autoFocus\"\n [placeholder]=\"textareaPlaceholder\"\n ></ng-container>\n <ng-container *ngIf=\"emojiPickerTemplate\" data-testid=\"emoji-picker\">\n <ng-container\n *ngTemplateOutlet=\"\n emojiPickerTemplate;\n context: getEmojiPickerContext()\n \"\n ></ng-container>\n </ng-container>\n </div>\n </div>\n <button\n *ngIf=\"canSendMessages && !isCooldownInProgress && !message\"\n [disabled]=\"\n (attachmentUploadInProgressCounter$ | async)! > 0 ||\n (!textareaValue && (attachmentUploads$ | async)!.length === 0)\n \"\n data-testid=\"send-button\"\n class=\"str-chat__send-button\"\n (click)=\"messageSent()\"\n (keyup.enter)=\"messageSent()\"\n >\n <stream-icon-placeholder icon=\"send\"></stream-icon-placeholder>\n </button>\n <div\n class=\"str-chat__message-input-cooldown\"\n *ngIf=\"isCooldownInProgress\"\n data-testid=\"cooldown-timer\"\n >\n {{ cooldown$ | async }}\n </div>\n </div>\n </ng-container>\n <ng-template #notAllowed>\n <div\n class=\"str-chat__message-input-not-allowed\"\n data-testid=\"disabled-textarea\"\n >\n {{ disabledTextareaText | translate }}\n </div>\n </ng-template>\n</div>\n","import { Component, Input, TemplateRef } from '@angular/core';\nimport { NotificationType } from '../types';\n\n/**\n * The `Notification` component displays a notification within the [`NotificationList`](./NotificationListComponent.mdx)\n */\n@Component({\n selector: 'stream-notification',\n templateUrl: './notification.component.html',\n styles: [],\n})\nexport class NotificationComponent {\n /**\n * The type of the notification\n */\n @Input() type: NotificationType | undefined;\n /**\n * The content of the notification (can also be provided using `ng-content`)\n */\n @Input() content: TemplateRef<void> | undefined;\n\n constructor() {}\n}\n","<div\n class=\"str-chat__custom-notification notification-{{\n type\n }} str-chat__notification\"\n data-testid=\"custom-notification\"\n>\n <ng-container *ngIf=\"content; else elseContent\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </ng-container>\n <ng-template #elseContent>\n <ng-content></ng-content>\n </ng-template>\n</div>\n","import { Component } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { NotificationService } from '../notification.service';\nimport { ThemeService } from '../theme.service';\nimport { NotificationPayload } from '../types';\n\n/**\n * The `NotificationList` component displays the list of active notifications.\n */\n@Component({\n selector: 'stream-notification-list',\n templateUrl: './notification-list.component.html',\n styles: [],\n})\nexport class NotificationListComponent {\n notifications$: Observable<NotificationPayload[]>;\n themeVersion: '1' | '2';\n theme$: Observable<string>;\n\n constructor(\n public readonly customTemplatesService: CustomTemplatesService,\n private notificationService: NotificationService,\n private themeService: ThemeService\n ) {\n this.notifications$ = this.notificationService.notifications$;\n this.theme$ = this.themeService.theme$;\n this.themeVersion = this.themeService.themeVersion;\n }\n\n trackById(_: number, item: NotificationPayload) {\n return item.id;\n }\n\n getNotificationContentContext(notification: NotificationPayload) {\n return {\n ...notification.templateContext,\n dismissFn: notification.dismissFn,\n };\n }\n}\n","<div\n class=\"str-chat__theme-{{ theme$ | async }} str-chat__list-notifications\"\n [class.str-chat]=\"themeVersion === '2'\"\n data-testid=\"notification-list\"\n>\n <ng-container\n *ngFor=\"let notification of notifications$ | async; trackBy: trackById\"\n >\n <ng-template #notificationContent>\n <div\n *ngIf=\"notification.text !== undefined\"\n data-testclass=\"notification-content\"\n >\n {{ notification.text | translate: notification.translateParams }}\n </div>\n <ng-container *ngIf=\"notification.template !== undefined\">\n <ng-container\n *ngTemplateOutlet=\"\n notification.template;\n context: getNotificationContentContext(notification)\n \"\n ></ng-container>\n </ng-container>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.notificationTemplate$ | async) ||\n defaultNotification;\n context: { type: notification.type, content: notificationContent }\n \"\n ></ng-container>\n </ng-container>\n</div>\n\n<ng-template #defaultNotification let-type=\"type\" let-content=\"content\">\n <stream-notification [type]=\"type\" [content]=\"content\"></stream-notification>\n</ng-template>\n","import {\n Component,\n HostBinding,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { MessageInputContext, ModalContext, StreamMessage } from '../types';\nimport { Observable, Subject, Subscription } from 'rxjs';\nimport { MessageActionsService } from '../message-actions.service';\n\n/**\n * The edit message form displays a modal that's opened when a user edits a message. The component uses the [`MessageActionsService`](../../services/MessageActionsService) to know which message is being edited.\n *\n * By default this is displayed within the [`stream-channel` component](../../components/ChannelComponent).\n */\n@Component({\n selector: 'stream-edit-message-form',\n templateUrl: './edit-message-form.component.html',\n styles: [],\n})\nexport class EditMessageFormComponent implements OnInit, OnDestroy {\n @HostBinding() class = 'str-chat-angular__edit-message-form';\n sendMessage$: Observable<void>;\n isModalOpen = false;\n message?: StreamMessage;\n @ViewChild('editMessageForm', { static: true })\n private modalContent!: TemplateRef<void>;\n private sendMessageSubject = new Subject<void>();\n private subscriptions: Subscription[] = [];\n\n constructor(\n readonly customTemplatesService: CustomTemplatesService,\n private messageActionsService: MessageActionsService\n ) {\n this.sendMessage$ = this.sendMessageSubject.asObservable();\n }\n\n ngOnInit(): void {\n this.messageActionsService.messageToEdit$.subscribe((message) => {\n if ((message && !this.isModalOpen) || (!message && this.isModalOpen)) {\n this.message = message;\n this.isModalOpen = !!message;\n }\n });\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n getEditModalContext(): ModalContext {\n return {\n isOpen: this.isModalOpen,\n isOpenChangeHandler: (isOpen) => {\n this.isModalOpen = isOpen;\n if (!this.isModalOpen) {\n this.dismissed();\n }\n },\n content: this.modalContent,\n };\n }\n\n getMessageInputContext(): MessageInputContext {\n return {\n message: this.message,\n messageUpdateHandler: () => {\n this.dismissed();\n },\n isFileUploadEnabled: undefined,\n areMentionsEnabled: undefined,\n isMultipleFileUploadEnabled: undefined,\n mentionScope: undefined,\n mode: undefined,\n sendMessage$: this.sendMessage$,\n };\n }\n\n sendClicked() {\n this.sendMessageSubject.next();\n }\n\n dismissed() {\n this.isModalOpen = false;\n this.message = undefined;\n this.messageActionsService.messageToEdit$.next(undefined);\n }\n}\n","<ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: getEditModalContext()\n \"\n></ng-container>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n [isOpen]=\"isOpen\"\n *ngIf=\"isOpen\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n [content]=\"content\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #editMessageForm>\n <div class=\"str-chat__edit-message-form\">\n <ng-template\n #defaultInput\n let-messageInput=\"message\"\n let-messageUpdateHandler=\"messageUpdateHandler\"\n let-sendMessage$Input=\"sendMessage$\"\n >\n <stream-message-input\n [message]=\"messageInput\"\n (messageUpdate)=\"messageUpdateHandler()\"\n [sendMessage$]=\"sendMessage$Input\"\n ></stream-message-input>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageInputTemplate$ | async) || defaultInput;\n context: getMessageInputContext()\n \"\n >\n </ng-container>\n\n <stream-notification-list></stream-notification-list>\n <div\n class=\"\n str-chat__message-team-form-footer\n str-chat__message-team-form-footer-angular\n \"\n >\n <div class=\"str-chat__edit-message-form-options\">\n <button\n class=\"str-chat__edit-message-cancel\"\n translate\n data-testid=\"cancel-button\"\n (click)=\"dismissed()\"\n >\n streamChat.Cancel\n </button>\n <button\n type=\"submit\"\n translate\n class=\"str-chat__edit-message-send\"\n data-testid=\"send-button\"\n (click)=\"sendClicked()\"\n (keyup.enter)=\"sendClicked()\"\n >\n streamChat.Send\n </button>\n </div>\n </div>\n </div>\n</ng-template>\n","import { Component, HostBinding, OnDestroy } from '@angular/core';\nimport { ChannelService } from '../channel.service';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { Subscription } from 'rxjs';\nimport { MessageActionsService } from '../message-actions.service';\nimport { StreamMessage } from '../types';\n\n/**\n * The component watches for the [`channelService.bouncedMessage$` stream](../../services/ChannelService/#bouncedmessage) and opens the bounce modal if a message is emitted.\n *\n * To bounce messages, you need to set up [semantic filters for moderation](https://getstream.io/automated-moderation/docs/automod_configuration/?q=semantic%20filters).\n */\n@Component({\n selector: 'stream-message-bounce-prompt',\n templateUrl: './message-bounce-prompt.component.html',\n styles: [],\n})\nexport class MessageBouncePromptComponent implements OnDestroy {\n @HostBinding() class = 'str-chat__message-bounce-prompt';\n isModalOpen = false;\n message?: StreamMessage;\n private subscriptions: Subscription[] = [];\n\n constructor(\n private channelService: ChannelService,\n readonly customTemplatesService: CustomTemplatesService,\n private messageActionsService: MessageActionsService\n ) {\n this.subscriptions.push(\n this.channelService.bouncedMessage$.subscribe((m) => {\n if (m !== this.message) {\n this.message = m;\n if (this.message) {\n this.isModalOpen = true;\n }\n }\n })\n );\n }\n\n messageBounceModalOpenChanged = (isOpen: boolean) => {\n this.isModalOpen = isOpen;\n if (!isOpen) {\n this.message = undefined;\n this.channelService.bouncedMessage$.next(undefined);\n }\n };\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n async resendMessage() {\n this.isModalOpen = false;\n await this.channelService.resendMessage(this.message!);\n this.message = undefined;\n this.channelService.bouncedMessage$.next(undefined);\n }\n\n async deleteMessage() {\n if (!this.message) {\n return;\n }\n this.isModalOpen = false;\n await this.channelService.deleteMessage(this.message, true);\n this.message = undefined;\n this.channelService.bouncedMessage$.next(undefined);\n }\n\n editMessage() {\n this.isModalOpen = false;\n this.messageActionsService.messageToEdit$.next(this.message);\n this.message = undefined;\n this.channelService.bouncedMessage$.next(undefined);\n }\n}\n","<ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: {\n message: message,\n isOpen: isModalOpen,\n isOpenChangeHandler: messageBounceModalOpenChanged,\n content: modalContent\n }\n \"\n></ng-container>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n [isOpen]=\"isOpen\"\n *ngIf=\"isOpen\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n [content]=\"content\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #modalContent>\n <div\n class=\"str-chat__message-bounce-prompt\"\n data-testid=\"message-bounce-prompt\"\n >\n <div class=\"str-chat__message-bounce-prompt-header\">\n {{\n \"streamChat.This message did not meet our content guidelines\"\n | translate\n }}\n </div>\n <div class=\"str-chat__message-bounce-actions\">\n <button\n class=\"str-chat__message-bounce-edit\"\n data-testid=\"message-bounce-edit\"\n (click)=\"editMessage()\"\n (keyup.enter)=\"editMessage()\"\n type=\"button\"\n >\n {{ \"streamChat.Edit Message\" | translate }}\n </button>\n <button\n class=\"str-chat__message-bounce-send\"\n data-testid=\"message-bounce-send\"\n (click)=\"resendMessage()\"\n (keyup.enter)=\"resendMessage()\"\n >\n {{ \"streamChat.Send Anyway\" | translate }}\n </button>\n <button\n class=\"str-chat__message-bounce-delete\"\n data-testid=\"message-bounce-delete\"\n (click)=\"deleteMessage()\"\n (keyup.enter)=\"deleteMessage()\"\n >\n {{ \"streamChat.Delete\" | translate }}\n </button>\n </div>\n </div>\n</ng-template>\n","import { Component } from '@angular/core';\nimport { combineLatest, Observable, Subscription } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { ChannelService } from '../channel.service';\nimport { ThemeService } from '../theme.service';\nimport { CustomTemplatesService } from '../custom-templates.service';\n\n/**\n * The `Channel` component is a container component that displays the [`ChannelHeader`](./ChannelHeaderComponent.mdx), [`MessageList`](./MessageListComponent.mdx), [`NotificationList`](./NotificationListComponent.mdx) and [`MessageInput`](./MessageInputComponent.mdx) components. You can also provide the [`Thread`](./ThreadComponent.mdx) component to use message [threads](https://getstream.io/chat/docs/javascript/threads/?language=javascript).\n */\n@Component({\n selector: 'stream-channel',\n templateUrl: './channel.component.html',\n styles: [],\n})\nexport class ChannelComponent {\n isError$: Observable<boolean>;\n isInitializing$: Observable<boolean>;\n isActiveThread$: Observable<boolean>;\n isActiveChannel$: Observable<boolean>;\n subscriptions: Subscription[] = [];\n theme$: Observable<string>;\n\n constructor(\n private channelService: ChannelService,\n private themeService: ThemeService,\n readonly customTemplatesService: CustomTemplatesService\n ) {\n this.isError$ = combineLatest([\n this.channelService.channelQueryState$,\n this.channelService.activeChannel$,\n ]).pipe(\n map(([state, activeChannel]) => {\n return !activeChannel && state?.state === 'error';\n })\n );\n this.isInitializing$ = combineLatest([\n this.channelService.channelQueryState$,\n this.channelService.activeChannel$,\n ]).pipe(\n map(([state, activeChannel]) => {\n return !activeChannel && state?.state === 'in-progress';\n })\n );\n this.isActiveThread$ = this.channelService.activeParentMessageId$.pipe(\n map((id) => !!id)\n );\n this.theme$ = this.themeService.theme$;\n this.isActiveChannel$ = this.channelService.activeChannel$.pipe(\n map((c) => !!c)\n );\n }\n}\n","<div\n class=\"str-chat str-chat-channel messaging str-chat__channel str-chat__theme-{{\n theme$ | async\n }}\"\n>\n <div\n class=\"str-chat__container\"\n *ngIf=\"\n (isError$ | async) === false &&\n (isInitializing$ | async) === false &&\n (isActiveChannel$ | async) === true;\n else noChannel\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.editMessageFormTemplate$ | async) ||\n defaultEditMessageForm\n \"\n ></ng-container>\n <ng-template #defaultEditMessageForm>\n <stream-edit-message-form></stream-edit-message-form>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageBouncePromptTemplate$ | async) ||\n defaultMessageBouncePrompt\n \"\n ></ng-container>\n <ng-template #defaultMessageBouncePrompt>\n <stream-message-bounce-prompt></stream-message-bounce-prompt>\n </ng-template>\n <div class=\"str-chat__main-panel\">\n <ng-content></ng-content>\n </div>\n <ng-content\n *ngIf=\"isActiveThread$ | async\"\n select='[name=\"thread\"]'\n ></ng-content>\n </div>\n <ng-template #noChannel>\n <div\n class=\"str-chat__empty-channel\"\n *ngIf=\"\n (isInitializing$ | async) === false &&\n ((isError$ | async) === true || (isActiveChannel$ | async) === false)\n \"\n >\n <stream-icon icon=\"chat-bubble\"></stream-icon>\n <p class=\"str-chat__empty-channel-text\">\n {{ \"streamChat.No chats here yet…\" | translate }}\n </p>\n <div class=\"str-chat__empty-channel-notifications\">\n <stream-notification-list></stream-notification-list>\n </div>\n </div>\n <div\n *ngIf=\"\n (isInitializing$ | async) === true &&\n (isError$ | async) === false &&\n (isActiveChannel$ | async) === false\n \"\n class=\"str-chat__loading-channel\"\n >\n <div class=\"str-chat__loading-channel-header\">\n <div class=\"str-chat__loading-channel-header-avatar\"></div>\n <div class=\"str-chat__loading-channel-header-end\">\n <div class=\"str-chat__loading-channel-header-name\"></div>\n <div class=\"str-chat__loading-channel-header-info\"></div>\n </div>\n </div>\n <div class=\"str-chat__loading-channel-message-list\">\n <div class=\"str-chat__loading-channel-message\">\n <div class=\"str-chat__loading-channel-message-avatar\"></div>\n <div class=\"str-chat__loading-channel-message-end\">\n <div class=\"str-chat__loading-channel-message-sender\"></div>\n <div class=\"str-chat__loading-channel-message-last-row\">\n <div class=\"str-chat__loading-channel-message-text\"></div>\n <div class=\"str-chat__loading-channel-message-date\"></div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__loading-channel-message\">\n <div class=\"str-chat__loading-channel-message-avatar\"></div>\n <div class=\"str-chat__loading-channel-message-end\">\n <div class=\"str-chat__loading-channel-message-sender\"></div>\n <div class=\"str-chat__loading-channel-message-last-row\">\n <div class=\"str-chat__loading-channel-message-text\"></div>\n <div class=\"str-chat__loading-channel-message-date\"></div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__loading-channel-message\">\n <div class=\"str-chat__loading-channel-message-avatar\"></div>\n <div class=\"str-chat__loading-channel-message-end\">\n <div class=\"str-chat__loading-channel-message-sender\"></div>\n <div class=\"str-chat__loading-channel-message-last-row\">\n <div class=\"str-chat__loading-channel-message-text\"></div>\n <div class=\"str-chat__loading-channel-message-date\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__loading-channel-message-input-row\">\n <div class=\"str-chat__loading-channel-message-input\"></div>\n <div class=\"str-chat__loading-channel-message-send\"></div>\n </div>\n </div>\n </ng-template>\n</div>\n","import { UserResponse } from 'stream-chat';\n\nexport const listUsers = (users: UserResponse[]) => {\n let outStr = '';\n\n const slicedArr = users.map((item) => item.name || item.id).slice(0, 5);\n const restLength = users.length - slicedArr.length;\n\n const commaSeparatedUsers = slicedArr.join(', ');\n outStr = commaSeparatedUsers;\n if (restLength > 0) {\n outStr += ` +${restLength}`;\n }\n\n return outStr;\n};\n","import { Channel, UserResponse } from 'stream-chat';\nimport { listUsers } from './list-users';\nimport { DefaultStreamChatGenerics } from './types';\n\nexport const getChannelDisplayText = (\n channel: Channel<DefaultStreamChatGenerics>,\n currentUser: UserResponse<DefaultStreamChatGenerics>\n) => {\n if (channel.data?.name) {\n return channel.data.name;\n }\n if (channel.state.members && Object.keys(channel.state.members).length > 0) {\n const members = Object.values(channel.state.members)\n .map((m) => m.user || { id: m.user_id! })\n .filter((m) => m.id !== currentUser?.id);\n return listUsers(members);\n }\n return channel.id;\n};\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { distinctUntilChanged, filter, first } from 'rxjs/operators';\n\n/**\n * The `ChannelListToggleService` can be used to toggle the channel list.\n *\n * @deprecated This service can only be used with [theming-v1](../concepts/theming-and-css.mdx), if you are using [thmeing-v2](../theming/introduction.mdx) please refer to our [responsive layout guide](../code-examples/responsive-layout.mdx)\n */\n@Injectable({ providedIn: 'root' })\nexport class ChannelListToggleService {\n /**\n * Emits `true` if the channel list is in open state, otherwise it emits `false`\n */\n isOpen$: Observable<boolean>;\n private isOpenSubject = new BehaviorSubject<boolean>(false);\n private menuElement: HTMLElement | undefined;\n\n constructor() {\n this.isOpen$ = this.isOpenSubject\n .asObservable()\n .pipe(distinctUntilChanged());\n this.isOpen$.pipe(filter((s) => s)).subscribe(() => {\n this.watchForOutsideClicks();\n });\n }\n\n /**\n * Opens the channel list.\n */\n open() {\n this.isOpenSubject.next(true);\n }\n\n /**\n * Closes the channel list.\n */\n close() {\n this.isOpenSubject.next(false);\n }\n\n /**\n * Opens the channel list if it was closed, and closes if it was opened.\n */\n toggle() {\n this.isOpenSubject.getValue() ? this.close() : this.open();\n }\n\n /**\n * Sets the channel list element, on mobile screen size if the user opens the channel list, and clicks outside, the service automatically closes the channel list if a reference to the HTML element is provided.\n * @param element\n */\n setMenuElement(element: HTMLElement | undefined) {\n this.menuElement = element;\n }\n\n /**\n * This method should be called if a channel was selected, if on mobile, the channel list will be closed.\n */\n channelSelected() {\n this.close();\n }\n\n private watchForOutsideClicks() {\n if (!this.menuElement) {\n return;\n }\n const eventHandler = (event: Event) => {\n if (!this.menuElement!.contains(event.target as Node)) {\n this.close();\n window.removeEventListener('click', eventHandler);\n }\n };\n window.addEventListener('click', eventHandler);\n this.isOpen$\n .pipe(\n filter((s) => !s),\n first()\n )\n .subscribe(() => window.removeEventListener('click', eventHandler));\n }\n}\n","import {\n ChangeDetectorRef,\n Component,\n OnDestroy,\n OnInit,\n TemplateRef,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { Channel } from 'stream-chat';\nimport { ChannelListToggleService } from '../channel-list/channel-list-toggle.service';\nimport { ChannelService } from '../channel.service';\nimport { ChatClientService } from '../chat-client.service';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { getChannelDisplayText } from '../get-channel-display-text';\nimport {\n ChannelActionsContext,\n ChannelHeaderInfoContext,\n DefaultStreamChatGenerics,\n} from '../types';\n\n/**\n * The `ChannelHeader` component displays the avatar and name of the currently active channel along with member and watcher information. You can read about [the difference between members and watchers](https://getstream.io/chat/docs/javascript/watch_channel/?language=javascript#watchers-vs-members) in the platform documentation. Please note that number of watchers is only displayed if the user has [`connect-events` capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript)\n */\n@Component({\n selector: 'stream-channel-header',\n templateUrl: './channel-header.component.html',\n styles: [],\n})\nexport class ChannelHeaderComponent implements OnInit, OnDestroy {\n channelActionsTemplate?: TemplateRef<ChannelActionsContext>;\n channelHeaderInfoTemplate?: TemplateRef<ChannelHeaderInfoContext>;\n activeChannel: Channel<DefaultStreamChatGenerics> | undefined;\n canReceiveConnectEvents: boolean | undefined;\n private subscriptions: Subscription[] = [];\n\n constructor(\n private channelService: ChannelService,\n private channelListToggleService: ChannelListToggleService,\n private customTemplatesService: CustomTemplatesService,\n private cdRef: ChangeDetectorRef,\n private chatClientService: ChatClientService\n ) {\n this.channelService.activeChannel$.subscribe((c) => {\n this.activeChannel = c;\n const capabilities = this.activeChannel?.data\n ?.own_capabilities as string[];\n if (!capabilities) {\n return;\n }\n this.canReceiveConnectEvents =\n capabilities.indexOf('connect-events') !== -1;\n });\n }\n ngOnInit(): void {\n this.subscriptions.push(\n this.customTemplatesService.channelActionsTemplate$.subscribe(\n (template) => {\n this.channelActionsTemplate = template;\n this.cdRef.detectChanges();\n }\n )\n );\n this.subscriptions.push(\n this.customTemplatesService.channelHeaderInfoTemplate$.subscribe(\n (template) => {\n this.channelHeaderInfoTemplate = template;\n this.cdRef.detectChanges();\n }\n )\n );\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n toggleMenu(event: Event) {\n event.stopPropagation();\n this.channelListToggleService.toggle();\n }\n\n getChannelActionsContext(): ChannelActionsContext {\n return { channel: this.activeChannel! };\n }\n\n getChannelInfoContext(): ChannelHeaderInfoContext {\n return { channel: this.activeChannel! };\n }\n\n get memberCountParam() {\n return { memberCount: this.activeChannel?.data?.member_count || 0 };\n }\n\n get watcherCountParam() {\n return { watcherCount: this.activeChannel?.state?.watcher_count || 0 };\n }\n\n get displayText() {\n if (!this.activeChannel) {\n return '';\n }\n return getChannelDisplayText(\n this.activeChannel,\n this.chatClientService.chatClient.user!\n );\n }\n\n get avatarName() {\n return this.activeChannel?.data?.name;\n }\n}\n","<div class=\"str-chat__header-livestream str-chat__channel-header\">\n <div\n class=\"str-chat__header-hamburger\"\n (click)=\"toggleMenu($event)\"\n (keyup.enter)=\"toggleMenu($event)\"\n >\n <stream-icon-placeholder icon=\"menu\"></stream-icon-placeholder>\n </div>\n <ng-content></ng-content>\n <stream-avatar-placeholder\n imageUrl=\"{{ activeChannel?.data?.image }}\"\n name=\"{{ avatarName }}\"\n type=\"channel\"\n location=\"channel-header\"\n [channel]=\"activeChannel\"\n [size]=\"40\"\n ></stream-avatar-placeholder>\n <div class=\"str-chat__header-livestream-left str-chat__channel-header-end\">\n <p\n data-testid=\"name\"\n class=\"\n str-chat__header-livestream-left--title str-chat__channel-header-title\n \"\n >\n {{ displayText }}\n </p>\n <ng-container\n *ngTemplateOutlet=\"\n channelHeaderInfoTemplate || defaultChannelInfo;\n context: getChannelInfoContext()\n \"\n ></ng-container>\n <ng-template #defaultChannelInfo>\n <p\n data-testid=\"info\"\n class=\"\n str-chat__header-livestream-left--members\n str-chat__channel-header-info\n \"\n >\n {{'streamChat.{{ memberCount }} members' | translate:memberCountParam}}\n {{canReceiveConnectEvents ? ('streamChat.{{ watcherCount }} online' |\n translate:watcherCountParam) : ''}}\n </p>\n </ng-template>\n </div>\n <ng-container *ngIf=\"channelActionsTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n channelActionsTemplate;\n context: getChannelActionsContext()\n \"\n ></ng-container>\n </ng-container>\n</div>\n","export const isOnSeparateDate = (date1: Date, date2: Date) => {\n if (date1.getDate() !== date2.getDate()) {\n return true;\n } else if (\n date1.getFullYear() !== date2.getFullYear() ||\n date1.getMonth() !== date2.getMonth()\n ) {\n return true;\n }\n return false;\n};\n","import { Injectable } from '@angular/core';\n\n/**\n * The message service contains configuration options related to displaying the message content\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MessageService {\n /**\n * Decides if the message content should be formatted as text or HTML\n *\n * If you display messages as text the following parts are still be displayed as HTML:\n * - user mentions -> you can customize this with your own template using the [`customTemplatesService.mentionTemplate$`](https://getstream.io/chat/docs/sdk/angular/services/CustomTemplatesService/#mentiontemplate)\n * - links -> you can customize this by providing you own [`customLinkRenderer`](#customlinkrenderer) method\n */\n displayAs: 'text' | 'html' = 'text';\n\n /**\n * You can provide a custom method to display links\n *\n * @param url the url the link should refer to\n * @returns the HTML markup as a string for the link\n */\n customLinkRenderer?: (url: string) => string;\n\n constructor() {}\n}\n","import Dayjs from 'dayjs';\nimport calendar from 'dayjs/plugin/calendar';\nimport relativeTime from 'dayjs/plugin/relativeTime';\n\nDayjs.extend(calendar);\nDayjs.extend(relativeTime);\n\nexport const parseDate = (\n date: Date,\n format: 'date' | 'date-time' | 'time' = 'date-time'\n) => {\n const parsedTime = Dayjs(date);\n\n switch (format) {\n case 'date': {\n return parsedTime.calendar(null, {\n sameDay: '[Today]', // The same day ( Today at 2:30 AM )\n nextDay: '[Tomorrow]', // The next day ( Tomorrow at 2:30 AM )\n nextWeek: 'dddd', // The next week ( Sunday at 2:30 AM )\n lastDay: '[Yesterday]', // The day before ( Yesterday at 2:30 AM )\n lastWeek: '[Last] dddd', // Last week ( Last Monday at 2:30 AM )\n sameElse: 'MM/DD/YYYY', // Everything else ( 10/17/2011 )\n });\n }\n case 'date-time': {\n return parsedTime.calendar();\n }\n case 'time': {\n return parsedTime.format('h:mm A');\n }\n }\n};\n","import { Injectable } from '@angular/core';\nimport { parseDate } from './parse-date';\n\n/**\n * The `DateParserService` parses dates into user-friendly string representations.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DateParserService {\n /**\n * Custom parser to override `parseTime`\n */\n customTimeParser?: (date: Date) => string;\n /**\n * Custom parser to override `parseDate`\n */\n customDateParser?: (date: Date) => string;\n /**\n * Custom parser to override `parseDateTime`\n */\n customDateTimeParser?: (date: Date) => string;\n\n constructor() {}\n\n /**\n * Return a user-friendly string representation of the time\n * @param date\n * @returns The parsed time\n */\n parseTime(date: Date) {\n if (this.customTimeParser) {\n return this.customTimeParser(date);\n }\n return parseDate(date, 'time');\n }\n\n /**\n * Return a user-friendly string representation of the date (year, month and date)\n * @param date\n * @returns The parsed date\n */\n parseDate(date: Date) {\n if (this.customDateParser) {\n return this.customDateParser(date);\n }\n return parseDate(date, 'date');\n }\n\n /**\n * Return a user-friendly string representation of the date and time\n * @param date\n * @returns The parsed date\n */\n parseDateTime(date: Date) {\n if (this.customDateTimeParser) {\n return this.customDateTimeParser(date);\n }\n return parseDate(date, 'date-time');\n }\n}\n","import { Component, Input, NgZone, OnDestroy, OnInit } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { filter } from 'rxjs/operators';\nimport { Channel, Event, FormatMessageResponse } from 'stream-chat';\nimport { ChannelService } from '../channel.service';\nimport { getChannelDisplayText } from '../get-channel-display-text';\nimport { DefaultStreamChatGenerics } from '../types';\nimport { ChatClientService } from '../chat-client.service';\nimport { getMessageTranslation } from '../get-message-translation';\nimport { MessageService } from '../message.service';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { getReadBy } from '../read-by';\nimport { isOnSeparateDate } from '../is-on-separate-date';\nimport { DateParserService } from '../date-parser.service';\n\n/**\n * The `ChannelPreview` component displays a channel preview in the channel list, it consists of the image, name and latest message of the channel.\n */\n@Component({\n selector: 'stream-channel-preview',\n templateUrl: './channel-preview.component.html',\n styles: [],\n})\nexport class ChannelPreviewComponent implements OnInit, OnDestroy {\n /**\n * The channel to be displayed\n */\n @Input() channel: Channel<DefaultStreamChatGenerics> | undefined;\n isActive = false;\n isUnreadMessageWasCalled = false;\n isUnread = false;\n unreadCount: number | undefined;\n latestMessageText: string = 'streamChat.Nothing yet...';\n latestMessageStatus?: 'delivered' | 'read';\n latestMessageTime?: string;\n latestMessage?: FormatMessageResponse<DefaultStreamChatGenerics>;\n displayAs: 'text' | 'html';\n userId?: string;\n private subscriptions: (Subscription | { unsubscribe: () => void })[] = [];\n private canSendReadEvents = true;\n\n constructor(\n private channelService: ChannelService,\n private ngZone: NgZone,\n private chatClientService: ChatClientService,\n messageService: MessageService,\n public customTemplatesService: CustomTemplatesService,\n private dateParser: DateParserService\n ) {\n this.displayAs = messageService.displayAs;\n }\n\n ngOnInit(): void {\n this.subscriptions.push(\n this.chatClientService.user$.subscribe((user) => {\n if (user?.id !== this.userId) {\n this.userId = user?.id;\n }\n })\n );\n this.subscriptions.push(\n this.channelService.activeChannel$.subscribe(\n (activeChannel) =>\n (this.isActive = activeChannel?.id === this.channel?.id)\n )\n );\n const messages = this.channel?.state?.latestMessages;\n if (messages && messages.length > 0) {\n this.setLatestMessage(messages[messages.length - 1]);\n }\n this.updateUnreadState();\n const capabilities =\n (this.channel?.data?.own_capabilities as string[]) || [];\n this.canSendReadEvents = capabilities.indexOf('read-events') !== -1;\n this.subscriptions.push(\n this.channel!.on('message.new', this.handleMessageEvent.bind(this))\n );\n this.subscriptions.push(\n this.channel!.on('message.updated', this.handleMessageEvent.bind(this))\n );\n this.subscriptions.push(\n this.channel!.on('message.deleted', this.handleMessageEvent.bind(this))\n );\n this.subscriptions.push(\n this.channel!.on('channel.truncated', this.handleMessageEvent.bind(this))\n );\n this.subscriptions.push(\n this.channel!.on('message.read', () =>\n this.ngZone.run(() => {\n this.isUnreadMessageWasCalled = false;\n this.updateUnreadState();\n })\n )\n );\n this.subscriptions.push(\n this.chatClientService.events$\n .pipe(\n filter(\n (e) =>\n e.eventType === 'notification.mark_unread' &&\n this.channel!.id === e.event?.channel_id\n )\n )\n .subscribe(() => {\n this.ngZone.run(() => {\n this.isUnreadMessageWasCalled = true;\n this.updateUnreadState();\n });\n })\n );\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n get avatarImage() {\n return this.channel?.data?.image;\n }\n\n get avatarName() {\n return this.channel?.data?.name;\n }\n\n get title() {\n if (!this.channel) {\n return '';\n }\n return getChannelDisplayText(\n this.channel,\n this.chatClientService.chatClient.user!\n );\n }\n\n setAsActiveChannel(): void {\n void this.channelService.setAsActiveChannel(this.channel!);\n }\n\n private handleMessageEvent(event: Event) {\n this.ngZone.run(() => {\n if (this.channel?.state.latestMessages.length === 0) {\n this.latestMessage = undefined;\n this.latestMessageStatus = undefined;\n this.latestMessageText = 'streamChat.Nothing yet...';\n this.latestMessageTime = undefined;\n return;\n }\n const latestMessage =\n this.channel?.state.latestMessages[\n this.channel?.state.latestMessages.length - 1\n ];\n if (!event.message || latestMessage?.id !== event.message.id) {\n return;\n }\n this.setLatestMessage(latestMessage);\n this.updateUnreadState();\n });\n }\n\n private setLatestMessage(\n message?: FormatMessageResponse<DefaultStreamChatGenerics>\n ) {\n this.latestMessage = message;\n if (message?.deleted_at) {\n this.latestMessageText = 'streamChat.Message deleted';\n } else if (message?.text) {\n this.latestMessageText =\n getMessageTranslation(\n message,\n this.channel,\n this.chatClientService.chatClient.user\n ) || message.text;\n } else if (message?.attachments && message.attachments.length) {\n this.latestMessageText = 'streamChat.🏙 Attachment...';\n }\n if (this.latestMessage && this.latestMessage.type === 'regular') {\n this.latestMessageTime = isOnSeparateDate(\n new Date(),\n this.latestMessage.created_at\n )\n ? this.dateParser.parseDate(this.latestMessage.created_at)\n : this.dateParser.parseTime(this.latestMessage.created_at);\n } else {\n this.latestMessageTime = undefined;\n }\n }\n\n private updateUnreadState() {\n if (\n this.channel &&\n this.latestMessage &&\n this.latestMessage.user?.id === this.userId &&\n this.latestMessage.status === 'received' &&\n this.latestMessage.type === 'regular'\n ) {\n this.latestMessageStatus =\n getReadBy(this.latestMessage, this.channel).length > 0\n ? 'read'\n : 'delivered';\n } else {\n this.latestMessageStatus = undefined;\n }\n if (\n (this.isActive && !this.isUnreadMessageWasCalled) ||\n !this.canSendReadEvents\n ) {\n this.unreadCount = 0;\n this.isUnread = false;\n return;\n }\n this.unreadCount = this.channel!.countUnread();\n this.isUnread = !!this.unreadCount;\n }\n}\n","<button\n class=\"str-chat__channel-preview-messenger str-chat__channel-preview\"\n [class.str-chat__channel-preview-messenger--active]=\"isActive\"\n [class.str-chat__channel-preview--active]=\"isActive\"\n [class.str-chat__channel-preview-messenger--unread]=\"isUnread\"\n (click)=\"setAsActiveChannel()\"\n data-testid=\"channel-preview-container\"\n>\n <div class=\"str-chat__channel-preview-messenger--left\">\n <stream-avatar-placeholder\n name=\"{{ avatarName }}\"\n imageUrl=\"{{ avatarImage }}\"\n type=\"channel\"\n [channel]=\"channel\"\n location=\"channel-preview\"\n [size]=\"49\"\n ></stream-avatar-placeholder>\n </div>\n <div\n class=\"\n str-chat__channel-preview-messenger--right str-chat__channel-preview-end\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.channelPreviewInfoTemplate$ | async) ||\n defaultChannelInfo;\n context: {\n channelDisplayTitle: title,\n channel: channel,\n unreadCount: unreadCount,\n latestMessageText: latestMessageText,\n latestMessageStatus: latestMessageStatus,\n latestMessageTime: latestMessageTime,\n latestMessage: latestMessage\n }\n \"\n ></ng-container>\n <ng-template\n #defaultChannelInfo\n let-channelDisplayTitle=\"channelDisplayTitle\"\n let-unreadCount=\"unreadCount\"\n let-latestMessageText=\"latestMessageText\"\n let-latestMessageStatus=\"latestMessageStatus\"\n let-latestMessageTime=\"latestMessageTime\"\n >\n <div class=\"str-chat__channel-preview-end-first-row\">\n <div class=\"str-chat__channel-preview-messenger--name\">\n <span data-testid=\"channel-preview-title\">{{\n channelDisplayTitle\n }}</span>\n </div>\n <div\n data-testid=\"unread-badge\"\n *ngIf=\"unreadCount\"\n class=\"str-chat__channel-preview-unread-badge\"\n >\n {{ unreadCount }}\n </div>\n </div>\n <div class=\"str-chat__channel-preview-end-second-row\">\n <div\n data-testid=\"latest-message\"\n class=\"str-chat__channel-preview-messenger--last-message\"\n >\n <ng-container *ngIf=\"displayAs === 'text'; else asHTML\">\n {{ latestMessageText | translate }}\n </ng-container>\n <ng-template #asHTML>\n <span\n data-testid=\"html-content\"\n [innerHTML]=\"latestMessageText | translate\"\n ></span>\n </ng-template>\n </div>\n <div\n data-testid=\"latest-message-status\"\n *ngIf=\"latestMessageStatus\"\n class=\"str-chat__channel-preview-messenger--status str-chat__channel-preview-messenger--status-{{\n latestMessageStatus\n }}\"\n >\n <stream-icon-placeholder\n [icon]=\"\n latestMessageStatus === 'delivered'\n ? 'delivered-icon'\n : 'read-icon'\n \"\n ></stream-icon-placeholder>\n </div>\n <div\n data-testid=\"latest-message-time\"\n class=\"str-chat__channel-preview-messenger--time\"\n *ngIf=\"latestMessageTime\"\n >\n {{ latestMessageTime }}\n </div>\n </div>\n </ng-template>\n </div>\n</button>\n","import {\n AfterViewInit,\n Component,\n ElementRef,\n OnDestroy,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { Observable, Subscription } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { Channel } from 'stream-chat';\nimport { ChannelService } from '../channel.service';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { ThemeService } from '../theme.service';\nimport { ChannelPreviewContext, DefaultStreamChatGenerics } from '../types';\nimport { ChannelListToggleService } from './channel-list-toggle.service';\n\n/**\n * The `ChannelList` component renders the list of channels.\n */\n@Component({\n selector: 'stream-channel-list',\n templateUrl: './channel-list.component.html',\n styles: [],\n})\nexport class ChannelListComponent implements AfterViewInit, OnDestroy {\n channels$: Observable<Channel<DefaultStreamChatGenerics>[] | undefined>;\n isError$: Observable<boolean>;\n isInitializing$: Observable<boolean>;\n isLoadingMoreChannels = false;\n isOpen$: Observable<boolean>;\n hasMoreChannels$: Observable<boolean>;\n customChannelPreviewTemplate: TemplateRef<ChannelPreviewContext> | undefined;\n theme$: Observable<string>;\n subscriptions: Subscription[] = [];\n @ViewChild('container') private container!: ElementRef<HTMLElement>;\n\n constructor(\n private channelService: ChannelService,\n private channelListToggleService: ChannelListToggleService,\n private customTemplatesService: CustomTemplatesService,\n private themeService: ThemeService\n ) {\n this.theme$ = this.themeService.theme$;\n this.isOpen$ = this.channelListToggleService.isOpen$;\n this.channels$ = this.channelService.channels$;\n this.hasMoreChannels$ = this.channelService.hasMoreChannels$;\n this.isError$ = this.channelService.channelQueryState$.pipe(\n map((s) => !this.isLoadingMoreChannels && s?.state === 'error')\n );\n this.isInitializing$ = this.channelService.channelQueryState$.pipe(\n map((s) => !this.isLoadingMoreChannels && s?.state === 'in-progress')\n );\n this.subscriptions.push(\n this.customTemplatesService.channelPreviewTemplate$.subscribe(\n (template) => (this.customChannelPreviewTemplate = template)\n )\n );\n }\n ngAfterViewInit(): void {\n this.channelListToggleService.setMenuElement(this.container.nativeElement);\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n async loadMoreChannels() {\n this.isLoadingMoreChannels = true;\n await this.channelService.loadMoreChannels();\n this.isLoadingMoreChannels = false;\n }\n\n trackByChannelId(index: number, item: Channel<DefaultStreamChatGenerics>) {\n return item.cid;\n }\n\n channelSelected() {\n this.channelListToggleService.channelSelected();\n }\n}\n","<div\n #container\n data-testid=\"channel-list-container\"\n class=\"str-chat str-chat__channel-list str-chat-channel-list messaging str-chat__theme-{{\n theme$ | async\n }}\"\n [class.str-chat-channel-list--open]=\"(isOpen$ | async) === true\"\n>\n <div\n *ngIf=\"\n (isError$ | async) === false && (isInitializing$ | async) === false;\n else statusIndicator\n \"\n class=\"str-chat__channel-list-messenger\"\n >\n <div class=\"str-chat__channel-list-messenger__main\">\n <ng-content select=\"[channel-list-top]\"></ng-content>\n <div\n class=\"str-chat__channel-list-empty\"\n *ngIf=\"!(channels$ | async)?.length\"\n >\n <stream-icon icon=\"chat-bubble\"></stream-icon>\n <p data-testid=\"empty-channel-list-indicator\">\n {{ \"streamChat.You have no channels currently\" | translate }}\n </p>\n </div>\n <p\n *ngIf=\"!(channels$ | async)?.length\"\n class=\"str-chat__channel-list-empty-v1\"\n data-testid=\"empty-channel-list-indicator\"\n >\n {{ \"streamChat.You have no channels currently\" | translate }}\n </p>\n <ng-container\n *ngFor=\"let channel of channels$ | async; trackBy: trackByChannelId\"\n >\n <ng-template #defaultTemplate let-channelInput=\"channel\">\n <stream-channel-preview\n data-testclass=\"channel-preview\"\n [channel]=\"channelInput\"\n ></stream-channel-preview>\n </ng-template>\n <div (click)=\"channelSelected()\" (keyup.enter)=\"channelSelected()\">\n <ng-container\n *ngTemplateOutlet=\"\n customChannelPreviewTemplate || defaultTemplate;\n context: { channel: channel }\n \"\n ></ng-container>\n </div>\n </ng-container>\n <div\n *ngIf=\"hasMoreChannels$ | async\"\n class=\"str-chat__load-more-button\"\n (click)=\"loadMoreChannels()\"\n (keyup.enter)=\"loadMoreChannels()\"\n data-testid=\"load-more\"\n >\n <button\n class=\"str-chat__load-more-button__button str-chat__cta-button\"\n data-testid=\"load-more-button\"\n [disabled]=\"isLoadingMoreChannels\"\n >\n <span *ngIf=\"!isLoadingMoreChannels; else loadingIndicator\">{{\n \"Load more\" | translate\n }}</span>\n <ng-template #loadingIndicator\n ><stream-loading-indicator-placeholder></stream-loading-indicator-placeholder\n ></ng-template>\n </button>\n </div>\n <ng-content select=\"[channel-list-bottom]\"></ng-content>\n </div>\n </div>\n</div>\n\n<ng-template #statusIndicator>\n <ng-container *ngIf=\"isError$ | async\">\n <ng-container *ngTemplateOutlet=\"chatDown\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"isInitializing$ | async\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #chatDown>\n <div data-testid=\"chatdown-container\" class=\"str-chat__down\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n <div class=\"str-chat__down-main\">\n <stream-icon-placeholder\n icon=\"connection-error\"\n ></stream-icon-placeholder>\n <h1>{{ \"streamChat.Connection error\" | translate }}</h1>\n <h3>\n {{\n \"streamChat.Error connecting to chat, refresh the page to try again.\"\n | translate\n }}\n </h3>\n </div>\n </div>\n</ng-template>\n\n<ng-template #loadingChannels>\n <div data-testid=\"loading-indicator\" class=\"str-chat__loading-channels\">\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #loadingChannel>\n <div\n class=\"str-chat__loading-channels-item str-chat__channel-preview-loading\"\n >\n <div class=\"str-chat__loading-channels-avatar\"></div>\n <div\n class=\"\n str-chat__loading-channels-meta str-chat__channel-preview-end-loading\n \"\n >\n <div class=\"str-chat__loading-channels-username\"></div>\n <div class=\"str-chat__loading-channels-status\"></div>\n </div>\n </div>\n</ng-template>\n","import { Injectable } from '@angular/core';\nimport { MessageReactionClickDetails, MessageReactionType } from './types';\nimport { BehaviorSubject } from 'rxjs';\n\n/**\n * The `MessageReactionsService` provides customization options to message [reactions](https://getstream.io/chat/docs/javascript/send_reaction/?language=javascript).\n *\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MessageReactionsService {\n /**\n * The enabled [reactions](https://getstream.io/chat/docs/javascript/send_reaction/?language=javascript) and the associated emoji\n *\n * You can provide any string as a reaction. The emoji can be provided as a string, if you want to use custom images for reactions you have to provide a [custom reactions UI](../../services/CustomTemplatesService/#messagereactionstemplate)\n */\n reactions$ = new BehaviorSubject<{ [key in MessageReactionType]: string }>({\n like: '👍',\n angry: '😠',\n love: '❤️',\n haha: '😂',\n wow: '😮',\n sad: '😞',\n });\n /**\n * By default the [`MessageReactionsComponent`](../../components/MessageReactionsComponent) will display the reacting users when a reaction is clicked. You can override this with your own UI by providing a custom event handler.\n *\n * The event handler can retrieve all reactions of a message inside the active channel using the [`channelService.getMessageReactions` method](../../services/ChannelService/#getmessagereactions)\n */\n customReactionClickHandler?: (details: MessageReactionClickDetails) => void;\n\n constructor() {}\n\n /**\n * Sets the enabled reactions\n */\n set reactions(reactions: { [key in MessageReactionType]: string }) {\n this.reactions$.next(reactions);\n }\n\n /**\n * Get the currently enabled reactions\n */\n get reactions() {\n return this.reactions$.getValue();\n }\n}\n","import {\n AfterViewChecked,\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\nimport { ReactionResponse, UserResponse } from 'stream-chat';\nimport { ChannelService } from '../channel.service';\nimport { MessageReactionType, DefaultStreamChatGenerics } from '../types';\nimport { NgxPopperjsTriggers, NgxPopperjsPlacements } from 'ngx-popperjs';\nimport { MessageReactionsService } from '../message-reactions.service';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { ThemeService } from '../theme.service';\nimport { Subscription } from 'rxjs';\n\n/**\n * The `MessageReactions` component displays the reactions of a message, the current user can add and remove reactions. You can read more about [message reactions](https://getstream.io/chat/docs/javascript/send_reaction/?language=javascript) in the platform documentation.\n */\n@Component({\n selector: 'stream-message-reactions',\n templateUrl: './message-reactions.component.html',\n})\nexport class MessageReactionsComponent\n implements AfterViewChecked, OnChanges, OnInit, AfterViewInit, OnDestroy\n{\n /**\n * The id of the message the reactions belong to\n */\n @Input() messageId: string | undefined;\n /**\n * The number of reactions grouped by [reaction types](https://github.com/GetStream/stream-chat-angular/tree/master/projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.ts)\n */\n @Input() messageReactionCounts: { [key in MessageReactionType]?: number } =\n {};\n /**\n * Indicates if the selector should be opened or closed. Adding a UI element to open and close the selector is the parent's component responsibility.\n */\n @Input() isSelectorOpen: boolean = false;\n /**\n * List of reactions of a [message](../types/stream-message.mdx), used to display the users of a reaction type.\n */\n @Input() latestReactions: ReactionResponse<DefaultStreamChatGenerics>[] = [];\n /**\n * List of the user's own reactions of a [message](../types/stream-message.mdx), used to display the users of a reaction type.\n */\n @Input() ownReactions: ReactionResponse<DefaultStreamChatGenerics>[] = [];\n /**\n * Indicates if the selector should be opened or closed. Adding a UI element to open and close the selector is the parent's component responsibility.\n */\n @Output() readonly isSelectorOpenChange = new EventEmitter<boolean>();\n tooltipPositions: { arrow: number; tooltip: number } | undefined;\n tooltipText: string | undefined;\n @ViewChild('selectorContainer') private selectorContainer:\n | ElementRef<HTMLElement>\n | undefined;\n @ViewChild('selectorTooltip') private selectorTooltip:\n | ElementRef<HTMLElement>\n | undefined;\n currentTooltipTarget: HTMLElement | undefined;\n popperTriggerHover = NgxPopperjsTriggers.hover;\n popperPlacementAuto = NgxPopperjsPlacements.AUTO;\n selectedReactionType: string | undefined;\n isLoading = true;\n reactions: ReactionResponse[] = [];\n shouldHandleReactionClick = true;\n existingReactions: string[] = [];\n reactionsCount: number = 0;\n reactionOptions: string[] = [];\n private subscriptions: Subscription[] = [];\n private isViewInited = false;\n\n constructor(\n private cdRef: ChangeDetectorRef,\n private channelService: ChannelService,\n private messageReactionsService: MessageReactionsService,\n public customTemplatesService: CustomTemplatesService,\n private themeService: ThemeService\n ) {}\n\n ngOnInit(): void {\n this.subscriptions.push(\n this.messageReactionsService.reactions$.subscribe((reactions) => {\n this.reactionOptions = Object.keys(reactions);\n this.setExistingReactions();\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n })\n );\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes.isSelectorOpen) {\n this.isSelectorOpen\n ? setTimeout(() => this.watchForOutsideClicks()) // setTimeout: wait for current click to bubble up, and only watch for clicks after that\n : this.stopWatchForOutsideClicks();\n }\n if (changes.messageReactionCounts) {\n this.setExistingReactions();\n }\n if (changes.messageReactionCounts && this.messageReactionCounts) {\n const reactionsCount = Object.keys(this.messageReactionCounts).reduce(\n (acc, key) => acc + (this.messageReactionCounts[key] || 0),\n 0\n );\n this.shouldHandleReactionClick =\n reactionsCount <= ChannelService.MAX_MESSAGE_REACTIONS_TO_FETCH ||\n !!this.messageReactionsService.customReactionClickHandler;\n }\n }\n\n ngAfterViewInit(): void {\n this.isViewInited = true;\n }\n\n ngAfterViewChecked(): void {\n if (this.tooltipText && !this.tooltipPositions) {\n this.setTooltipPosition();\n this.cdRef.detectChanges();\n }\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n getLatestUserByReaction(reactionType: MessageReactionType) {\n return this.latestReactions.find((r) => r.type === reactionType && r.user)\n ?.user;\n }\n\n getEmojiByReaction(reactionType: MessageReactionType) {\n return this.messageReactionsService.reactions[reactionType];\n }\n\n reactionSelected(reactionType: string) {\n if (!this.shouldHandleReactionClick) {\n return;\n }\n if (this.themeService.themeVersion === '1') {\n return;\n }\n if (!this.messageId) {\n return;\n }\n if (this.messageReactionsService.customReactionClickHandler) {\n this.messageReactionsService.customReactionClickHandler({\n messageId: this.messageId,\n reactionType: reactionType,\n });\n } else {\n this.selectedReactionType = reactionType;\n void this.fetchAllReactions();\n }\n }\n\n getUsersByReaction(reactionType: MessageReactionType) {\n return this.latestReactions\n .filter((r) => r.type === reactionType)\n .map((r) => r.user?.name || r.user?.id)\n .filter((i) => !!i)\n .join(', ');\n }\n\n getAllUsersByReaction(\n reactionType?: MessageReactionType\n ): UserResponse<DefaultStreamChatGenerics>[] {\n if (!reactionType) {\n return [];\n }\n\n const users = this.reactions\n .filter((r) => r.type === reactionType)\n .map((r) => r.user)\n .filter((i) => !!i) as UserResponse[];\n\n users.sort((u1, u2) => {\n const name1 = u1.name?.toLowerCase();\n const name2 = u2.name?.toLowerCase();\n\n if (!name1) {\n return 1;\n }\n\n if (!name2) {\n return -1;\n }\n\n if (name1 === name2) {\n return 0;\n }\n\n if (name1 < name2) {\n return -1;\n } else {\n return 1;\n }\n });\n\n return users;\n }\n\n showTooltip(event: Event, reactionType: MessageReactionType) {\n this.currentTooltipTarget = event.target as HTMLElement;\n this.tooltipText = this.getUsersByReaction(reactionType);\n }\n\n hideTooltip() {\n this.tooltipText = undefined;\n this.currentTooltipTarget = undefined;\n this.tooltipPositions = undefined;\n }\n\n trackByMessageReaction(index: number, item: MessageReactionType) {\n return item;\n }\n\n trackByUserId(index: number, item: UserResponse) {\n return item.id;\n }\n\n async react(type: MessageReactionType) {\n this.ownReactions.find((r) => r.type === type)\n ? await this.channelService.removeReaction(this.messageId!, type)\n : await this.channelService.addReaction(this.messageId!, type);\n this.isSelectorOpenChange.emit(false);\n }\n\n isOwnReaction(reactionType: MessageReactionType) {\n return !!this.ownReactions.find((r) => r.type === reactionType);\n }\n\n isOpenChange = (isOpen: boolean) => {\n this.selectedReactionType = isOpen ? this.selectedReactionType : undefined;\n };\n\n private eventHandler = (event: Event) => {\n if (!this.selectorContainer?.nativeElement.contains(event.target as Node)) {\n this.isSelectorOpenChange.emit(false);\n }\n };\n\n private watchForOutsideClicks() {\n window.addEventListener('click', this.eventHandler);\n }\n\n private stopWatchForOutsideClicks() {\n window.removeEventListener('click', this.eventHandler);\n }\n\n private setTooltipPosition() {\n const tooltip = this.selectorTooltip?.nativeElement.getBoundingClientRect();\n const target = this.currentTooltipTarget?.getBoundingClientRect();\n\n const container =\n this.selectorContainer?.nativeElement.getBoundingClientRect();\n\n if (!tooltip || !target || !container) return;\n\n const tooltipPosition =\n tooltip.width === container.width || tooltip.x < container.x\n ? 0\n : target.left + target.width / 2 - container.left - tooltip.width / 2;\n\n const arrowPosition =\n target.x - tooltip.x + target.width / 2 - tooltipPosition;\n\n this.tooltipPositions = {\n tooltip: tooltipPosition,\n arrow: arrowPosition,\n };\n }\n\n private async fetchAllReactions() {\n if (!this.messageId) {\n return;\n }\n this.isLoading = true;\n try {\n this.reactions = await this.channelService.getMessageReactions(\n this.messageId\n );\n } catch (error) {\n this.selectedReactionType = undefined;\n } finally {\n this.isLoading = false;\n this.cdRef.detectChanges();\n }\n }\n\n private setExistingReactions() {\n this.existingReactions = Object.keys(this.messageReactionCounts)\n .filter((k) => this.reactionOptions.indexOf(k) !== -1)\n .filter((k) => this.messageReactionCounts[k]! > 0);\n this.reactionsCount = this.existingReactions.reduce(\n (total, reaction) => total + this.messageReactionCounts[reaction]!,\n 0\n );\n }\n}\n","<div\n *ngIf=\"existingReactions.length > 0\"\n class=\"str-chat__reaction-list str-chat__message-reactions-container\"\n [class.str-chat__reaction-list--reverse]=\"true\"\n [class.str-chat__reaction-list-hidden]=\"isSelectorOpen\"\n data-testid=\"reaction-list\"\n>\n <ul class=\"str-chat__message-reactions\">\n <li\n class=\"str-chat__message-reaction\"\n *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n [ngStyle]=\"{ cursor: shouldHandleReactionClick ? 'pointer' : 'default' }\"\n [class.str-chat__message-reaction-own]=\"isOwnReaction(reactionType)\"\n data-testclass=\"emoji\"\n (click)=\"reactionSelected(reactionType)\"\n (keyup.enter)=\"reactionSelected(reactionType)\"\n >\n <span class=\"emoji str-chat__message-reaction-emoji\">\n {{ getEmojiByReaction(reactionType) }}&nbsp;\n </span>\n <span\n data-testclass=\"reaction-list-reaction-count\"\n class=\"str-chat__message-reaction-count\"\n >\n {{ messageReactionCounts[reactionType] }}\n </span>\n </li>\n <li>\n <span\n data-testid=\"reactions-count\"\n class=\"str-chat__reaction-list--counter\"\n >{{ reactionsCount }}</span\n >\n </li>\n </ul>\n</div>\n\n<div\n #selectorContainer\n class=\"str-chat__reaction-selector str-chat__message-reaction-selector\"\n *ngIf=\"isSelectorOpen\"\n data-testid=\"reaction-selector\"\n>\n <div\n *ngIf=\"tooltipText\"\n data-testid=\"tooltip\"\n #selectorTooltip\n class=\"str-chat__reaction-selector-tooltip\"\n [ngStyle]=\"{\n left: tooltipPositions?.tooltip + 'px',\n visibility: tooltipPositions ? 'visible' : 'hidden'\n }\"\n >\n <div\n class=\"arrow\"\n [ngStyle]=\"{ left: tooltipPositions?.arrow + 'px' }\"\n ></div>\n <span class=\"latest-user-username\">\n {{ tooltipText }}\n </span>\n </div>\n <ul\n class=\"str-chat__message-reactions-list str-chat__message-reactions-options\"\n >\n <li\n class=\"\n str-chat__message-reactions-option\n str-chat__message-reactions-list-item\n str-chat__emoji\n \"\n *ngFor=\"\n let reactionType of reactionOptions;\n trackBy: trackByMessageReaction\n \"\n [class.str-chat__message-reactions-option-selected]=\"\n isOwnReaction(reactionType)\n \"\n data-testclass=\"emoji-option\"\n (click)=\"react(reactionType)\"\n (keyup.enter)=\"react(reactionType)\"\n >\n <div\n *ngIf=\"getLatestUserByReaction(reactionType) as user\"\n class=\"latest-user str-chat__message-reactions-last-user\"\n (click)=\"hideTooltip()\"\n (keyup.enter)=\"hideTooltip()\"\n (mouseenter)=\"showTooltip($event, reactionType)\"\n (mouseleave)=\"hideTooltip()\"\n attr.data-testid=\"{{ reactionType }}-last-user\"\n >\n <stream-avatar-placeholder\n attr.data-testid=\"{{ reactionType }}-avatar\"\n [imageUrl]=\"user.image\"\n [name]=\"user.name || user.id\"\n [size]=\"20\"\n location=\"reaction\"\n ></stream-avatar-placeholder>\n </div>\n <span\n class=\"\n emoji\n str-chat__emoji-selector-emoji-angular\n str-chat__message-reaction-emoji\n \"\n >\n {{ getEmojiByReaction(reactionType) }}\n </span>\n <span\n *ngIf=\"\n messageReactionCounts[reactionType] &&\n messageReactionCounts[reactionType]! > 0\n \"\n class=\"str-chat__message-reactions-list-item__count\"\n attr.data-testid=\"{{ reactionType }}-reaction-count\"\n >\n {{ messageReactionCounts[reactionType] }}\n </span>\n </li>\n </ul>\n</div>\n\n<ng-container *ngIf=\"selectedReactionType\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: {\n isOpen: !!selectedReactionType,\n messageId: messageId,\n reactionType: selectedReactionType,\n isOpenChangeHandler: isOpenChange,\n content: modalContent\n }\n \"\n ></ng-container>\n</ng-container>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-messageId=\"messageId\"\n let-reactionType=\"reactionType\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n class=\"str-chat__message-reactions-details-modal\"\n [isOpen]=\"isOpen\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n [content]=\"content\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #modalContent>\n <div class=\"str-chat__message-reactions-details\">\n <div class=\"str-chat__message-reactions-details-reaction-types\">\n <div\n class=\"str-chat__message-reactions-details-reaction-type\"\n *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n [ngStyle]=\"{\n cursor: shouldHandleReactionClick ? 'pointer' : 'default'\n }\"\n attr.data-testid=\"reaction-details-selector-{{ reactionType }}\"\n [class.str-chat__message-reactions-details-reaction-type--selected]=\"\n reactionType === selectedReactionType\n \"\n (click)=\"selectedReactionType = reactionType; allUsers.scrollTop = 0\"\n (keyup.enter)=\"\n selectedReactionType = reactionType; allUsers.scrollTop = 0\n \"\n >\n <span class=\"emoji str-chat__message-reaction-emoji\">\n {{ getEmojiByReaction(reactionType) }}&nbsp;\n </span>\n <span class=\"str-chat__message-reaction-count\">\n {{ messageReactionCounts[reactionType] }}\n </span>\n </div>\n </div>\n <div\n class=\"\n emoji\n str-chat__message-reaction-emoji str-chat__message-reaction-emoji-big\n \"\n >\n {{ getEmojiByReaction(selectedReactionType!) }}\n </div>\n <div\n #allUsers\n data-testid=\"all-reacting-users\"\n class=\"str-chat__message-reactions-details-reacting-users\"\n >\n <stream-loading-indicator\n *ngIf=\"isLoading; else reactions\"\n ></stream-loading-indicator>\n <ng-template #reactions>\n <div\n class=\"str-chat__message-reactions-details-reacting-user\"\n *ngFor=\"\n let user of getAllUsersByReaction(selectedReactionType);\n trackBy: trackByUserId\n \"\n >\n <stream-avatar-placeholder\n data-testclass=\"avatar\"\n class=\"str-chat__avatar str-chat__avatar--circle\"\n [size]=\"30\"\n [imageUrl]=\"user.image\"\n [name]=\"user.name\"\n type=\"user\"\n location=\"reaction\"\n [user]=\"user\"\n ></stream-avatar-placeholder>\n <span\n data-testclass=\"reaction-user-username\"\n class=\"str-chat__user-item--name\"\n >{{ user.name }}</span\n >\n </div>\n </ng-template>\n </div>\n </div>\n</ng-template>\n","import {\n Component,\n ElementRef,\n Input,\n OnChanges,\n SimpleChanges,\n ViewChild,\n OnDestroy,\n OnInit,\n ChangeDetectorRef,\n ChangeDetectionStrategy,\n NgZone,\n AfterViewInit,\n} from '@angular/core';\nimport { Attachment, UserResponse } from 'stream-chat';\nimport { ChannelService } from '../channel.service';\nimport { ChatClientService } from '../chat-client.service';\nimport {\n AttachmentListContext,\n MentionTemplateContext,\n MessageActionsBoxContext,\n MessageReactionsContext,\n DefaultStreamChatGenerics,\n StreamMessage,\n DeliveredStatusContext,\n SendingStatusContext,\n ReadStatusContext,\n CustomMessageActionItem,\n SystemMessageContext,\n CustomMetadataContext,\n} from '../types';\nimport emojiRegex from 'emoji-regex';\nimport { Subscription } from 'rxjs';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { listUsers } from '../list-users';\nimport { ThemeService } from '../theme.service';\nimport {\n NgxPopperjsTriggers,\n NgxPopperjsPlacements,\n NgxPopperjsContentComponent,\n} from 'ngx-popperjs';\nimport { DateParserService } from '../date-parser.service';\nimport { MessageService } from '../message.service';\nimport { MessageActionsService } from '../message-actions.service';\n\ntype MessagePart = {\n content: string;\n type: 'text' | 'mention';\n user?: UserResponse;\n};\n\n/**\n * The `Message` component displays a message with additional information such as sender and date, and enables [interaction with the message (i.e. edit or react)](../concepts/message-interactions.mdx).\n */\n@Component({\n selector: 'stream-message',\n templateUrl: './message.component.html',\n styles: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MessageComponent\n implements OnInit, OnChanges, OnDestroy, AfterViewInit\n{\n /**\n * The message to be displayed\n */\n @Input() message: StreamMessage | undefined;\n /**\n * The list of [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) that are enabled for the current user, the list of [supported interactions](../concepts/message-interactions.mdx) can be found in our message interaction guide. Unathorized actions won't be displayed on the UI. The [`MessageList`](./MessageListComponent.mdx) component automatically sets this based on [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).\n */\n @Input() enabledMessageActions: string[] = [];\n /**\n * If `true`, the message status (sending, sent, who read the message) is displayed.\n */\n @Input() isLastSentMessage: boolean | undefined;\n /**\n * Determines if the message is being dispalyed in a channel or in a [thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript).\n */\n @Input() mode: 'thread' | 'main' = 'main';\n /**\n * Highlighting is used to add visual emphasize to a message when jumping to the message\n */\n @Input() isHighlighted = false;\n /**\n * A list of custom message actions to be displayed in the action box\n *\n * @deprecated please use the [`MessageActionsService`](https://getstream.io/chat/docs/sdk/angular/services/MessageActionsService) to set this property.\n */\n @Input() customActions: CustomMessageActionItem[] = [];\n readonly themeVersion: '1' | '2';\n canReceiveReadEvents: boolean | undefined;\n canReactToMessage: boolean | undefined;\n isActionBoxOpen = false;\n isEditedFlagOpened = false;\n isReactionSelectorOpen = false;\n visibleMessageActionsCount = 0;\n messageTextParts: MessagePart[] | undefined = [];\n messageText?: string;\n popperTriggerClick = NgxPopperjsTriggers.click;\n popperTriggerHover = NgxPopperjsTriggers.hover;\n popperPlacementAuto = NgxPopperjsPlacements.AUTO;\n popperPlacementTop = NgxPopperjsPlacements.TOP;\n shouldDisplayTranslationNotice = false;\n displayedMessageTextContent: 'original' | 'translation' = 'original';\n imageAttachmentModalState: 'opened' | 'closed' = 'closed';\n shouldDisplayThreadLink = false;\n isSentByCurrentUser = false;\n readByText = '';\n displayAs: 'text' | 'html';\n lastReadUser: UserResponse<DefaultStreamChatGenerics> | undefined = undefined;\n isOnlyReadByMe = false;\n isReadByMultipleUsers = false;\n isMessageDeliveredAndRead = false;\n parsedDate = '';\n pasedEditedDate = '';\n areOptionsVisible = false;\n hasAttachment = false;\n hasReactions = false;\n replyCountParam: { replyCount: number | undefined } = {\n replyCount: undefined,\n };\n canDisplayReadStatus = false;\n private quotedMessageAttachments: Attachment[] | undefined;\n private subscriptions: Subscription[] = [];\n private isViewInited = false;\n private userId?: string;\n @ViewChild('container') private container:\n | ElementRef<HTMLElement>\n | undefined;\n private readonly urlRegexp =\n /(?:(?:https?|ftp|file):\\/\\/|www\\.|ftp\\.)(?:\\([-A-Z0-9+&@#/%=~_|$?!:,.]*\\)|[-A-Z0-9+&@#/%=~_|$?!:,.])*(?:\\([-A-Z0-9+&@#/%=~_|$?!:,.]*\\)|[A-Z0-9+&@#/%=~_|$])/gim;\n private emojiRegexp = new RegExp(emojiRegex(), 'g');\n\n constructor(\n private chatClientService: ChatClientService,\n private channelService: ChannelService,\n public customTemplatesService: CustomTemplatesService,\n private cdRef: ChangeDetectorRef,\n themeService: ThemeService,\n private dateParser: DateParserService,\n private ngZone: NgZone,\n private messageService: MessageService,\n private messageActionsService: MessageActionsService\n ) {\n this.themeVersion = themeService.themeVersion;\n this.displayAs = this.messageService.displayAs;\n }\n\n ngOnInit(): void {\n this.subscriptions.push(\n this.chatClientService.user$.subscribe((u) => {\n if (u?.id !== this.userId) {\n this.userId = u?.id;\n this.setIsSentByCurrentUser();\n this.setLastReadUser();\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n })\n );\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.message) {\n this.shouldDisplayTranslationNotice = false;\n this.displayedMessageTextContent = 'original';\n this.createMessageParts();\n const originalAttachments = this.message?.quoted_message?.attachments;\n this.quotedMessageAttachments =\n originalAttachments && originalAttachments.length\n ? [originalAttachments[0]]\n : [];\n this.setIsSentByCurrentUser();\n this.setLastReadUser();\n this.readByText = this.message?.readBy\n ? listUsers(this.message.readBy)\n : '';\n this.isOnlyReadByMe = !!(\n this.message &&\n this.message.readBy &&\n this.message.readBy.length === 0\n );\n this.isReadByMultipleUsers = !!(\n this.message &&\n this.message.readBy &&\n this.message.readBy.length > 1\n );\n this.isMessageDeliveredAndRead = !!(\n this.message &&\n this.message.readBy &&\n this.message.status === 'received' &&\n this.message.readBy.length > 0\n );\n this.parsedDate =\n (this.message &&\n this.message.created_at &&\n this.dateParser.parseDateTime(this.message.created_at)) ||\n '';\n this.pasedEditedDate =\n (this.message &&\n this.message.message_text_updated_at &&\n this.dateParser.parseDateTime(\n new Date(this.message.message_text_updated_at)\n )) ||\n '';\n this.hasAttachment =\n !!this.message?.attachments && !!this.message.attachments.length;\n this.hasReactions =\n !!this.message?.reaction_counts &&\n Object.keys(this.message.reaction_counts).length > 0;\n this.replyCountParam = { replyCount: this.message?.reply_count };\n }\n if (changes.enabledMessageActions) {\n this.canReactToMessage =\n this.enabledMessageActions.indexOf('send-reaction') !== -1;\n this.canReceiveReadEvents =\n this.enabledMessageActions.indexOf('read-events') !== -1;\n this.canDisplayReadStatus =\n this.canReceiveReadEvents !== false &&\n this.enabledMessageActions.indexOf('read-events') !== -1;\n }\n if (changes.message || changes.enabledMessageActions || changes.mode) {\n this.shouldDisplayThreadLink =\n !!this.message?.reply_count && this.mode !== 'thread';\n }\n if (changes.message || changes.mode) {\n this.areOptionsVisible = this.message\n ? !(\n !this.message.type ||\n this.message.type === 'error' ||\n this.message.type === 'system' ||\n this.message.type === 'ephemeral' ||\n this.message.status === 'failed' ||\n this.message.status === 'sending' ||\n (this.mode === 'thread' && !this.message.parent_id)\n )\n : false;\n }\n if (\n changes.message ||\n changes.enabledMessageActions ||\n changes.customActions\n ) {\n if (this.message) {\n this.visibleMessageActionsCount =\n this.messageActionsService.getAuthorizedMessageActionsCount(\n this.message,\n this.enabledMessageActions\n );\n } else {\n this.visibleMessageActionsCount = 0;\n }\n }\n }\n\n ngAfterViewInit(): void {\n this.isViewInited = true;\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n messageActionsClicked() {\n if (!this.message) {\n return;\n }\n if (this.messageActionsService.customActionClickHandler) {\n this.messageActionsService.customActionClickHandler({\n message: this.message,\n enabledActions: this.enabledMessageActions,\n customActions: this.customActions,\n isMine: this.isSentByCurrentUser,\n });\n } else {\n this.isActionBoxOpen = !this.isActionBoxOpen;\n }\n }\n\n messageActionsBoxClicked(popperContent: NgxPopperjsContentComponent) {\n popperContent.hide();\n }\n\n getAttachmentListContext(): AttachmentListContext {\n return {\n messageId: this.message?.id || '',\n attachments: this.message?.attachments || [],\n parentMessageId: this.message?.parent_id,\n imageModalStateChangeHandler: (state) =>\n (this.imageAttachmentModalState = state),\n };\n }\n\n getMessageContext(): SystemMessageContext {\n return {\n message: this.message,\n enabledMessageActions: this.enabledMessageActions,\n isHighlighted: this.isHighlighted,\n isLastSentMessage: this.isLastSentMessage,\n mode: this.mode,\n customActions: this.customActions,\n parsedDate: this.parsedDate,\n };\n }\n\n getQuotedMessageAttachmentListContext(): AttachmentListContext {\n return {\n messageId: this.message?.quoted_message?.id || '',\n attachments: this.quotedMessageAttachments!,\n parentMessageId: this?.message?.quoted_message?.parent_id,\n };\n }\n\n getMessageReactionsContext(): MessageReactionsContext {\n return {\n messageReactionCounts: this.message?.reaction_counts || {},\n latestReactions: this.message?.latest_reactions || [],\n isSelectorOpen: this.isReactionSelectorOpen,\n isSelectorOpenChangeHandler: (isOpen) =>\n (this.isReactionSelectorOpen = isOpen),\n messageId: this.message?.id,\n ownReactions: this.message?.own_reactions || [],\n };\n }\n\n messageClicked() {\n if (\n this.message?.status === 'failed' &&\n this.message?.errorStatusCode !== 403\n ) {\n this.resendMessage();\n } else if (\n this.message?.type === 'error' &&\n this.message?.moderation_details\n ) {\n this.openMessageBouncePrompt();\n } else {\n this.isEditedFlagOpened = !this.isEditedFlagOpened;\n }\n }\n\n resendMessage() {\n void this.channelService.resendMessage(this.message!);\n }\n\n setAsActiveParentMessage() {\n void this.channelService.setAsActiveParentMessage(this.message);\n }\n\n getMentionContext(messagePart: MessagePart): MentionTemplateContext {\n return {\n content: messagePart.content,\n user: messagePart.user!,\n };\n }\n\n getMessageActionsBoxContext(): MessageActionsBoxContext {\n return {\n isOpen: this.isActionBoxOpen,\n isMine: this.isSentByCurrentUser,\n enabledActions: this.enabledMessageActions,\n message: this.message,\n displayedActionsCountChaneHanler: (count) => {\n this.visibleMessageActionsCount = count;\n // message action box changes UI bindings in parent, so we'll have to rerun change detection\n this.cdRef.detectChanges();\n },\n displayedActionsCountChangeHandler: (count) => {\n this.visibleMessageActionsCount = count;\n // message action box changes UI bindings in parent, so we'll have to rerun change detection\n this.cdRef.detectChanges();\n },\n customActions: this.customActions || [],\n };\n }\n\n getDeliveredStatusContext(): DeliveredStatusContext {\n return {\n message: this.message!,\n };\n }\n\n getSendingStatusContext(): SendingStatusContext {\n return {\n message: this.message!,\n };\n }\n\n getReadStatusContext(): ReadStatusContext {\n return {\n message: this.message!,\n readByText: this.readByText,\n };\n }\n\n getMessageMetadataContext(): CustomMetadataContext {\n return {\n message: this.message!,\n };\n }\n\n jumpToMessage(messageId: string, parentMessageId?: string) {\n void this.channelService.jumpToMessage(messageId, parentMessageId);\n }\n\n displayTranslatedMessage() {\n this.createMessageParts(true);\n }\n\n displayOriginalMessage() {\n this.createMessageParts(false);\n }\n\n openMessageBouncePrompt() {\n this.channelService.bouncedMessage$.next(this.message);\n }\n\n private createMessageParts(shouldTranslate = true) {\n this.messageTextParts = undefined;\n this.messageText = undefined;\n let content = this.getMessageContent(shouldTranslate);\n if (\n (!this.message!.mentioned_users ||\n this.message!.mentioned_users.length === 0) &&\n !content?.match(this.emojiRegexp) &&\n !content?.match(this.urlRegexp)\n ) {\n this.messageTextParts = undefined;\n this.messageText = content;\n return;\n }\n if (!content) {\n return;\n }\n if (\n !this.message!.mentioned_users ||\n this.message!.mentioned_users.length === 0\n ) {\n content = this.fixEmojiDisplay(content);\n content = this.wrapLinksWithAnchorTag(content);\n this.messageTextParts = [{ content, type: 'text' }];\n } else {\n this.messageTextParts = [];\n let text = content;\n this.message!.mentioned_users.forEach((user) => {\n const mention = `@${user.name || user.id}`;\n const precedingText = text.substring(0, text.indexOf(mention));\n let formattedPrecedingText = this.fixEmojiDisplay(precedingText);\n formattedPrecedingText = this.wrapLinksWithAnchorTag(\n formattedPrecedingText\n );\n this.messageTextParts!.push({\n content: formattedPrecedingText,\n type: 'text',\n });\n this.messageTextParts!.push({\n content: mention,\n type: 'mention',\n user,\n });\n text = text.replace(precedingText + mention, '');\n });\n if (text) {\n text = this.fixEmojiDisplay(text);\n text = this.wrapLinksWithAnchorTag(text);\n this.messageTextParts.push({ content: text, type: 'text' });\n }\n }\n }\n\n private getMessageContent(shouldTranslate: boolean) {\n const originalContent = this.message?.text;\n if (shouldTranslate) {\n const translation = this.message?.translation;\n if (translation) {\n this.shouldDisplayTranslationNotice = true;\n this.displayedMessageTextContent = 'translation';\n }\n return translation || originalContent;\n } else {\n this.displayedMessageTextContent = 'original';\n return originalContent;\n }\n }\n\n private fixEmojiDisplay(content: string) {\n // Wrap emojis in span to display emojis correctly in Chrome https://bugs.chromium.org/p/chromium/issues/detail?id=596223\n // Based on this: https://stackoverflow.com/questions/4565112/javascript-how-to-find-out-if-the-user-browser-is-chrome\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n const isChrome =\n !!(window as any).chrome && typeof (window as any).opr === 'undefined';\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n content = content.replace(\n this.emojiRegexp,\n (match) =>\n `<span ${\n isChrome ? 'class=\"str-chat__emoji-display-fix\"' : ''\n }>${match}</span>`\n );\n\n return content;\n }\n\n private wrapLinksWithAnchorTag(content: string) {\n if (this.displayAs === 'html') {\n return content;\n }\n content = content.replace(this.urlRegexp, (match) =>\n this.messageService.customLinkRenderer\n ? this.messageService.customLinkRenderer(match)\n : `<a href=\"${match}\" target=\"_blank\" rel=\"nofollow\">${match}</a>`\n );\n\n return content;\n }\n\n private setIsSentByCurrentUser() {\n this.isSentByCurrentUser = this.message?.user?.id === this.userId;\n }\n\n private setLastReadUser() {\n this.lastReadUser = this.message?.readBy?.filter(\n (u) => u.id !== this.userId\n )[0];\n }\n}\n","<div\n #container\n class=\"str-chat__message-simple str-chat__message str-chat__message--{{\n message?.type\n }} str-chat__message--{{ message?.status }} {{\n message?.text ? 'str-chat__message--has-text' : 'has-no-text'\n }}\"\n [class.str-chat__message--me]=\"isSentByCurrentUser\"\n [class.str-chat__message--other]=\"!isSentByCurrentUser\"\n [class.str-chat__message-simple--me]=\"isSentByCurrentUser\"\n [class.str-chat__message--has-attachment]=\"hasAttachment\"\n [class.str-chat__message--with-reactions]=\"hasReactions\"\n [class.str-chat__message--highlighted]=\"isHighlighted\"\n [class.str-chat__message-with-thread-link]=\"shouldDisplayThreadLink\"\n [class.str-chat__message-send-can-be-retried]=\"\n (message?.status === 'failed' && message?.errorStatusCode !== 403) ||\n (message?.type === 'error' && message?.moderation_details)\n \"\n data-testid=\"message-container\"\n>\n <ng-container *ngIf=\"!message?.deleted_at; else deletedMessage\">\n <ng-container *ngIf=\"message?.type !== 'system'; else systemMessage\">\n <ng-container *ngIf=\"themeVersion === '1'\">\n <ng-container *ngTemplateOutlet=\"messageStatus\"></ng-container>\n </ng-container>\n <stream-avatar-placeholder\n data-testid=\"avatar\"\n class=\"str-chat-angular__avatar-host str-chat__message-sender-avatar\"\n [imageUrl]=\"message?.user?.image\"\n [name]=\"message?.user?.name || message?.user?.id\"\n type=\"user\"\n location=\"message-sender\"\n [user]=\"message?.user || undefined\"\n ></stream-avatar-placeholder>\n <div class=\"str-chat__message-inner\">\n <div\n class=\"str-chat__message-simple__actions str-chat__message-options\"\n data-testid=\"message-options\"\n [class.str-chat__message-actions-open]=\"isActionBoxOpen\"\n *ngIf=\"areOptionsVisible\"\n >\n <div\n data-testid=\"message-actions-container\"\n #messageActionsToggle\n class=\"\n str-chat__message-actions-container\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--options\n \"\n [popper]=\"popperContent\"\n [popperTrigger]=\"popperTriggerClick\"\n [popperPlacement]=\"popperPlacementAuto\"\n [popperHideOnScroll]=\"false\"\n [popperHideOnClickOutside]=\"true\"\n [popperHideOnMouseLeave]=\"false\"\n [popperDisableAnimation]=\"true\"\n (popperOnHidden)=\"isActionBoxOpen = false\"\n >\n <popper-content #popperContent>\n <ng-template\n #defaultMessageActionsBox\n let-isOpen=\"isOpen\"\n let-isMine=\"isMine\"\n let-enabledActions=\"enabledActions\"\n let-messageInput=\"message\"\n let-customActions=\"customActions\"\n >\n <stream-message-actions-box\n (click)=\"messageActionsBoxClicked(popperContent)\"\n *ngIf=\"isOpen\"\n [isOpen]=\"isOpen\"\n [isMine]=\"isMine\"\n [enabledActions]=\"enabledActions\"\n [customActions]=\"customActions\"\n [message]=\"messageInput\"\n ></stream-message-actions-box>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageActionsBoxTemplate$ | async) ||\n defaultMessageActionsBox;\n context: getMessageActionsBoxContext()\n \"\n >\n </ng-container>\n </popper-content>\n <div\n class=\"str-chat__message-actions-box-button\"\n data-testid=\"action-icon\"\n (click)=\"messageActionsClicked()\"\n (keyup.enter)=\"messageActionsClicked()\"\n *ngIf=\"visibleMessageActionsCount > 0\"\n >\n <stream-icon-placeholder\n icon=\"action-icon\"\n class=\"str-chat__message-action-icon\"\n ></stream-icon-placeholder>\n </div>\n </div>\n <div\n *ngIf=\"\n enabledMessageActions.indexOf('send-reply') !== -1 &&\n mode === 'main'\n \"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--thread\n str-chat__message-reply-in-thread-button\n \"\n data-testid=\"reply-in-thread\"\n (click)=\"setAsActiveParentMessage()\"\n (keyup.enter)=\"setAsActiveParentMessage()\"\n >\n <stream-icon-placeholder\n class=\"str-chat__message-action-icon\"\n icon=\"reply-in-thread\"\n ></stream-icon-placeholder>\n </div>\n <div\n *ngIf=\"canReactToMessage\"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--reactions\n str-chat__message-reactions-button\n \"\n data-testid=\"reaction-icon\"\n (click)=\"isReactionSelectorOpen = !isReactionSelectorOpen\"\n (keyup.enter)=\"isReactionSelectorOpen = !isReactionSelectorOpen\"\n >\n <stream-icon-placeholder\n class=\"str-chat__message-action-icon\"\n icon=\"reaction-icon\"\n ></stream-icon-placeholder>\n </div>\n </div>\n <div class=\"str-chat__message-reactions-host\">\n <ng-template\n #defaultMessageReactions\n let-messageReactionCounts=\"messageReactionCounts\"\n let-latestReactions=\"latestReactions\"\n let-isSelectorOpen=\"isSelectorOpen\"\n let-isSelectorOpenChangeHandler=\"isSelectorOpenChangeHandler\"\n let-messageId=\"messageId\"\n let-ownReactions=\"ownReactions\"\n >\n <stream-message-reactions\n [messageReactionCounts]=\"messageReactionCounts\"\n [latestReactions]=\"latestReactions\"\n [isSelectorOpen]=\"isSelectorOpen\"\n (isSelectorOpenChange)=\"isSelectorOpenChangeHandler($event)\"\n [messageId]=\"messageId\"\n [ownReactions]=\"ownReactions\"\n ></stream-message-reactions>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageReactionsTemplate$ | async) ||\n defaultMessageReactions;\n context: getMessageReactionsContext()\n \"\n ></ng-container>\n </div>\n <div\n class=\"str-chat__message-bubble str-chat-angular__message-bubble\"\n [class.str-chat-angular__message-bubble--attachment-modal-open]=\"\n imageAttachmentModalState === 'opened'\n \"\n >\n <ng-container *ngIf=\"hasAttachment && !message?.quoted_message\">\n <ng-container\n *ngTemplateOutlet=\"attachmentsTemplate\"\n ></ng-container>\n </ng-container>\n <div\n class=\"str-chat__message-text\"\n tabindex=\"0\"\n *ngIf=\"message?.text || (message?.quoted_message && hasAttachment)\"\n [class.str-chat__message-text--pointer-cursor]=\"\n (message?.status === 'failed' &&\n message?.errorStatusCode !== 403) ||\n (this.message?.type === 'error' &&\n this.message?.moderation_details) ||\n message?.message_text_updated_at\n \"\n (click)=\"messageClicked()\"\n (keyup.enter)=\"messageClicked()\"\n >\n <div\n data-testid=\"inner-message\"\n class=\"\n str-chat__message-text-inner str-chat__message-simple-text-inner\n \"\n [class.str-chat__message-light-text-inner--has-attachment]=\"\n hasAttachment\n \"\n >\n <ng-container *ngTemplateOutlet=\"quotedMessage\"></ng-container>\n <ng-container *ngIf=\"hasAttachment && message?.quoted_message\">\n <ng-container\n *ngTemplateOutlet=\"attachmentsTemplate\"\n ></ng-container>\n </ng-container>\n <div\n data-testid=\"client-error-message\"\n *ngIf=\"message?.type === 'error'\"\n class=\"\n str-chat__simple-message--error-message\n str-chat__message--error-message\n \"\n >\n <ng-container *ngIf=\"!message?.moderation_details\">{{\n \"streamChat.Error · Unsent\" | translate\n }}</ng-container>\n </div>\n <div\n data-testid=\"error-message\"\n *ngIf=\"message?.status === 'failed'\"\n class=\"\n str-chat__simple-message--error-message\n str-chat__message--error-message\n \"\n >\n {{\n (message?.errorStatusCode === 403\n ? \"streamChat.Message Failed · Unauthorized\"\n : \"streamChat.Message Failed · Click to try again\"\n ) | translate\n }}\n </div>\n <div data-testid=\"text\">\n <p>\n <ng-container *ngIf=\"messageTextParts; else defaultContent\">\n <!-- eslint-disable-next-line @angular-eslint/template/use-track-by-function -->\n <ng-container *ngFor=\"let part of messageTextParts\">\n <span\n *ngIf=\"part.type === 'text'; else mention\"\n [innerHTML]=\"part.content\"\n ></span>\n <ng-template #mention>\n <ng-template #defaultMention let-content=\"content\">\n <span class=\"str-chat__message-mention\">{{\n content\n }}</span>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.mentionTemplate$ | async) ||\n defaultMention;\n context: getMentionContext(part)\n \"\n ></ng-container>\n </ng-template>\n </ng-container>\n </ng-container>\n <ng-template #defaultContent>\n <ng-container *ngIf=\"displayAs === 'text'; else asHTML\">\n {{ messageText || \"\" }}\n </ng-container>\n <ng-template #asHTML\n ><span\n data-testid=\"html-content\"\n [innerHTML]=\"messageText\"\n ></span\n ></ng-template>\n </ng-template>\n </p>\n </div>\n </div>\n </div>\n <stream-icon-placeholder\n *ngIf=\"themeVersion === '2'\"\n class=\"str-chat__message-error-icon\"\n icon=\"error\"\n ></stream-icon-placeholder>\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n replyCountButton;\n context: { position: 'inside-message-bubble' }\n \"\n ></ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n messageDateAndSender;\n context: { position: 'inside-message-bubble' }\n \"\n ></ng-container>\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n replyCountButton;\n context: { position: 'outside-message-bubble', message: message }\n \"\n ></ng-container>\n\n <ng-container\n *ngTemplateOutlet=\"\n messageDateAndSender;\n context: { position: 'outside-message-bubble' }\n \"\n ></ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<ng-template #deletedMessage>\n <div data-testid=\"message-deleted-component\">\n <div class=\"str-chat__message--deleted-inner\" translate>\n streamChat.This message was deleted...\n </div>\n </div>\n</ng-template>\n\n<ng-template #systemMessage>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.systemMessageTemplate$ | async) ||\n defaultSystemMessage;\n context: getMessageContext()\n \"\n ></ng-container>\n <ng-template #defaultSystemMessage let-messageInput=\"message\">\n <div data-testid=\"system-message\" class=\"str-chat__message--system\">\n <div class=\"str-chat__message--system__text\">\n <div class=\"str-chat__message--system__line\"></div>\n <p>{{ messageInput?.text }}</p>\n <div class=\"str-chat__message--system__line\"></div>\n </div>\n <div class=\"str-chat__message--system__date\">\n {{ parsedDate }}\n </div>\n </div>\n </ng-template>\n</ng-template>\n\n<ng-template #quotedMessage>\n <div\n *ngIf=\"message?.quoted_message\"\n class=\"quoted-message str-chat__quoted-message-preview\"\n data-testid=\"quoted-message-container\"\n [class.mine]=\"isSentByCurrentUser\"\n (click)=\"\n jumpToMessage(\n (message?.quoted_message)!.id,\n message?.quoted_message?.parent_id\n )\n \"\n (keyup.enter)=\"\n jumpToMessage(\n (message?.quoted_message)!.id,\n message?.quoted_message?.parent_id\n )\n \"\n >\n <stream-avatar-placeholder\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host str-chat__message-sender-avatar\"\n [imageUrl]=\"message?.quoted_message?.user?.image\"\n [name]=\"\n message?.quoted_message?.user?.name || message?.quoted_message?.user?.id\n \"\n [size]=\"20\"\n type=\"user\"\n location=\"quoted-message-sender\"\n [user]=\"message?.quoted_message?.user || undefined\"\n ></stream-avatar-placeholder>\n <div class=\"quoted-message-inner str-chat__quoted-message-bubble\">\n <ng-container\n *ngIf=\"\n message?.quoted_message?.attachments &&\n message?.quoted_message?.attachments?.length\n \"\n >\n <ng-template\n #defaultAttachments\n let-messageId=\"messageId\"\n let-attachments=\"attachments\"\n let-parentMessageId=\"parentMessageId\"\n let-imageModalStateChangeHandler=\"imageModalStateChangeHandler\"\n >\n <stream-attachment-list\n [messageId]=\"messageId\"\n [attachments]=\"attachments\"\n [parentMessageId]=\"parentMessageId\"\n (imageModalStateChange)=\"imageModalStateChangeHandler($event)\"\n ></stream-attachment-list>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.attachmentListTemplate$ | async) ||\n defaultAttachments;\n context: getQuotedMessageAttachmentListContext()\n \"\n ></ng-container>\n </ng-container>\n <div\n data-testid=\"quoted-message-text\"\n [innerHTML]=\"\n message?.quoted_message?.translation ||\n message?.quoted_message?.html ||\n message?.quoted_message?.text\n \"\n ></div>\n </div>\n </div>\n</ng-template>\n\n<!-- We need these markups in slightly different positions in theme-v1 and theme-v2, this soultion makes that possible without duplicating the code -->\n<ng-template #messageDateAndSender let-position=\"position\">\n <ng-container\n *ngIf=\"\n (position === 'inside-message-bubble' && themeVersion === '1') ||\n (position === 'outside-message-bubble' && themeVersion === '2')\n \"\n >\n <div\n class=\"str-chat__translation-notice\"\n *ngIf=\"shouldDisplayTranslationNotice\"\n data-testid=\"translation-notice\"\n >\n <button\n data-testid=\"see-original\"\n *ngIf=\"displayedMessageTextContent === 'translation'\"\n (click)=\"displayOriginalMessage()\"\n (keyup.enter)=\"displayOriginalMessage()\"\n translate\n >\n streamChat.See original (automatically translated)\n </button>\n <button\n data-testid=\"see-translation\"\n *ngIf=\"displayedMessageTextContent === 'original'\"\n (click)=\"displayTranslatedMessage()\"\n (keyup.enter)=\"displayTranslatedMessage()\"\n translate\n >\n streamChat.See translation\n </button>\n </div>\n <ng-container\n *ngIf=\"customTemplatesService.customMessageMetadataTemplate$ | async\"\n >\n <div class=\"str-chat__custom-message-metadata\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.customMessageMetadataTemplate$ | async)!;\n context: getMessageMetadataContext()\n \"\n ></ng-container>\n </div>\n </ng-container>\n <div\n class=\"\n str-chat__message-data\n str-chat__message-simple-data\n str-chat__message-metadata\n \"\n >\n <ng-container *ngIf=\"themeVersion === '2'\">\n <ng-container *ngTemplateOutlet=\"messageStatus\"></ng-container>\n </ng-container>\n <span\n data-testid=\"sender\"\n *ngIf=\"!isSentByCurrentUser\"\n class=\"str-chat__message-simple-name str-chat__message-sender-name\"\n >\n {{ message?.user?.name ? message?.user?.name : message?.user?.id }}\n </span>\n <span\n data-testid=\"date\"\n class=\"str-chat__message-simple-timestamp str-chat__message-simple-time\"\n >\n {{ parsedDate }}\n </span>\n <ng-container *ngIf=\"message?.message_text_updated_at\">\n <span\n data-testid=\"edited-flag\"\n class=\"str-chat__mesage-simple-edited\"\n translate\n >streamChat.Edited</span\n >\n <div\n data-testid=\"edited-timestamp\"\n class=\"str-chat__message-edited-timestamp\"\n [ngClass]=\"{\n 'str-chat__message-edited-timestamp--open': isEditedFlagOpened,\n 'str-chat__message-edited-timestamp--collapsed': !isEditedFlagOpened\n }\"\n >\n <span translate>streamChat.Edited</span>\n <time\n dateTime=\"{{ message?.message_text_updated_at }}\"\n title=\"{{ message?.message_text_updated_at }}\"\n >\n {{ pasedEditedDate }}\n </time>\n </div>\n </ng-container>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #messageStatus>\n <ng-container\n *ngIf=\"\n isSentByCurrentUser &&\n ((isLastSentMessage && message?.status === 'received') ||\n message?.status === 'sending')\n \"\n >\n <ng-container *ngIf=\"message?.status === 'sending'; else sentStatus\">\n <ng-container *ngTemplateOutlet=\"sendingStatus\"></ng-container>\n </ng-container>\n <ng-template #sentStatus>\n <ng-container\n *ngIf=\"\n mode === 'main' && isMessageDeliveredAndRead && canDisplayReadStatus;\n else deliveredStatus\n \"\n >\n <ng-container *ngTemplateOutlet=\"readStatus\"></ng-container>\n </ng-container>\n </ng-template>\n <ng-template #deliveredStatus>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.deliveredStatusTemplate$ | async) ||\n defaultDeliveredStatus;\n context: getDeliveredStatusContext()\n \"\n ></ng-container>\n </ng-template>\n <ng-template #defaultDeliveredStatus>\n <span\n *ngIf=\"mode === 'main'\"\n class=\"\n str-chat__message-simple-status\n str-chat__message-simple-status-angular\n str-chat__message-status\n \"\n data-testid=\"delivered-indicator\"\n tabindex=\"0\"\n [popper]=\"popperContent\"\n [popperTrigger]=\"popperTriggerHover\"\n [popperPlacement]=\"popperPlacementTop\"\n [popperHideOnScroll]=\"false\"\n [popperHideOnClickOutside]=\"false\"\n (hover)=\"$event.stopPropagation()\"\n >\n <popper-content #popperContent>\n <div class=\"str-chat__tooltip str-chat__tooltip-angular\">\n {{ \"streamChat.Delivered\" | translate }}\n </div>\n </popper-content>\n <stream-icon-placeholder\n data-testid=\"delivered-icon\"\n icon=\"delivered-icon\"\n ></stream-icon-placeholder>\n </span>\n </ng-template>\n <ng-template #sendingStatus>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.sendingStatusTemplate$ | async) ||\n defaultSendingStatus;\n context: getSendingStatusContext()\n \"\n ></ng-container>\n </ng-template>\n <ng-template #defaultSendingStatus>\n <span\n class=\"\n str-chat__message-simple-status\n str-chat__message-simple-status-angular\n str-chat__message-status\n \"\n data-testid=\"sending-indicator\"\n tabindex=\"0\"\n [popper]=\"popperContent\"\n [popperTrigger]=\"popperTriggerHover\"\n [popperPlacement]=\"popperPlacementTop\"\n [popperHideOnScroll]=\"false\"\n [popperHideOnClickOutside]=\"false\"\n (hover)=\"$event.stopPropagation()\"\n >\n <popper-content #popperContent>\n <div class=\"str-chat__tooltip str-chat__tooltip-angular\">\n {{ \"streamChat.Sending...\" | translate }}\n </div>\n </popper-content>\n <stream-loading-indicator-placeholder\n data-testid=\"loading-indicator\"\n ></stream-loading-indicator-placeholder>\n </span>\n </ng-template>\n <ng-template #readStatus>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.readStatusTemplate$ | async) ||\n defaultReadStatus;\n context: getReadStatusContext()\n \"\n ></ng-container>\n </ng-template>\n <ng-template #defaultReadStatus let-readByText=\"readByText\">\n <span\n class=\"\n str-chat__message-simple-status\n str-chat__message-simple-status-angular\n str-chat__message-status\n \"\n data-testid=\"read-indicator\"\n tabindex=\"0\"\n [popper]=\"popperContent\"\n [popperTrigger]=\"popperTriggerHover\"\n [popperPlacement]=\"popperPlacementTop\"\n [popperHideOnScroll]=\"false\"\n [popperHideOnClickOutside]=\"false\"\n (hover)=\"$event.stopPropagation()\"\n >\n <popper-content #popperContent>\n <div\n class=\"str-chat__tooltip str-chat__tooltip-angular\"\n data-testid=\"read-by-tooltip\"\n >\n {{ readByText }}\n </div>\n </popper-content>\n <stream-icon-placeholder icon=\"read-icon\"></stream-icon-placeholder>\n </span>\n </ng-template>\n </ng-container>\n</ng-template>\n\n<ng-template #replyCountButton let-position=\"position\">\n <div\n *ngIf=\"\n (position === 'inside-message-bubble' && themeVersion === '1') ||\n (position === 'outside-message-bubble' && themeVersion === '2')\n \"\n class=\"\n str-chat__message-simple-reply-button\n str-chat__message-replies-count-button-wrapper\n \"\n >\n <button\n *ngIf=\"shouldDisplayThreadLink\"\n class=\"str-chat__message-replies-count-button\"\n data-testid=\"reply-count-button\"\n (click)=\"setAsActiveParentMessage()\"\n >\n <stream-icon-placeholder\n *ngIf=\"themeVersion === '1'\"\n stream-icon-placeholder\n icon=\"reply\"\n ></stream-icon-placeholder>\n {{message?.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </button>\n </div>\n</ng-template>\n\n<ng-template #attachmentsTemplate>\n <ng-template\n #defaultAttachments\n let-messageId=\"messageId\"\n let-attachments=\"attachments\"\n let-parentMessageId=\"parentMessageId\"\n let-imageModalStateChangeHandler=\"imageModalStateChangeHandler\"\n >\n <stream-attachment-list\n [messageId]=\"messageId\"\n [attachments]=\"attachments\"\n [parentMessageId]=\"parentMessageId\"\n (imageModalStateChange)=\"imageModalStateChangeHandler($event)\"\n ></stream-attachment-list>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.attachmentListTemplate$ | async) ||\n defaultAttachments;\n context: getAttachmentListContext()\n \"\n ></ng-container>\n</ng-template>\n","import {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n HostBinding,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { ThemeService } from '../../theme.service';\nimport { EmojiInputService } from '../emoji-input.service';\nimport { TextareaInterface } from '../textarea.interface';\n\n/**\n * The `Textarea` component is used by the [`MessageInput`](./MessageInputComponent.mdx) component to display the input HTML element where users can type their message.\n */\n@Component({\n selector: 'stream-textarea',\n templateUrl: './textarea.component.html',\n styles: [],\n})\nexport class TextareaComponent\n implements TextareaInterface, OnChanges, OnDestroy, AfterViewInit\n{\n @HostBinding() class =\n 'str-chat__textarea str-chat__message-textarea-angular-host';\n /**\n * The value of the input HTML element.\n */\n @Input() value = '';\n /**\n * Placeholder of the textarea\n */\n @Input() placeholder = '';\n /**\n * See [`MessageInputConfigService`](../services/MessageInputConfigService.mdx) for more information\n */\n @Input() inputMode!: 'desktop' | 'mobile';\n /**\n * Enables or disables auto focus on the textarea element\n */\n @Input() autoFocus = true;\n /**\n * Emits the current value of the input element when a user types.\n */\n @Output() readonly valueChange = new EventEmitter<string>();\n /**\n * Emits when a user triggers a message send event (this happens when they hit the `Enter` key).\n */\n @Output() readonly send = new EventEmitter<void>();\n @ViewChild('input') private messageInput!: ElementRef<HTMLInputElement>;\n private subscriptions: Subscription[] = [];\n\n constructor(\n private emojiInputService: EmojiInputService,\n private themeService: ThemeService\n ) {\n this.subscriptions.push(\n this.emojiInputService.emojiInput$.subscribe((emoji) => {\n this.messageInput.nativeElement.focus();\n const { selectionStart } = this.messageInput.nativeElement;\n this.messageInput.nativeElement.setRangeText(emoji);\n this.messageInput.nativeElement.selectionStart =\n selectionStart! + emoji.length;\n this.messageInput.nativeElement.selectionEnd =\n selectionStart! + emoji.length;\n this.inputChanged();\n })\n );\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.value && !this.value && this.messageInput) {\n this.messageInput.nativeElement.style.height = 'auto';\n }\n }\n\n ngAfterViewInit(): void {\n if (this.messageInput.nativeElement.scrollHeight > 0) {\n this.adjustTextareaHeight();\n }\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n inputChanged() {\n this.valueChange.emit(this.messageInput.nativeElement.value);\n this.adjustTextareaHeight();\n }\n\n enterHit(event: Event) {\n if (this.inputMode === 'desktop') {\n event.preventDefault();\n this.send.next();\n }\n }\n\n private adjustTextareaHeight() {\n if (this.themeService.themeVersion === '2') {\n this.messageInput.nativeElement.style.height = '';\n this.messageInput.nativeElement.style.height = `${this.messageInput.nativeElement.scrollHeight}px`;\n }\n }\n}\n","<textarea\n [value]=\"value || ''\"\n [autofocus]=\"autoFocus\"\n data-testid=\"textarea\"\n #input\n placeholder=\"{{ placeholder | translate }}\"\n class=\"\n rta__textarea\n str-chat__textarea__textarea\n str-chat__angular-textarea\n str-chat__message-textarea\n \"\n rows=\"1\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"enterHit($event)\"\n></textarea>\n","import { Injectable } from '@angular/core';\nimport transliterate from '@stream-io/transliterate';\n\n/**\n * The `TransliterationService` wraps the [@sindresorhus/transliterate](https://www.npmjs.com/package/@sindresorhus/transliterate) library\n */\n@Injectable({ providedIn: 'root' })\nexport class TransliterationService {\n constructor() {}\n\n /**\n *\n * @param s the string to be transliterated\n * @returns the result of the transliteration\n */\n transliterate(s: string) {\n return transliterate(s);\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n HostBinding,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { MentionConfig, Mentions } from 'angular-mentions';\nimport {\n MentionAutcompleteListItemContext,\n MentionAutcompleteListItem,\n CommandAutocompleteListItemContext,\n} from '../../types';\n\nimport { BehaviorSubject, Subscription } from 'rxjs';\nimport { UserResponse } from 'stream-chat';\nimport { ChannelService } from '../../channel.service';\nimport { TextareaInterface } from '../textarea.interface';\nimport { ChatClientService } from '../../chat-client.service';\nimport { debounceTime } from 'rxjs/operators';\nimport { TransliterationService } from '../../transliteration.service';\nimport { EmojiInputService } from '../emoji-input.service';\nimport { CustomTemplatesService } from '../../custom-templates.service';\nimport { ThemeService } from '../../theme.service';\n\n/**\n * The `AutocompleteTextarea` component is used by the [`MessageInput`](./MessageInputComponent.mdx) component to display the input HTML element where users can type their message.\n */\n@Component({\n selector: 'stream-autocomplete-textarea',\n templateUrl: './autocomplete-textarea.component.html',\n styles: [],\n})\nexport class AutocompleteTextareaComponent\n implements TextareaInterface, OnChanges, AfterViewInit\n{\n @HostBinding() class =\n 'str-chat__textarea str-chat__message-textarea-angular-host';\n /**\n * The value of the input HTML element.\n */\n @Input() value = '';\n /**\n * Placeholder of the textarea\n */\n @Input() placeholder = '';\n /**\n * If true, users can mention other users in messages. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.\n */\n @Input() areMentionsEnabled: boolean | undefined = true;\n /**\n * See [`MessageInputConfigService`](../services/MessageInputConfigService.mdx) for more information\n */\n @Input() inputMode!: 'desktop' | 'mobile';\n /**\n * The scope for user mentions, either members of the current channel of members of the application. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.\n */\n @Input() mentionScope: 'channel' | 'application' = 'channel';\n /**\n * Enables or disables auto focus on the textarea element\n */\n @Input() autoFocus = true;\n /**\n * Emits the current value of the input element when a user types.\n */\n @Output() readonly valueChange = new EventEmitter<string>();\n /**\n * Emits when a user triggers a message send event (this happens when they hit the `Enter` key).\n */\n @Output() readonly send = new EventEmitter<void>();\n /**\n * Emits the array of users that are mentioned in the message, it is updated when a user mentions a new user or deletes a mention.\n */\n @Output() readonly userMentions = new EventEmitter<UserResponse[]>();\n mentionAutocompleteItemTemplate:\n | TemplateRef<MentionAutcompleteListItemContext>\n | undefined;\n commandAutocompleteItemTemplate:\n | TemplateRef<CommandAutocompleteListItemContext>\n | undefined;\n themeVersion: '1' | '2';\n private readonly autocompleteKey = 'autocompleteLabel';\n private readonly mentionTriggerChar = '@';\n private readonly commandTriggerChar = '/';\n autocompleteConfig: MentionConfig = {\n mentions: [],\n };\n @ViewChild('input') private messageInput!: ElementRef<HTMLInputElement>;\n private subscriptions: Subscription[] = [];\n private mentionedUsers: UserResponse[] = [];\n private userMentionConfig: Mentions = {\n triggerChar: this.mentionTriggerChar,\n dropUp: true,\n labelKey: this.autocompleteKey,\n returnTrigger: true,\n mentionFilter: (\n searchString: string,\n items: { autocompleteLabel: string }[]\n ) => this.filter(searchString, items),\n mentionSelect: (item, triggerChar) =>\n this.itemSelectedFromAutocompleteList(item, triggerChar),\n };\n private slashCommandConfig: Mentions = {\n triggerChar: this.commandTriggerChar,\n dropUp: true,\n labelKey: 'name',\n returnTrigger: true,\n mentionFilter: (\n searchString: string,\n items: { autocompleteLabel: string }[]\n ) => this.filter(searchString, items),\n mentionSelect: (item, triggerChar) =>\n this.itemSelectedFromAutocompleteList(item, triggerChar),\n };\n private searchTerm$ = new BehaviorSubject<string>('');\n\n constructor(\n private channelService: ChannelService,\n private chatClientService: ChatClientService,\n private transliterationService: TransliterationService,\n private emojiInputService: EmojiInputService,\n private customTemplatesService: CustomTemplatesService,\n private themeService: ThemeService,\n private cdRef: ChangeDetectorRef\n ) {\n this.searchTerm$.pipe(debounceTime(300)).subscribe((searchTerm) => {\n if (searchTerm.startsWith(this.mentionTriggerChar)) {\n void this.updateMentionOptions(searchTerm);\n }\n });\n this.subscriptions.push(\n this.channelService.activeChannel$.subscribe((channel) => {\n const commands = channel?.getConfig()?.commands || [];\n this.slashCommandConfig.items = commands.map((c) => ({\n ...c,\n [this.autocompleteKey]: c.name,\n type: 'command',\n }));\n this.mentionedUsers = [];\n this.userMentions.next([...this.mentionedUsers]);\n void this.updateMentionOptions(this.searchTerm$.getValue());\n })\n );\n this.subscriptions.push(\n this.emojiInputService.emojiInput$.subscribe((emoji) => {\n this.messageInput.nativeElement.focus();\n const { selectionStart } = this.messageInput.nativeElement;\n this.messageInput.nativeElement.setRangeText(emoji);\n this.messageInput.nativeElement.selectionStart =\n selectionStart! + emoji.length;\n this.messageInput.nativeElement.selectionEnd =\n selectionStart! + emoji.length;\n this.inputChanged();\n })\n );\n this.subscriptions.push(\n this.customTemplatesService.mentionAutocompleteItemTemplate$.subscribe(\n (template) => (this.mentionAutocompleteItemTemplate = template)\n )\n );\n this.subscriptions.push(\n this.customTemplatesService.commandAutocompleteItemTemplate$.subscribe(\n (template) => (this.commandAutocompleteItemTemplate = template)\n )\n );\n this.autocompleteConfig.mentions = [\n this.userMentionConfig,\n this.slashCommandConfig,\n ];\n this.themeVersion = this.themeService.themeVersion;\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.areMentionsEnabled) {\n if (this.areMentionsEnabled) {\n this.autocompleteConfig.mentions = [\n this.userMentionConfig,\n this.slashCommandConfig,\n ];\n this.autocompleteConfig = { ...this.autocompleteConfig };\n } else {\n this.autocompleteConfig.mentions = [this.slashCommandConfig];\n this.autocompleteConfig = { ...this.autocompleteConfig };\n }\n }\n if (changes.mentionScope) {\n void this.updateMentionOptions(this.searchTerm$.getValue());\n }\n if (changes.value && !this.value && this.messageInput) {\n this.messageInput.nativeElement.style.height = 'auto';\n this.chatClientService?.chatClient?.logger?.(\n 'info',\n '[Autocomplete textarea] Value reset, adjusting textarea height to auto'\n );\n this.updateMentionedUsersFromText();\n }\n }\n\n ngAfterViewInit(): void {\n this.chatClientService?.chatClient?.logger?.(\n 'info',\n '[Autocomplete textarea] View inited'\n );\n if (this.messageInput.nativeElement.scrollHeight > 0) {\n this.adjustTextareaHeight();\n }\n }\n\n filter(searchString: string, items: { autocompleteLabel: string }[]) {\n return items.filter((item) =>\n this.transliterate(item.autocompleteLabel.toLowerCase()).includes(\n this.transliterate(searchString.toLowerCase())\n )\n );\n }\n\n itemSelectedFromAutocompleteList(\n item: MentionAutcompleteListItem,\n triggerChar = ''\n ) {\n if (triggerChar === this.mentionTriggerChar) {\n this.mentionedUsers.push((item.user ? item.user : item) as UserResponse);\n this.userMentions.next([...this.mentionedUsers]);\n }\n return triggerChar + item.autocompleteLabel + ' ';\n }\n\n autcompleteSearchTermChanged(searchTerm: string) {\n if (searchTerm === this.mentionTriggerChar) {\n void this.updateMentionOptions();\n } else {\n this.searchTerm$.next(searchTerm);\n }\n }\n\n inputChanged() {\n this.chatClientService?.chatClient?.logger?.(\n 'info',\n '[Autocomplete textarea] Input changed'\n );\n this.valueChange.emit(this.messageInput.nativeElement.value);\n this.adjustTextareaHeight();\n }\n\n inputLeft() {\n this.updateMentionedUsersFromText();\n }\n\n enterHit(event: Event) {\n if (this.inputMode === 'desktop') {\n event.preventDefault();\n this.updateMentionedUsersFromText();\n this.send.next();\n }\n }\n\n private adjustTextareaHeight() {\n if (this.themeVersion === '2') {\n this.chatClientService?.chatClient?.logger?.(\n 'info',\n `[Autocomplete textarea] Textarea height set from ${this.messageInput.nativeElement.style.height} to ${this.messageInput.nativeElement.scrollHeight}px`\n );\n this.messageInput.nativeElement.style.height = '';\n this.messageInput.nativeElement.style.height = `${this.messageInput.nativeElement.scrollHeight}px`;\n }\n }\n\n private transliterate(s: string) {\n if (this.transliterationService) {\n return this.transliterationService.transliterate(s);\n } else {\n return s;\n }\n }\n\n private async updateMentionOptions(searchTerm?: string) {\n if (!this.areMentionsEnabled) {\n return;\n }\n searchTerm = searchTerm?.replace(this.mentionTriggerChar, '');\n const request =\n this.mentionScope === 'application'\n ? (s: string) => this.chatClientService.autocompleteUsers(s)\n : (s: string) => this.channelService.autocompleteMembers(s);\n const result = await request(searchTerm || '');\n const items = this.filter(\n searchTerm || '',\n result.map((i) => {\n const user = (i.user ? i.user : i) as UserResponse;\n return {\n ...i,\n autocompleteLabel: user.name || user.id,\n type: 'mention',\n };\n })\n );\n this.userMentionConfig.items = items;\n this.autocompleteConfig.mentions = [\n this.userMentionConfig,\n this.slashCommandConfig,\n ];\n this.autocompleteConfig = { ...this.autocompleteConfig };\n this.cdRef.detectChanges();\n }\n\n private updateMentionedUsersFromText() {\n const updatedMentionedUsers: UserResponse[] = [];\n this.mentionedUsers.forEach((u) => {\n const key = u.name || u.id;\n if (this.value.includes(`${this.mentionTriggerChar}${key}`)) {\n updatedMentionedUsers.push(u);\n }\n });\n if (updatedMentionedUsers.length !== this.mentionedUsers.length) {\n this.userMentions.next([...updatedMentionedUsers]);\n this.mentionedUsers = updatedMentionedUsers;\n }\n }\n}\n","<textarea\n [value]=\"value || ''\"\n [autofocus]=\"autoFocus\"\n data-testid=\"textarea\"\n #input\n placeholder=\"{{ placeholder | translate }}\"\n class=\"\n rta__textarea\n str-chat__textarea__textarea\n str-chat__angular-textarea\n str-chat__message-textarea\n \"\n rows=\"1\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"enterHit($event)\"\n [mentionConfig]=\"autocompleteConfig\"\n (searchTerm)=\"autcompleteSearchTermChanged($event)\"\n [mentionListTemplate]=\"autocompleteItem\"\n (blur)=\"inputLeft()\"\n></textarea>\n<ng-template #autocompleteItem let-item=\"item\">\n <div class=\"rta rta__item str-chat__emojisearch__item\" [ngSwitch]=\"item.type\">\n <div class=\"rta__entity\" *ngSwitchCase=\"'mention'\">\n <ng-container\n *ngTemplateOutlet=\"\n mentionAutocompleteItemTemplate || defaultMentionTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n <div class=\"rta__entity\" *ngSwitchCase=\"'command'\">\n <ng-container\n *ngTemplateOutlet=\"\n commandAutocompleteItemTemplate || defaultCommandTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #defaultCommandTemplate let-item=\"item\">\n <div class=\"str-chat__slash-command\">\n <span class=\"str-chat__slash-command-header\">\n <strong\n class=\"str-chat__slash-command-name\"\n data-testclass=\"command-name\"\n >{{ item.name }}</strong\n >\n <span class=\"str-chat__slash-command-args\"\n >/{{ item.name }} {{ item.args }}</span\n >\n </span>\n <br />\n </div>\n</ng-template>\n\n<ng-template #defaultMentionTemplate let-item=\"item\">\n <div class=\"str-chat__user-item\">\n <stream-avatar-placeholder\n data-testclass=\"avatar\"\n class=\"str-chat__avatar str-chat__avatar--circle\"\n [ngStyle]=\"{ height: themeVersion === '2' ? 30 : 20 + 'px' }\"\n [size]=\"themeVersion === '2' ? 30 : 20\"\n [imageUrl]=\"item.image || item.user?.image\"\n [name]=\"item.autocompleteLabel\"\n type=\"user\"\n location=\"autocomplete-item\"\n [user]=\"item.user || item\"\n ></stream-avatar-placeholder>\n <span data-testclass=\"username\" class=\"str-chat__user-item--name\">{{\n item.autocompleteLabel\n }}</span>\n </div>\n</ng-template>\n","import { GroupStyleOptions, StreamMessage } from '../types';\n\nexport type GroupStyle = '' | 'middle' | 'top' | 'bottom' | 'single';\n\nexport const getGroupStyles = (\n message: StreamMessage,\n previousMessage?: StreamMessage,\n nextMessage?: StreamMessage,\n options: GroupStyleOptions = {\n noGroupByUser: false,\n lastReadMessageId: undefined,\n noGroupByReadState: false,\n }\n): GroupStyle => {\n if (\n options.noGroupByUser ||\n (message.attachments && message.attachments.length !== 0)\n )\n return 'single';\n\n const isTopMessage =\n !previousMessage ||\n !isOnSameDay(previousMessage.created_at, message.created_at) ||\n previousMessage.type === 'system' ||\n (previousMessage.attachments &&\n previousMessage.attachments?.length !== 0) ||\n message.user?.id !== previousMessage.user?.id ||\n previousMessage.type === 'error' ||\n previousMessage.deleted_at ||\n (previousMessage.id === options.lastReadMessageId &&\n !options.noGroupByReadState) ||\n previousMessage.message_text_updated_at ||\n (message.reaction_counts &&\n Object.keys(message.reaction_counts).length > 0);\n\n const isBottomMessage =\n !nextMessage ||\n !isOnSameDay(message.created_at, nextMessage.created_at) ||\n nextMessage.type === 'system' ||\n (nextMessage.attachments && nextMessage.attachments?.length !== 0) ||\n message.user?.id !== nextMessage.user?.id ||\n nextMessage.type === 'error' ||\n nextMessage.deleted_at ||\n (message.id === options.lastReadMessageId && !options.noGroupByReadState) ||\n message.message_text_updated_at ||\n (nextMessage.reaction_counts &&\n Object.keys(nextMessage.reaction_counts).length > 0);\n\n if (!isTopMessage && !isBottomMessage) {\n if (message.deleted_at || message.type === 'error') return 'single';\n return 'middle';\n }\n\n if (isBottomMessage) {\n if (isTopMessage || message.deleted_at || message.type === 'error')\n return 'single';\n return 'bottom';\n }\n\n if (isTopMessage) return 'top';\n\n return '';\n};\n\nconst isOnSameDay = (date1: Date, date2: Date) => {\n return (\n date1.getFullYear() === date2.getFullYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate()\n );\n};\n","import {\n AfterViewChecked,\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n HostBinding,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { ChannelService } from '../channel.service';\nimport { Observable, Subject, Subscription, combineLatest } from 'rxjs';\nimport { filter, map, shareReplay, tap, throttleTime } from 'rxjs/operators';\nimport {\n MessageContext,\n DefaultStreamChatGenerics,\n StreamMessage,\n TypingIndicatorContext,\n CustomMessageActionItem,\n DateSeparatorContext,\n UnreadMessagesNotificationContext,\n UnreadMessagesIndicatorContext,\n} from '../types';\nimport { ChatClientService } from '../chat-client.service';\nimport { getGroupStyles, GroupStyle } from './group-styles';\nimport { UserResponse } from 'stream-chat';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { listUsers } from '../list-users';\nimport { DateParserService } from '../date-parser.service';\nimport { MessageActionsService } from '../message-actions.service';\nimport { isOnSeparateDate } from '../is-on-separate-date';\n\n/**\n * The `MessageList` component renders a scrollable list of messages.\n */\n@Component({\n selector: 'stream-message-list',\n templateUrl: './message-list.component.html',\n styles: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MessageListComponent\n implements AfterViewChecked, OnChanges, OnInit, OnDestroy, AfterViewInit\n{\n /**\n * Determines if the message list should display channel messages or [thread messages](https://getstream.io/chat/docs/javascript/threads/?language=javascript).\n */\n @Input() mode: 'main' | 'thread' = 'main';\n /**\n * The direction of the messages in the list, `bottom-to-top` means newest message is at the bottom of the message list and users scroll upwards to load older messages\n */\n @Input() direction: 'bottom-to-top' | 'top-to-bottom' = 'bottom-to-top';\n /**\n * Determines what triggers the appearance of the message options: by default you can hover (click on mobile) anywhere in the row of the message (`message-row` option), or you can set `message-bubble`, in that case only a hover (click on mobile) in the message bubble will trigger the options to appear.\n */\n @Input() messageOptionsTrigger: 'message-row' | 'message-bubble' =\n 'message-row';\n /**\n * You can hide the \"jump to latest\" button while scrolling. A potential use-case for this input would be to [workaround a known issue on iOS Safar webview](https://github.com/GetStream/stream-chat-angular/issues/418)\n *\n */\n @Input() hideJumpToLatestButtonDuringScroll = false;\n /**\n * A list of custom message actions to be displayed in the message action box\n *\n * @deprecated please use the [`MessageActionsService`](https://getstream.io/chat/docs/sdk/angular/services/MessageActionsService) to set this property.\n */\n @Input() customMessageActions: CustomMessageActionItem<any>[] = [];\n /**\n * If `true` date separators will be displayed\n */\n @Input() displayDateSeparator = true;\n /**\n * If `true` unread indicator will be displayed\n */\n @Input() displayUnreadSeparator = true;\n /**\n * If date separators are displayed, you can set the horizontal position of the date text.\n */\n @Input() dateSeparatorTextPos: 'center' | 'right' | 'left' = 'center';\n /**\n * `last-message` option will open the message list at the last message, `last-read-message` will open the list at the last unread message. This option only works if mode is `main`.\n */\n @Input() openMessageListAt: 'last-message' | 'last-read-message' =\n 'last-message';\n /**\n * If the user has unread messages when they open the channel the UI shows the unread indicator / notification which features the unread count by default. This count will be increased every time a user receives a new message. If you don't want to show the unread count, you can turn that off.\n *\n * This is only applicable for `main` mode, as threads doesn't have read infromation.\n */\n @Input() hideUnreadCountForNotificationAndIndicator = false;\n /**\n * You can turn on and off the loading indicator that signals to users that more messages are being loaded to the message list\n */\n @Input() displayLoadingIndicator = true;\n /**\n * @internal\n */\n @Input() limitNumberOfMessagesInList = true;\n typingIndicatorTemplate: TemplateRef<TypingIndicatorContext> | undefined;\n messageTemplate: TemplateRef<MessageContext> | undefined;\n customDateSeparatorTemplate: TemplateRef<DateSeparatorContext> | undefined;\n customnewMessagesIndicatorTemplate:\n | TemplateRef<UnreadMessagesIndicatorContext>\n | undefined;\n customnewMessagesNotificationTemplate:\n | TemplateRef<UnreadMessagesNotificationContext>\n | undefined;\n emptyMainMessageListTemplate: TemplateRef<void> | null = null;\n emptyThreadMessageListTemplate: TemplateRef<void> | null = null;\n messages$!: Observable<StreamMessage[]>;\n enabledMessageActions: string[] = [];\n isEmpty = true;\n newMessageCountWhileBeingScrolled = 0;\n isUserScrolled: boolean | undefined;\n groupStyles: GroupStyle[] = [];\n isNextMessageOnSeparateDate: boolean[] = [];\n lastSentMessageId: string | undefined;\n parentMessage: StreamMessage | undefined;\n highlightedMessageId: string | undefined;\n isLoading = false;\n scrollEndTimeout: any;\n lastReadMessageId?: string;\n isUnreadNotificationVisible = true;\n firstUnreadMessageId?: string;\n unreadCount?: number;\n isJumpingToLatestUnreadMessage = false;\n isJumpToLatestButtonVisible = true;\n @ViewChild('scrollContainer')\n private scrollContainer!: ElementRef<HTMLElement>;\n @ViewChild('parentMessageElement')\n private parentMessageElement!: ElementRef<HTMLElement>;\n private latestMessage: { id: string; created_at: Date } | undefined;\n private hasNewMessages: boolean | undefined;\n private containerHeight: number | undefined;\n private oldestMessage: { id: string; created_at: Date } | undefined;\n private olderMassagesLoaded: boolean | undefined;\n private isNewMessageSentByUser: boolean | undefined;\n private subscriptions: Subscription[] = [];\n private newMessageSubscription: { unsubscribe: () => void } | undefined;\n private prevScrollTop: number | undefined;\n private usersTypingInChannel$!: Observable<\n UserResponse<DefaultStreamChatGenerics>[]\n >;\n private usersTypingInThread$!: Observable<\n UserResponse<DefaultStreamChatGenerics>[]\n >;\n private isLatestMessageInList = true;\n private channelId?: string;\n private parsedDates = new Map<Date, string>();\n private isViewInited = false;\n private checkIfUnreadNotificationIsVisibleTimeout?: any;\n private jumpToLatestButtonVisibilityTimeout?: any;\n private messageRemoveTimeout?: any;\n private removeOldMessagesSubscription?: Subscription;\n private isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n private forceRepaintSubject = new Subject<void>();\n\n @HostBinding('class')\n private get class() {\n return `str-chat-angular__main-panel-inner str-chat-angular__message-list-host str-chat__main-panel-inner ${\n this.isEmpty ? 'str-chat-angular__message-list-host--empty' : ''\n }`;\n }\n\n constructor(\n private channelService: ChannelService,\n private chatClientService: ChatClientService,\n private customTemplatesService: CustomTemplatesService,\n private dateParser: DateParserService,\n private ngZone: NgZone,\n private cdRef: ChangeDetectorRef,\n private messageActionsService: MessageActionsService\n ) {\n this.usersTypingInChannel$ = this.channelService.usersTypingInChannel$;\n this.usersTypingInThread$ = this.channelService.usersTypingInThread$;\n }\n\n messageNotificationJumpClicked = () => {\n this.jumpToFirstUnreadMessage();\n this.isUnreadNotificationVisible = false;\n };\n\n messageNotificationDismissClicked = () => {\n this.isUnreadNotificationVisible = false;\n };\n\n ngOnInit(): void {\n this.subscriptions.push(\n this.forceRepaintSubject.pipe(throttleTime(1000)).subscribe(() => {\n this.forceRepaint();\n })\n );\n this.subscriptions.push(\n this.channelService.activeChannel$.subscribe((channel) => {\n this.chatClientService.chatClient?.logger?.(\n 'info',\n `${channel?.cid || 'undefined'} selected`,\n { tags: `message list ${this.mode}` }\n );\n let isNewChannel = false;\n if (this.channelId !== channel?.id) {\n isNewChannel = true;\n if (this.checkIfUnreadNotificationIsVisibleTimeout) {\n clearTimeout(this.checkIfUnreadNotificationIsVisibleTimeout);\n }\n this.isUnreadNotificationVisible = false;\n this.chatClientService?.chatClient?.logger?.(\n 'info',\n `new channel is different from prev channel, reseting scroll state`,\n { tags: `message list ${this.mode}` }\n );\n this.parsedDates = new Map();\n if (this.messageRemoveTimeout) {\n clearTimeout(this.messageRemoveTimeout);\n }\n this.resetScrollState();\n this.channelId = channel?.id;\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n if (this.mode === 'main') {\n const lastReadMessageId =\n this.channelService.activeChannelLastReadMessageId;\n const unreadCount = this.channelService.activeChannelUnreadCount;\n if (\n lastReadMessageId !== this.lastReadMessageId ||\n unreadCount !== this.unreadCount\n ) {\n this.lastReadMessageId = lastReadMessageId;\n this.unreadCount = unreadCount || 0;\n if (isNewChannel && this.lastReadMessageId) {\n if (this.openMessageListAt === 'last-read-message') {\n this.jumpToFirstUnreadMessage();\n } else {\n // Wait till messages and the unread banner is rendered\n // If unread banner isn't visible on the screen, we display the unread notificaion\n setTimeout(() => {\n const bannerElement = document.getElementById(\n 'stream-chat-new-message-indicator'\n );\n if (\n !bannerElement ||\n bannerElement?.offsetTop <\n this.scrollContainer?.nativeElement?.scrollHeight -\n this.scrollContainer?.nativeElement?.clientHeight\n ) {\n this.isUnreadNotificationVisible = true;\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n }, 100);\n }\n }\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n } else if (this.lastReadMessageId) {\n this.lastReadMessageId = undefined;\n this.unreadCount = 0;\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n const capabilites = channel?.data?.own_capabilities as string[];\n const capabilitesString = [...(capabilites || [])].sort().join('');\n const enabledActionsString = [...(this.enabledMessageActions || [])]\n .sort()\n .join('');\n if (capabilitesString !== enabledActionsString) {\n this.enabledMessageActions = capabilites || [];\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n this.newMessageSubscription?.unsubscribe();\n if (channel) {\n this.newMessageSubscription = channel.on('message.new', (event) => {\n // If we display main channel messages and we're switched to an older message set -> use message.new event to update unread count and detect new messages sent by current user\n if (\n !event.message ||\n channel.state.messages === channel.state.latestMessages ||\n this.mode === 'thread'\n ) {\n return;\n }\n this.newMessageReceived({\n id: event.message.id,\n user: event.message.user,\n created_at: new Date(event.message.created_at || ''),\n });\n });\n }\n })\n );\n this.subscriptions.push(\n this.messageActionsService.customActions$.subscribe((actions) => {\n if (actions !== this.customMessageActions) {\n this.customMessageActions = actions;\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n })\n );\n this.subscriptions.push(\n this.channelService.activeParentMessage$.subscribe((message) => {\n if (\n message &&\n this.parentMessage &&\n message.id !== this.parentMessage.id &&\n this.mode === 'thread'\n ) {\n this.resetScrollState();\n }\n if (this.parentMessage === message) {\n return;\n }\n this.parentMessage = message;\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n })\n );\n this.subscriptions.push(\n this.customTemplatesService.messageTemplate$.subscribe((template) => {\n if (this.messageTemplate === template) {\n return;\n }\n this.messageTemplate = template;\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n })\n );\n this.subscriptions.push(\n this.customTemplatesService.dateSeparatorTemplate$.subscribe(\n (template) => {\n if (this.customDateSeparatorTemplate === template) {\n return;\n }\n this.customDateSeparatorTemplate = template;\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n )\n );\n this.subscriptions.push(\n this.customTemplatesService.newMessagesIndicatorTemplate$.subscribe(\n (template) => {\n if (this.customnewMessagesIndicatorTemplate === template) {\n return;\n }\n this.customnewMessagesIndicatorTemplate = template;\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n )\n );\n this.subscriptions.push(\n this.customTemplatesService.newMessagesNotificationTemplate$.subscribe(\n (template) => {\n if (this.customnewMessagesNotificationTemplate === template) {\n return;\n }\n this.customnewMessagesNotificationTemplate = template;\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n )\n );\n this.subscriptions.push(\n this.customTemplatesService.typingIndicatorTemplate$.subscribe(\n (template) => {\n if (this.typingIndicatorTemplate === template) {\n return;\n }\n this.typingIndicatorTemplate = template;\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n )\n );\n this.subscriptions.push(\n this.channelService.jumpToMessage$\n .pipe(filter((config) => !!config.id))\n .subscribe((config) => {\n let messageId: string | undefined = undefined;\n if (this.messageRemoveTimeout) {\n clearTimeout(this.messageRemoveTimeout);\n }\n if (this.mode === 'main') {\n messageId = config.parentId || config.id;\n } else if (config.parentId) {\n messageId = config.id;\n }\n this.chatClientService.chatClient?.logger?.(\n 'info',\n `Jumping to ${messageId || ''}`,\n { tags: `message list ${this.mode}` }\n );\n if (messageId) {\n if (messageId === 'latest') {\n this.scrollToLatestMessage();\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n } else {\n if (this.isJumpingToLatestUnreadMessage) {\n this.scrollMessageIntoView(\n this.firstUnreadMessageId || messageId\n );\n this.highlightedMessageId =\n this.firstUnreadMessageId || messageId;\n } else {\n this.scrollMessageIntoView(messageId);\n this.highlightedMessageId = messageId;\n }\n }\n }\n this.channelService.clearMessageJump();\n })\n );\n this.subscriptions.push(\n this.customTemplatesService.emptyMainMessageListPlaceholder$.subscribe(\n (template) => {\n const isChanged = this.emptyMainMessageListTemplate !== template;\n this.emptyMainMessageListTemplate = template || null;\n if (isChanged && this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n )\n );\n this.subscriptions.push(\n this.customTemplatesService.emptyThreadMessageListPlaceholder$.subscribe(\n (template) => {\n const isChanged = this.emptyThreadMessageListTemplate !== template;\n this.emptyThreadMessageListTemplate = template || null;\n if (isChanged && this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n )\n );\n this.setMessages$();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.mode || changes.direction) {\n this.setMessages$();\n }\n if (changes.direction) {\n if (this.scrollContainer?.nativeElement) {\n this.jumpToLatestMessage();\n }\n }\n if (changes.customMessageActions) {\n this.messageActionsService.customActions$.next(this.customMessageActions);\n }\n }\n\n ngAfterViewInit(): void {\n this.isViewInited = true;\n this.ngZone.runOutsideAngular(() => {\n this.scrollContainer.nativeElement.addEventListener('scroll', () =>\n this.scrolled()\n );\n });\n }\n\n ngAfterViewChecked() {\n if (this.highlightedMessageId) {\n // Turn off programatic scroll adjustments while jump to message is in progress\n this.hasNewMessages = false;\n this.olderMassagesLoaded = false;\n }\n if (this.direction === 'top-to-bottom') {\n if (\n this.hasNewMessages &&\n (this.isNewMessageSentByUser || !this.isUserScrolled)\n ) {\n this.isLatestMessageInList\n ? this.scrollToTop()\n : this.jumpToLatestMessage();\n this.hasNewMessages = false;\n this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;\n }\n } else {\n if (this.hasNewMessages) {\n if (!this.isUserScrolled || this.isNewMessageSentByUser) {\n this.chatClientService.chatClient?.logger?.(\n 'info',\n `User has new messages, and not scrolled or sent new messages, therefore we ${\n this.isLatestMessageInList ? 'scroll' : 'jump'\n } to latest message`,\n { tags: `message list ${this.mode}` }\n );\n this.isLatestMessageInList\n ? this.scrollToBottom()\n : this.jumpToLatestMessage();\n }\n this.hasNewMessages = false;\n this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;\n } else if (this.olderMassagesLoaded) {\n this.chatClientService.chatClient?.logger?.(\n 'info',\n `Older messages are loaded, we preserve the scroll position`,\n { tags: `message list ${this.mode}` }\n );\n this.preserveScrollbarPosition();\n this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;\n this.olderMassagesLoaded = false;\n } else if (\n this.getScrollPosition() !== 'bottom' &&\n !this.isUserScrolled &&\n !this.highlightedMessageId\n ) {\n this.chatClientService.chatClient?.logger?.(\n 'info',\n `Container grew and user didn't scroll therefore we ${\n this.isLatestMessageInList ? 'scroll' : 'jump'\n } to latest message`,\n { tags: `message list ${this.mode}` }\n );\n this.isLatestMessageInList\n ? this.scrollToBottom()\n : this.jumpToLatestMessage();\n this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;\n }\n }\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n this.newMessageSubscription?.unsubscribe();\n if (this.scrollEndTimeout) {\n clearTimeout(this.scrollEndTimeout);\n }\n if (this.checkIfUnreadNotificationIsVisibleTimeout) {\n clearTimeout(this.checkIfUnreadNotificationIsVisibleTimeout);\n }\n if (this.jumpToLatestButtonVisibilityTimeout) {\n clearTimeout(this.jumpToLatestButtonVisibilityTimeout);\n }\n if (this.messageRemoveTimeout) {\n clearTimeout(this.messageRemoveTimeout);\n }\n this.removeOldMessagesSubscription?.unsubscribe();\n }\n\n trackByMessageId(index: number, item: StreamMessage) {\n return item.id;\n }\n\n trackByUserId(index: number, user: UserResponse) {\n return user.id;\n }\n\n jumpToLatestMessage() {\n void this.channelService.jumpToMessage(\n 'latest',\n this.mode === 'thread' ? this.parentMessage?.id : undefined\n );\n }\n\n scrollToBottom(): void {\n this.scrollContainer.nativeElement.scrollTop =\n this.scrollContainer.nativeElement.scrollHeight + 0.1;\n if (this.isSafari) {\n this.forceRepaintSubject.next();\n }\n }\n\n scrollToTop() {\n this.scrollContainer.nativeElement.scrollTop = 0;\n }\n\n scrolled() {\n if (\n this.scrollContainer.nativeElement.scrollHeight ===\n this.scrollContainer.nativeElement.clientHeight\n ) {\n return;\n }\n const scrollPosition = this.getScrollPosition();\n this.chatClientService.chatClient?.logger?.(\n 'info',\n `Scrolled - scroll position: ${scrollPosition}, container height: ${this.scrollContainer.nativeElement.scrollHeight}`,\n { tags: `message list ${this.mode}` }\n );\n\n const isUserScrolled =\n (this.direction === 'bottom-to-top'\n ? scrollPosition !== 'bottom'\n : scrollPosition !== 'top') || !this.isLatestMessageInList;\n if (this.isUserScrolled !== isUserScrolled) {\n this.ngZone.run(() => {\n this.isUserScrolled = isUserScrolled;\n if (!this.isUserScrolled) {\n this.newMessageCountWhileBeingScrolled = 0;\n }\n this.cdRef.detectChanges();\n });\n }\n\n if (this.hideJumpToLatestButtonDuringScroll) {\n if (this.isJumpToLatestButtonVisible) {\n this.isJumpToLatestButtonVisible = false;\n this.cdRef.detectChanges();\n }\n if (this.jumpToLatestButtonVisibilityTimeout) {\n clearTimeout(this.jumpToLatestButtonVisibilityTimeout);\n }\n this.jumpToLatestButtonVisibilityTimeout = setTimeout(() => {\n if (this.isUserScrolled) {\n this.isJumpToLatestButtonVisible = true;\n this.jumpToLatestButtonVisibilityTimeout = undefined;\n this.cdRef.detectChanges();\n }\n }, 100);\n }\n\n if (this.shouldLoadMoreMessages(scrollPosition)) {\n this.ngZone.run(() => {\n this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;\n let direction: 'newer' | 'older';\n if (this.direction === 'top-to-bottom') {\n direction = scrollPosition === 'top' ? 'newer' : 'older';\n } else {\n direction = scrollPosition === 'top' ? 'older' : 'newer';\n }\n const result =\n this.mode === 'main'\n ? this.channelService.loadMoreMessages(direction)\n : this.channelService.loadMoreThreadReplies(direction);\n if (result) {\n this.chatClientService.chatClient?.logger?.(\n 'info',\n `Displaying loading indicator`,\n { tags: `message list ${this.mode}` }\n );\n this.isLoading = true;\n result.catch?.(() => {\n this.isLoading = false;\n });\n }\n this.cdRef.detectChanges();\n });\n }\n this.prevScrollTop = this.scrollContainer.nativeElement.scrollTop;\n }\n\n jumpToFirstUnreadMessage() {\n if (!this.lastReadMessageId) {\n return;\n }\n this.isJumpingToLatestUnreadMessage = true;\n void this.channelService.jumpToMessage(this.lastReadMessageId);\n }\n\n getTypingIndicatorContext(): TypingIndicatorContext {\n return {\n usersTyping$: this.usersTyping$,\n };\n }\n\n getTypingIndicatorText(users: UserResponse[]) {\n const text = listUsers(users);\n\n return text;\n }\n\n isSentByCurrentUser(message?: StreamMessage) {\n if (!message) {\n return false;\n }\n return message.user?.id === this.chatClientService.chatClient.user?.id;\n }\n\n parseDate(date: Date) {\n if (this.parsedDates.has(date)) {\n return this.parsedDates.get(date);\n }\n const parsedDate = this.dateParser.parseDate(date);\n this.parsedDates.set(date, parsedDate);\n return parsedDate;\n }\n\n get replyCountParam() {\n return { replyCount: this.parentMessage?.reply_count };\n }\n\n get emptyListTemplate() {\n return this.mode === 'main'\n ? this.emptyMainMessageListTemplate\n : this.emptyThreadMessageListTemplate;\n }\n\n private preserveScrollbarPosition() {\n this.scrollContainer.nativeElement.scrollTop =\n (this.prevScrollTop || 0) +\n (this.scrollContainer.nativeElement.scrollHeight - this.containerHeight!);\n }\n\n private forceRepaint() {\n // Solves the issue of empty screen on Safari when scrolling\n this.scrollContainer.nativeElement.style.display = 'none';\n this.scrollContainer.nativeElement.offsetHeight; // no need to store this anywhere, the reference is enough\n this.scrollContainer.nativeElement.style.display = '';\n }\n\n private getScrollPosition(): 'top' | 'bottom' | 'middle' {\n let position: 'top' | 'bottom' | 'middle' = 'middle';\n if (\n Math.floor(this.scrollContainer.nativeElement.scrollTop) <=\n (this.parentMessageElement?.nativeElement.clientHeight || 0) &&\n (this.prevScrollTop === undefined ||\n this.prevScrollTop >\n (this.parentMessageElement?.nativeElement.clientHeight || 0))\n ) {\n position = 'top';\n } else if (\n Math.ceil(this.scrollContainer.nativeElement.scrollTop) +\n this.scrollContainer.nativeElement.clientHeight +\n 1 >=\n this.scrollContainer.nativeElement.scrollHeight\n ) {\n position = 'bottom';\n }\n\n return position;\n }\n\n private shouldLoadMoreMessages(scrollPosition: 'top' | 'bottom' | 'middle') {\n return (\n scrollPosition !== 'middle' &&\n !this.highlightedMessageId &&\n !this.isLoading\n );\n }\n\n private setMessages$() {\n this.messages$ = (\n this.mode === 'main'\n ? this.channelService.activeChannelMessages$\n : this.channelService.activeThreadMessages$\n ).pipe(\n tap((messages) => {\n this.isLoading = false;\n if (messages.length === 0) {\n this.chatClientService.chatClient?.logger?.(\n 'info',\n `Empty messages array, reseting scroll state`,\n {\n tags: `message list ${this.mode}`,\n }\n );\n this.resetScrollState();\n return;\n }\n if (this.isEmpty) {\n // cdRef.detectChanges() isn't enough here, test will fail\n setTimeout(() => (this.isEmpty = false), 0);\n }\n this.chatClientService.chatClient?.logger?.(\n 'info',\n `Received one or more messages`,\n {\n tags: `message list ${this.mode}`,\n }\n );\n const currentLatestMessageInState = messages[messages.length - 1];\n this.newMessageReceived(currentLatestMessageInState);\n const currentOldestMessage = messages[0];\n if (\n !this.oldestMessage ||\n !messages.find((m) => m.id === this.oldestMessage!.id)\n ) {\n this.oldestMessage = currentOldestMessage;\n } else if (\n this.oldestMessage.created_at.getTime() >\n currentOldestMessage.created_at.getTime()\n ) {\n this.oldestMessage = currentOldestMessage;\n this.olderMassagesLoaded = true;\n }\n }),\n tap((messages) => {\n if (\n this.isJumpingToLatestUnreadMessage &&\n !this.firstUnreadMessageId &&\n this.lastReadMessageId\n ) {\n const lastReadIndex = messages.findIndex(\n (m) => m.id === this.lastReadMessageId\n );\n this.firstUnreadMessageId =\n messages[lastReadIndex + 1]?.id || this.lastReadMessageId;\n }\n }),\n tap(\n (messages) =>\n (this.lastSentMessageId = [...messages]\n .reverse()\n .find(\n (m) =>\n m.user?.id === this.chatClientService.chatClient?.user?.id &&\n m.status !== 'sending'\n )?.id)\n ),\n tap((messages) => {\n this.isLatestMessageInList =\n !this.latestMessage ||\n messages.length === 0 ||\n messages[messages.length - 1].id === this.latestMessage.id ||\n this.mode === 'thread';\n if (!this.isLatestMessageInList) {\n this.isUserScrolled = true;\n }\n }),\n map((messages) =>\n this.direction === 'bottom-to-top' ? messages : [...messages].reverse()\n ),\n tap((messages) => {\n this.groupStyles = messages.map((m, i) =>\n getGroupStyles(m, messages[i - 1], messages[i + 1], {\n lastReadMessageId: this.lastReadMessageId,\n })\n );\n this.isNextMessageOnSeparateDate = messages.map((m, i) =>\n this.checkIfOnSeparateDates(m, messages[i + 1])\n );\n }),\n shareReplay(1)\n );\n this.removeOldMessagesSubscription?.unsubscribe();\n this.removeOldMessagesSubscription = combineLatest([\n this.channelService.jumpToMessage$,\n this.messages$,\n ]).subscribe(([jumpToMessage, messages]) => {\n if (\n this.limitNumberOfMessagesInList &&\n this.mode === 'main' &&\n messages.length >\n ChannelService.MAX_MESSAGE_COUNT_IN_MESSAGE_LIST * 0.5 &&\n !this.isUserScrolled &&\n !jumpToMessage?.id &&\n this.isLatestMessageInList\n ) {\n if (this.messageRemoveTimeout) {\n clearTimeout(this.messageRemoveTimeout);\n }\n if (\n messages.length >= ChannelService.MAX_MESSAGE_COUNT_IN_MESSAGE_LIST\n ) {\n this.channelService.removeOldMessageFromMessageList();\n } else {\n this.messageRemoveTimeout = setTimeout(() => {\n if (\n this.limitNumberOfMessagesInList &&\n this.mode === 'main' &&\n messages.length >\n ChannelService.MAX_MESSAGE_COUNT_IN_MESSAGE_LIST * 0.5 &&\n !this.isUserScrolled &&\n !this.highlightedMessageId &&\n this.isLatestMessageInList\n ) {\n this.channelService.removeOldMessageFromMessageList();\n }\n }, 1500);\n }\n }\n });\n }\n\n private resetScrollState() {\n this.isEmpty = true;\n this.latestMessage = undefined;\n this.hasNewMessages = true;\n this.isUserScrolled = false;\n this.containerHeight = undefined;\n this.olderMassagesLoaded = false;\n this.oldestMessage = undefined;\n this.newMessageCountWhileBeingScrolled = 0;\n this.prevScrollTop = undefined;\n this.isNewMessageSentByUser = undefined;\n this.isLatestMessageInList = true;\n }\n\n private get usersTyping$() {\n return this.mode === 'thread'\n ? this.usersTypingInThread$\n : this.usersTypingInChannel$;\n }\n\n private scrollMessageIntoView(messageId: string, withRetry = true) {\n const element = document.getElementById(messageId);\n if (!element && withRetry) {\n // If the message was newly inserted into activeChannelMessages$, the message will be rendered after the current change detection cycle -> wait for this cycle to complete\n setTimeout(() => this.scrollMessageIntoView(messageId, false));\n } else if (element) {\n element.scrollIntoView({\n block: 'center',\n });\n setTimeout(() => {\n this.highlightedMessageId = undefined;\n this.firstUnreadMessageId = undefined;\n this.isJumpingToLatestUnreadMessage = false;\n this.cdRef.detectChanges();\n }, 1000);\n }\n }\n\n private scrollToLatestMessage(withRetry = true) {\n if (document.getElementById(this.latestMessage!.id)) {\n this.direction === 'bottom-to-top'\n ? this.scrollToBottom()\n : this.scrollToTop();\n } else if (withRetry) {\n // If the message was newly inserted into activeChannelMessages$, the message will be rendered after the current change detection cycle -> wait for this cycle to complete\n setTimeout(() => this.scrollToLatestMessage(false), 0);\n }\n }\n\n private newMessageReceived(message: {\n id: string;\n created_at: Date;\n user?: { id: string } | null;\n }) {\n const latestMessages =\n this.channelService.activeChannel?.state?.latestMessages;\n if (\n !this.latestMessage ||\n this.latestMessage.created_at?.getTime() < message.created_at.getTime() ||\n (this.mode === 'main' &&\n latestMessages &&\n this.latestMessage &&\n latestMessages[latestMessages.length - 1]?.id !== this.latestMessage.id)\n ) {\n this.chatClientService.chatClient?.logger?.(\n 'info',\n `Received new message`,\n { tags: `message list ${this.mode}` }\n );\n const isNewChannel = !this.latestMessage;\n this.latestMessage = message;\n this.hasNewMessages = true;\n this.isNewMessageSentByUser =\n message.user?.id === this.chatClientService.chatClient?.user?.id;\n if (this.isUserScrolled) {\n this.newMessageCountWhileBeingScrolled++;\n }\n if (\n !this.isNewMessageSentByUser &&\n this.unreadCount !== undefined &&\n !isNewChannel\n ) {\n this.unreadCount++;\n }\n this.cdRef.detectChanges();\n }\n }\n\n private checkIfOnSeparateDates(\n message?: StreamMessage,\n nextMessage?: StreamMessage\n ) {\n if (!message || !nextMessage) {\n return false;\n }\n return isOnSeparateDate(message.created_at, nextMessage.created_at);\n }\n}\n","<ng-container\n *ngIf=\"\n lastReadMessageId &&\n isUnreadNotificationVisible &&\n openMessageListAt === 'last-message' &&\n displayUnreadSeparator\n \"\n>\n <ng-container\n *ngTemplateOutlet=\"\n customnewMessagesNotificationTemplate ||\n defaultUnreadMessagesNotification;\n context: {\n unreadCount: unreadCount,\n onDismiss: messageNotificationDismissClicked,\n onJump: messageNotificationJumpClicked\n }\n \"\n ></ng-container>\n</ng-container>\n<ng-template\n #defaultUnreadMessagesNotification\n let-unreadCount=\"unreadCount\"\n let-onDismiss=\"onDismiss\"\n let-onJump=\"onJump\"\n>\n <div\n class=\"str-chat__unread-messages-notification\"\n data-testid=\"unread-messages-notification\"\n >\n <button\n data-testid=\"unread-messages-notification-jump-to-message\"\n (click)=\"onJump()\"\n >\n <ng-container\n *ngIf=\"\n unreadCount > 0 && !hideUnreadCountForNotificationAndIndicator;\n else noUnreadCount\n \"\n >\n {{\n (unreadCount === 1\n ? \"streamChat.\\{\\{count\\}\\} unread message\"\n : \"streamChat.\\{\\{count\\}\\} unread messages\"\n ) | translate: { count: unreadCount }\n }}\n </ng-container>\n <ng-template #noUnreadCount>\n {{ \"streamChat.Unread messages\" | translate }}\n </ng-template>\n </button>\n <button\n data-testid=\"unread-messages-notification-dismiss\"\n (click)=\"onDismiss()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </button>\n </div>\n</ng-template>\n<div #scrollContainer data-testid=\"scroll-container\" class=\"str-chat__list\">\n <ng-container *ngIf=\"mode === 'main' && isEmpty && emptyListTemplate\">\n <ng-container *ngTemplateOutlet=\"emptyListTemplate\"></ng-container>\n </ng-container>\n <div class=\"str-chat__reverse-infinite-scroll str-chat__message-list-scroll\">\n <ul\n class=\"str-chat__ul\"\n [class.str-chat__message-options-in-bubble]=\"\n messageOptionsTrigger === 'message-bubble'\n \"\n >\n <li\n #parentMessageElement\n *ngIf=\"mode === 'thread' && parentMessage\"\n data-testid=\"parent-message\"\n class=\"str-chat__parent-message-li\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: parentMessage, index: 'parent' }\n \"\n ></ng-container>\n <div data-testid=\"reply-count\" class=\"str-chat__thread-start\">\n {{parentMessage?.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </div>\n </li>\n <ng-container *ngIf=\"mode === 'thread' && isEmpty && emptyListTemplate\">\n <ng-container *ngTemplateOutlet=\"emptyListTemplate\"></ng-container>\n </ng-container>\n <stream-loading-indicator\n data-testid=\"top-loading-indicator\"\n *ngIf=\"\n isLoading && direction === 'bottom-to-top' && displayLoadingIndicator\n \"\n ></stream-loading-indicator>\n <ng-container *ngIf=\"messages$ | async as messages\">\n <ng-container\n *ngFor=\"\n let message of messages;\n let i = index;\n let isFirst = first;\n let isLast = last;\n trackBy: trackByMessageId\n \"\n >\n <ng-container *ngIf=\"isFirst\">\n <ng-container\n *ngTemplateOutlet=\"\n dateSeparator;\n context: {\n date: message.created_at,\n parsedDate: parseDate(message.created_at)\n }\n \"\n ></ng-container>\n </ng-container>\n <li\n tabindex=\"0\"\n data-testclass=\"message\"\n class=\"str-chat__li str-chat__li--{{ groupStyles[i] }}\"\n id=\"{{ message.id }}\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: message, index: i }\n \"\n ></ng-container>\n </li>\n <ng-container\n *ngIf=\"\n (lastReadMessageId === message?.id &&\n direction === 'bottom-to-top') ||\n (direction === 'top-to-bottom' &&\n lastReadMessageId === messages[i + 1]?.id)\n \"\n >\n <li\n *ngIf=\"displayUnreadSeparator\"\n id=\"stream-chat-new-message-indicator\"\n data-testid=\"new-messages-indicator\"\n class=\"str-chat__li str-chat__unread-messages-separator-wrapper\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n customnewMessagesIndicatorTemplate ||\n defaultNewMessagesIndicator;\n context: { unreadCount: unreadCount }\n \"\n ></ng-container>\n </li>\n </ng-container>\n <ng-container *ngIf=\"isNextMessageOnSeparateDate[i]\">\n <ng-container\n *ngTemplateOutlet=\"\n dateSeparator;\n context: {\n date: messages[i + 1].created_at,\n parsedDate: parseDate(messages[i + 1].created_at)\n }\n \"\n ></ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n <stream-loading-indicator\n data-testid=\"bottom-loading-indicator\"\n *ngIf=\"\n isLoading && direction === 'top-to-bottom' && displayLoadingIndicator\n \"\n ></stream-loading-indicator>\n </ul>\n <ng-template #defaultTypingIndicator let-usersTyping$=\"usersTyping$\">\n <!-- eslint-disable-next-line @angular-eslint/template/no-any -->\n <ng-container *ngIf=\"$any(usersTyping$ | async) as users\">\n <div\n *ngIf=\"users.length > 0\"\n data-testid=\"typing-indicator\"\n class=\"str-chat__typing-indicator str-chat__typing-indicator--typing\"\n >\n <div class=\"str-chat__typing-indicator__dots\">\n <span class=\"str-chat__typing-indicator__dot\"></span>\n <span class=\"str-chat__typing-indicator__dot\"></span>\n <span class=\"str-chat__typing-indicator__dot\"></span>\n </div>\n <div\n data-testid=\"typing-users\"\n class=\"str-chat__typing-indicator__users\"\n >\n {{\n users.length === 1\n ? (\"streamChat.user is typing\"\n | translate: { user: getTypingIndicatorText(users) })\n : (\"streamChat.users are typing\"\n | translate: { users: getTypingIndicatorText(users) })\n }}\n </div>\n </div>\n </ng-container>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n typingIndicatorTemplate || defaultTypingIndicator;\n context: getTypingIndicatorContext()\n \"\n ></ng-container>\n </div>\n</div>\n<div class=\"str-chat__jump-to-latest-message\">\n <button\n data-testid=\"scroll-to-latest\"\n *ngIf=\"isUserScrolled && isJumpToLatestButtonVisible\"\n class=\"\n str-chat__message-notification-scroll-to-latest\n str-chat__message-notification-scroll-to-latest-right\n str-chat__circle-fab\n \"\n (keyup.enter)=\"jumpToLatestMessage()\"\n (click)=\"jumpToLatestMessage()\"\n >\n <stream-icon\n class=\"str-chat__jump-to-latest-icon str-chat__circle-fab-icon\"\n [icon]=\"direction === 'bottom-to-top' ? 'arrow-down' : 'arrow-up'\"\n ></stream-icon>\n <div\n *ngIf=\"newMessageCountWhileBeingScrolled > 0\"\n class=\"\n str-chat__message-notification\n str-chat__message-notification-scroll-to-latest-unread-count\n str-chat__jump-to-latest-unread-count\n \"\n >\n {{ newMessageCountWhileBeingScrolled }}\n </div>\n </button>\n</div>\n\n<ng-template #messageTemplateContainer let-message=\"message\" let-index=\"index\">\n <ng-template\n #defaultMessageTemplate\n let-messageInput=\"message\"\n let-isLastSentMessage=\"isLastSentMessage\"\n let-enabledMessageActions=\"enabledMessageActions\"\n let-mode=\"mode\"\n let-isHighlighted=\"isHighlighted\"\n let-customActions=\"customActions\"\n >\n <stream-message\n [message]=\"messageInput\"\n [isLastSentMessage]=\"isLastSentMessage\"\n [enabledMessageActions]=\"enabledMessageActions\"\n [mode]=\"mode\"\n [isHighlighted]=\"isHighlighted\"\n [customActions]=\"customActions\"\n ></stream-message>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplate || defaultMessageTemplate;\n context: {\n message: message,\n isLastSentMessage: !!(\n lastSentMessageId && message?.id === lastSentMessageId\n ),\n enabledMessageActions: enabledMessageActions,\n mode: mode,\n isHighlighted: message?.id === highlightedMessageId,\n customActions: customMessageActions\n }\n \"\n ></ng-container>\n</ng-template>\n\n<ng-template #dateSeparator let-date=\"date\" let-parsedDate=\"parsedDate\">\n <ng-container *ngIf=\"displayDateSeparator\">\n <ng-container\n *ngTemplateOutlet=\"\n customDateSeparatorTemplate || defaultDateSeparator;\n context: {\n date: date,\n parsedDate: parsedDate\n }\n \"\n ></ng-container>\n </ng-container>\n\n <ng-template\n #defaultDateSeparator\n let-date=\"date\"\n let-parsedDate=\"parsedDate\"\n >\n <div data-testid=\"date-separator\" class=\"str-chat__date-separator\">\n <hr\n *ngIf=\"\n dateSeparatorTextPos === 'right' || dateSeparatorTextPos === 'center'\n \"\n class=\"str-chat__date-separator-line\"\n />\n <div class=\"str-chat__date-separator-date\">\n {{ parsedDate }}\n </div>\n <hr\n *ngIf=\"\n dateSeparatorTextPos === 'left' || dateSeparatorTextPos === 'center'\n \"\n class=\"str-chat__date-separator-line\"\n />\n </div>\n </ng-template>\n</ng-template>\n\n<ng-template #defaultNewMessagesIndicator let-unreadCount=\"unreadCount\">\n <div class=\"str-chat__unread-messages-separator\">\n <ng-container\n *ngIf=\"\n unreadCount > 0 && !hideUnreadCountForNotificationAndIndicator;\n else noUnreadCount\n \"\n >\n {{\n (unreadCount === 1\n ? \"streamChat.\\{\\{count\\}\\} unread message\"\n : \"streamChat.\\{\\{count\\}\\} unread messages\"\n ) | translate: { count: unreadCount }\n }}\n </ng-container>\n <ng-template #noUnreadCount>\n {{ \"streamChat.Unread messages\" | translate }}\n </ng-template>\n </div>\n</ng-template>\n","import { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n/**\n * The `ImageLoadService` is used to position the scrollbar in the message list\n * @deprecated - This class is no longer used by SDK components as image sizes are fixed\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ImageLoadService {\n /**\n * A subject that can be used to notify the message list if an image attachment finished loading\n */\n imageLoad$ = new Subject<void>();\n\n constructor() {}\n}\n","import { Component, HostBinding, OnDestroy } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { Channel } from 'stream-chat';\nimport { ChatClientService } from '../chat-client.service';\nimport { ChannelService } from '../channel.service';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { getChannelDisplayText } from '../get-channel-display-text';\nimport {\n DefaultStreamChatGenerics,\n StreamMessage,\n ThreadHeaderContext,\n} from '../types';\n\n/**\n * The `Thread` component represents a [message thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript), it is a container component that displays a thread with a header, [`MessageList`](./MessageListComponent.mdx) and [`MessageInput`](./MessageInputComponent.mdx) components.\n */\n@Component({\n selector: 'stream-thread',\n templateUrl: './thread.component.html',\n styles: [],\n})\nexport class ThreadComponent implements OnDestroy {\n @HostBinding('class') private class = 'str-chat__thread';\n parentMessage: StreamMessage | undefined;\n channel: Channel<DefaultStreamChatGenerics> | undefined;\n private subscriptions: Subscription[] = [];\n\n constructor(\n public customTemplatesService: CustomTemplatesService,\n private channelService: ChannelService,\n private chatClientService: ChatClientService\n ) {\n this.subscriptions.push(\n this.channelService.activeParentMessage$.subscribe(\n (parentMessage) => (this.parentMessage = parentMessage)\n )\n );\n this.subscriptions.push(\n this.channelService.activeChannel$.subscribe(\n (channel) => (this.channel = channel)\n )\n );\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n getThreadHeaderContext(): ThreadHeaderContext {\n return {\n parentMessage: this.parentMessage,\n closeThreadHandler: () => this.closeThread(),\n };\n }\n\n closeThread() {\n void this.channelService.setAsActiveParentMessage(undefined);\n }\n\n get channelName() {\n if (!this.channel || !this.chatClientService.chatClient.user) {\n return '';\n }\n return getChannelDisplayText(\n this.channel,\n this.chatClientService.chatClient.user\n );\n }\n}\n","<div class=\"str-chat__thread-container\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.threadHeaderTemplate$ | async) ||\n defaultThreadHeader;\n context: getThreadHeaderContext()\n \"\n ></ng-container>\n <ng-content></ng-content>\n</div>\n\n<ng-template\n #defaultThreadHeader\n let-parentMessage=\"parentMessage\"\n let-closeThreadHandler=\"closeThreadHandler\"\n>\n <div class=\"str-chat__thread-header\">\n <div class=\"str-chat__thread-header-details\">\n <div class=\"str-chat__thread-header-name\" translate>\n streamChat.Thread\n </div>\n <div\n class=\"str-chat__thread-header-channel-name\"\n data-testid=\"channel-name\"\n >\n {{ channelName }}\n </div>\n </div>\n <button\n class=\"str-chat__square-button str-chat__close-thread-button\"\n data-testid=\"close-button\"\n (click)=\"closeThreadHandler()\"\n >\n <stream-icon-placeholder\n icon=\"close-no-outline\"\n ></stream-icon-placeholder>\n </button>\n </div>\n</ng-template>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { AvatarComponent } from './avatar/avatar.component';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { AvatarPlaceholderComponent } from './avatar-placeholder/avatar-placeholder.component';\n\n@NgModule({\n declarations: [AvatarComponent, AvatarPlaceholderComponent],\n imports: [CommonModule, TranslateModule],\n exports: [AvatarComponent, AvatarPlaceholderComponent],\n})\nexport class StreamAvatarModule {}\n","import { NgModule } from '@angular/core';\nimport { ChannelComponent } from './channel/channel.component';\nimport { ChannelHeaderComponent } from './channel-header/channel-header.component';\nimport { ChannelListComponent } from './channel-list/channel-list.component';\nimport { ChannelPreviewComponent } from './channel-preview/channel-preview.component';\nimport { MessageComponent } from './message/message.component';\nimport { MessageInputComponent } from './message-input/message-input.component';\nimport { MessageListComponent } from './message-list/message-list.component';\nimport { CommonModule } from '@angular/common';\nimport { LoadingIndicatorComponent } from './loading-indicator/loading-indicator.component';\nimport { IconComponent } from './icon/icon.component';\nimport { MessageActionsBoxComponent } from './message-actions-box/message-actions-box.component';\nimport { AttachmentListComponent } from './attachment-list/attachment-list.component';\nimport { MessageReactionsComponent } from './message-reactions/message-reactions.component';\nimport { NotificationComponent } from './notification/notification.component';\nimport { NotificationListComponent } from './notification-list/notification-list.component';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { AttachmentPreviewListComponent } from './attachment-preview-list/attachment-preview-list.component';\nimport { ModalComponent } from './modal/modal.component';\nimport { TextareaDirective } from './message-input/textarea.directive';\nimport { StreamAvatarModule } from './stream-avatar.module';\nimport { ThreadComponent } from './thread/thread.component';\nimport { IconPlaceholderComponent } from './icon-placeholder/icon-placeholder.component';\nimport { LoadingIndicatorPlaceholderComponent } from './loading-indicator-placeholder/loading-indicator-placeholder.component';\nimport { NgxPopperjsModule } from 'ngx-popperjs';\nimport { EditMessageFormComponent } from './edit-message-form/edit-message-form.component';\nimport { MessageBouncePromptComponent } from './message-bounce-prompt/message-bounce-prompt.component';\nimport { VoiceRecordingComponent } from './voice-recording/voice-recording.component';\nimport { VoiceRecordingWavebarComponent } from './voice-recording/voice-recording-wavebar/voice-recording-wavebar.component';\n\n@NgModule({\n declarations: [\n ChannelComponent,\n ChannelHeaderComponent,\n ChannelListComponent,\n ChannelPreviewComponent,\n MessageComponent,\n MessageInputComponent,\n MessageListComponent,\n LoadingIndicatorComponent,\n IconComponent,\n MessageActionsBoxComponent,\n AttachmentListComponent,\n MessageReactionsComponent,\n NotificationComponent,\n NotificationListComponent,\n AttachmentPreviewListComponent,\n ModalComponent,\n TextareaDirective,\n ThreadComponent,\n IconPlaceholderComponent,\n LoadingIndicatorPlaceholderComponent,\n EditMessageFormComponent,\n MessageBouncePromptComponent,\n VoiceRecordingComponent,\n VoiceRecordingWavebarComponent,\n ],\n imports: [\n CommonModule,\n TranslateModule,\n StreamAvatarModule,\n NgxPopperjsModule,\n ],\n exports: [\n ChannelComponent,\n ChannelHeaderComponent,\n ChannelListComponent,\n ChannelPreviewComponent,\n MessageComponent,\n MessageInputComponent,\n MessageListComponent,\n LoadingIndicatorComponent,\n IconComponent,\n MessageActionsBoxComponent,\n AttachmentListComponent,\n MessageReactionsComponent,\n NotificationComponent,\n NotificationListComponent,\n AttachmentPreviewListComponent,\n ModalComponent,\n StreamAvatarModule,\n ThreadComponent,\n IconPlaceholderComponent,\n LoadingIndicatorPlaceholderComponent,\n EditMessageFormComponent,\n MessageBouncePromptComponent,\n VoiceRecordingComponent,\n VoiceRecordingWavebarComponent,\n ],\n})\nexport class StreamChatModule {}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { AutocompleteTextareaComponent } from './message-input/autocomplete-textarea/autocomplete-textarea.component';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { MentionModule } from 'angular-mentions';\nimport { StreamAvatarModule } from './stream-avatar.module';\nimport { textareaInjectionToken } from './injection-tokens';\n\n@NgModule({\n declarations: [AutocompleteTextareaComponent],\n imports: [CommonModule, TranslateModule, MentionModule, StreamAvatarModule],\n exports: [AutocompleteTextareaComponent],\n providers: [\n {\n provide: textareaInjectionToken,\n useValue: AutocompleteTextareaComponent,\n },\n ],\n})\nexport class StreamAutocompleteTextareaModule {}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { TextareaComponent } from './message-input/textarea/textarea.component';\nimport { textareaInjectionToken } from './injection-tokens';\n\n@NgModule({\n declarations: [TextareaComponent],\n imports: [CommonModule, TranslateModule],\n exports: [TextareaComponent],\n providers: [\n {\n provide: textareaInjectionToken,\n useValue: TextareaComponent,\n },\n ],\n})\nexport class StreamTextareaModule {}\n","/*\n * Public API Surface of stream-chat-angular\n */\n\nexport * from './lib/chat-client.service';\nexport * from './lib/channel.service';\nexport * from './lib/theme.service';\nexport * from './lib/attachment.service';\nexport * from './lib/attachment-configuration.service';\nexport * from './lib/stream-i18n.service';\nexport * from './lib/avatar/avatar.component';\nexport * from './lib/avatar-placeholder/avatar-placeholder.component';\nexport * from './lib/icon/icon.component';\nexport * from './lib/icon-placeholder/icon-placeholder.component';\nexport * from './lib/loading-indicator/loading-indicator.component';\nexport * from './lib/loading-indicator-placeholder/loading-indicator-placeholder.component';\nexport * from './lib/message-actions-box/message-actions-box.component';\nexport * from './lib/channel/channel.component';\nexport * from './lib/channel-header/channel-header.component';\nexport * from './lib/channel-preview/channel-preview.component';\nexport * from './lib/channel-list/channel-list.component';\nexport * from './lib/channel-list/channel-list-toggle.service';\nexport * from './lib/message/message.component';\nexport * from './lib/parse-date';\nexport * from './lib/list-users';\nexport * from './lib/message-input/message-input.component';\nexport * from './lib/edit-message-form/edit-message-form.component';\nexport * from './lib/message-bounce-prompt/message-bounce-prompt.component';\nexport * from './lib/message-input/textarea/textarea.component';\nexport * from './lib/message-input/autocomplete-textarea/autocomplete-textarea.component';\nexport * from './lib/message-input/message-input-config.service';\nexport * from './lib/message-input/textarea.directive';\nexport * from './lib/message-input/textarea.interface';\nexport * from './lib/message-input/emoji-input.service';\nexport * from './lib/message-list/message-list.component';\nexport * from './lib/message-list/image-load.service';\nexport * from './lib/message-list/group-styles';\nexport * from './lib/attachment-list/attachment-list.component';\nexport * from './lib/attachment-preview-list/attachment-preview-list.component';\nexport * from './lib/message-reactions/message-reactions.component';\nexport * from './lib/notification/notification.component';\nexport * from './lib/notification-list/notification-list.component';\nexport * from './lib/thread/thread.component';\nexport * from './lib/modal/modal.component';\nexport * from './lib/read-by';\nexport * from './lib/get-message-translation';\nexport * from './lib/get-channel-display-text';\nexport * from './lib/is-image-attachment';\nexport * from './lib/is-image-file';\nexport * from './lib/message-preview';\nexport * from './lib/notification.service';\nexport * from './lib/transliteration.service';\nexport * from './lib/stream-chat.module';\nexport * from './lib/stream-avatar.module';\nexport * from './lib/stream-autocomplete-textarea.module';\nexport * from './lib/stream-textarea.module';\nexport * from './lib/injection-tokens';\nexport * from './lib/custom-templates.service';\nexport * from './lib/message-reactions.service';\nexport * from './lib/date-parser.service';\nexport * from './lib/types';\nexport * from './lib/message.service';\nexport * from './lib/message-actions.service';\nexport * from './lib/voice-recording/voice-recording.component';\nexport * from './lib/voice-recording/voice-recording-wavebar/voice-recording-wavebar.component';\nexport * from './lib/is-on-separate-date';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["BehaviorSubject","Injectable","ReplaySubject","StreamChat","take","uuidv4","shareReplay","map","combineLatest","first","filter","Component","Input","EventEmitter","Output","ViewChild","InjectionToken","Directive","Subject","prettybytes","HostBinding","timer","tap","Inject","distinctUntilChanged","Dayjs","calendar","relativeTime","NgxPopperjsTriggers","NgxPopperjsPlacements","emojiRegex","ChangeDetectionStrategy","transliterate","debounceTime","throttleTime","CommonModule","TranslateModule","NgModule","NgxPopperjsModule","MentionModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA;;;;;;;;;;;;;;IAcA;IAEA,IAAI,aAAa,GAAG,UAAS,CAAC,EAAE,CAAC;QAC7B,aAAa,GAAG,MAAM,CAAC,cAAc;aAChC,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EA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;;;;;;;"}
1
+ {"version":3,"file":"stream-chat-angular.umd.js","sources":["../../../node_modules/tslib/tslib.es6.js","../../../projects/stream-chat-angular/src/assets/version.ts","../../../projects/stream-chat-angular/src/lib/notification.service.ts","../../../projects/stream-chat-angular/src/lib/chat-client.service.ts","../../../projects/stream-chat-angular/src/lib/get-message-translation.ts","../../../projects/stream-chat-angular/src/lib/message-preview.ts","../../../projects/stream-chat-angular/src/lib/read-by.ts","../../../projects/stream-chat-angular/src/lib/channel.service.ts","../../../projects/stream-chat-angular/src/lib/theme.service.ts","../../../projects/stream-chat-angular/src/lib/is-image-file.ts","../../../projects/stream-chat-angular/src/lib/is-image-attachment.ts","../../../projects/stream-chat-angular/src/lib/attachment.service.ts","../../../projects/stream-chat-angular/src/lib/attachment-configuration.service.ts","../../../projects/stream-chat-angular/src/assets/i18n/en.ts","../../../projects/stream-chat-angular/src/lib/stream-i18n.service.ts","../../../projects/stream-chat-angular/src/lib/avatar/avatar.component.ts","../../../projects/stream-chat-angular/src/lib/avatar/avatar.component.html","../../../projects/stream-chat-angular/src/lib/custom-templates.service.ts","../../../projects/stream-chat-angular/src/lib/avatar-placeholder/avatar-placeholder.component.ts","../../../projects/stream-chat-angular/src/lib/avatar-placeholder/avatar-placeholder.component.html","../../../projects/stream-chat-angular/src/lib/icon/icon.component.ts","../../../projects/stream-chat-angular/src/lib/icon/icon.component.html","../../../projects/stream-chat-angular/src/lib/icon-placeholder/icon-placeholder.component.ts","../../../projects/stream-chat-angular/src/lib/icon-placeholder/icon-placeholder.component.html","../../../projects/stream-chat-angular/src/lib/loading-indicator/loading-indicator.component.ts","../../../projects/stream-chat-angular/src/lib/loading-indicator/loading-indicator.component.html","../../../projects/stream-chat-angular/src/lib/loading-indicator-placeholder/loading-indicator-placeholder.component.ts","../../../projects/stream-chat-angular/src/lib/loading-indicator-placeholder/loading-indicator-placeholder.component.html","../../../projects/stream-chat-angular/src/lib/message-actions.service.ts","../../../projects/stream-chat-angular/src/lib/message-actions-box/message-actions-box.component.ts","../../../projects/stream-chat-angular/src/lib/message-actions-box/message-actions-box.component.html","../../../projects/stream-chat-angular/src/lib/modal/modal.component.ts","../../../projects/stream-chat-angular/src/lib/modal/modal.component.html","../../../projects/stream-chat-angular/src/lib/injection-tokens.ts","../../../projects/stream-chat-angular/src/lib/message-input/textarea.directive.ts","../../../projects/stream-chat-angular/src/lib/message-input/emoji-input.service.ts","../../../projects/stream-chat-angular/src/lib/message-input/message-input-config.service.ts","../../../projects/stream-chat-angular/src/lib/voice-recording/voice-recording-wavebar/voice-recording-wavebar.component.ts","../../../projects/stream-chat-angular/src/lib/voice-recording/voice-recording-wavebar/voice-recording-wavebar.component.html","../../../projects/stream-chat-angular/src/lib/voice-recording/voice-recording.component.ts","../../../projects/stream-chat-angular/src/lib/voice-recording/voice-recording.component.html","../../../projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.ts","../../../projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.html","../../../projects/stream-chat-angular/src/lib/attachment-preview-list/attachment-preview-list.component.ts","../../../projects/stream-chat-angular/src/lib/attachment-preview-list/attachment-preview-list.component.html","../../../projects/stream-chat-angular/src/lib/message-input/message-input.component.ts","../../../projects/stream-chat-angular/src/lib/message-input/message-input.component.html","../../../projects/stream-chat-angular/src/lib/notification/notification.component.ts","../../../projects/stream-chat-angular/src/lib/notification/notification.component.html","../../../projects/stream-chat-angular/src/lib/notification-list/notification-list.component.ts","../../../projects/stream-chat-angular/src/lib/notification-list/notification-list.component.html","../../../projects/stream-chat-angular/src/lib/edit-message-form/edit-message-form.component.ts","../../../projects/stream-chat-angular/src/lib/edit-message-form/edit-message-form.component.html","../../../projects/stream-chat-angular/src/lib/message-bounce-prompt/message-bounce-prompt.component.ts","../../../projects/stream-chat-angular/src/lib/message-bounce-prompt/message-bounce-prompt.component.html","../../../projects/stream-chat-angular/src/lib/channel/channel.component.ts","../../../projects/stream-chat-angular/src/lib/channel/channel.component.html","../../../projects/stream-chat-angular/src/lib/list-users.ts","../../../projects/stream-chat-angular/src/lib/get-channel-display-text.ts","../../../projects/stream-chat-angular/src/lib/channel-list/channel-list-toggle.service.ts","../../../projects/stream-chat-angular/src/lib/channel-header/channel-header.component.ts","../../../projects/stream-chat-angular/src/lib/channel-header/channel-header.component.html","../../../projects/stream-chat-angular/src/lib/is-on-separate-date.ts","../../../projects/stream-chat-angular/src/lib/message.service.ts","../../../projects/stream-chat-angular/src/lib/parse-date.ts","../../../projects/stream-chat-angular/src/lib/date-parser.service.ts","../../../projects/stream-chat-angular/src/lib/channel-preview/channel-preview.component.ts","../../../projects/stream-chat-angular/src/lib/channel-preview/channel-preview.component.html","../../../projects/stream-chat-angular/src/lib/channel-list/channel-list.component.ts","../../../projects/stream-chat-angular/src/lib/channel-list/channel-list.component.html","../../../projects/stream-chat-angular/src/lib/message-reactions.service.ts","../../../projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.ts","../../../projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.html","../../../projects/stream-chat-angular/src/lib/message/message.component.ts","../../../projects/stream-chat-angular/src/lib/message/message.component.html","../../../projects/stream-chat-angular/src/lib/message-input/textarea/textarea.component.ts","../../../projects/stream-chat-angular/src/lib/message-input/textarea/textarea.component.html","../../../projects/stream-chat-angular/src/lib/transliteration.service.ts","../../../projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts","../../../projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.html","../../../projects/stream-chat-angular/src/lib/message-list/group-styles.ts","../../../projects/stream-chat-angular/src/lib/message-list/message-list.component.ts","../../../projects/stream-chat-angular/src/lib/message-list/message-list.component.html","../../../projects/stream-chat-angular/src/lib/message-list/image-load.service.ts","../../../projects/stream-chat-angular/src/lib/thread/thread.component.ts","../../../projects/stream-chat-angular/src/lib/thread/thread.component.html","../../../projects/stream-chat-angular/src/lib/stream-avatar.module.ts","../../../projects/stream-chat-angular/src/lib/stream-chat.module.ts","../../../projects/stream-chat-angular/src/lib/stream-autocomplete-textarea.module.ts","../../../projects/stream-chat-angular/src/lib/stream-textarea.module.ts","../../../projects/stream-chat-angular/src/public-api.ts","../../../projects/stream-chat-angular/src/stream-chat-angular.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","export const version = '4.68.6';\n","import { Injectable, TemplateRef } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { NotificationPayload, NotificationType } from './types';\n\n/**\n * The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](../components/NotificationListComponent.mdx) component displays the currently active notifications.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class NotificationService {\n /**\n * Emits the currently active [notifications](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/notification.service.ts).\n */\n notifications$: Observable<NotificationPayload[]>;\n private notificationsSubject = new BehaviorSubject<NotificationPayload[]>([]);\n\n constructor() {\n this.notifications$ = this.notificationsSubject.asObservable();\n }\n\n /**\n * Displays a notification for the given amount of time.\n * @param content The text of the notification or the HTML template for the notification\n * @param type The type of the notification\n * @param timeout The number of milliseconds while the notification should be visible\n * @param translateParams Translation parameters for the `content` (for text notifications)\n * @param templateContext The input of the notification template (for HTML notifications)\n * @returns A method to clear the notification (before the timeout).\n */\n addTemporaryNotification<T>(\n content: string | TemplateRef<T>,\n type: NotificationType = 'error',\n timeout: number = 5000,\n translateParams?: Object,\n templateContext?: T\n ) {\n const notification = this.createNotification<T>(\n content,\n type,\n translateParams,\n templateContext\n );\n const id = setTimeout(\n () => this.removeNotification(notification.id),\n timeout\n );\n notification.dismissFn = () => {\n clearTimeout(id);\n this.removeNotification(notification.id);\n };\n this.notificationsSubject.next([\n ...this.notificationsSubject.getValue(),\n notification,\n ]);\n\n return notification.dismissFn;\n }\n\n /**\n * Displays a notification, that will be visible until it's removed.\n * @param content The text of the notification or the HTML template for the notification\n * @param type The type of the notification\n * @param translateParams Translation parameters for the `content` (for text notifications)\n * @param templateContext The input of the notification template (for HTML notifications)\n * @returns A method to clear the notification.\n */\n addPermanentNotification<\n T = {\n [key: string]: any;\n dismissFn: () => {};\n }\n >(\n content: string | TemplateRef<T>,\n type: NotificationType = 'error',\n translateParams?: Object,\n templateContext?: T\n ) {\n const notification = this.createNotification<T>(\n content,\n type,\n translateParams,\n templateContext\n );\n this.notificationsSubject.next([\n ...this.notificationsSubject.getValue(),\n notification,\n ]);\n\n return notification.dismissFn;\n }\n\n private createNotification<T>(\n content: string | TemplateRef<T>,\n type: NotificationType,\n translateParams?: Object,\n templateContext?: T\n ) {\n const id = new Date().getTime().toString() + Math.random().toString();\n return {\n id,\n [typeof content === 'string' ? 'text' : 'template']: content,\n type,\n translateParams,\n templateContext,\n dismissFn: () => this.removeNotification(id),\n };\n }\n\n private removeNotification(id: string) {\n const notifications = this.notificationsSubject.getValue();\n const index = notifications.findIndex((n) => n.id === id);\n if (index === -1) {\n return;\n }\n notifications.splice(index, 1);\n this.notificationsSubject.next([...notifications]);\n }\n}\n","import { Injectable, NgZone } from '@angular/core';\nimport { BehaviorSubject, Observable, ReplaySubject } from 'rxjs';\nimport {\n Channel,\n ChannelFilters,\n ChannelResponse,\n ConnectAPIResponse,\n OwnUserResponse,\n StreamChatOptions,\n UserFilters,\n UserResponse,\n} from 'stream-chat';\nimport { AppSettings, Event, StreamChat, TokenOrProvider } from 'stream-chat';\nimport { version } from '../assets/version';\nimport { NotificationService } from './notification.service';\nimport { DefaultStreamChatGenerics } from './types';\nimport { take } from 'rxjs/operators';\n\nexport type ClientEvent<\n T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics\n> = {\n eventType: string;\n event: Event<T>;\n};\n\n/**\n * The `ChatClient` service connects the user to the Stream chat.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ChatClientService<\n T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics\n> {\n /**\n * The [StreamChat client](https://github.com/GetStream/stream-chat-js/blob/master/src/client.ts) instance. In general you shouldn't need to access the client, but it's there if you want to use it.\n */\n chatClient!: StreamChat<T>;\n /**\n * Emits [`ClientEvent`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/chat-client.service.ts) events. The platform documentation covers [the list of client, user presence and notification events](https://getstream.io/chat/docs/javascript/event_object/?language=javascript).\n * :::important\n * For performance reasons this Observable operates outside of the Angular change detection zone. If you subscribe to it, you need to manually reenter Angular's change detection zone, our [Change detection guide](../concepts/change-detection.mdx) explains this in detail.\n * :::\n */\n events$: Observable<ClientEvent<T>>;\n /**\n * Emits the current [application settings](https://getstream.io/chat/docs/javascript/app_setting_overview/?language=javascript). Since getting the application settings is an expensive API call and we don't always need the result, this is not initialized by default, you need to call `getApplicationSettings` to load them.\n */\n appSettings$: Observable<AppSettings | undefined>;\n /**\n * Emits the current connection state of the user (`online` or `offline`)\n */\n connectionState$: Observable<'offline' | 'online'>;\n /**\n * Emits the list of pending invites of the user. It emits every pending invitation during initialization and then extends the list when a new invite is received. More information can be found in the [channel invitations](../code-examples/channel-invites.mdx) guide.\n */\n pendingInvites$: Observable<(ChannelResponse<T> | Channel<T>)[]>;\n /**\n * Emits the current chat user\n */\n user$: Observable<OwnUserResponse<T> | UserResponse<T> | undefined>;\n private notificationSubject = new ReplaySubject<ClientEvent<T>>(1);\n private connectionStateSubject = new ReplaySubject<'offline' | 'online'>(1);\n private appSettingsSubject = new BehaviorSubject<AppSettings | undefined>(\n undefined\n );\n private pendingInvitesSubject = new BehaviorSubject<\n (ChannelResponse<T> | Channel<T>)[]\n >([]);\n private userSubject = new ReplaySubject<\n OwnUserResponse<T> | UserResponse<T> | undefined\n >(1);\n private subscriptions: { unsubscribe: () => void }[] = [];\n private trackPendingChannelInvites = true;\n\n constructor(\n private ngZone: NgZone,\n private notificationService: NotificationService\n ) {\n this.events$ = this.notificationSubject.asObservable();\n this.connectionState$ = this.connectionStateSubject.asObservable();\n this.appSettings$ = this.appSettingsSubject.asObservable();\n this.pendingInvites$ = this.pendingInvitesSubject.asObservable();\n this.user$ = this.userSubject.asObservable();\n }\n\n /**\n * Creates a [`StreamChat`](https://github.com/GetStream/stream-chat-js/blob/668b3e5521339f4e14fc657834531b4c8bf8176b/src/client.ts#L124) instance using the provided `apiKey`, and connects a user with the given meta data and token. More info about [connecting users](https://getstream.io/chat/docs/javascript/init_and_users/?language=javascript) can be found in the platform documentation.\n * @param apiKey\n * @param userOrId you can emit this for anonymous logins\n * @param userTokenOrProvider You can provide:<ul>\n * <li> a token, </li>\n * <li> a token provider, a method that returns `Promise<string>`, which can be called when the previous token expires (recommended setup for production applications)</li>\n * <li> the keyword 'guest' to connect as [guest user](https://getstream.io/chat/docs/javascript/authless_users/?language=javascript#guest-users) </li>\n * <li> the keyword 'anonymous' to connect as [anonymous user](https://getstream.io/chat/docs/javascript/authless_users/?language=javascript#anonymous-users) </li>\n * </ul>\n * @param clientOptions Setting to provide to the Stream client instance\n */\n async init(\n apiKey: string,\n userOrId: string | OwnUserResponse<T> | UserResponse<T> | undefined,\n userTokenOrProvider: TokenOrProvider | 'anonymous' | 'guest',\n clientOptions?: StreamChatOptions & { trackPendingChannelInvites?: boolean }\n ): ConnectAPIResponse<T> {\n this.trackPendingChannelInvites =\n clientOptions?.trackPendingChannelInvites !== false;\n this.chatClient = StreamChat.getInstance<T>(apiKey, clientOptions);\n this.chatClient.recoverStateOnReconnect = false;\n this.chatClient.devToken;\n let result;\n await this.ngZone.runOutsideAngular(async () => {\n const user = typeof userOrId === 'string' ? { id: userOrId } : userOrId;\n try {\n result = await (\n {\n guest: () => this.chatClient.setGuestUser(user!),\n anonymous: () => this.chatClient.connectAnonymousUser(),\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n }[`${userTokenOrProvider}`] ??\n (() => this.chatClient.connectUser(user!, userTokenOrProvider))\n )();\n } catch (error) {\n this.notificationService.addPermanentNotification(\n 'streamChat.Error connecting to chat, refresh the page to try again.',\n 'error'\n );\n throw error;\n }\n this.userSubject.next(\n this.chatClient.user ? { ...this.chatClient.user } : undefined\n );\n const sdkPrefix = 'stream-chat-angular';\n if (!this.chatClient.getUserAgent().includes(sdkPrefix)) {\n this.chatClient.setUserAgent(\n `${sdkPrefix}-${version}-${this.chatClient.getUserAgent()}`\n );\n }\n });\n if (this.chatClient.user?.id && this.trackPendingChannelInvites) {\n const channels = await this.chatClient.queryChannels(\n {\n invite: 'pending',\n members: { $in: [this.chatClient.user?.id] },\n } as any as ChannelFilters<T> // TODO: find out why we need this typecast\n );\n this.pendingInvitesSubject.next(channels);\n }\n this.appSettingsSubject.next(undefined);\n this.subscriptions.push(\n this.chatClient.on((e) => {\n this.updateUser(e);\n this.updatePendingInvites(e);\n this.notificationSubject.next({\n eventType: e.type,\n event: e,\n });\n })\n );\n let removeNotification: undefined | Function;\n this.subscriptions.push(\n this.chatClient.on('connection.changed', (e) => {\n this.ngZone.run(() => {\n const isOnline = e.online;\n if (isOnline) {\n if (removeNotification) {\n removeNotification();\n }\n } else {\n removeNotification =\n this.notificationService.addPermanentNotification(\n 'streamChat.Connection failure, reconnecting now...'\n );\n }\n this.connectionStateSubject.next(isOnline ? 'online' : 'offline');\n });\n })\n );\n return result;\n }\n\n /**\n * Disconnects the current user, and closes the WebSocket connection. Useful when disconnecting a chat user, use in combination with [`reset`](./ChannelService.mdx/#reset).\n */\n async disconnectUser() {\n this.pendingInvitesSubject.next([]);\n await this.chatClient.disconnectUser();\n this.userSubject.next(undefined);\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n /**\n * Loads the current [application settings](https://getstream.io/chat/docs/javascript/app_setting_overview/?language=javascript), if the application settings have already been loaded, it does nothing.\n */\n async getAppSettings() {\n if (this.appSettingsSubject.getValue()) {\n return;\n }\n const settings = await this.chatClient.getAppSettings();\n this.appSettingsSubject.next((settings.app as AppSettings) || {});\n }\n\n /**\n * Flag the message with the given ID. If you want to know [more about flags](https://getstream.io/chat/docs/javascript/moderation/?language=javascript) check out the platform documentation.\n * @param messageId\n */\n async flagMessage(messageId: string) {\n await this.chatClient.flagMessage(messageId);\n }\n\n /**\n * Searches for users in the application that have ID or name matching the provided search term\n * @param searchTerm\n * @returns The users matching the search\n */\n async autocompleteUsers(searchTerm: string) {\n if (!searchTerm) {\n return [];\n }\n const result = await this.chatClient.queryUsers({\n $or: [\n { id: { $autocomplete: searchTerm } },\n { name: { $autocomplete: searchTerm } },\n ],\n id: { $ne: this.chatClient.userID! },\n } as UserFilters<T>); // TODO: find out why we need this typecast\n return result.users;\n }\n\n private updatePendingInvites(e: Event<T>) {\n if (!this.trackPendingChannelInvites) {\n return;\n }\n if (e.member?.user?.id === this.chatClient.user?.id && e.channel) {\n const pendingInvites = this.pendingInvitesSubject.getValue();\n if (e.type === 'notification.invited') {\n this.pendingInvitesSubject.next([...pendingInvites, e.channel]);\n } else if (\n e.type === 'notification.invite_accepted' ||\n e.type === 'notification.invite_rejected'\n ) {\n const index = pendingInvites.findIndex(\n (i) => i?.cid === e.channel?.cid\n );\n if (index !== -1) {\n pendingInvites.splice(index, 1);\n this.pendingInvitesSubject.next([...pendingInvites]);\n }\n }\n }\n }\n\n private updateUser(e: Event<T>) {\n if (typeof e.total_unread_count !== 'undefined') {\n let user: OwnUserResponse<T> | UserResponse<T> | undefined;\n this.userSubject.pipe(take(1)).subscribe((u) => {\n user = u;\n });\n if (user && user.total_unread_count !== e.total_unread_count) {\n this.userSubject.next({\n ...user,\n total_unread_count: e.total_unread_count,\n });\n }\n }\n if (typeof e.unread_channels !== 'undefined') {\n let user: OwnUserResponse<T> | UserResponse<T> | undefined;\n this.userSubject.pipe(take(1)).subscribe((u) => {\n user = u;\n });\n if (user && user.unread_channels !== e.unread_channels) {\n this.userSubject.next({\n ...user,\n unread_channels: e.unread_channels,\n });\n }\n }\n if (typeof e.unread_count !== 'undefined') {\n let user: OwnUserResponse<T> | UserResponse<T> | undefined;\n this.userSubject.pipe(take(1)).subscribe((u) => {\n user = u;\n });\n if (user && user.unread_count !== e.unread_count) {\n this.userSubject.next({\n ...user,\n unread_count: e.unread_count,\n });\n }\n }\n if (\n e.type === 'user.updated' &&\n this.chatClient.user &&\n e.user?.id === this.chatClient.user.id\n ) {\n this.userSubject.next({ ...this.chatClient.user });\n }\n }\n}\n","import {\n Channel,\n FormatMessageResponse,\n MessageResponse,\n TranslationLanguages,\n User,\n} from 'stream-chat';\nimport { DefaultStreamChatGenerics, StreamMessage } from './types';\n\nexport const getMessageTranslation = <\n T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics\n>(\n message?: StreamMessage | MessageResponse | FormatMessageResponse,\n channel?: Channel<T>,\n user?: User\n) => {\n const language =\n user?.language ||\n (channel?.data?.auto_translation_language as TranslationLanguages);\n if (language && message?.i18n && message?.user?.id !== user?.id) {\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n return message.i18n[`${language}_text` as `${TranslationLanguages}_text`];\n } else {\n return undefined;\n }\n};\n","import { Attachment, MessageResponse, UserResponse } from 'stream-chat';\nimport { v4 as uuidv4 } from 'uuid';\nimport { DefaultStreamChatGenerics } from './types';\n\nexport const createMessagePreview = <\n T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics\n>(\n user: UserResponse,\n text: string,\n attachments: Attachment<T>[] = [],\n mentionedUsers: UserResponse<T>[] = [],\n parentId: undefined | string = undefined,\n quotedMessageId: undefined | string = undefined,\n customData: undefined | Partial<T['messageType']>\n) => {\n const clientSideId = `${user.id}-${uuidv4()}`;\n\n return {\n __html: text,\n created_at: new Date(),\n html: text,\n id: clientSideId,\n reactions: [],\n status: 'sending',\n text,\n type: 'regular',\n user,\n attachments,\n mentioned_users: mentionedUsers,\n parent_id: parentId,\n quoted_message_id: quotedMessageId,\n ...customData,\n } as unknown as MessageResponse<T>;\n};\n","import { Channel, FormatMessageResponse, UserResponse } from 'stream-chat';\nimport { DefaultStreamChatGenerics } from './types';\n\nexport const getReadBy = <\n T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics\n>(\n message: FormatMessageResponse<T>,\n channel: Channel<T>\n) => {\n const readBy: UserResponse[] = [];\n Object.keys(channel.state.read).forEach((key) => {\n if (\n channel.state.read[key].last_read.getTime() >=\n message.created_at.getTime() &&\n message.user?.id !== key\n ) {\n readBy.push(channel.state.read[key].user);\n }\n });\n\n return readBy;\n};\n","import { Injectable, NgZone } from '@angular/core';\nimport {\n BehaviorSubject,\n combineLatest,\n Observable,\n ReplaySubject,\n Subscription,\n} from 'rxjs';\nimport { filter, first, map, shareReplay, take } from 'rxjs/operators';\nimport {\n Attachment,\n Channel,\n ChannelFilters,\n ChannelOptions,\n ChannelResponse,\n ChannelSort,\n Event,\n EventTypes,\n FormatMessageResponse,\n Message,\n MessageResponse,\n ReactionResponse,\n UpdatedMessage,\n UserFilters,\n UserResponse,\n} from 'stream-chat';\nimport { ChatClientService, ClientEvent } from './chat-client.service';\nimport { getMessageTranslation } from './get-message-translation';\nimport { createMessagePreview } from './message-preview';\nimport { NotificationService } from './notification.service';\nimport { getReadBy } from './read-by';\nimport {\n AttachmentUpload,\n AttachmentUploadErrorReason,\n ChannelQueryState,\n DefaultStreamChatGenerics,\n MessageInput,\n MessageReactionType,\n NextPageConfiguration,\n StreamMessage,\n} from './types';\n\n/**\n * The `ChannelService` provides data and interaction for the channel list and message list.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ChannelService<\n T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics\n> {\n /**\n * Emits `false` if there are no more pages of channels that can be loaded.\n */\n hasMoreChannels$: Observable<boolean>;\n /**\n * Emits the currently loaded and [watched](https://getstream.io/chat/docs/javascript/watch_channel/?language=javascript) channel list.\n *\n * :::important\n * If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](../concepts/change-detection.mdx) explains this in detail.\n * :::\n *\n * Apart from pagination, the channel list is also updated on the following events:\n *\n * | Event type | Default behavior | Custom handler to override |\n * | ----------------------------------- | ------------------------------------------------------------------ | --------------------------------------------- |\n * | `channel.deleted` | Remove channel from the list | `customChannelDeletedHandler` |\n * | `channel.hidden` | Remove channel from the list | `customChannelHiddenHandler` |\n * | `channel.truncated` | Updates the channel | `customChannelTruncatedHandler` |\n * | `channel.updated` | Updates the channel | `customChannelUpdatedHandler` |\n * | `channel.visible` | Adds the channel to the list | `customChannelVisibleHandler` |\n * | `message.new` | Moves the channel to top of the list | `customNewMessageHandler` |\n * | `notification.added_to_channel` | Adds the new channel to the top of the list and starts watching it | `customAddedToChannelNotificationHandler` |\n * | `notification.message_new` | Adds the new channel to the top of the list and starts watching it | `customNewMessageNotificationHandler` |\n * | `notification.removed_from_channel` | Removes the channel from the list | `customRemovedFromChannelNotificationHandler` |\n *\n * It's important to note that filters don't apply to updates to the list from events.\n *\n * Our platform documentation covers the topic of [channel events](https://getstream.io/chat/docs/javascript/event_object/?language=javascript#events) in depth.\n *\n * By default if an error occurs during channel load, the Observable will emit an error, which will close the stream. Users will have to reload the page to be able to reinitialize the `ChannelService`. If you don't want the streams to be closed, you can pass `options.keepAliveChannels$OnError = true` to the `init` method. In that case the `channelQueryState$` stream will emit the status of the latest channel load request.\n */\n channels$: Observable<Channel<T>[] | undefined>;\n /**\n * The result of the latest channel query request.\n */\n channelQueryState$: Observable<ChannelQueryState | undefined>;\n /**\n * Emits the currently active channel.\n *\n * :::important\n * If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](../concepts/change-detection.mdx) explains this in detail.\n * :::\n *\n * The active channel will always be marked as read when a new message is received\n */\n activeChannel$: Observable<Channel<T> | undefined>;\n /**\n * Emits the list of currently loaded messages of the active channel.\n */\n activeChannelMessages$: Observable<StreamMessage<T>[]>;\n /**\n * Emits the list of pinned messages of the active channel.\n */\n activeChannelPinnedMessages$: Observable<StreamMessage<T>[]>;\n /**\n * Emits the id of the currently selected parent message. If no message is selected, it emits undefined.\n */\n activeParentMessageId$: Observable<string | undefined>;\n /**\n * Emits the list of currently loaded thread replies belonging to the selected parent message. If there is no currently active thread it emits an empty array.\n */\n activeThreadMessages$: Observable<StreamMessage<T>[]>;\n /**\n * Emits the currently selected parent message. If no message is selected, it emits undefined.\n */\n activeParentMessage$: Observable<StreamMessage<T> | undefined>;\n /**\n * Emits the currently selected message to quote\n */\n messageToQuote$: Observable<StreamMessage<T> | undefined>;\n /**\n * Emits the ID of the message the message list should jump to (can be a channel message or thread message)\n */\n jumpToMessage$: Observable<{ id?: string; parentId?: string }>;\n /**\n * Emits the list of users that are currently typing in the channel (current user is not included)\n */\n usersTypingInChannel$: Observable<UserResponse<T>[]>;\n /**\n * Emits the list of users that are currently typing in the active thread (current user is not included)\n */\n usersTypingInThread$: Observable<UserResponse<T>[]>;\n /**\n * Emits a map that contains the date of the latest message sent by the current user by channels (this is used to detect if slow mode countdown should be started)\n */\n latestMessageDateByUserByChannels$: Observable<{ [key: string]: Date }>;\n /**\n * If you're using [semantic filters for moderation](https://getstream.io/automated-moderation/docs/automod_configuration/?q=semantic%20filters) you can set up rules for bouncing messages.\n *\n * If a message is bounced, it will be emitted via this `Observable`. The built-in [`MessageBouncePrompt` component](../../components/MessageBouncePromptComponent) will display the bounce option to the user if a bounced message is clicked.\n */\n bouncedMessage$: BehaviorSubject<StreamMessage<T> | undefined>;\n /**\n * The last read message id of the active channel, it's used by the message list component to display unread UI, and jump to latest read message\n *\n * This property isn't always updated, please use `channel.read` to display up-to-date read information\n */\n activeChannelLastReadMessageId?: string;\n /**\n * The unread count of the active channel, it's used by the message list component to display unread UI\n *\n * This property isn't always updated, please use `channel.read` to display up-to-date read information\n */\n activeChannelUnreadCount?: number;\n /**\n * Custom event handler to call if a new message received from a channel that is not being watched, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customNewMessageNotificationHandler?: (\n clientEvent: ClientEvent,\n channelListSetter: (\n channels: (Channel<T> | ChannelResponse<T>)[],\n shouldStopWatchingRemovedChannels?: boolean\n ) => void\n ) => void;\n /**\n * Custom event handler to call when the user is added to a channel, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customAddedToChannelNotificationHandler?: (\n clientEvent: ClientEvent,\n channelListSetter: (\n channels: (Channel<T> | ChannelResponse<T>)[],\n shouldStopWatchingRemovedChannels?: boolean\n ) => void\n ) => void;\n /**\n * Custom event handler to call when the user is removed from a channel, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customRemovedFromChannelNotificationHandler?: (\n clientEvent: ClientEvent,\n channelListSetter: (\n channels: (Channel<T> | ChannelResponse<T>)[],\n shouldStopWatchingRemovedChannels?: boolean\n ) => void\n ) => void;\n /**\n * Custom event handler to call when a channel is deleted, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customChannelDeletedHandler?: (\n event: Event,\n channel: Channel<T>,\n channelListSetter: (\n channels: (Channel<T> | ChannelResponse<T>)[],\n shouldStopWatchingRemovedChannels?: boolean\n ) => void,\n messageListSetter: (messages: StreamMessage<T>[]) => void,\n threadListSetter: (messages: StreamMessage<T>[]) => void,\n parentMessageSetter: (message: StreamMessage<T> | undefined) => void\n ) => void;\n /**\n * Custom event handler to call when a channel is updated, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customChannelUpdatedHandler?: (\n event: Event,\n channel: Channel<T>,\n channelListSetter: (\n channels: (Channel<T> | ChannelResponse<T>)[],\n shouldStopWatchingRemovedChannels?: boolean\n ) => void,\n messageListSetter: (messages: StreamMessage[]) => void,\n threadListSetter: (messages: StreamMessage[]) => void,\n parentMessageSetter: (message: StreamMessage | undefined) => void\n ) => void;\n /**\n * Custom event handler to call when a channel is truncated, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customChannelTruncatedHandler?: (\n event: Event,\n channel: Channel<T>,\n channelListSetter: (\n channels: (Channel<T> | ChannelResponse<T>)[],\n shouldStopWatchingRemovedChannels?: boolean\n ) => void,\n messageListSetter: (messages: StreamMessage<T>[]) => void,\n threadListSetter: (messages: StreamMessage<T>[]) => void,\n parentMessageSetter: (message: StreamMessage<T> | undefined) => void\n ) => void;\n /**\n * Custom event handler to call when a channel becomes hidden, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customChannelHiddenHandler?: (\n event: Event,\n channel: Channel<T>,\n channelListSetter: (\n channels: (Channel<T> | ChannelResponse<T>)[],\n shouldStopWatchingRemovedChannels?: boolean\n ) => void,\n messageListSetter: (messages: StreamMessage<T>[]) => void,\n threadListSetter: (messages: StreamMessage<T>[]) => void,\n parentMessageSetter: (message: StreamMessage<T> | undefined) => void\n ) => void;\n /**\n * Custom event handler to call when a channel becomes visible, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customChannelVisibleHandler?: (\n event: Event,\n channel: Channel<T>,\n channelListSetter: (\n channels: (Channel<T> | ChannelResponse<T>)[],\n shouldStopWatchingRemovedChannels?: boolean\n ) => void,\n messageListSetter: (messages: StreamMessage<T>[]) => void,\n threadListSetter: (messages: StreamMessage<T>[]) => void,\n parentMessageSetter: (message: StreamMessage<T> | undefined) => void\n ) => void;\n /**\n * Custom event handler to call if a new message received from a channel that is being watched, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customNewMessageHandler?: (\n event: Event,\n channel: Channel<T>,\n channelListSetter: (\n channels: (Channel<T> | ChannelResponse<T>)[],\n shouldStopWatchingRemovedChannels?: boolean\n ) => void,\n messageListSetter: (messages: StreamMessage<T>[]) => void,\n threadListSetter: (messages: StreamMessage<T>[]) => void,\n parentMessageSetter: (message: StreamMessage<T> | undefined) => void\n ) => void;\n /**\n * You can override the default file upload request - you can use this to upload files to your own CDN\n */\n customFileUploadRequest?: (\n file: File,\n channel: Channel<T>\n ) => Promise<{ file: string }>;\n /**\n * You can override the default image upload request - you can use this to upload images to your own CDN\n */\n customImageUploadRequest?: (\n file: File,\n channel: Channel<T>\n ) => Promise<{ file: string }>;\n /**\n * You can override the default file delete request - override this if you use your own CDN\n */\n customFileDeleteRequest?: (url: string, channel: Channel<T>) => Promise<void>;\n /**\n * You can override the default image delete request - override this if you use your own CDN\n */\n customImageDeleteRequest?: (\n url: string,\n channel: Channel<T>\n ) => Promise<void>;\n /**\n * The provided method will be called before deleting a message. If the returned Promise resolves to `true` to deletion will go ahead. If `false` is returned, the message won't be deleted.\n */\n messageDeleteConfirmationHandler?: (\n message: StreamMessage<T>\n ) => Promise<boolean>;\n /**\n * The provided method will be called before a new message is sent to Stream's API. You can use this hook to tranfrom or enrich the message being sent.\n */\n beforeSendMessage?: (\n input: MessageInput<T>\n ) => MessageInput<T> | Promise<MessageInput<T>>;\n /**\n * The provided method will be called before a message is sent to Stream's API for update. You can use this hook to tranfrom or enrich the message being updated.\n */\n beforeUpdateMessage?: (\n message: StreamMessage<T>\n ) => StreamMessage<T> | Promise<StreamMessage<T>>;\n /**\n * By default the SDK uses an offset based pagination, you can change/extend this by providing your own custom paginator method.\n *\n * The method will be called with the result of the latest channel query.\n *\n * You can return either an offset, or a filter using the [`$lte`/`$gte` operator](https://getstream.io/chat/docs/javascript/query_syntax_operators/). If you return a filter, it will be merged with the filter provided for the `init` method.\n */\n customPaginator?: (channelQueryResult: Channel<T>[]) => NextPageConfiguration;\n /**\n * @internal\n */\n static readonly MAX_MESSAGE_COUNT_IN_MESSAGE_LIST = 250;\n /**\n * @internal\n */\n static readonly MAX_MESSAGE_REACTIONS_TO_FETCH = 1200;\n private channelsSubject = new BehaviorSubject<Channel<T>[] | undefined>(\n undefined\n );\n private activeChannelSubject = new BehaviorSubject<Channel<T> | undefined>(\n undefined\n );\n private activeChannelMessagesSubject = new BehaviorSubject<\n (StreamMessage<T> | MessageResponse<T> | FormatMessageResponse<T>)[]\n >([]);\n private activeChannelPinnedMessagesSubject = new BehaviorSubject<\n StreamMessage[]\n >([]);\n private hasMoreChannelsSubject = new ReplaySubject<boolean>(1);\n private activeChannelSubscriptions: { unsubscribe: () => void }[] = [];\n private channelSubscriptions: { [key: string]: () => void } = {};\n private activeParentMessageIdSubject = new BehaviorSubject<\n string | undefined\n >(undefined);\n private activeThreadMessagesSubject = new BehaviorSubject<\n (StreamMessage<T> | MessageResponse<T> | FormatMessageResponse<T>)[]\n >([]);\n private jumpToMessageSubject = new BehaviorSubject<{\n id?: string;\n parentId?: string;\n }>({ id: undefined, parentId: undefined });\n private latestMessageDateByUserByChannelsSubject = new BehaviorSubject<{\n [key: string]: Date;\n }>({});\n private filters: ChannelFilters<T> | undefined;\n private sort: ChannelSort<T> | undefined;\n private options:\n | (ChannelOptions & { keepAliveChannels$OnError?: boolean })\n | undefined;\n private readonly messagePageSize = 25;\n private messageToQuoteSubject = new BehaviorSubject<\n StreamMessage<T> | undefined\n >(undefined);\n private usersTypingInChannelSubject = new BehaviorSubject<UserResponse<T>[]>(\n []\n );\n private usersTypingInThreadSubject = new BehaviorSubject<UserResponse<T>[]>(\n []\n );\n private _shouldMarkActiveChannelAsRead = true;\n private shouldSetActiveChannel: boolean | undefined;\n private clientEventsSubscription: Subscription | undefined;\n private isStateRecoveryInProgress = false;\n private channelQueryStateSubject = new BehaviorSubject<\n ChannelQueryState | undefined\n >(undefined);\n\n private channelListSetter = (\n channels: (Channel<T> | ChannelResponse<T>)[],\n shouldStopWatchingRemovedChannels = true\n ) => {\n const currentChannels = this.channelsSubject.getValue() || [];\n const newChannels = channels.filter(\n (c) => !currentChannels.find((channel) => channel.cid === c.cid)\n );\n const deletedChannels = currentChannels.filter(\n (c) => !channels?.find((channel) => channel.cid === c.cid)\n );\n void this.addChannelsFromNotification(newChannels as ChannelResponse<T>[]);\n this.removeChannelsFromChannelList(\n deletedChannels.map((c) => c.cid),\n shouldStopWatchingRemovedChannels\n );\n };\n\n private messageListSetter = (messages: StreamMessage<T>[]) => {\n this.activeChannelMessagesSubject.next(messages);\n };\n\n private threadListSetter = (messages: StreamMessage<T>[]) => {\n this.activeThreadMessagesSubject.next(messages);\n };\n\n private parentMessageSetter = (message: StreamMessage<T> | undefined) => {\n this.activeParentMessageIdSubject.next(message?.id);\n };\n private dismissErrorNotification?: Function;\n private nextPageConfiguration?: NextPageConfiguration;\n private areReadEventsPaused = false;\n private markReadThrottleTime = 1050;\n private markReadTimeout?: ReturnType<typeof setTimeout>;\n private scheduledMarkReadRequest?: () => void;\n\n constructor(\n private chatClientService: ChatClientService<T>,\n private ngZone: NgZone,\n private notificationService: NotificationService\n ) {\n this.channels$ = this.channelsSubject.asObservable().pipe(shareReplay(1));\n this.activeChannel$ = this.activeChannelSubject\n .asObservable()\n .pipe(shareReplay(1));\n this.activeChannelMessages$ = this.activeChannelMessagesSubject.pipe(\n map((messages) => {\n const channel = this.activeChannelSubject.getValue()!;\n return messages.map((message) =>\n this.transformToStreamMessage(message, channel)\n );\n }),\n shareReplay(1)\n );\n this.bouncedMessage$ = new BehaviorSubject<StreamMessage<T> | undefined>(\n undefined\n );\n this.hasMoreChannels$ = this.hasMoreChannelsSubject\n .asObservable()\n .pipe(shareReplay(1));\n this.activeParentMessageId$ = this.activeParentMessageIdSubject\n .asObservable()\n .pipe(shareReplay(1));\n this.activeThreadMessages$ = this.activeThreadMessagesSubject.pipe(\n map((messages) => {\n const channel = this.activeChannelSubject.getValue()!;\n return messages.map((message) =>\n this.transformToStreamMessage(message, channel)\n );\n }),\n shareReplay(1)\n );\n this.activeParentMessage$ = combineLatest([\n this.activeChannelMessages$,\n this.activeParentMessageId$,\n ]).pipe(\n map(\n ([messages, parentMessageId]: [\n StreamMessage[],\n string | undefined\n ]) => {\n if (!parentMessageId) {\n return undefined;\n } else {\n const message = messages.find((m) => m.id === parentMessageId);\n if (!message) {\n void this.setAsActiveParentMessage(undefined);\n return undefined;\n } else {\n return message;\n }\n }\n }\n ),\n shareReplay(1)\n );\n this.messageToQuote$ = this.messageToQuoteSubject\n .asObservable()\n .pipe(shareReplay(1));\n this.jumpToMessage$ = this.jumpToMessageSubject\n .asObservable()\n .pipe(shareReplay(1));\n\n this.usersTypingInChannel$ = this.usersTypingInChannelSubject\n .asObservable()\n .pipe(shareReplay(1));\n this.usersTypingInThread$ = this.usersTypingInThreadSubject\n .asObservable()\n .pipe(shareReplay(1));\n this.latestMessageDateByUserByChannels$ =\n this.latestMessageDateByUserByChannelsSubject\n .asObservable()\n .pipe(shareReplay(1));\n this.activeChannelPinnedMessages$ = this.activeChannelPinnedMessagesSubject\n .asObservable()\n .pipe(shareReplay(1));\n this.channelQueryState$ = this.channelQueryStateSubject\n .asObservable()\n .pipe(shareReplay(1));\n }\n\n /**\n * internal\n */\n removeOldMessageFromMessageList() {\n const channel = this.activeChannelSubject.getValue();\n const channelMessages = channel?.state.latestMessages;\n const targetLength = Math.ceil(\n ChannelService.MAX_MESSAGE_COUNT_IN_MESSAGE_LIST / 2\n );\n if (\n !channel ||\n !channelMessages ||\n channelMessages !== channel?.state.latestMessages ||\n channelMessages.length <= targetLength\n ) {\n return;\n }\n const messages = channelMessages;\n messages.splice(0, messages.length - targetLength);\n this.activeChannelMessagesSubject.next(messages);\n }\n\n /**\n * If set to false, read events won't be sent as new messages are received. If set to true active channel (if any) will immediately be marked as read.\n */\n get shouldMarkActiveChannelAsRead() {\n return this._shouldMarkActiveChannelAsRead;\n }\n\n /**\n * If set to false, read events won't be sent as new messages are received. If set to true active channel (if any) will immediately be marked as read.\n */\n set shouldMarkActiveChannelAsRead(shouldMarkActiveChannelAsRead: boolean) {\n if (!this._shouldMarkActiveChannelAsRead && shouldMarkActiveChannelAsRead) {\n const activeChannel = this.activeChannelSubject.getValue();\n if (activeChannel && this.canSendReadEvents) {\n void activeChannel.markRead();\n }\n }\n this._shouldMarkActiveChannelAsRead = shouldMarkActiveChannelAsRead;\n }\n\n /**\n * Sets the given `channel` as active and marks it as read.\n * If the channel wasn't previously part of the channel, it will be added to the beginning of the list.\n *\n * @param channel\n */\n setAsActiveChannel(channel: Channel<T>) {\n const prevActiveChannel = this.activeChannelSubject.getValue();\n if (prevActiveChannel?.cid === channel.cid) {\n return;\n }\n this.stopWatchForActiveChannelEvents(prevActiveChannel);\n this.flushMarkReadQueue();\n this.areReadEventsPaused = false;\n const readState =\n channel.state.read[this.chatClientService.chatClient.user?.id || ''];\n this.activeChannelLastReadMessageId = readState?.last_read_message_id;\n if (\n channel.state.latestMessages[channel.state.latestMessages.length - 1]\n ?.id === this.activeChannelLastReadMessageId\n ) {\n this.activeChannelLastReadMessageId = undefined;\n }\n this.activeChannelUnreadCount = readState?.unread_messages || 0;\n this.watchForActiveChannelEvents(channel);\n this.addChannel(channel);\n this.activeChannelSubject.next(channel);\n const channelStateLength = channel.state.latestMessages.length;\n if (channelStateLength > 2 * this.messagePageSize) {\n channel.state.latestMessages = channel.state.latestMessages.slice(\n channelStateLength - 2 * this.messagePageSize\n );\n }\n this.setChannelState(channel);\n }\n\n /**\n * Deselects the currently active (if any) channel\n */\n deselectActiveChannel() {\n const activeChannel = this.activeChannelSubject.getValue();\n if (!activeChannel) {\n return;\n }\n this.stopWatchForActiveChannelEvents(activeChannel);\n this.flushMarkReadQueue();\n this.activeChannelMessagesSubject.next([]);\n this.activeChannelSubject.next(undefined);\n this.activeParentMessageIdSubject.next(undefined);\n this.activeThreadMessagesSubject.next([]);\n this.latestMessageDateByUserByChannelsSubject.next({});\n this.selectMessageToQuote(undefined);\n this.jumpToMessageSubject.next({ id: undefined, parentId: undefined });\n this.activeChannelPinnedMessagesSubject.next([]);\n this.usersTypingInChannelSubject.next([]);\n this.usersTypingInThreadSubject.next([]);\n this.activeChannelLastReadMessageId = undefined;\n this.activeChannelUnreadCount = undefined;\n this.areReadEventsPaused = false;\n }\n\n /**\n * Sets the given `message` as an active parent message. If `undefined` is provided, it will deleselect the current parent message.\n * @param message\n * @param loadMessagesForm\n */\n async setAsActiveParentMessage(\n message: StreamMessage<T> | undefined,\n loadMessagesForm: 'request' | 'state' = 'request'\n ) {\n const messageToQuote = this.messageToQuoteSubject.getValue();\n if (messageToQuote && !!messageToQuote.parent_id) {\n this.messageToQuoteSubject.next(undefined);\n }\n if (!message) {\n this.activeParentMessageIdSubject.next(undefined);\n this.activeThreadMessagesSubject.next([]);\n const messageToJumpTo = this.jumpToMessageSubject.getValue();\n if (messageToJumpTo && !!messageToJumpTo.parentId) {\n this.jumpToMessageSubject.next({ id: undefined, parentId: undefined });\n }\n } else {\n this.activeParentMessageIdSubject.next(message.id);\n const activeChannel = this.activeChannelSubject.getValue();\n if (loadMessagesForm === 'request') {\n const result = await activeChannel?.getReplies(message.id, {\n limit: this.options?.message_limit,\n });\n this.activeThreadMessagesSubject.next(result?.messages || []);\n } else {\n this.activeThreadMessagesSubject.next(\n activeChannel?.state.threads[message.id] || []\n );\n }\n }\n }\n\n /**\n * Loads the next page of messages of the active channel. The page size can be set in the [query option](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript#query-options) object.\n * @param direction\n */\n loadMoreMessages(direction: 'older' | 'newer' = 'older') {\n const activeChnannel = this.activeChannelSubject.getValue();\n const messages = this.activeChannelMessagesSubject.getValue();\n const lastMessageId =\n messages[direction === 'older' ? 0 : messages.length - 1]?.id;\n if (\n direction === 'newer' &&\n activeChnannel?.state?.latestMessages === activeChnannel?.state?.messages\n ) {\n // If we are on latest message set, activeChannelMessages$ will be refreshed by WS events, no need for a request\n return false;\n }\n return activeChnannel\n ?.query({\n messages: {\n limit: this.options?.message_limit,\n [direction === 'older' ? 'id_lt' : 'id_gt']: lastMessageId,\n },\n members: { limit: 0 },\n watchers: { limit: 0 },\n })\n .then((res) => {\n if (\n activeChnannel?.data?.id ===\n this.activeChannelSubject.getValue()?.data?.id\n ) {\n this.activeChannelMessagesSubject.next([\n ...activeChnannel.state.messages,\n ]);\n }\n\n return res;\n });\n }\n\n /**\n * Loads the next page of messages of the active thread. The page size can be set in the [query option](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript#query-options) object.\n * @param direction\n */\n async loadMoreThreadReplies(direction: 'older' | 'newer' = 'older') {\n if (direction === 'newer') {\n // Thread replies aren't broke into different message sets, activeThreadMessages$ will be refreshed by WS events, no need for a request\n return;\n }\n const activeChnannel = this.activeChannelSubject.getValue();\n const parentMessageId = this.activeParentMessageIdSubject.getValue();\n if (!parentMessageId) {\n return;\n }\n const threadMessages = this.activeThreadMessagesSubject.getValue();\n const lastMessageId =\n threadMessages[direction === 'older' ? 0 : threadMessages.length - 1]?.id;\n await activeChnannel?.getReplies(parentMessageId, {\n limit: this.options?.message_limit,\n [direction === 'older' ? 'id_lt' : 'id_gt']: lastMessageId,\n });\n this.activeThreadMessagesSubject.next(\n activeChnannel?.state.threads[parentMessageId] || []\n );\n }\n\n /**\n * Queries the channels with the given filters, sorts and options. More info about [channel querying](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript) can be found in the platform documentation. By default the first channel in the list will be set as active channel and will be marked as read.\n * @param filters\n * @param sort\n * @param options\n * @param shouldSetActiveChannel Decides if the first channel in the result should be made as an active channel, or no channel should be marked as active\n * @returns the list of channels found by the query\n */\n async init(\n filters: ChannelFilters<T>,\n sort?: ChannelSort<T>,\n options?: ChannelOptions & { keepAliveChannels$OnError?: boolean },\n shouldSetActiveChannel: boolean = true\n ) {\n this.filters = filters;\n this.options = {\n limit: 25,\n state: true,\n presence: true,\n watch: true,\n message_limit: this.messagePageSize,\n ...options,\n };\n this.sort = sort || { last_message_at: -1 };\n this.shouldSetActiveChannel = shouldSetActiveChannel;\n this.clientEventsSubscription = this.chatClientService.events$.subscribe(\n (notification) => void this.handleNotification(notification)\n );\n try {\n const result = await this.queryChannels(this.shouldSetActiveChannel);\n return result;\n } catch (error) {\n this.dismissErrorNotification =\n this.notificationService.addPermanentNotification(\n 'streamChat.Error loading channels',\n 'error'\n );\n throw error;\n }\n }\n\n /**\n * Resets the `activeChannel$`, `channels$` and `activeChannelMessages$` Observables. Useful when disconnecting a chat user, use in combination with [`disconnectUser`](./ChatClientService.mdx/#disconnectuser).\n */\n reset() {\n this.deselectActiveChannel();\n this.channelsSubject.next(undefined);\n this.channelQueryStateSubject.next(undefined);\n this.clientEventsSubscription?.unsubscribe();\n this.dismissErrorNotification?.();\n this.dismissErrorNotification = undefined;\n Object.keys(this.channelSubscriptions).forEach((cid) => {\n this.channelSubscriptions[cid]();\n });\n this.channelSubscriptions = {};\n this.nextPageConfiguration = undefined;\n }\n\n /**\n * Loads the next page of channels. The page size can be set in the [query option](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript#query-options) object.\n */\n async loadMoreChannels() {\n await this.queryChannels(false);\n }\n\n /**\n * Adds a reaction to a message.\n * @param messageId The id of the message to add the reaction to\n * @param reactionType The type of the reaction\n * @param customData\n */\n async addReaction(\n messageId: string,\n reactionType: MessageReactionType,\n customData?: T['reactionType']\n ) {\n await this.activeChannelSubject.getValue()?.sendReaction(messageId, {\n type: reactionType,\n ...customData,\n });\n }\n\n /**\n * Removes a reaction from a message.\n * @param messageId The id of the message to remove the reaction from\n * @param reactionType Thr type of reaction to remove\n */\n async removeReaction(messageId: string, reactionType: MessageReactionType) {\n await this.activeChannelSubject\n .getValue()\n ?.deleteReaction(messageId, reactionType);\n }\n\n /**\n * Sends a message to the active channel. The message is immediately added to the message list, if an error occurs and the message can't be sent, the error is indicated in `state` of the message.\n * @param text The text of the message\n * @param attachments The attachments\n * @param mentionedUsers Mentioned users\n * @param parentId Id of the parent message (if sending a thread reply)\n * @param quotedMessageId Id of the message to quote (if sending a quote reply)\n * @param customData\n */\n async sendMessage(\n text: string,\n attachments: Attachment<T>[] = [],\n mentionedUsers: UserResponse<T>[] = [],\n parentId: string | undefined = undefined,\n quotedMessageId: string | undefined = undefined,\n customData: undefined | Partial<T['messageType']> = undefined\n ) {\n let input: MessageInput<T> = {\n text,\n attachments,\n mentionedUsers,\n parentId,\n quotedMessageId,\n customData,\n };\n if (this.beforeSendMessage) {\n input = await this.beforeSendMessage(input);\n }\n const preview = createMessagePreview(\n this.chatClientService.chatClient.user!,\n input.text,\n input.attachments,\n input.mentionedUsers,\n input.parentId,\n input.quotedMessageId,\n input.customData\n );\n const channel = this.activeChannelSubject.getValue()!;\n preview.readBy = [];\n channel.state.addMessageSorted(preview, true);\n const response = await this.sendMessageRequest(preview, input.customData);\n return response;\n }\n\n /**\n * Resends the given message to the active channel\n * @param message The message to resend\n */\n async resendMessage(message: StreamMessage) {\n const channel = this.activeChannelSubject.getValue()!;\n channel.state.addMessageSorted(\n {\n ...(message as any as MessageResponse<T>),\n errorStatusCode: undefined,\n status: 'sending',\n },\n true\n );\n return this.sendMessageRequest(message, undefined, true);\n }\n\n /**\n * Updates the message in the active channel\n * @param message Mesage to be updated\n */\n async updateMessage(message: StreamMessage<T>) {\n let messageToUpdate = { ...message };\n delete messageToUpdate.i18n;\n if (this.beforeUpdateMessage) {\n messageToUpdate = await this.beforeUpdateMessage(messageToUpdate);\n }\n if (message.moderation_details) {\n return this.resendMessage(message);\n }\n const response = await this.chatClientService.chatClient.updateMessage(\n messageToUpdate as any as UpdatedMessage<T>\n );\n\n const channel = this.channelsSubject\n .getValue()\n ?.find((c) => c.cid === message.cid);\n\n if (\n response.message.type === 'error' &&\n response.message.moderation_details\n ) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.This message did not meet our content guidelines'\n );\n return message;\n }\n\n return this.transformToStreamMessage(response.message, channel);\n }\n\n /**\n * Deletes the message from the active channel\n * @param message Message to be deleted\n * @param isLocalDelete set this `true` if you want to delete a message that's only part of the local state, not yet saved on the backend\n */\n async deleteMessage(message: StreamMessage, isLocalDelete = false) {\n if (isLocalDelete && this.activeChannel) {\n const result = this.activeChannel.state.removeMessage({\n id: message.id,\n parent_id: message.parent_id,\n });\n if (result) {\n message.parent_id\n ? this.activeThreadMessagesSubject.next(\n this.activeChannel.state.threads[message.parent_id]\n )\n : this.activeChannelMessagesSubject.next(\n this.activeChannel.state.messages\n );\n }\n return;\n }\n if (this.messageDeleteConfirmationHandler) {\n const result = await this.messageDeleteConfirmationHandler(message);\n if (result) {\n await this.chatClientService.chatClient.deleteMessage(message.id);\n }\n } else {\n await this.chatClientService.chatClient.deleteMessage(message.id);\n }\n }\n\n /**\n * Uploads files to the channel. If you want to know more about [file uploads](https://getstream.io/chat/docs/javascript/file_uploads/?language=javascript) check out the platform documentation.\n * @param uploads the attachments to upload (output of the [`AttachmentService`](./AttachmentService.mdx))\n * @returns the result of file upload requests\n */\n async uploadAttachments(\n uploads: AttachmentUpload[]\n ): Promise<AttachmentUpload[]> {\n const result: AttachmentUpload[] = [];\n const channel = this.activeChannelSubject.getValue()!;\n const uploadResults = await Promise.allSettled(\n uploads.map((upload) =>\n upload.type === 'image'\n ? this.customImageUploadRequest\n ? this.customImageUploadRequest(upload.file, channel)\n : channel.sendImage(upload.file, upload.file.name, upload.file.type)\n : this.customFileUploadRequest\n ? this.customFileUploadRequest(upload.file, channel)\n : channel.sendFile(upload.file, upload.file.name, upload.file.type)\n )\n );\n uploadResults.forEach((uploadResult, i) => {\n const file = uploads[i].file;\n const type = uploads[i].type;\n if (uploadResult.status === 'fulfilled') {\n result.push({\n file,\n type,\n state: 'success',\n url: uploadResult.value.file,\n /* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access */\n thumb_url: (uploadResult.value as any).thumb_url,\n });\n } else {\n let reason: AttachmentUploadErrorReason = 'unknown';\n let extraData: { param: string } | undefined;\n /* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment */\n const message: string | undefined =\n /* eslint-disable-next-line @typescript-eslint/no-unsafe-member-access */\n uploadResult.reason.response?.data?.message;\n /* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment */\n const code: number | undefined =\n /* eslint-disable-next-line @typescript-eslint/no-unsafe-member-access */\n uploadResult.reason.response?.data?.code;\n if (code === 22) {\n reason = 'file-size';\n extraData = { param: /\\d+MB/.exec(message || '')?.[0] || '100MB' };\n } else if (\n code === 4 &&\n message?.toLowerCase()?.includes('file extension')\n ) {\n reason = 'file-extension';\n extraData = { param: /\\.\\w+/.exec(message)?.[0] || '' };\n }\n result.push({\n file,\n type,\n state: 'error',\n errorReason: reason,\n errorExtraInfo: extraData ? [extraData] : undefined,\n });\n }\n });\n\n return result;\n }\n\n /**\n * Deletes an uploaded file by URL. If you want to know more about [file uploads](https://getstream.io/chat/docs/javascript/file_uploads/?language=javascript) check out the platform documentation\n * @param attachmentUpload Attachment to be deleted (output of the [`AttachmentService`](./AttachmentService.mdx))\n */\n async deleteAttachment(attachmentUpload: AttachmentUpload) {\n const channel = this.activeChannelSubject.getValue()!;\n await (attachmentUpload.type === 'image'\n ? this.customImageDeleteRequest\n ? this.customImageDeleteRequest(attachmentUpload.url!, channel)\n : channel.deleteImage(attachmentUpload.url!)\n : this.customFileDeleteRequest\n ? this.customFileDeleteRequest(attachmentUpload.url!, channel)\n : channel.deleteFile(attachmentUpload.url!));\n }\n\n /**\n * Returns the autocomplete options for current channel members. If the channel has less than 100 members, it returns the channel members, otherwise sends a [search request](https://getstream.io/chat/docs/javascript/query_members/?language=javascript#pagination-and-ordering) with the given search term.\n * @param searchTerm Text to search for in the names of members\n * @returns The list of members matching the search filter\n */\n async autocompleteMembers(searchTerm: string) {\n const activeChannel = this.activeChannelSubject.getValue();\n if (!activeChannel) {\n return [];\n }\n if (Object.keys(activeChannel.state.members).length < 100) {\n return Object.values(activeChannel.state.members).filter(\n (m) => m.user?.id !== this.chatClientService.chatClient.userID!\n );\n } else {\n if (!searchTerm) {\n return [];\n }\n const result = await activeChannel.queryMembers({\n name: { $autocomplete: searchTerm },\n id: { $ne: this.chatClientService.chatClient.userID! },\n } as UserFilters<T>); // TODO: find out why we need typecast here\n return Object.values(result.members);\n }\n }\n\n /**\n * [Runs a message action](https://getstream.io/chat/docs/rest/#messages-runmessageaction) in the current channel. Updates the message list based on the action result (if no message is returned, the message will be removed from the message list).\n * @param messageId\n * @param formData\n * @param parentMessageId\n */\n async sendAction(\n messageId: string,\n formData: Record<string, string>,\n parentMessageId?: string\n ) {\n const channel = this.activeChannelSubject.getValue()!;\n const response = await channel.sendAction(messageId, formData);\n if (response?.message) {\n channel.state.addMessageSorted({\n ...response.message,\n status: 'received',\n });\n const isThreadReply = !!response.message.parent_id;\n isThreadReply\n ? this.activeThreadMessagesSubject.next([\n ...channel.state.threads[response.message.parent_id!],\n ])\n : this.activeChannelMessagesSubject.next([...channel.state.messages]);\n } else {\n channel.state.removeMessage({\n id: messageId,\n parent_id: parentMessageId,\n });\n if (parentMessageId) {\n this.activeThreadMessagesSubject.next(\n channel.state.threads[this.activeParentMessageIdSubject.getValue()!]\n );\n } else {\n this.activeChannelMessagesSubject.next([...channel.state.messages]);\n }\n }\n }\n\n /**\n * Selects or deselects the current message to quote reply to\n * @param message The message to select, if called with `undefined`, it deselects the message\n */\n selectMessageToQuote(message: StreamMessage | undefined) {\n this.messageToQuoteSubject.next(message);\n }\n\n /**\n * Add a new channel to the channel list\n * The channel will be added to the beginning of the channel list\n * @param channel\n */\n addChannel(channel: Channel<T>) {\n if (!this.channels.find((c) => c.cid === channel.cid)) {\n this.channelsSubject.next([channel, ...this.channels]);\n this.watchForChannelEvents(channel);\n }\n }\n\n private async sendMessageRequest(\n preview: MessageResponse<T> | StreamMessage<T>,\n customData?: Partial<T['messageType']>,\n isResend = false\n ) {\n const channel = this.activeChannelSubject.getValue()!;\n const isThreadReply = !!preview.parent_id;\n isThreadReply\n ? this.activeThreadMessagesSubject.next([\n ...channel.state.threads[preview.parent_id!],\n ])\n : this.activeChannelMessagesSubject.next([...channel.state.messages]);\n try {\n const response = await channel.sendMessage({\n id: preview.id,\n text: preview.text,\n attachments: preview.attachments,\n mentioned_users: preview.mentioned_users?.map((u) => u.id),\n parent_id: preview.parent_id,\n quoted_message_id: preview.quoted_message_id,\n ...customData,\n } as Message<T>); // TODO: find out why we need typecast here\n channel.state.addMessageSorted(\n {\n ...response.message,\n status: 'received',\n },\n true\n );\n isThreadReply\n ? this.activeThreadMessagesSubject.next([\n ...channel.state.threads[preview.parent_id!],\n ])\n : this.activeChannelMessagesSubject.next([...channel.state.messages]);\n let messages!: StreamMessage<T>[];\n (isThreadReply ? this.activeThreadMessages$ : this.activeChannelMessages$)\n .pipe(take(1))\n .subscribe((m) => (messages = m));\n const newMessage = messages[messages.length - 1]!;\n return newMessage;\n } catch (error: any) {\n const stringError = JSON.stringify(error);\n const parsedError: {\n status?: number;\n code?: number;\n response?: { data?: { message?: string } };\n } = stringError ? (JSON.parse(stringError) as { status?: number }) : {};\n\n let isAlreadyExists = false;\n if (isResend) {\n if (\n parsedError.status === 400 &&\n parsedError.code === 4 &&\n parsedError?.response?.data?.message?.includes('already exists')\n ) {\n isAlreadyExists = true;\n }\n }\n\n channel.state.addMessageSorted(\n {\n ...(preview as MessageResponse<T>),\n errorStatusCode: isAlreadyExists\n ? undefined\n : parsedError.status || undefined,\n status: isAlreadyExists ? 'received' : 'failed',\n },\n true\n );\n isThreadReply\n ? this.activeThreadMessagesSubject.next([\n ...channel.state.threads[preview.parent_id!],\n ])\n : this.activeChannelMessagesSubject.next([...channel.state.messages]);\n let messages!: StreamMessage<T>[];\n (isThreadReply ? this.activeThreadMessages$ : this.activeChannelMessages$)\n .pipe(take(1))\n .subscribe((m) => (messages = m));\n const newMessage = messages[messages.length - 1]!;\n return newMessage;\n }\n }\n\n /**\n * Jumps to the selected message inside the message list, if the message is not yet loaded, it'll load the message (and it's surroundings) from the API.\n * @param messageId The ID of the message to be loaded, 'latest' means jump to the latest messages\n * @param parentMessageId The ID of the parent message if we want to load a thread message\n */\n async jumpToMessage(messageId: string, parentMessageId?: string) {\n const activeChannel = this.activeChannelSubject.getValue();\n try {\n await activeChannel?.state.loadMessageIntoState(\n messageId,\n parentMessageId\n );\n const messages = activeChannel?.state.messages || [];\n this.activeChannelMessagesSubject.next([...messages]);\n if (parentMessageId) {\n const parentMessage = messages.find((m) => m.id === parentMessageId);\n void this.setAsActiveParentMessage(parentMessage, 'state');\n }\n this.jumpToMessageSubject.next({\n id: messageId,\n parentId: parentMessageId,\n });\n } catch (error) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Message not found'\n );\n throw error;\n }\n }\n\n /**\n * Clears the currently selected message to jump\n */\n clearMessageJump() {\n this.jumpToMessageSubject.next({ id: undefined, parentId: undefined });\n }\n\n /**\n * Pins the given message in the channel\n * @param message\n */\n async pinMessage(message: StreamMessage<DefaultStreamChatGenerics>) {\n try {\n await this.chatClientService.chatClient?.pinMessage(message);\n this.notificationService.addTemporaryNotification(\n 'streamChat.Message pinned',\n 'success'\n );\n } catch (error) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error pinning message'\n );\n throw error;\n }\n }\n\n /**\n * Removes the given message from pinned messages\n * @param message\n */\n async unpinMessage(message: StreamMessage<DefaultStreamChatGenerics>) {\n try {\n await this.chatClientService.chatClient?.unpinMessage(message);\n this.notificationService.addTemporaryNotification(\n 'streamChat.Message unpinned',\n 'success'\n );\n } catch (error) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error removing message pin'\n );\n throw error;\n }\n }\n\n private handleNotification(clientEvent: ClientEvent<T>) {\n switch (clientEvent.eventType) {\n case 'connection.recovered': {\n void this.ngZone.run(async () => {\n if (this.isStateRecoveryInProgress) {\n return;\n }\n this.isStateRecoveryInProgress = true;\n try {\n this.nextPageConfiguration = undefined;\n // If channel list is not inited, we set the active channel\n const shoulSetActiveChannel =\n this.shouldSetActiveChannel &&\n !this.activeChannelSubject.getValue();\n await this.queryChannels(shoulSetActiveChannel || false, true);\n if (this.activeChannelSubject.getValue()) {\n // Thread messages are not refetched so active thread gets deselected to avoid displaying stale messages\n void this.setAsActiveParentMessage(undefined);\n // Update and reselect message to quote\n const messageToQuote = this.messageToQuoteSubject.getValue();\n this.setChannelState(this.activeChannelSubject.getValue()!);\n let messages!: StreamMessage<T>[];\n this.activeChannelMessages$\n .pipe(take(1))\n .subscribe((m) => (messages = m));\n const updatedMessageToQuote = messages.find(\n (m) => m.id === messageToQuote?.id\n );\n if (updatedMessageToQuote) {\n this.selectMessageToQuote(updatedMessageToQuote);\n }\n }\n this.isStateRecoveryInProgress = false;\n } catch {\n this.isStateRecoveryInProgress = false;\n }\n });\n break;\n }\n case 'notification.message_new': {\n this.ngZone.run(() => {\n if (this.customNewMessageNotificationHandler) {\n this.customNewMessageNotificationHandler(\n clientEvent,\n this.channelListSetter\n );\n } else {\n this.handleNewMessageNotification(clientEvent);\n }\n });\n break;\n }\n case 'notification.added_to_channel': {\n this.ngZone.run(() => {\n if (this.customAddedToChannelNotificationHandler) {\n this.customAddedToChannelNotificationHandler(\n clientEvent,\n this.channelListSetter\n );\n } else {\n this.handleAddedToChannelNotification(clientEvent);\n }\n });\n break;\n }\n case 'notification.removed_from_channel': {\n this.ngZone.run(() => {\n if (this.customRemovedFromChannelNotificationHandler) {\n this.customRemovedFromChannelNotificationHandler(\n clientEvent,\n this.channelListSetter\n );\n } else {\n this.handleRemovedFromChannelNotification(clientEvent);\n }\n });\n break;\n }\n case 'user.updated': {\n this.ngZone.run(() => {\n const updatedChannels = this.channelsSubject.getValue()?.map((c) => {\n if (this.chatClientService.chatClient.activeChannels[c.cid]) {\n return this.chatClientService.chatClient.activeChannels[c.cid];\n } else {\n return c;\n }\n });\n this.channelsSubject.next(updatedChannels);\n const activeChannel = this.activeChannelSubject.getValue();\n if (activeChannel) {\n this.activeChannelSubject.next(\n this.chatClientService.chatClient.activeChannels[\n activeChannel.cid\n ] || activeChannel\n );\n this.activeChannelMessagesSubject.next(\n activeChannel.state.messages.map((m) => {\n m.readBy = getReadBy(m, activeChannel);\n return { ...m };\n })\n );\n const activeParentMessage =\n this.activeParentMessageIdSubject.getValue();\n if (activeParentMessage) {\n const messages = activeChannel.state.threads[activeParentMessage];\n this.activeThreadMessagesSubject.next([...messages]);\n }\n this.activeChannelPinnedMessagesSubject.next([\n ...activeChannel.state.pinnedMessages,\n ]);\n }\n });\n break;\n }\n }\n }\n\n private handleRemovedFromChannelNotification(clientEvent: ClientEvent<T>) {\n const channelIdToBeRemoved = clientEvent.event.channel!.cid;\n this.removeChannelsFromChannelList([channelIdToBeRemoved], true);\n }\n\n private handleNewMessageNotification(clientEvent: ClientEvent<T>) {\n if (clientEvent.event.channel) {\n void this.addChannelsFromNotification([clientEvent.event.channel]);\n }\n }\n\n private handleAddedToChannelNotification(clientEvent: ClientEvent<T>) {\n if (clientEvent.event.channel) {\n void this.addChannelsFromNotification([clientEvent.event.channel]);\n }\n }\n\n private async addChannelsFromNotification(\n channelResponses: ChannelResponse<T>[]\n ) {\n let newChannels: Channel<T>[] = [];\n const watchRequests: Promise<any>[] = [];\n channelResponses.forEach((channelResponse) => {\n const channel = this.chatClientService.chatClient.channel(\n channelResponse.type,\n channelResponse.id\n );\n watchRequests.push(channel.watch());\n newChannels.push(channel);\n });\n await Promise.all(watchRequests);\n const currentChannels = this.channelsSubject.getValue() || [];\n newChannels = newChannels.filter(\n (newChannel) => !currentChannels.find((c) => c.cid === newChannel.cid)\n );\n if (newChannels.length > 0) {\n newChannels.forEach((c) => this.watchForChannelEvents(c));\n this.channelsSubject.next([...newChannels, ...currentChannels]);\n }\n }\n\n private removeChannelsFromChannelList(\n cids: string[],\n shouldStopWatching: boolean\n ) {\n const channels = this.channels.filter((c) => !cids.includes(c.cid || ''));\n if (shouldStopWatching) {\n cids.forEach((cid) => {\n if (this.channelSubscriptions[cid]) {\n this.channelSubscriptions[cid]();\n delete this.channelSubscriptions.cid;\n }\n void this.chatClientService.chatClient.activeChannels[\n cid\n ]?.stopWatching();\n });\n }\n if (channels.length < this.channels.length) {\n this.channelsSubject.next(channels);\n if (cids.includes(this.activeChannelSubject.getValue()?.cid || '')) {\n if (channels.length > 0) {\n this.setAsActiveChannel(channels[0]);\n } else {\n this.activeChannelSubject.next(undefined);\n }\n }\n }\n }\n\n private watchForActiveChannelEvents(channel: Channel<T>) {\n this.activeChannelSubscriptions.push(\n channel.on('message.new', (event) => {\n this.ngZone.run(() => {\n event.message && event.message.parent_id\n ? event.message.parent_id ===\n this.activeParentMessageIdSubject.getValue()\n ? this.activeThreadMessagesSubject.next([\n ...channel.state.threads[event.message.parent_id],\n ])\n : null\n : this.activeChannelMessagesSubject.next([\n ...channel.state.messages,\n ]);\n this.activeChannel$.pipe(first()).subscribe((c) => {\n if (c) {\n this.markRead(c);\n }\n });\n this.updateLatestMessages(event);\n });\n })\n );\n this.activeChannelSubscriptions.push(\n channel.on('message.updated', (event) => this.messageUpdated(event))\n );\n this.activeChannelSubscriptions.push(\n channel.on('message.deleted', (event) => this.messageUpdated(event))\n );\n this.activeChannelSubscriptions.push(\n channel.on('reaction.new', (e) => this.messageReactionEventReceived(e))\n );\n this.activeChannelSubscriptions.push(\n channel.on('reaction.deleted', (e) =>\n this.messageReactionEventReceived(e)\n )\n );\n this.activeChannelSubscriptions.push(\n channel.on('reaction.updated', (e) =>\n this.messageReactionEventReceived(e)\n )\n );\n this.activeChannelSubscriptions.push(\n channel.on('message.read', (e) => {\n this.ngZone.run(() => {\n let latestMessage!: StreamMessage;\n let messages!: StreamMessage[];\n this.activeChannelMessages$.pipe(first()).subscribe((m) => {\n messages = m;\n latestMessage = messages[messages.length - 1];\n });\n if (!latestMessage || !e.user) {\n return;\n }\n if (latestMessage.readBy) {\n latestMessage.readBy.splice(0, latestMessage.readBy.length);\n } else {\n latestMessage.readBy = [];\n }\n latestMessage.readBy.push(...getReadBy(latestMessage, channel));\n messages[messages.length - 1] = { ...latestMessage };\n\n this.activeChannelMessagesSubject.next([...messages]);\n });\n })\n );\n this.activeChannelSubscriptions.push(\n this.chatClientService.events$\n .pipe(\n filter(\n (e) =>\n e.eventType === 'notification.mark_unread' &&\n e.event.channel_id === channel.id\n ),\n map((e) => e.event)\n )\n .subscribe((e) => {\n this.ngZone.run(() => {\n this.activeChannelLastReadMessageId = e.last_read_message_id;\n this.activeChannelUnreadCount = e.unread_messages;\n this.activeChannelSubject.next(this.activeChannel);\n });\n })\n );\n this.activeChannelSubscriptions.push(\n channel.on('typing.start', (e) =>\n this.ngZone.run(() => this.handleTypingStartEvent(e))\n )\n );\n this.activeChannelSubscriptions.push(\n channel.on('typing.stop', (e) =>\n this.ngZone.run(() => this.handleTypingStopEvent(e))\n )\n );\n }\n\n /**\n * Call this method if user started typing in the active channel\n * @param parentId The id of the parent message, if user is typing in a thread\n */\n async typingStarted(parentId?: string) {\n const activeChannel = this.activeChannelSubject.getValue();\n await activeChannel?.keystroke(parentId);\n }\n\n /**\n * Call this method if user stopped typing in the active channel\n * @param parentId The id of the parent message, if user were typing in a thread\n */\n async typingStopped(parentId?: string) {\n const activeChannel = this.activeChannelSubject.getValue();\n await activeChannel?.stopTyping(parentId);\n }\n\n /**\n * The current list of channels\n */\n get channels() {\n return this.channelsSubject.getValue() || [];\n }\n\n /**\n * The current active channel\n */\n get activeChannel() {\n return this.activeChannelSubject.getValue() || undefined;\n }\n\n /**\n * The current active channel messages\n */\n get activeChannelMessages() {\n return this.activeChannelMessagesSubject.getValue() || [];\n }\n\n /**\n * Get the last 1200 reactions of a message in the current active channel. If you need to fetch more reactions please use the [following endpoint](https://getstream.io/chat/docs/javascript/send_reaction/?language=javascript#paginating-reactions).\n * @param messageId\n * @returns all reactions of a message\n */\n async getMessageReactions(messageId: string) {\n const reactions: ReactionResponse<T>[] = [];\n const limit = 300;\n let offset = 0;\n const reactionsLimit = ChannelService.MAX_MESSAGE_REACTIONS_TO_FETCH;\n let lastPageSize = limit;\n\n while (lastPageSize === limit && reactions.length < reactionsLimit) {\n try {\n const response = await this.activeChannel?.getReactions(messageId, {\n offset,\n limit,\n });\n lastPageSize = response?.reactions?.length || 0;\n if (lastPageSize > 0) {\n reactions.push(...response!.reactions);\n }\n offset += lastPageSize;\n } catch (e) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error loading reactions'\n );\n throw e;\n }\n }\n return reactions;\n }\n\n /**\n * Marks the channel from the given message as unread\n * @param messageId\n * @returns the result of the request\n */\n async markMessageUnread(messageId: string) {\n if (!this.activeChannel) {\n return;\n }\n\n try {\n const response = await this.activeChannel.markUnread({\n message_id: messageId,\n });\n this.areReadEventsPaused = true;\n return response;\n } catch (e: any) {\n const error: {\n response?: {\n data?: { code?: number; message?: string; StatusCode?: number };\n };\n } = JSON.parse(JSON.stringify(e)) as {\n response?: {\n data?: { code?: number; message?: string; StatusCode?: number };\n };\n };\n const data = error?.response?.data;\n if (\n data &&\n data.code === 4 &&\n data.StatusCode === 400 &&\n data.message?.includes('it is older than last')\n ) {\n const count = /\\d+ channel messages/\n .exec(data.message)?.[0]\n .match(/\\d+/)?.[0];\n if (count) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error, only the first {{count}} message can be marked as unread',\n undefined,\n undefined,\n { count }\n );\n throw e;\n }\n }\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error marking message as unread'\n );\n throw e;\n }\n }\n\n private messageUpdated(event: Event<T>) {\n this.ngZone.run(() => {\n const isThreadReply = event.message && event.message.parent_id;\n const channel = this.activeChannelSubject.getValue();\n if (!channel) {\n return;\n }\n // Get messages from state as message order could change, and message could've been deleted\n const messages: FormatMessageResponse<T>[] = isThreadReply\n ? channel.state.threads[event?.message?.parent_id || '']\n : channel.state.messages;\n if (!messages) {\n return;\n }\n const messageIndex = messages.findIndex(\n (m) => m.id === event?.message?.id\n );\n if (messageIndex !== -1) {\n isThreadReply\n ? this.activeThreadMessagesSubject.next([...messages])\n : this.activeChannelMessagesSubject.next([...messages]);\n this.activeChannelPinnedMessagesSubject.next([\n ...channel.state.pinnedMessages,\n ]);\n }\n });\n }\n\n private messageReactionEventReceived(e: Event<T>) {\n this.ngZone.run(() => {\n const isThreadMessage = e.message && e.message.parent_id;\n let messages!: StreamMessage[];\n (isThreadMessage\n ? this.activeThreadMessages$\n : this.activeChannelMessages$\n )\n .pipe(first())\n .subscribe((m) => (messages = m));\n const messageIndex = messages.findIndex((m) => m.id === e?.message?.id);\n if (messageIndex === -1) {\n return;\n }\n const message = messages[messageIndex];\n message.reaction_counts = { ...e.message?.reaction_counts };\n message.reaction_scores = { ...e.message?.reaction_scores };\n message.latest_reactions = [...(e.message?.latest_reactions || [])];\n message.own_reactions = [...(e.message?.own_reactions || [])];\n\n messages[messageIndex] = { ...message };\n isThreadMessage\n ? this.activeThreadMessagesSubject.next([...messages])\n : this.activeChannelMessagesSubject.next([...messages]);\n });\n }\n\n private formatMessage(message: MessageResponse<T>) {\n const m = message as any as FormatMessageResponse<T>;\n m.pinned_at = message.pinned_at ? new Date(message.pinned_at) : null;\n m.created_at = message.created_at\n ? new Date(message.created_at)\n : new Date();\n m.updated_at = message.updated_at\n ? new Date(message.updated_at)\n : new Date();\n message.status = message.status || 'received';\n\n return m;\n }\n\n private isStreamMessage(\n message: StreamMessage | FormatMessageResponse | MessageResponse\n ): message is StreamMessage {\n return !!message.readBy;\n }\n\n private isFormatMessageResponse(\n message: StreamMessage | FormatMessageResponse | MessageResponse\n ): message is FormatMessageResponse {\n return message.created_at instanceof Date;\n }\n\n private stopWatchForActiveChannelEvents(channel: Channel<T> | undefined) {\n if (!channel) {\n return;\n }\n this.activeChannelSubscriptions.forEach((s) => s.unsubscribe());\n this.activeChannelSubscriptions = [];\n }\n\n private async queryChannels(\n shouldSetActiveChannel: boolean,\n recoverState = false\n ) {\n try {\n this.channelQueryStateSubject.next({ state: 'in-progress' });\n let filters: ChannelFilters<T>;\n let options: ChannelOptions;\n if (this.nextPageConfiguration) {\n if (this.nextPageConfiguration.type === 'filter') {\n filters = {\n ...this.filters!,\n ...this.nextPageConfiguration.paginationFilter,\n };\n options = this.options as ChannelOptions;\n } else {\n options = {\n ...this.options,\n offset: this.nextPageConfiguration.offset,\n };\n filters = this.filters!;\n }\n } else {\n filters = this.filters!;\n options = this.options as ChannelOptions;\n }\n const channels = await this.chatClientService.chatClient.queryChannels(\n filters,\n this.sort || {},\n options\n );\n this.setNextPageConfiguration(channels);\n channels.forEach((c) => this.watchForChannelEvents(c));\n const prevChannels = recoverState\n ? []\n : this.channelsSubject.getValue() || [];\n const filteredChannels = channels.filter(\n (channel) =>\n !prevChannels.find(\n (existingChannel) => existingChannel.cid === channel.cid\n )\n );\n let currentActiveChannel = this.activeChannelSubject.getValue();\n let isCurrentActiveChannelDeselected = false;\n const nextChannels = [...prevChannels, ...filteredChannels];\n if (\n recoverState &&\n currentActiveChannel &&\n !filteredChannels.find((c) => c.cid === currentActiveChannel?.cid)\n ) {\n try {\n await currentActiveChannel.watch();\n nextChannels.unshift(currentActiveChannel);\n } catch (e) {\n isCurrentActiveChannelDeselected = true;\n }\n }\n this.channelsSubject.next(nextChannels);\n if (isCurrentActiveChannelDeselected) {\n this.deselectActiveChannel();\n }\n if (\n filteredChannels.length > 0 &&\n !currentActiveChannel &&\n shouldSetActiveChannel\n ) {\n this.setAsActiveChannel(filteredChannels[0]);\n currentActiveChannel = this.activeChannelSubject.getValue();\n }\n this.hasMoreChannelsSubject.next(channels.length >= this.options!.limit!);\n this.channelQueryStateSubject.next({ state: 'success' });\n if (\n this.options?.keepAliveChannels$OnError &&\n this.dismissErrorNotification\n ) {\n this.dismissErrorNotification();\n }\n return channels;\n } catch (error) {\n if (!this.options?.keepAliveChannels$OnError) {\n this.channelsSubject.error(error);\n }\n this.channelQueryStateSubject.next({\n state: 'error',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n error,\n });\n throw error;\n }\n }\n\n private watchForChannelEvents(channel: Channel<T>) {\n const unsubscribe = channel.on((event: Event<T>) => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const type = event.type as EventTypes | 'capabilities.changed';\n switch (type) {\n case 'message.new': {\n this.ngZone.run(() => {\n if (this.customNewMessageHandler) {\n this.customNewMessageHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleNewMessage(event, channel);\n }\n });\n break;\n }\n case 'channel.hidden': {\n this.ngZone.run(() => {\n if (this.customChannelHiddenHandler) {\n this.customChannelHiddenHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleChannelHidden(event);\n }\n });\n break;\n }\n case 'channel.deleted': {\n this.ngZone.run(() => {\n if (this.customChannelDeletedHandler) {\n this.customChannelDeletedHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleChannelDeleted(event);\n }\n });\n break;\n }\n case 'channel.visible': {\n this.ngZone.run(() => {\n if (this.customChannelVisibleHandler) {\n this.customChannelVisibleHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleChannelVisible(event, channel);\n }\n });\n break;\n }\n case 'channel.updated': {\n this.ngZone.run(() => {\n if (this.customChannelUpdatedHandler) {\n this.customChannelUpdatedHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleChannelUpdate(event);\n }\n });\n break;\n }\n case 'channel.truncated': {\n this.ngZone.run(() => {\n if (this.customChannelTruncatedHandler) {\n this.customChannelTruncatedHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleChannelTruncate(event);\n }\n });\n break;\n }\n case 'capabilities.changed': {\n this.ngZone.run(() => {\n const cid = event.cid;\n if (cid) {\n const currentChannels = this.channelsSubject.getValue();\n const index = currentChannels?.findIndex((c) => c.cid === cid);\n if (index !== -1 && index !== undefined) {\n this.channelsSubject.next([...currentChannels!]);\n if (cid === this.activeChannelSubject.getValue()?.cid) {\n this.activeChannelSubject.next(\n this.activeChannelSubject.getValue()\n );\n }\n }\n }\n });\n break;\n }\n }\n });\n this.channelSubscriptions[channel.cid] = unsubscribe.unsubscribe;\n }\n\n private handleNewMessage(_: Event, channel: Channel<T>) {\n const channelIndex = this.channels.findIndex((c) => c.cid === channel.cid);\n this.channels.splice(channelIndex, 1);\n this.channelsSubject.next([channel, ...this.channels]);\n }\n\n private handleChannelHidden(event: Event) {\n this.removeChannelsFromChannelList([event.channel!.cid], false);\n }\n\n private handleChannelDeleted(event: Event) {\n this.removeChannelsFromChannelList([event.channel!.cid], false);\n }\n\n private handleChannelVisible(event: Event, channel: Channel<T>) {\n if (!this.channels.find((c) => c.cid === event.cid)) {\n this.ngZone.run(() =>\n this.channelsSubject.next([...this.channels, channel])\n );\n }\n }\n\n private handleChannelUpdate(event: Event<T>) {\n const channelIndex = this.channels.findIndex(\n (c) => c.cid === event.channel!.cid\n );\n if (channelIndex !== -1) {\n const channel = this.channels[channelIndex];\n const notIncludedProperies = {\n hidden: channel.data?.hidden || false,\n own_capabilities: channel.data?.own_capabilities || [],\n };\n channel.data = {\n ...event.channel!,\n ...notIncludedProperies,\n };\n this.channelsSubject.next([...this.channels]);\n if (event.channel?.cid === this.activeChannelSubject.getValue()?.cid) {\n this.activeChannelSubject.next(channel);\n }\n }\n }\n\n private handleChannelTruncate(event: Event) {\n const channelIndex = this.channels.findIndex(\n (c) => c.cid === event.channel!.cid\n );\n if (channelIndex !== -1) {\n this.channels[channelIndex].state.messages = [];\n this.channelsSubject.next([...this.channels]);\n if (event.channel?.cid === this.activeChannelSubject.getValue()?.cid) {\n const channel = this.activeChannelSubject.getValue()!;\n channel.state.messages = [];\n this.activeChannelSubject.next(channel);\n this.activeChannelMessagesSubject.next([]);\n this.activeParentMessageIdSubject.next(undefined);\n this.activeThreadMessagesSubject.next([]);\n }\n }\n }\n\n private get canSendReadEvents() {\n const channel = this.activeChannelSubject.getValue();\n if (!channel) {\n return false;\n }\n const capabilites = channel.data?.own_capabilities as string[];\n return capabilites.indexOf('read-events') !== -1;\n }\n\n private transformToStreamMessage(\n message: StreamMessage<T> | MessageResponse<T> | FormatMessageResponse<T>,\n channel?: Channel<T>\n ) {\n const isThreadMessage = !!message.parent_id;\n if (\n this.isStreamMessage(message) &&\n this.isFormatMessageResponse(message)\n ) {\n if (message.quoted_message) {\n message.quoted_message.translation = getMessageTranslation(\n message.quoted_message,\n channel,\n this.chatClientService.chatClient.user\n );\n }\n message.translation = getMessageTranslation(\n message,\n channel,\n this.chatClientService.chatClient.user\n );\n return message;\n } else {\n if (message.quoted_message) {\n message.quoted_message.translation = getMessageTranslation(\n message.quoted_message,\n channel,\n this.chatClientService.chatClient.user\n );\n }\n if (this.isFormatMessageResponse(message)) {\n message.readBy = isThreadMessage\n ? []\n : channel\n ? getReadBy(message, channel)\n : [];\n message.translation = getMessageTranslation(\n message,\n channel,\n this.chatClientService.chatClient.user\n );\n\n return message;\n } else {\n message = this.formatMessage(message);\n message.readBy = isThreadMessage\n ? []\n : channel\n ? getReadBy(message, channel)\n : [];\n message.translation = getMessageTranslation(\n message,\n channel,\n this.chatClientService.chatClient.user\n );\n return message;\n }\n }\n }\n\n private handleTypingStartEvent(event: Event) {\n if (event.user?.id === this.chatClientService.chatClient.user?.id) {\n return;\n }\n const isTypingInThread = !!event.parent_id;\n if (\n isTypingInThread &&\n event.parent_id !== this.activeParentMessageIdSubject.getValue()\n ) {\n return;\n }\n const subject = isTypingInThread\n ? this.usersTypingInThreadSubject\n : this.usersTypingInChannelSubject;\n const users: UserResponse[] = subject.getValue();\n const user = event.user;\n if (user && !users.find((u) => u.id === user.id)) {\n users.push(user);\n subject.next([...users]);\n }\n }\n\n private handleTypingStopEvent(event: Event) {\n const usersTypingInChannel = this.usersTypingInChannelSubject.getValue();\n const usersTypingInThread = this.usersTypingInThreadSubject.getValue();\n const user = event.user;\n if (user && usersTypingInChannel.find((u) => u.id === user.id)) {\n usersTypingInChannel.splice(\n usersTypingInChannel.findIndex((u) => u.id === user.id),\n 1\n );\n this.usersTypingInChannelSubject.next([...usersTypingInChannel]);\n return;\n }\n if (user && usersTypingInThread.find((u) => u.id === user.id)) {\n usersTypingInThread.splice(\n usersTypingInThread.findIndex((u) => u.id === user.id),\n 1\n );\n this.usersTypingInThreadSubject.next([...usersTypingInThread]);\n return;\n }\n }\n\n private updateLatestMessages(event: Event) {\n if (\n event.message?.user?.id !== this.chatClientService?.chatClient.user?.id\n ) {\n return;\n }\n const latestMessages =\n this.latestMessageDateByUserByChannelsSubject.getValue();\n if (!event.message?.created_at) {\n return;\n }\n const channelId = event?.message?.cid;\n if (!channelId) {\n return;\n }\n const messageDate = new Date(event.message.created_at);\n if (\n !latestMessages[channelId] ||\n latestMessages[channelId]?.getTime() < messageDate.getTime()\n ) {\n latestMessages[channelId] = messageDate;\n this.latestMessageDateByUserByChannelsSubject.next({\n ...latestMessages,\n });\n }\n }\n\n private setChannelState(channel: Channel<T>) {\n channel.state.messages.forEach((m) => {\n m.readBy = getReadBy(m, channel);\n m.translation = getMessageTranslation(\n m,\n channel,\n this.chatClientService.chatClient.user\n );\n if (m.quoted_message) {\n m.quoted_message.translation = getMessageTranslation(\n m.quoted_message,\n channel,\n this.chatClientService.chatClient.user\n );\n }\n });\n this.markRead(channel);\n this.activeChannelMessagesSubject.next([...channel.state.messages]);\n this.activeChannelPinnedMessagesSubject.next([\n ...channel.state.pinnedMessages,\n ]);\n this.activeParentMessageIdSubject.next(undefined);\n this.activeThreadMessagesSubject.next([]);\n this.messageToQuoteSubject.next(undefined);\n this.usersTypingInChannelSubject.next([]);\n this.usersTypingInThreadSubject.next([]);\n }\n\n private markRead(channel: Channel<T>, isThrottled = true) {\n if (\n this.canSendReadEvents &&\n this.shouldMarkActiveChannelAsRead &&\n !this.areReadEventsPaused\n ) {\n if (isThrottled) {\n this.markReadThrottled(channel);\n } else {\n void channel.markRead();\n }\n }\n }\n\n private markReadThrottled(channel: Channel<T>) {\n if (!this.markReadTimeout) {\n this.markRead(channel, false);\n this.markReadTimeout = setTimeout(() => {\n this.flushMarkReadQueue();\n }, this.markReadThrottleTime);\n } else {\n clearTimeout(this.markReadTimeout);\n this.scheduledMarkReadRequest = () => this.markRead(channel, false);\n this.markReadTimeout = setTimeout(() => {\n this.flushMarkReadQueue();\n }, this.markReadThrottleTime);\n }\n }\n\n private flushMarkReadQueue() {\n this.scheduledMarkReadRequest?.();\n this.scheduledMarkReadRequest = undefined;\n clearTimeout(this.markReadTimeout);\n this.markReadTimeout = undefined;\n }\n\n private setNextPageConfiguration(channelQueryResult: Channel<T>[]) {\n if (this.customPaginator) {\n this.nextPageConfiguration = this.customPaginator(channelQueryResult);\n } else {\n this.nextPageConfiguration = {\n type: 'offset',\n offset:\n (this.nextPageConfiguration?.type === 'offset'\n ? this.nextPageConfiguration.offset\n : 0) + channelQueryResult.length,\n };\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\nexport type Theme = 'light' | 'dark';\n\n/**\n * The `ThemeService` can be used to change the theme of the chat UI and to customize the theme. Our [theming guide](../theming/introduction.mdx) gives a complete overview about the topic.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ThemeService {\n /**\n * A Subject that can be used to get or set the currently active theme.\n */\n theme$ = new BehaviorSubject<Theme | string>('light');\n /**\n * Stream chat theme version - this is used internally by some UI components of the SDK, integrators shouldn't need to use this variable\n */\n themeVersion: '1' | '2';\n private _customLightThemeVariables: { [key: string]: string } | undefined;\n private _customDarkThemeVariables: { [key: string]: string } | undefined;\n private defaultDarkModeVariables = {\n '--bg-gradient-end': '#101214',\n '--bg-gradient-start': '#070a0d',\n '--black': '#ffffff',\n '--blue-alice': '#00193d',\n '--border': '#141924',\n '--button-background': '#ffffff',\n '--button-text': '#005fff',\n '--grey': '#7a7a7a',\n '--grey-gainsboro': '#2d2f2f',\n '--grey-whisper': '#1c1e22',\n '--modal-shadow': '#000000',\n '--overlay': '#00000066', // 66 = 40% opacity\n '--overlay-dark': '#ffffffcc', // CC = 80% opacity\n '--shadow-icon': '#00000080', // 80 = 50% opacity\n '--targetedMessageBackground': '#302d22',\n '--transparent': 'transparent',\n '--white': '#101418',\n '--white-smoke': '#13151b',\n '--white-snow': '#070a0d',\n };\n private variablesToDelete: { [key: string]: string }[] = [];\n\n constructor() {\n this.theme$.subscribe((theme) => {\n const darkVariables = this.customDarkThemeVariables\n ? { ...this.defaultDarkModeVariables, ...this.customDarkThemeVariables }\n : this.defaultDarkModeVariables;\n const lightVariables = this.customLightThemeVariables\n ? this.customLightThemeVariables\n : {};\n this.variablesToDelete.forEach((variables) =>\n this.deleteVariables(variables)\n );\n if (theme === 'dark') {\n this.deleteVariables(lightVariables);\n this.setVariables(darkVariables);\n } else {\n this.deleteVariables(darkVariables);\n this.setVariables(lightVariables);\n }\n });\n\n this.themeVersion = (getComputedStyle(document.documentElement)\n .getPropertyValue('--str-chat__theme-version')\n .replace(' ', '') || '1') as '1' | '2';\n }\n\n /**\n * A getter that returns the currently set custom light theme variables.\n * @deprecated Only use with [theme v1](../concepts/theming-and-css.mdx)\n * @returns An object where the keys are theme variables, and the values are the currently set CSS values.\n */\n get customLightThemeVariables() {\n return this._customLightThemeVariables;\n }\n\n /**\n * A setter that can be used to overwrite the values of the CSS theme variables of the light theme.\n * @deprecated Only use with [theme v1](../concepts/theming-and-css.mdx)\n * @param variables An object where the keys are theme variables, and the values are CSS values.\n */\n set customLightThemeVariables(\n variables: { [key: string]: string } | undefined\n ) {\n const prevVariables = this.customLightThemeVariables;\n if (prevVariables) {\n this.variablesToDelete.push(prevVariables);\n }\n this._customLightThemeVariables = variables;\n if (this.theme$.getValue() === 'light') {\n this.theme$.next('light');\n }\n }\n\n /**\n * A getter that returns the currently set custom dark theme variables.\n * @deprecated Only use with [theme v1](../concepts/theming-and-css.mdx)\n * @returns An object where the keys are theme variables, and the values are the currently set CSS values.\n */\n get customDarkThemeVariables() {\n return this._customDarkThemeVariables;\n }\n\n /**\n * A setter that can be used to overwrite the values of the CSS theme variables of the dark theme.\n * @deprecated Only use with [theme v1](../concepts/theming-and-css.mdx)\n * @param variables An object where the keys are theme variables, and the values are CSS values.\n */\n set customDarkThemeVariables(\n variables: { [key: string]: string } | undefined\n ) {\n const prevVariables = this.customDarkThemeVariables;\n if (prevVariables) {\n this.variablesToDelete.push(prevVariables);\n }\n this._customDarkThemeVariables = variables;\n if (this.theme$.getValue() === 'dark') {\n this.theme$.next('dark');\n }\n }\n\n private deleteVariables(variables: { [key: string]: string } | undefined) {\n if (!variables) {\n return;\n }\n Object.keys(variables).forEach((key) =>\n document.documentElement.style.setProperty(key, null)\n );\n }\n\n private setVariables(variables: { [key: string]: string } | undefined) {\n if (!variables) {\n return;\n }\n Object.keys(variables).forEach((key) =>\n document.documentElement.style.setProperty(key, variables[key])\n );\n }\n}\n","export const isImageFile = (file: File) => {\n // photoshop files begin with 'image/'\n return file.type.startsWith('image/') && !file.type.endsWith('.photoshop');\n};\n","import { Attachment } from 'stream-chat';\n\nexport const isImageAttachment = (attachment: Attachment) => {\n return (\n attachment.type === 'image' &&\n !attachment.title_link &&\n !attachment.og_scrape_url\n );\n};\n","import { Injectable } from '@angular/core';\nimport { isImageFile } from './is-image-file';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { Attachment } from 'stream-chat';\nimport { ChannelService } from './channel.service';\nimport { isImageAttachment } from './is-image-attachment';\nimport { NotificationService } from './notification.service';\nimport { AttachmentUpload, DefaultStreamChatGenerics } from './types';\n\n/**\n * The `AttachmentService` manages the uploads of a message input.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class AttachmentService<\n T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics\n> {\n /**\n * Emits the number of uploads in progress.\n */\n attachmentUploadInProgressCounter$: Observable<number>;\n /**\n * Emits the state of the uploads ([`AttachmentUpload[]`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/types.ts)), it adds a state (`success`, `error` or `uploading`) to each file the user selects for upload. It is used by the [`AttachmentPreviewList`](../components/AttachmentPreviewListComponent.mdx) to display the attachment previews.\n */\n attachmentUploads$: Observable<AttachmentUpload[]>;\n private attachmentUploadInProgressCounterSubject =\n new BehaviorSubject<number>(0);\n private attachmentUploadsSubject = new BehaviorSubject<AttachmentUpload[]>(\n []\n );\n\n constructor(\n private channelService: ChannelService,\n private notificationService: NotificationService\n ) {\n this.attachmentUploadInProgressCounter$ =\n this.attachmentUploadInProgressCounterSubject.asObservable();\n this.attachmentUploads$ = this.attachmentUploadsSubject.asObservable();\n }\n\n /**\n * Resets the attachments uploads (for example after the message with the attachments sent successfully)\n */\n resetAttachmentUploads() {\n this.attachmentUploadsSubject.next([]);\n }\n\n /**\n * Uploads the selected files, and creates preview for image files. The result is propagated throught the `attachmentUploads$` stream.\n * @param fileList The files selected by the user\n * @returns A promise with the result\n */\n async filesSelected(fileList: FileList | null) {\n if (!fileList) {\n return;\n }\n const imageFiles: File[] = [];\n const dataFiles: File[] = [];\n const videoFiles: File[] = [];\n\n Array.from(fileList).forEach((file) => {\n if (isImageFile(file)) {\n imageFiles.push(file);\n } else if (file.type.startsWith('video/')) {\n videoFiles.push(file);\n } else {\n dataFiles.push(file);\n }\n });\n imageFiles.forEach((f) => this.createPreview(f));\n const newUploads = [\n ...imageFiles.map((file) => ({\n file,\n state: 'uploading' as 'uploading',\n type: 'image' as 'image',\n })),\n ...videoFiles.map((file) => ({\n file,\n state: 'uploading' as 'uploading',\n type: 'video' as 'video',\n })),\n ...dataFiles.map((file) => ({\n file,\n state: 'uploading' as 'uploading',\n type: 'file' as 'file',\n })),\n ];\n this.attachmentUploadsSubject.next([\n ...this.attachmentUploadsSubject.getValue(),\n ...newUploads,\n ]);\n await this.uploadAttachments(newUploads);\n }\n\n /**\n * You can add custom `image`, `video` and `file` attachments using this method.\n *\n * Note: If you just want to use your own CDN for file uploads, you don't necessary need this method, you can just specify you own upload function in the [`ChannelService`](./ChannelService.mdx)\n *\n * @param attachment\n */\n addAttachment(attachment: Attachment<T>) {\n attachment.isCustomAttachment = true;\n this.createFromAttachments([attachment]);\n }\n\n /**\n * Retries to upload an attachment.\n * @param file\n * @returns A promise with the result\n */\n async retryAttachmentUpload(file: File) {\n const attachmentUploads = this.attachmentUploadsSubject.getValue();\n const upload = attachmentUploads.find((u) => u.file === file);\n if (!upload) {\n return;\n }\n upload.state = 'uploading';\n this.attachmentUploadsSubject.next([...attachmentUploads]);\n await this.uploadAttachments([upload]);\n }\n\n /**\n * Deletes an attachment, the attachment can have any state (`error`, `uploading` or `success`).\n * @param upload\n */\n async deleteAttachment(upload: AttachmentUpload) {\n const attachmentUploads = this.attachmentUploadsSubject.getValue();\n let result!: AttachmentUpload[];\n if (\n upload.state === 'success' &&\n !upload.fromAttachment?.isCustomAttachment\n ) {\n try {\n await this.channelService.deleteAttachment(upload);\n result = [...attachmentUploads];\n const index = attachmentUploads.indexOf(upload);\n result.splice(index, 1);\n } catch (error) {\n result = attachmentUploads;\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error deleting attachment'\n );\n }\n } else {\n result = [...attachmentUploads];\n const index = attachmentUploads.indexOf(upload);\n result.splice(index, 1);\n }\n this.attachmentUploadsSubject.next([...result]);\n }\n\n /**\n * Maps the current uploads to a format that can be sent along with the message to the Stream API.\n * @returns the attachments\n */\n mapToAttachments() {\n const attachmentUploads = this.attachmentUploadsSubject.getValue();\n return attachmentUploads\n .filter((r) => r.state === 'success')\n .map((r) => {\n const attachment: Attachment = {\n type: r.type,\n };\n if (r.fromAttachment) {\n return r.fromAttachment;\n } else {\n attachment.mime_type = r.file?.type;\n if (r.type === 'image') {\n attachment.fallback = r.file?.name;\n attachment.image_url = r.url;\n } else {\n attachment.asset_url = r.url;\n attachment.title = r.file?.name;\n attachment.file_size = r.file?.size;\n attachment.thumb_url = r.thumb_url;\n }\n }\n\n return attachment;\n });\n }\n\n /**\n * Maps attachments received from the Stream API to uploads. This is useful when editing a message.\n * @param attachments Attachemnts received with the message\n */\n createFromAttachments(attachments: Attachment<T>[]) {\n const attachmentUploads: AttachmentUpload[] = [];\n attachments.forEach((attachment) => {\n if (isImageAttachment(attachment)) {\n attachmentUploads.push({\n url: (attachment.img_url ||\n attachment.thumb_url ||\n attachment.image_url) as string,\n state: 'success',\n type: 'image',\n file: {\n name: attachment.fallback,\n type: attachment.mime_type,\n } as File,\n fromAttachment: attachment,\n });\n } else if (attachment.type === 'file' || attachment.type === 'video') {\n attachmentUploads.push({\n url: attachment.asset_url,\n state: 'success',\n file: {\n name: attachment.title,\n size: attachment.file_size,\n type: attachment.mime_type,\n } as File,\n type: attachment.type,\n thumb_url: attachment.thumb_url,\n fromAttachment: attachment,\n });\n }\n });\n\n if (attachmentUploads.length > 0) {\n this.attachmentUploadsSubject.next([\n ...this.attachmentUploadsSubject.getValue(),\n ...attachmentUploads,\n ]);\n }\n }\n\n private createPreview(file: File) {\n const reader = new FileReader();\n reader.onload = (event) => {\n const attachmentUploads = this.attachmentUploadsSubject.getValue();\n const upload = attachmentUploads.find((upload) => upload.file === file);\n if (!upload) {\n return;\n }\n upload.previewUri = event.target?.result || undefined;\n this.attachmentUploadsSubject.next([...attachmentUploads]);\n };\n reader.readAsDataURL(file as Blob);\n }\n\n private async uploadAttachments(uploads: AttachmentUpload[]) {\n this.attachmentUploadInProgressCounterSubject.next(\n this.attachmentUploadInProgressCounterSubject.getValue() + 1\n );\n const result = await this.channelService.uploadAttachments(uploads);\n const attachmentUploads = this.attachmentUploadsSubject.getValue();\n result.forEach((r) => {\n const upload = attachmentUploads.find((upload) => upload.file === r.file);\n if (!upload) {\n if (r.url) {\n void this.channelService.deleteAttachment(r);\n }\n return;\n }\n upload.state = r.state;\n upload.url = r.url;\n upload.thumb_url = r.thumb_url;\n if (upload.state === 'error') {\n upload.errorReason = r.errorReason;\n upload.errorExtraInfo = r.errorExtraInfo;\n let errorKey;\n const translateParams: { name: string; ext?: string; limit?: string } =\n { name: upload.file.name };\n switch (upload.errorReason) {\n case 'file-extension':\n errorKey =\n 'streamChat.Error uploading file, extension not supported';\n translateParams.ext = upload.errorExtraInfo?.[0]?.param;\n break;\n case 'file-size':\n errorKey =\n 'streamChat.Error uploading file, maximum file size exceeded';\n translateParams.limit = upload.errorExtraInfo?.[0]?.param;\n break;\n default:\n errorKey = 'streamChat.Error uploading file';\n }\n this.notificationService.addTemporaryNotification(\n errorKey,\n 'error',\n undefined,\n translateParams\n );\n }\n });\n this.attachmentUploadInProgressCounterSubject.next(\n this.attachmentUploadInProgressCounterSubject.getValue() - 1\n );\n this.attachmentUploadsSubject.next([...attachmentUploads]);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Attachment } from 'stream-chat';\nimport {\n AttachmentConfigration,\n DefaultStreamChatGenerics,\n ImageAttachmentConfiguration,\n VideoAttachmentConfiguration,\n} from './types';\n\n/**\n * The `AttachmentConfigurationService` provides customization for certain attributes of attachments displayed inside the message component. If you're using your own CDN, you can integrate resizing features of it by providing your own handlers.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class AttachmentConfigurationService<\n T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics\n> {\n /**\n * A custom handler can be provided to override the default image attachment (images uploaded from files) configuration. By default the SDK uses fixed image height (a size that's known before image is loaded), if you override that with dynamic image height (for example: height: 100%) the scrolling logic inside the message list can break.\n */\n customImageAttachmentConfigurationHandler?: (\n a: Attachment<T>,\n type: 'gallery' | 'single' | 'carousel',\n containerElement: HTMLElement\n ) => ImageAttachmentConfiguration;\n /**\n * A custom handler can be provided to override the default video attachment (videos uploaded from files) configuration. By default the SDK uses fixed height (a size that's known before video is loaded), if you override that with dynamic height (for example: height: 100%) the scrolling logic inside the message list can break.\n */\n customVideoAttachmentConfigurationHandler?: (\n a: Attachment<T>,\n containerElement: HTMLElement\n ) => VideoAttachmentConfiguration;\n /**\n * A custom handler can be provided to override the default giphy attachment (GIFs sent with the /giphy command) configuration. By default the SDK uses fixed height (a size that's known before the GIF is loaded), if you override that with dynamic height (for example: height: 100%) the scrolling logic inside the message list can break.\n */\n customGiphyAttachmentConfigurationHandler?: (\n a: Attachment<T>\n ) => AttachmentConfigration;\n /**\n * A custom handler can be provided to override the default scraped image attachment (images found in links inside messages) configuration. By default the SDK uses fixed height (a size that's known before image is loaded), if you override that with dynamic height (for example: height: 100%) the scrolling logic inside the message list can break.\n */\n customScrapedImageAttachmentConfigurationHandler?: (\n a: Attachment<T>\n ) => AttachmentConfigration;\n /**\n * You can turn on/off thumbnail generation for video attachments\n */\n shouldGenerateVideoThumbnail = true;\n\n /**\n * Handles the configuration for image attachments, it's possible to provide your own function to override the default logic\n * @param attachment The attachment to configure\n * @param location Specifies where the image is being displayed\n * @param element The default resizing logics reads the height/max-height and max-width propperties of this element and reduces file size based on the given values. File size reduction is done by Stream's CDN.\n */\n getImageAttachmentConfiguration(\n attachment: Attachment<T>,\n location: 'gallery' | 'single' | 'carousel',\n element: HTMLElement\n ): ImageAttachmentConfiguration {\n if (this.customImageAttachmentConfigurationHandler) {\n return this.customImageAttachmentConfigurationHandler(\n attachment,\n location,\n element\n );\n }\n\n const defaultOriginalDimension = 1000000;\n const urlString = (attachment.img_url ||\n attachment.thumb_url ||\n attachment.image_url ||\n '') as string;\n let url: URL;\n try {\n url = new URL(urlString);\n } catch (error) {\n return {\n url: urlString,\n width: '', // Not set to respect responsive width\n height: '', // Set from CSS\n originalHeight: defaultOriginalDimension,\n originalWidth: defaultOriginalDimension,\n };\n }\n const originalHeight =\n Number(url.searchParams.get('oh')) > 1\n ? Number(url.searchParams.get('oh'))\n : defaultOriginalDimension;\n const originalWidth =\n Number(url.searchParams.get('ow')) > 1\n ? Number(url.searchParams.get('ow'))\n : defaultOriginalDimension;\n const displayWarning = location === 'gallery' || location === 'single';\n const sizeRestriction = this.getSizingRestrictions(\n url,\n element,\n displayWarning\n );\n\n if (sizeRestriction) {\n // Apply 2x for retina displays\n sizeRestriction.height *= 2;\n sizeRestriction.width *= 2;\n this.addResizingParamsToUrl(sizeRestriction, url);\n }\n\n return {\n url: url.href,\n width: '', // Not set to respect responsive width\n height: '', // Set from CSS\n originalHeight,\n originalWidth,\n };\n }\n\n /**\n * Handles the configuration for video attachments, it's possible to provide your own function to override the default logic\n * @param attachment The attachment to configure\n * @param element The default resizing logics reads the height/max-height and max-width propperties of this element and reduces file size based on the given values. File size reduction is done by Stream's CDN.\n */\n getVideoAttachmentConfiguration(\n attachment: Attachment<T>,\n element: HTMLElement\n ): VideoAttachmentConfiguration {\n if (this.customVideoAttachmentConfigurationHandler) {\n return this.customVideoAttachmentConfigurationHandler(\n attachment,\n element\n );\n }\n\n let thumbUrl: string | undefined = undefined;\n let originalHeight = 1000000;\n let originalWidth = 1000000;\n if (attachment.thumb_url && this.shouldGenerateVideoThumbnail) {\n let url: URL;\n try {\n url = new URL(attachment.thumb_url);\n\n originalHeight =\n Number(url.searchParams.get('oh')) > 1\n ? Number(url.searchParams.get('oh'))\n : originalHeight;\n originalWidth =\n Number(url.searchParams.get('ow')) > 1\n ? Number(url.searchParams.get('ow'))\n : originalWidth;\n const displayWarning = true;\n const sizeRestriction = this.getSizingRestrictions(\n url,\n element,\n displayWarning\n );\n if (sizeRestriction) {\n sizeRestriction.height *= 2;\n sizeRestriction.width *= 2;\n this.addResizingParamsToUrl(sizeRestriction, url);\n }\n thumbUrl = url.href;\n } catch {\n thumbUrl = attachment.thumb_url;\n }\n }\n return {\n url: attachment.asset_url || '',\n width: '', // Not set to respect responsive width\n height: '', // Set from CSS\n thumbUrl: thumbUrl,\n originalHeight,\n originalWidth,\n };\n }\n\n /**\n * Handles the configuration for giphy attachments, it's possible to provide your own function to override the default logic\n * @param attachment The attachment to configure\n */\n getGiphyAttachmentConfiguration(\n attachment: Attachment<T>\n ): AttachmentConfigration {\n if (this.customGiphyAttachmentConfigurationHandler) {\n return this.customGiphyAttachmentConfigurationHandler(attachment);\n }\n\n const giphy = attachment.giphy?.fixed_height_downsampled;\n\n return {\n url: giphy?.url || attachment.image_url || attachment.thumb_url || '',\n height: giphy?.height ? `${giphy?.height}px` : '300px',\n width: giphy?.width ? `${giphy?.width}px` : '',\n };\n }\n\n /**\n * Handles the configuration for scraped image attachments, it's possible to provide your own function to override the default logic\n * @param attachment The attachment to configure\n */\n getScrapedImageAttachmentConfiguration(\n attachment: Attachment<T>\n ): AttachmentConfigration {\n if (this.customScrapedImageAttachmentConfigurationHandler) {\n return this.customScrapedImageAttachmentConfigurationHandler(attachment);\n }\n\n return {\n url: attachment.image_url || attachment.thumb_url || '',\n width: '',\n height: '', // Set from CSS\n };\n }\n\n private addResizingParamsToUrl(\n sizeRestriction: { width: number; height: number },\n url: URL\n ) {\n url.searchParams.set('h', sizeRestriction.height.toString());\n url.searchParams.set('w', sizeRestriction.width.toString());\n }\n\n private getSizingRestrictions(\n url: URL,\n htmlElement: HTMLElement,\n displayWarning = false\n ) {\n const urlParams = url.searchParams;\n const originalHeight = Number(urlParams.get('oh')) || 1;\n const originalWidth = Number(urlParams.get('ow')) || 1;\n const cssSizeRestriction = this.getCSSSizeRestriction(htmlElement);\n let sizeRestriction: { width: number; height: number } | undefined;\n\n if (\n (cssSizeRestriction.maxHeight || cssSizeRestriction.height) &&\n cssSizeRestriction.maxWidth\n ) {\n sizeRestriction = this.getSizeRestrictions(\n originalHeight,\n originalWidth,\n (cssSizeRestriction.maxHeight || cssSizeRestriction.height)!,\n cssSizeRestriction.maxWidth\n );\n } else {\n sizeRestriction = undefined;\n if (displayWarning) {\n console.warn(\n `Invalid value set for height/max-height and/or max-width for HTML element, this can cause scrolling issues inside the message list, more info https://getstream.io/chat/docs/sdk/angular/components/AttachmentListComponent/#image-and-video-sizing, attachment URL: ${url.toString()}`\n );\n }\n }\n\n return sizeRestriction;\n }\n\n private getSizeRestrictions(\n originalHeight: number,\n originalWidth: number,\n maxHeight: number,\n maxWidth: number\n ) {\n return {\n height: Math.round(\n Math.max(maxHeight, (maxWidth / originalWidth) * originalHeight)\n ),\n width: Math.round(\n Math.max(maxHeight, (maxWidth / originalHeight) * originalWidth)\n ),\n };\n }\n\n private getCSSSizeRestriction(htmlElement: HTMLElement) {\n const computedStylesheet = getComputedStyle(htmlElement);\n const height = this.getValueRepresentationOfCSSProperty(\n computedStylesheet.getPropertyValue('height')\n );\n const maxHeight = this.getValueRepresentationOfCSSProperty(\n computedStylesheet.getPropertyValue('max-height')\n );\n const maxWidth = this.getValueRepresentationOfCSSProperty(\n computedStylesheet.getPropertyValue('max-width')\n );\n\n return { height, maxHeight, maxWidth };\n }\n\n private getValueRepresentationOfCSSProperty(property: string) {\n return Number(property.replace('px', '')) || undefined;\n }\n}\n","export const en = {\n streamChat: {\n '1 reply': '1 reply',\n 'Attach files': 'Attach files',\n Cancel: 'Cancel',\n 'Channel Missing': 'Channel Missing',\n Close: 'Close',\n 'Close emoji picker': 'Close emoji picker',\n 'Commands matching': 'Commands matching',\n 'Connection failure, reconnecting now...':\n 'Connection failure, reconnecting now...',\n Delete: 'Delete',\n Delivered: 'Delivered',\n 'Edit Message': 'Edit Message',\n 'Edit message request failed': 'Edit message request failed',\n 'Emoji matching': 'Emoji matching',\n 'Empty message...': 'Empty message...',\n 'Error adding flag': 'Error adding flag',\n 'Error connecting to chat, refresh the page to try again.':\n 'Error connecting to chat, refresh the page to try again',\n 'Error deleting message': 'Error deleting message',\n 'Error loading reactions': 'Error loading reactions',\n 'Error muting a user ...': 'Error muting a user ...',\n 'Error pinning message': 'Error pinning message',\n 'Error removing message pin': 'Error removing message pin',\n 'Error unmuting a user ...': 'Error unmuting a user ...',\n 'Error uploading file': 'Error uploading file \"{{ name }}\"',\n 'Error uploading file, maximum file size exceeded':\n 'Error uploading \"{{ name }}\", maximum file size {{ limit }} exceeded',\n 'Error uploading file, extension not supported':\n 'Error uploading \"{{ name }}\", type {{ ext }} not supported',\n 'Error deleting attachment': 'Error deleting attachment',\n 'Error · Unsent': \"Message couldn't be sent\",\n 'Error: {{ errorMessage }}': 'Error: {{ errorMessage }}',\n Flag: 'Flag',\n 'Message Failed': 'Message Failed',\n 'Message Failed · Unauthorized': 'Unauthorized to send message',\n 'Message Failed · Click to try again':\n \"Message couldn't be sent, click to try again\",\n 'Message deleted': 'Message deleted',\n 'Message has been successfully flagged':\n 'Message has been successfully flagged',\n 'Message pinned': 'Message pinned',\n 'Message unpinned': 'Message unpinned',\n Mute: 'Mute',\n New: 'New',\n 'New Messages!': 'New Messages!',\n 'No results found': 'No results found',\n 'Nothing yet...': 'Nothing yet...',\n 'Only visible to you': 'Only visible to you',\n 'Open emoji picker': 'Open emoji picker',\n 'People matching': 'People matching',\n 'Pick your emoji': 'Pick your emoji',\n Pin: 'Pin',\n 'Pinned by': 'Pinned by',\n Reply: 'Reply',\n 'Reply to Message': 'Reply to Message',\n Search: 'Search',\n 'Searching...': 'Searching...',\n Send: 'Send',\n 'Send message request failed': 'Send message request failed',\n 'Sending...': 'Sending...',\n 'Slow Mode ON': 'Slow Mode ON',\n 'Start of a new thread': 'Start of a new thread',\n 'This message was deleted...': 'This message was deleted...',\n Thread: 'Thread reply',\n 'Type your message': 'Type your message',\n Unmute: 'Unmute',\n Unpin: 'Unpin',\n 'Wait until all attachments have uploaded':\n 'Wait until all attachments have uploaded',\n 'You have no channels currently': 'You have no channels currently',\n \"You've reached the maximum number of files\":\n \"You've reached the maximum number of files\",\n live: 'live',\n 'this content could not be displayed':\n 'this content could not be displayed',\n '{{ commaSeparatedUsers }} and {{ moreCount }} more':\n '{{ commaSeparatedUsers }} and {{ moreCount }} more',\n '{{ commaSeparatedUsers }}, and {{ lastUser }}':\n '{{ commaSeparatedUsers }}, and {{ lastUser }}',\n '{{ firstUser }} and {{ secondUser }}':\n '{{ firstUser }} and {{ secondUser }}',\n '{{ imageCount }} more': '{{ imageCount }} more',\n '{{ memberCount }} members': '{{ memberCount }} members',\n '{{ replyCount }} replies': '{{ replyCount }} replies',\n '{{ user }} has been muted': '{{ user }} has been muted',\n '{{ user }} has been unmuted': '{{ user }} has been unmuted',\n '{{ watcherCount }} online': '{{ watcherCount }} online',\n '🏙 Attachment...': '🏙 Attachment...',\n 'Connection error': 'Connection error',\n 'Load more': 'Load more',\n failed: 'failed',\n retry: 'retry',\n test: 'success',\n 'Sending links is not allowed in this conversation':\n 'Sending links is not allowed in this conversation',\n \"You can't send messages in this channel\":\n \"You can't send messages in this channel\",\n \"You can't send thread replies in this channel\":\n \"You can't send thread replies in this channel\",\n 'Message not found': 'Message not found',\n 'No chats here yet…': 'No chats here yet…',\n 'user is typing': '{{ user }} is typing',\n 'users are typing': '{{ users }} are typing',\n 'Error loading channels': 'Error loading channels',\n 'See original (automatically translated)':\n 'See original (automatically translated)',\n 'See translation': 'See translation',\n 'Mark as unread': 'Mark as unread',\n 'Error marking message as unread': 'Error marking message as unread',\n 'Error, only the first {{count}} message can be marked as unread':\n 'Error, only the first {{count}} message can be marked as unread',\n 'Unread messages': 'Unread messages',\n '{{count}} unread messages': '{{count}} unread messages',\n '{{count}} unread message': '{{count}} unread message',\n 'This message did not meet our content guidelines':\n 'This message did not meet our content guidelines',\n 'Send Anyway': 'Send Anyway',\n Edited: 'Edited',\n 'Error playing audio': 'Error playing audio',\n },\n};\n","import { Injectable } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { en } from '../assets/i18n/en';\n\n/**\n * The `StreamI18nService` can be used to customize the labels of the chat UI. Our [translation guide](../concepts/translation.mdx) covers this topic in detail.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class StreamI18nService {\n constructor(private translteService: TranslateService) {}\n\n /**\n * Registers the translation to the [ngx-translate](https://github.com/ngx-translate/core) TranslateService.\n * @param lang The language key to register the translation to\n * @param overrides An object which keys are translation keys, and the values are custom translations\n */\n setTranslation(lang = 'en', overrides?: { [key: string]: string }) {\n if (!this.translteService.defaultLang) {\n this.translteService.defaultLang = lang;\n }\n this.translteService.setTranslation(\n lang,\n { streamChat: { ...en.streamChat, ...overrides } },\n true\n );\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n SimpleChanges,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { filter } from 'rxjs/operators';\nimport { Channel, User } from 'stream-chat';\nimport { ChatClientService } from '../chat-client.service';\nimport {\n AvatarLocation,\n AvatarType,\n DefaultStreamChatGenerics,\n} from '../types';\n\n/**\n * The `Avatar` component displays the provided image, with fallback to the first letter of the optional name input.\n */\n@Component({\n selector: 'stream-avatar',\n templateUrl: './avatar.component.html',\n styleUrls: ['./avatar.component.scss'],\n})\nexport class AvatarComponent\n implements OnChanges, OnInit, OnChanges, AfterViewInit, OnDestroy\n{\n /**\n * An optional name of the image, used for fallback image or image title (if `imageUrl` is provided)\n */\n @Input() name: string | undefined;\n /**\n * The URL of the image to be displayed. If the image can't be displayed the first letter of the name input is displayed.\n */\n @Input() imageUrl: string | undefined;\n /**\n * The size in pixels of the avatar image.\n */\n @Input() size = 32;\n /**\n * The location the avatar will be displayed in\n */\n @Input() location: AvatarLocation | undefined;\n /**\n * The channel the avatar belongs to (if avatar of a channel is displayed)\n */\n @Input() channel?: Channel<DefaultStreamChatGenerics>;\n /**\n * The user the avatar belongs to (if avatar of a user is displayed)\n */\n @Input() user?: User<DefaultStreamChatGenerics>;\n /**\n * The type of the avatar: channel if channel avatar is displayed, user if user avatar is displayed\n */\n @Input() type: AvatarType | undefined;\n /**\n * If a channel avatar is displayed, and if the channel has exactly two members a green dot is displayed if the other member is online. Set this flag to `false` to turn off this behavior.\n */\n @Input() showOnlineIndicator = true;\n /**\n * If channel/user image isn't provided the initials of the name of the channel/user is shown instead, you can choose how the initals should be computed\n */\n @Input() initialsType:\n | 'first-letter-of-first-word'\n | 'first-letter-of-each-word' = 'first-letter-of-first-word';\n isError = false;\n isOnline = false;\n private isOnlineSubscription?: Subscription;\n initials: string = '';\n fallbackChannelImage: string | undefined;\n private userId?: string;\n private isViewInited = false;\n private subscriptions: Subscription[] = [];\n\n constructor(\n private chatClientService: ChatClientService,\n private ngZone: NgZone,\n private cdRef: ChangeDetectorRef\n ) {}\n\n ngOnInit(): void {\n this.subscriptions.push(\n this.chatClientService.user$.subscribe((u) => {\n if (u?.id !== this.userId) {\n this.userId = u?.id;\n if (this.type || this.channel || this.name) {\n this.setInitials();\n this.setFallbackChannelImage();\n this.updateIsOnlineSubscription();\n }\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n })\n );\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes['channel']) {\n this.updateIsOnlineSubscription();\n }\n if (changes.type || changes.name || changes.channel) {\n this.setInitials();\n }\n\n if (changes.type || changes.channel) {\n this.setFallbackChannelImage();\n }\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n private setFallbackChannelImage() {\n if (this.type !== 'channel') {\n this.fallbackChannelImage = undefined;\n } else {\n const otherMember = this.getOtherMemberIfOneToOneChannel();\n if (otherMember) {\n this.fallbackChannelImage = otherMember.image;\n } else {\n this.fallbackChannelImage = undefined;\n }\n }\n }\n\n private setInitials() {\n let result: string = '';\n if (this.type === 'user') {\n result = this.name?.toString() || '';\n } else if (this.type === 'channel') {\n if (this.channel?.data?.name) {\n result = this.channel?.data?.name;\n } else {\n const otherMember = this.getOtherMemberIfOneToOneChannel();\n if (otherMember) {\n result = otherMember.name || otherMember.id || '';\n } else {\n result = '#';\n }\n }\n }\n\n const words = result.split(' ');\n let initials: string;\n if (this.initialsType === 'first-letter-of-each-word') {\n initials = words.map((w) => w.charAt(0) || '').join('');\n } else {\n initials = words[0].charAt(0) || '';\n }\n this.initials = initials;\n }\n\n private updateIsOnlineSubscription() {\n if (this.channel) {\n const otherMember = this.getOtherMemberIfOneToOneChannel();\n if (otherMember) {\n this.isOnline = otherMember.online || false;\n this.isOnlineSubscription = this.chatClientService.events$\n .pipe(filter((e) => e.eventType === 'user.presence.changed'))\n .subscribe((event) => {\n if (event.event.user?.id === otherMember.id) {\n this.ngZone.run(() => {\n this.isOnline = event.event.user?.online || false;\n });\n }\n });\n } else {\n this.isOnline = false;\n this.isOnlineSubscription?.unsubscribe();\n }\n } else {\n this.isOnline = false;\n this.isOnlineSubscription?.unsubscribe();\n }\n }\n\n ngAfterViewInit(): void {\n this.isViewInited = true;\n }\n\n private getOtherMemberIfOneToOneChannel() {\n const otherMembers = Object.values(\n this.channel?.state?.members || {}\n ).filter((m) => m.user_id !== this.userId);\n if (otherMembers.length === 1) {\n return otherMembers[0].user;\n } else {\n return undefined;\n }\n }\n}\n","<div\n class=\"str-chat__avatar str-chat__avatar--circle stream-chat__avatar--{{\n location\n }}\"\n title=\"{{ name }}\"\n [ngStyle]=\"{\n flexBasis: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',\n fontSize:\n initialsType === 'first-letter-of-first-word'\n ? 'calc(var(--str-chat__spacing-px, 1px) * ' + size / 2 + ')'\n : 'calc(var(--str-chat__spacing-px, 1px) * ' + size / 3 + ')',\n height: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',\n lineHeight: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',\n width: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')'\n }\"\n>\n <img\n *ngIf=\"(imageUrl || fallbackChannelImage) && !isError; else fallback\"\n class=\"str-chat__avatar-image str-chat__avatar-image\"\n src=\"{{ imageUrl || fallbackChannelImage }}\"\n alt=\"{{ initials }}\"\n data-testid=\"avatar-img\"\n (error)=\"isError = true\"\n [ngStyle]=\"{\n flexBasis: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',\n height: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',\n objectFit: 'cover',\n width: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')'\n }\"\n fetchpriority=\"high\"\n />\n <ng-template #fallback>\n <div data-testid=\"fallback-img\" class=\"str-chat__avatar-fallback\">\n {{ initials }}\n </div>\n </ng-template>\n <div\n data-testid=\"online-indicator\"\n *ngIf=\"isOnline && showOnlineIndicator\"\n class=\"str-chat__avatar--online-indicator\"\n ></div>\n</div>\n","import { Injectable, TemplateRef } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport {\n AttachmentContext,\n AttachmentListContext,\n AttachmentPreviewListContext,\n AvatarContext,\n ChannelActionsContext,\n ChannelHeaderInfoContext,\n ChannelPreviewContext,\n ChannelPreviewInfoContext,\n CommandAutocompleteListItemContext,\n CustomAttachmentUploadContext,\n CustomMetadataContext,\n DateSeparatorContext,\n DefaultStreamChatGenerics,\n DeliveredStatusContext,\n EmojiPickerContext,\n IconContext,\n LoadingIndicatorContext,\n MentionAutcompleteListItemContext,\n MentionTemplateContext,\n MessageActionBoxItemContext,\n MessageActionsBoxContext,\n MessageContext,\n MessageInputContext,\n MessageReactionsContext,\n ModalContext,\n NotificationContext,\n ReadStatusContext,\n SendingStatusContext,\n SystemMessageContext,\n ThreadHeaderContext,\n TypingIndicatorContext,\n UnreadMessagesIndicatorContext,\n UnreadMessagesNotificationContext,\n} from './types';\n\n/**\n * A central location for registering your custom templates to override parts of the chat application.\n *\n * For code examples to the different customizations see our [customizations example application](https://github.com/GetStream/stream-chat-angular/tree/master/projects/customizations-example), specifically the [AppComponent](https://github.com/GetStream/stream-chat-angular/tree/master/projects/customizations-example/src/app) (see [README](https://github.com/GetStream/stream-chat-angular/blob/master/README.md#customization-examples) for instructions on how to start the application).\n *\n * You can find the type definitions of the context that is provided for each template [on GitHub](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angu)\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class CustomTemplatesService<\n T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics\n> {\n /**\n * The autocomplete list item template for mentioning users (used in the [`AutocompleteTextareaComponent`](../components/AutocompleteTextareaComponent.mdx))\n */\n mentionAutocompleteItemTemplate$ = new BehaviorSubject<\n TemplateRef<MentionAutcompleteListItemContext> | undefined\n >(undefined);\n /**\n * The autocomplete list item template for commands (used in the [`AutocompleteTextareaComponent`](../components/AutocompleteTextareaComponent.mdx))\n */\n commandAutocompleteItemTemplate$ = new BehaviorSubject<\n TemplateRef<CommandAutocompleteListItemContext> | undefined\n >(undefined);\n /**\n * Template used to display an item in the [channel list](../components/ChannelListComponent.mdx) (instead of the default [channal list item](../components/ChannelPreviewComponent.mdx))\n *\n */\n channelPreviewTemplate$ = new BehaviorSubject<\n TemplateRef<ChannelPreviewContext> | undefined\n >(undefined);\n /**\n * The message input template used when editing a message (instead of the [default message input](../components/MessageInputComponent.mdx))\n *\n */\n messageInputTemplate$ = new BehaviorSubject<\n TemplateRef<MessageInputContext> | undefined\n >(undefined);\n /**\n * The template used for displaying a [mention inside a message](../code-examples/mention-actions.mdx)\n *\n */\n mentionTemplate$ = new BehaviorSubject<\n TemplateRef<MentionTemplateContext> | undefined\n >(undefined);\n /**\n * The template for [emoji picker](../code-examples/emoji-picker.mdx)\n *\n */\n emojiPickerTemplate$ = new BehaviorSubject<\n TemplateRef<EmojiPickerContext> | undefined\n >(undefined);\n /**\n * The typing indicator template used in the [message list](../components/MessageListComponent.mdx)\n *\n */\n typingIndicatorTemplate$ = new BehaviorSubject<\n TemplateRef<TypingIndicatorContext> | undefined\n >(undefined);\n /**\n * The template used to display a message in the [message list](../components/MessageListComponent.mdx) (instead of the [default message component](../components/MessageComponent.mdx))\n *\n */\n messageTemplate$ = new BehaviorSubject<\n TemplateRef<MessageContext> | undefined\n >(undefined);\n /**\n * The template for channel actions displayed in the [channel header](../components/ChannelHeaderComponent.mdx) (by default no channel action is displayed)\n *\n */\n channelActionsTemplate$ = new BehaviorSubject<\n TemplateRef<ChannelActionsContext> | undefined\n >(undefined);\n /**\n * The template used to display attachments of a [message](../components/MessageComponent.mdx) (instead of the [default attachment list](../components/AttachmentListComponent.mdx))\n *\n */\n attachmentListTemplate$ = new BehaviorSubject<\n TemplateRef<AttachmentListContext> | undefined\n >(undefined);\n /**\n * The template used to display attachments in the [message input](../components/MessageInputComponent.mdx) component (instead of the [default attachment preview](../components/AttachmentPreviewListComponent.mdx))\n *\n */\n attachmentPreviewListTemplate$ = new BehaviorSubject<\n TemplateRef<AttachmentPreviewListContext> | undefined\n >(undefined);\n /**\n * The template used to display avatars for channels and users (instead of the [default avatar](../components/AvatarComponent.mdx))\n *\n */\n avatarTemplate$ = new BehaviorSubject<TemplateRef<AvatarContext> | undefined>(\n undefined\n );\n /**\n * Template for displaying icons (instead of the [default icon component](../components/IconComponent.mdx))\n *\n */\n iconTemplate$ = new BehaviorSubject<TemplateRef<IconContext> | undefined>(\n undefined\n );\n /**\n * Template for displaying the loading indicator (instead of the [default loading indicator](../components/LoadingIndicatorComponent.mdx))\n *\n */\n loadingIndicatorTemplate$ = new BehaviorSubject<\n TemplateRef<LoadingIndicatorContext> | undefined\n >(undefined);\n /**\n * Template for displaying the message actions box (instead of the [default message actions box](../components/MessageActionsBoxComponent.mdx))\n *\n */\n messageActionsBoxTemplate$ = new BehaviorSubject<\n TemplateRef<MessageActionsBoxContext> | undefined\n >(undefined);\n /**\n * The template used for displaying an item in the [message actions box](../components/MessageActionsBoxComponent.mdx)\n *\n */\n messageActionsBoxItemTemplate$ = new BehaviorSubject<\n TemplateRef<MessageActionBoxItemContext> | undefined\n >(undefined);\n /**\n * The template used to display the reactions of a [message](../components/MessageComponent.mdx), and the selector to add a reaction to a message (instead of the [default message reactions component](../components/MessageReactionsComponent.mdx))\n *\n */\n messageReactionsTemplate$ = new BehaviorSubject<\n TemplateRef<MessageReactionsContext> | undefined\n >(undefined);\n /**\n * The template used to display a modal window (instead of the [default modal](../components/ModalComponent.mdx))\n *\n */\n modalTemplate$ = new BehaviorSubject<TemplateRef<ModalContext> | undefined>(\n undefined\n );\n /**\n * The template used to override the [default notification component](../components/NotificationComponent.mdx)\n *\n */\n notificationTemplate$ = new BehaviorSubject<\n TemplateRef<NotificationContext> | undefined\n >(undefined);\n /**\n * The template used for header of a [thread](../components/ThreadComponent.mdx)\n *\n */\n threadHeaderTemplate$ = new BehaviorSubject<\n TemplateRef<ThreadHeaderContext> | undefined\n >(undefined);\n /**\n * The template used for displaying the delivered state of the message inside the [message component](../components/MessageComponent.mdx)\n *\n * Displayed for the last message sent by the current user, if the message isn't yet read by anyone\n *\n */\n deliveredStatusTemplate$ = new BehaviorSubject<\n TemplateRef<DeliveredStatusContext> | undefined\n >(undefined);\n /**\n * The template used for displaying the sending state of the message inside the [message component](../components/MessageComponent.mdx)\n *\n * Displayed for the last message sent by the current user, if the message is currently being sent\n *\n */\n sendingStatusTemplate$ = new BehaviorSubject<\n TemplateRef<SendingStatusContext> | undefined\n >(undefined);\n /**\n * The template used for displaying the sent state of the message inside the [message component](../components/MessageComponent.mdx)\n *\n * Displayed for the last message sent by the current user, if the message is read at least by one user\n *\n */\n readStatusTemplate$ = new BehaviorSubject<\n TemplateRef<ReadStatusContext> | undefined\n >(undefined);\n /**\n * Template to display custom metadata inside [message component](../components/MessageComponent.mdx)\n *\n */\n customMessageMetadataTemplate$ = new BehaviorSubject<\n TemplateRef<CustomMetadataContext<T>> | undefined\n >(undefined);\n /**\n * The template used to display additional information about a channel under the channel name inside the [channel header component](../components/ChannelHeaderComponent.mdx)\n *\n */\n channelHeaderInfoTemplate$ = new BehaviorSubject<\n TemplateRef<ChannelHeaderInfoContext> | undefined\n >(undefined);\n /**\n * The template used for displaying file upload/attachment selector inside the [message input](../components/MessageInputComponent.mdx)\n *\n */\n customAttachmentUploadTemplate$ = new BehaviorSubject<\n TemplateRef<CustomAttachmentUploadContext> | undefined\n >(undefined);\n /**\n * The template that can be used to override how a single image attachment is displayed inside the [attachment list](../components/AttachmentListComponent.mdx)\n */\n imageAttachmentTemplate$ = new BehaviorSubject<\n TemplateRef<AttachmentContext> | undefined\n >(undefined);\n /**\n * The template that can be used to override how a voice recording attachment is displayed inside the [attachment list](../components/AttachmentListComponent.mdx), by default the [voice recording component](../components/VoiceRecordingComponent.mdx) is used\n */\n voiceRecordingAttachmentTemplate$ = new BehaviorSubject<\n TemplateRef<AttachmentContext> | undefined\n >(undefined);\n /**\n * The template that can be used to override how a video attachment is displayed inside the [attachment list](../components/AttachmentListComponent.mdx)\n */\n videoAttachmentTemplate$ = new BehaviorSubject<\n TemplateRef<AttachmentContext> | undefined\n >(undefined);\n /**\n * The template that can be used to override how image gallery is displayed inside the [attachment list](../components/AttachmentListComponent.mdx)\n */\n galleryAttachmentTemplate$ = new BehaviorSubject<\n TemplateRef<AttachmentContext> | undefined\n >(undefined);\n /**\n * The template that can be used to override how a file attachment is displayed inside the [attachment list](../components/AttachmentListComponent.mdx)\n */\n fileAttachmentTemplate$ = new BehaviorSubject<\n TemplateRef<AttachmentContext> | undefined\n >(undefined);\n /**\n * The template that can be used to override how a card attachment is displayed inside the [attachment list](../components/AttachmentListComponent.mdx)\n */\n cardAttachmentTemplate$ = new BehaviorSubject<\n TemplateRef<AttachmentContext> | undefined\n >(undefined);\n /**\n * The template that can be used to override how attachment actions are displayed inside the [attachment list](../components/AttachmentListComponent.mdx)\n */\n attachmentActionsTemplate$ = new BehaviorSubject<\n TemplateRef<AttachmentContext> | undefined\n >(undefined);\n /**\n * The template used to display [system messages](https://getstream.io/chat/docs/javascript/silent_messages/?language=javascript&q=system) indise the [message component](../components/MessageComponent.mdx)\n */\n systemMessageTemplate$ = new BehaviorSubject<\n TemplateRef<SystemMessageContext> | undefined\n >(undefined);\n /**\n * The template used to display the date separator inside the [message list](../components/MessageListComponent.mdx)\n */\n dateSeparatorTemplate$ = new BehaviorSubject<\n TemplateRef<DateSeparatorContext> | undefined\n >(undefined);\n /**\n * The template used to display unread messages indicator inside the [message list](../components/MessageListComponent.mdx) when the channel is opened\n *\n * This UI element is used to separate unread messages from read messages\n */\n newMessagesIndicatorTemplate$ = new BehaviorSubject<\n TemplateRef<UnreadMessagesIndicatorContext> | undefined\n >(undefined);\n /**\n * The template used to display unread messages notification inside the [message list](../components/MessageListComponent.mdx) when the channel is opened\n *\n * Users can use this notification to jump to the first unread message when it's clicked\n */\n newMessagesNotificationTemplate$ = new BehaviorSubject<\n TemplateRef<UnreadMessagesNotificationContext> | undefined\n >(undefined);\n /**\n * The template to show if the main message list is empty\n */\n emptyMainMessageListPlaceholder$ = new BehaviorSubject<\n TemplateRef<void> | undefined\n >(undefined);\n /**\n * The template to show if the thread message list is empty\n */\n emptyThreadMessageListPlaceholder$ = new BehaviorSubject<\n TemplateRef<void> | undefined\n >(undefined);\n /**\n * The template used to display the [edit message form](../components/EditMessageFormComponent.mdx)\n */\n editMessageFormTemplate$ = new BehaviorSubject<TemplateRef<void> | undefined>(\n undefined\n );\n /**\n * The template used to display the [message bounce prompt](../components/MessageBouncePromptComponent.mdx)\n */\n messageBouncePromptTemplate$ = new BehaviorSubject<\n TemplateRef<void> | undefined\n >(undefined);\n /**\n * Template used to display the channel information inside the [channel list item](../components/ChannelPreviewComponent.mdx)\n *\n */\n channelPreviewInfoTemplate$ = new BehaviorSubject<\n TemplateRef<ChannelPreviewInfoContext> | undefined\n >(undefined);\n constructor() {}\n}\n","import { Component, Input, OnChanges } from '@angular/core';\nimport { Channel, User } from 'stream-chat';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport {\n AvatarContext,\n AvatarLocation,\n AvatarType,\n DefaultStreamChatGenerics,\n} from '../types';\n\n/**\n * The `AvatarPlaceholder` component displays the [default avatar](./AvatarComponent.mdx) unless a [custom template](../services/CustomTemplatesService.mdx) is provided. This component is used by the SDK internally, you likely won't need to use it.\n */\n@Component({\n selector: 'stream-avatar-placeholder',\n templateUrl: './avatar-placeholder.component.html',\n styles: [],\n})\nexport class AvatarPlaceholderComponent implements OnChanges {\n /**\n * An optional name of the image, used for fallback image or image title (if `imageUrl` is provided)\n */\n @Input() name: string | undefined;\n /**\n * The URL of the image to be displayed. If the image can't be displayed the first letter of the name input is displayed.\n */\n @Input() imageUrl: string | undefined;\n /**\n * The size in pixels of the avatar image.\n */\n @Input() size = 32;\n /**\n * The location the avatar will be displayed in\n */\n @Input() location: AvatarLocation | undefined;\n /**\n * The channel the avatar belongs to (if avatar of a channel is displayed)\n */\n @Input() channel?: Channel<DefaultStreamChatGenerics>;\n /**\n * The user the avatar belongs to (if avatar of a user is displayed)\n */\n @Input() user?: User<DefaultStreamChatGenerics>;\n /**\n * The type of the avatar: channel if channel avatar is displayed, user if user avatar is displayed\n */\n @Input() type: AvatarType | undefined;\n /**\n * If channel/user image isn't provided the initials of the name of the channel/user is shown instead, you can choose how the initals should be computed\n */\n @Input() initialsType:\n | 'first-letter-of-first-word'\n | 'first-letter-of-each-word' = 'first-letter-of-first-word';\n /**\n * If a channel avatar is displayed, and if the channel has exactly two members a green dot is displayed if the other member is online. Set this flag to `false` to turn off this behavior.\n */\n @Input() showOnlineIndicator = true;\n context: AvatarContext = {\n name: undefined,\n imageUrl: undefined,\n size: undefined,\n location: undefined,\n channel: undefined,\n user: undefined,\n type: undefined,\n initialsType: undefined,\n showOnlineIndicator: undefined,\n };\n constructor(public customTemplatesService: CustomTemplatesService) {}\n\n ngOnChanges(): void {\n this.context = {\n name: this.name,\n imageUrl: this.imageUrl,\n size: this.size,\n location: this.location,\n type: this.type,\n user: this.user,\n channel: this.channel,\n initialsType: this.initialsType,\n showOnlineIndicator: this.showOnlineIndicator,\n };\n }\n}\n","<ng-template\n #defaultAvatar\n let-name=\"name\"\n let-imageUrl=\"imageUrl\"\n let-size=\"size\"\n let-type=\"type\"\n let-channel=\"channel\"\n let-user=\"user\"\n let-location=\"location\"\n let-initialsType=\"initialsType\"\n let-showOnlineIndicator=\"showOnlineIndicator\"\n>\n <stream-avatar\n [name]=\"name\"\n [imageUrl]=\"imageUrl\"\n [size]=\"size\"\n [type]=\"type\"\n [channel]=\"channel\"\n [user]=\"user\"\n [location]=\"location\"\n [initialsType]=\"initialsType\"\n [showOnlineIndicator]=\"showOnlineIndicator\"\n ></stream-avatar>\n</ng-template>\n<ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.avatarTemplate$ | async) || defaultAvatar;\n context: context\n \"\n></ng-container>\n","import { Component, Input } from '@angular/core';\n\nexport type Icon =\n | 'action-icon'\n | 'delivered-icon'\n | 'read-icon'\n | 'reaction-icon'\n | 'connection-error'\n | 'send'\n | 'file-upload'\n | 'retry'\n | 'close'\n | 'file'\n | 'audio-file'\n | 'reply'\n | 'close-no-outline'\n | 'reply-in-thread'\n | 'arrow-left'\n | 'arrow-right'\n | 'menu'\n | 'arrow-up'\n | 'arrow-down'\n | 'chat-bubble'\n | 'attach'\n | 'unspecified-filetype'\n | 'download'\n | 'error'\n | 'play'\n | 'pause';\n\n/**\n * The `Icon` component can be used to display different icons (i. e. message delivered icon).\n */\n@Component({\n selector: 'stream-icon',\n templateUrl: './icon.component.html',\n styles: [],\n})\nexport class IconComponent {\n /**\n * The icon to display, the list of [supported icons](https://github.com/GetStream/stream-chat-angular/tree/master/projects/stream-chat-angular/src/lib/icon/icon.component.ts) can be found on GitHub.\n */\n @Input() icon: Icon | undefined;\n /**\n * The size of the icon (in pixels)\n */\n @Input() size: number | undefined;\n constructor() {}\n}\n","<svg\n data-testid=\"action-icon\"\n *ngIf=\"icon === 'action-icon'\"\n height=\"4\"\n viewBox=\"0 0 11 4\"\n width=\"11\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M1.5 3a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm4 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm4 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'delivered-icon'\"\n data-testid=\"delivered-icon\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M8.9999 16.2L4.7999 12L3.3999 13.4L8.9999 19L20.9999 6.99998L19.5999 5.59998L8.9999 16.2Z\"\n fill=\"black\"\n />\n</svg>\n\n<svg\n *ngIf=\"icon === 'reaction-icon'\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n width=\"12\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"reaction-icon\"\n>\n <g clipRule=\"evenodd\" fillRule=\"evenodd\">\n <path\n d=\"M6 1.2C3.3 1.2 1.2 3.3 1.2 6c0 2.7 2.1 4.8 4.8 4.8 2.7 0 4.8-2.1 4.8-4.8 0-2.7-2.1-4.8-4.8-4.8zM0 6c0-3.3 2.7-6 6-6s6 2.7 6 6-2.7 6-6 6-6-2.7-6-6z\"\n ></path>\n <path\n d=\"M5.4 4.5c0 .5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9zM8.4 4.5c0 .5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9zM3.3 6.7c.3-.2.6-.1.8.1.3.4.8.9 1.5 1 .6.2 1.4.1 2.4-1 .2-.2.6-.3.8 0 .2.2.3.6 0 .8-1.1 1.3-2.4 1.7-3.5 1.5-1-.2-1.8-.9-2.2-1.5-.2-.3-.1-.7.2-.9z\"\n ></path>\n </g>\n</svg>\n<svg\n data-testid=\"connection-error\"\n *ngIf=\"icon === 'connection-error'\"\n width=\"78px\"\n height=\"78px\"\n viewBox=\"0 0 78 78\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n>\n <!-- Generator: Sketch 52.6 (67491) - http://www.bohemiancoding.com/sketch -->\n <title>Combined Shape</title>\n <desc>Created with Sketch.</desc>\n <g\n id=\"Interactions\"\n stroke=\"none\"\n stroke-width=\"1\"\n fill=\"none\"\n fill-rule=\"evenodd\"\n >\n <g\n id=\"Connection-Error-_-Connectivity\"\n transform=\"translate(-270.000000, -30.000000)\"\n fill=\"#CF1F25\"\n >\n <g\n id=\"109-network-connection\"\n transform=\"translate(270.000000, 30.000000)\"\n >\n <path\n d=\"M66.4609744,11.414231 C81.6225232,26.5757798 81.6225232,51.157545 66.4609744,66.3188467 C51.2994256,81.4803954 26.7176604,81.4803954 11.5563587,66.3188467 C-3.60519004,51.1572979 -3.60519004,26.5755327 11.5563587,11.414231 C26.7179075,-3.74731776 51.2996727,-3.74731776 66.4609744,11.414231 Z M54.7853215,45.8823776 L54.7853215,40.5882574 C54.7853215,39.613638 53.9952341,38.8235506 53.0206147,38.8235506 L44.9576695,38.8235506 L41.428256,42.3529641 L51.255555,42.3529641 L51.255555,45.8823776 L54.7853215,45.8823776 Z M40.6659027,43.1153174 L37.8988425,45.8823776 L40.6659027,45.8823776 L40.6659027,43.1153174 Z M51.1764962,56.4702653 L58.2353232,56.4702653 C59.2099355,56.4702653 60.00003,55.6801708 60.00003,54.7055585 L60.00003,51.176145 C60.00003,50.2015327 59.2099355,49.4114382 58.2353232,49.4114382 L51.1764962,49.4114382 C50.2018839,49.4114382 49.4117894,50.2015327 49.4117894,51.176145 L49.4117894,54.7055585 C49.4117894,55.6801708 50.2018839,56.4702653 51.1764962,56.4702653 Z M35.2941353,56.4702653 L42.3529624,56.4702653 C43.3275746,56.4702653 44.1176691,55.6801708 44.1176691,54.7055585 L44.1176691,51.176145 C44.1176691,50.2015327 43.3275746,49.4114382 42.3529624,49.4114382 L35.2941353,49.4114382 C34.319523,49.4114382 33.5294285,50.2015327 33.5294285,51.176145 L33.5294285,54.7055585 C33.5294285,55.6801708 34.319523,56.4702653 35.2941353,56.4702653 Z M56.6964989,19.0874231 C56.007381,18.3985134 54.8903216,18.3985134 54.2012036,19.087423 L45.882376,27.4062507 L45.882376,19.4117761 C45.882376,18.4371568 45.0922885,17.6470693 44.1176692,17.6470693 L33.5294286,17.6470693 C32.5548092,17.6470694 31.7647218,18.4371568 31.7647218,19.4117761 L31.7647218,30.0000167 C31.7647219,30.9746363 32.5548092,31.7647237 33.5294285,31.7647237 L41.5239031,31.7647237 L34.4650761,38.8235508 L24.7058947,38.8235508 C23.7312753,38.8235508 22.9411879,39.6136382 22.9411879,40.5882575 L22.9411879,45.8823778 L26.4706014,45.8823778 L26.4706014,42.3529643 L30.9356624,42.3529643 L23.8768354,49.4117914 L19.4117743,49.4117914 C18.4371549,49.4117914 17.6470675,50.2018788 17.6470675,51.1764981 L17.6470675,54.7059117 C17.6504049,54.9674302 17.7129076,55.2248042 17.8298886,55.4587302 L16.4456526,56.8429662 C15.7446193,57.5200453 15.7252005,58.6372282 16.4022825,59.3382615 C17.0793616,60.0392948 18.1965445,60.0587136 18.8975778,59.3816316 C18.9122847,59.3674273 18.9267436,59.3529684 18.940948,59.3382615 L56.6964963,21.5830662 C57.3856425,20.8939094 57.3856425,19.7765747 56.6964963,19.0874179 Z\"\n id=\"Combined-Shape\"\n ></path>\n </g>\n </g>\n </g>\n</svg>\n<svg\n *ngIf=\"icon === 'send'\"\n data-testid=\"send\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <title translate>streamChat.Send</title>\n <path\n d=\"M4.00952 22L24 12L4.00952 2L4 9.77778L18.2857 12L4 14.2222L4.00952 22Z\"\n fill=\"black\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'file-upload'\"\n data-testid=\"file-upload\"\n height=\"14\"\n width=\"14\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <title translate>streamChat.Attach files</title>\n <path\n d=\"M1.667.333h10.666c.737 0 1.334.597 1.334 1.334v10.666c0 .737-.597 1.334-1.334 1.334H1.667a1.333 1.333 0 0 1-1.334-1.334V1.667C.333.93.93.333 1.667.333zm2 1.334a1.667 1.667 0 1 0 0 3.333 1.667 1.667 0 0 0 0-3.333zm-2 9.333v1.333h10.666v-4l-2-2-4 4-2-2L1.667 11z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'retry'\"\n data-testid=\"retry\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M17.6449 6.35C16.1949 4.9 14.2049 4 11.9949 4C7.57488 4 4.00488 7.58 4.00488 12C4.00488 16.42 7.57488 20 11.9949 20C15.7249 20 18.8349 17.45 19.7249 14H17.6449C16.8249 16.33 14.6049 18 11.9949 18C8.68488 18 5.99488 15.31 5.99488 12C5.99488 8.69 8.68488 6 11.9949 6C13.6549 6 15.1349 6.69 16.2149 7.78L12.9949 11H19.9949V4L17.6449 6.35Z\"\n fill=\"black\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'close'\"\n data-testid=\"close\"\n width=\"28\"\n height=\"28\"\n viewBox=\"0 0 28 28\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <rect width=\"28\" height=\"28\" rx=\"14\" fill=\"#72767E\" />\n <circle cx=\"14\" cy=\"14\" r=\"12\" fill=\"#72767E\" />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M28 14C28 21.732 21.732 28 14 28C6.26801 28 0 21.732 0 14C0 6.26801 6.26801 0 14 0C21.732 0 28 6.26801 28 14ZM26 14C26 20.6274 20.6274 26 14 26C7.37258 26 2 20.6274 2 14C2 7.37258 7.37258 2 14 2C20.6274 2 26 7.37258 26 14ZM19.59 7L21 8.41L15.41 14L21 19.59L19.59 21L14 15.41L8.41 21L7 19.59L12.59 14L7 8.41L8.41 7L14 12.59L19.59 7Z\"\n fill=\"white\"\n />\n</svg>\n\n<svg\n *ngIf=\"icon === 'file'\"\n data-testid=\"file\"\n className=\"rfu-file-icon--small fa-file-fallback\"\n [attr.height]=\"size || 20\"\n [attr.width]=\"size || 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 384 512\"\n>\n <path\n d=\"M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48z\"\n fill=\"#414D54\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'unspecified-filetype'\"\n data-testid=\"unspecified-filetype\"\n width=\"34\"\n height=\"40\"\n viewBox=\"0 0 34 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M0 3C0 1.34315 1.34315 0 3 0H23L34 11V37C34 38.6569 32.6569 40 31 40H3C1.34315 40 0 38.6569 0 37V3Z\"\n fill=\"url(#paint0_linear)\"\n />\n <path d=\"M34 11L26 11C24.3431 11 23 9.65685 23 8V0L34 11Z\" fill=\"#DBDBDB\" />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M8 13H23V15H8V13Z\"\n fill=\"#CFCFCF\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M8 17H18V19H8V17Z\"\n fill=\"#CFCFCF\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M8 21H23V23H8V21Z\"\n fill=\"#CFCFCF\"\n />\n <defs>\n <linearGradient\n id=\"paint0_linear\"\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"40\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stop-color=\"white\" />\n <stop offset=\"1\" stop-color=\"#DBDBDB\" />\n </linearGradient>\n </defs>\n</svg>\n<svg\n *ngIf=\"icon === 'reply'\"\n data-testid=\"reply\"\n height=\"15\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M.56 10.946H.06l-.002-.498L.025.92a.5.5 0 1 1 1-.004l.032 9.029H9.06v-4l9 4.5-9 4.5v-4H.56z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n data-testid=\"close-no-outline\"\n *ngIf=\"icon === 'close-no-outline'\"\n viewBox=\"0 0 24 24\"\n width=\"24\"\n height=\"24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z\"\n fill=\"black\"\n />\n</svg>\n<svg\n height=\"10\"\n width=\"14\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"reply-in-thread\"\n *ngIf=\"icon === 'reply-in-thread'\"\n>\n <path\n d=\"M8.516 3c4.78 0 4.972 6.5 4.972 6.5-1.6-2.906-2.847-3.184-4.972-3.184v2.872L3.772 4.994 8.516.5V3zM.484 5l4.5-4.237v1.78L2.416 5l2.568 2.125v1.828L.484 5z\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'arrow-left'\"\n data-testid=\"arrow-left\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M15.7049 7.41L14.2949 6L8.29492 12L14.2949 18L15.7049 16.59L11.1249 12L15.7049 7.41Z\"\n fill=\"var(--black)\"\n />\n</svg>\n\n<svg\n *ngIf=\"icon === 'arrow-right'\"\n data-testid=\"arrow-right\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M9.70492 6L8.29492 7.41L12.8749 12L8.29492 16.59L9.70492 18L15.7049 12L9.70492 6Z\"\n fill=\"var(--black)\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'menu'\"\n data-testid=\"menu\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M3 8V6H21V8H3ZM3 13H21V11H3V13ZM3 18H21V16H3V18Z\"\n fill=\"black\"\n />\n</svg>\n\n<svg\n data-testid=\"arrow-up\"\n *ngIf=\"icon === 'arrow-up'\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M16.59 15.7051L12 11.1251L7.41 15.7051L6 14.2951L12 8.29508L18 14.2951L16.59 15.7051Z\"\n fill=\"var(--primary-color)\"\n />\n</svg>\n<svg\n data-testid=\"arrow-down\"\n *ngIf=\"icon === 'arrow-down'\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M7.41 8.29504L12 12.875L16.59 8.29504L18 9.70504L12 15.705L6 9.70504L7.41 8.29504Z\"\n fill=\"var(--primary-color)\"\n />\n</svg>\n<svg\n data-testid=\"chat-bubble\"\n *ngIf=\"icon === 'chat-bubble'\"\n viewBox=\"0 0 136 136\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M106 24.5H30C24.775 24.5 20.5 28.775 20.5 34V119.5L39.5 100.5H106C111.225 100.5 115.5 96.225 115.5 91V34C115.5 28.775 111.225 24.5 106 24.5ZM106 91H39.5L30 100.5V34H106V91Z\"\n fill=\"#B4B7BB\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'attach'\"\n data-testid=\"attach\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <g clip-path=\"url(#clip0_10878_5)\">\n <path\n d=\"M12.9997 6.99993L10.9997 6.99993L10.9997 10.9999L6.99972 10.9999L6.99972 12.9999L10.9997 12.9999L10.9997 16.9999L12.9997 16.9999L12.9997 12.9999L16.9997 12.9999L16.9997 10.9999L12.9997 10.9999L12.9997 6.99993ZM11.9997 1.99992C6.47972 1.99992 1.99972 6.47993 1.99972 11.9999C1.99972 17.5199 6.47972 21.9999 11.9997 21.9999C17.5197 21.9999 21.9997 17.5199 21.9997 11.9999C21.9997 6.47993 17.5197 1.99992 11.9997 1.99992ZM11.9997 19.9999C7.58972 19.9999 3.99972 16.4099 3.99972 11.9999C3.99972 7.58993 7.58972 3.99993 11.9997 3.99993C16.4097 3.99993 19.9997 7.58993 19.9997 11.9999C19.9997 16.4099 16.4097 19.9999 11.9997 19.9999Z\"\n fill=\"black\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_10878_5\">\n <rect width=\"24\" height=\"24\" fill=\"white\" />\n </clipPath>\n </defs>\n</svg>\n<svg\n *ngIf=\"icon === 'download'\"\n data-testid=\"download\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04ZM19 18H6C3.79 18 2 16.21 2 14C2 11.95 3.53 10.24 5.56 10.03L6.63 9.92L7.13 8.97C8.08 7.14 9.94 6 12 6C14.62 6 16.88 7.86 17.39 10.43L17.69 11.93L19.22 12.04C20.78 12.14 22 13.45 22 15C22 16.65 20.65 18 19 18ZM13.45 10H10.55V13H8L12 17L16 13H13.45V10Z\"\n fill=\"black\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'error'\"\n data-testid=\"error\"\n [attr.width]=\"size ?? 24\"\n [attr.height]=\"size ?? 24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n id=\"background\"\n d=\"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2Z\"\n fill=\"var(--str-chat__message-error-message-color)\"\n />\n <path d=\"M13 17H11V15H13V17ZM13 13H11V7H13V13Z\" fill=\"white\" />\n</svg>\n<svg\n *ngIf=\"icon === 'play'\"\n fill=\"none\"\n viewBox=\"0 0 12 14\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path d=\"M0.5 0V14L11.5 7L0.5 0Z\" fill=\"#080707\" />\n</svg>\n<svg\n *ngIf=\"icon === 'pause'\"\n fill=\"none\"\n viewBox=\"0 0 12 14\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path d=\"M0 14H4V0H0V14ZM8 0V14H12V0H8Z\" fill=\"#080707\" />\n</svg>\n\n<svg\n *ngIf=\"icon === 'audio-file'\"\n class=\"rfu-file-audio\"\n fill=\"none\"\n [attr.height]=\"size || 20\"\n [attr.width]=\"size || 20\"\n viewBox=\"0 0 34 40\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n clip-rule=\"evenodd\"\n d=\"M17.7168 33.172C18.2348 33.172 18.4238 33.655 18.4238 34.18C18.4238 34.642 18.2978 35.195 17.7168 35.195C17.1708 35.195 16.9888 34.642 16.9888 34.145C16.9888 33.683 17.1708 33.172 17.7168 33.172ZM19.5718 31.002H18.3818V32.7589H18.3678C18.1228 32.43 17.7798 32.262 17.3318 32.262C16.3028 32.262 15.7988 33.158 15.7988 34.103C15.7988 35.125 16.2818 36.1049 17.4228 36.1049C17.8428 36.1049 18.1928 35.923 18.4238 35.58H18.4378V36H19.5718V31.002ZM12.7095 34.1872C12.7095 33.7252 12.8775 33.1722 13.4305 33.1722C13.9835 33.1722 14.1585 33.7252 14.1585 34.1872C14.1585 34.6492 13.9835 35.1952 13.4305 35.1952C12.8775 35.1952 12.7095 34.6492 12.7095 34.1872ZM11.5195 34.1872C11.5195 35.2792 12.3035 36.1052 13.4305 36.1052C14.5575 36.1052 15.3485 35.2792 15.3485 34.1872C15.3485 33.0952 14.5575 32.2622 13.4305 32.2622C12.3035 32.2622 11.5195 33.0952 11.5195 34.1872ZM21.839 32.3671H22.574V33.1371H21.839V34.7891C21.839 35.0761 22.007 35.1391 22.266 35.1391C22.3142 35.1391 22.364 35.1357 22.4147 35.1323C22.4672 35.1287 22.5206 35.1251 22.574 35.1251V36.0001C22.481 36.0031 22.388 36.0099 22.295 36.0168C22.171 36.0259 22.047 36.0351 21.923 36.0351C20.908 36.0351 20.649 35.7411 20.649 34.7541V33.1371H20.047V32.3671H20.649V31.2681H21.839V32.3671Z\"\n fill=\"white\"\n fill-rule=\"evenodd\"\n ></path>\n <path\n d=\"M0 28H34V37C34 38.6569 32.6569 40 31 40H3C1.34315 40 0 38.6569 0 37V28Z\"\n fill=\"#2727B0\"\n ></path>\n <path d=\"M0 3C0 1.34315 1.34315 0 3 0H23L34 11V28H0V3Z\" fill=\"#F5F5F5\"></path>\n <path\n d=\"M34 11L26 11C24.3431 11 23 9.65685 23 8V0L34 11Z\"\n fill=\"#DBDBDB\"\n ></path>\n <path\n clip-rule=\"evenodd\"\n d=\"M8.87912 21.941H12.298L16.9521 24.7493C17.0307 24.8138 17.1293 24.849 17.2311 24.849C17.4738 24.8488 17.6705 24.6519 17.6703 24.4092V12.4399C17.6704 12.3381 17.6352 12.2396 17.5707 12.1609C17.4168 11.9732 17.1398 11.9457 16.9521 12.0996L12.298 14.908H8.87912C8.3936 14.908 8 15.3016 8 15.7871V21.0619C8 21.5474 8.3936 21.941 8.87912 21.941ZM12.9258 16.6664L15.9122 15.2224V21.6268L12.9258 20.1829H9.7583V16.6664H12.9258ZM19.8511 16.3517C19.474 16.4092 19.2397 16.6637 19.3283 16.9191L19.3262 16.92C19.5295 17.4995 19.6305 18.098 19.6284 18.6953C19.6305 19.2975 19.5237 19.9014 19.3196 20.4909C19.229 20.7462 19.4682 20.9996 19.8474 21.06C19.9008 21.0683 19.9542 21.072 20.0076 21.072C20.3259 21.072 20.6156 20.9234 20.6922 20.7057C20.9194 20.0451 21.0337 19.37 21.0374 18.6953C21.0349 18.0251 20.9211 17.3575 20.6955 16.7035C20.6053 16.4477 20.229 16.2908 19.8511 16.3517ZM22.1605 14.6028C22.5252 14.5163 22.9259 14.6454 23.055 14.8938C23.6891 16.1157 24 17.4042 24 18.6923C24.0004 19.9895 23.6796 21.2839 23.0521 22.5153C22.9503 22.7123 22.6763 22.8344 22.3828 22.8344C22.3071 22.8344 22.2301 22.8261 22.1543 22.8092C21.7863 22.7251 21.5914 22.4536 21.7185 22.2077C22.2988 21.0761 22.5922 19.8836 22.5931 18.6919C22.5931 17.5056 22.3054 16.3222 21.7276 15.2025C21.6001 14.9563 21.795 14.686 22.1605 14.6028Z\"\n fill=\"#2727B0\"\n fill-rule=\"evenodd\"\n ></path>\n</svg>\n<svg\n *ngIf=\"icon === 'read-icon'\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M15.7071 7.29289C16.0976 7.68342 16.0976 8.31658 15.7071 8.70711L11.4142 13L13 14.5858L20.2929 7.29289C20.6834 6.90237 21.3166 6.90237 21.7071 7.29289C22.0976 7.68342 22.0976 8.31658 21.7071 8.70711L13.7071 16.7071C13.3166 17.0976 12.6834 17.0976 12.2929 16.7071L10 14.4142L7.70711 16.7071C7.31658 17.0976 6.68342 17.0976 6.29289 16.7071L6.29206 16.7063L2.29289 12.7071C1.90237 12.3166 1.90237 11.6834 2.29289 11.2929C2.68342 10.9024 3.31658 10.9024 3.70711 11.2929L7 14.5858L9.29214 12.2936L9.29289 12.2929L9.29364 12.2921L14.2929 7.29289C14.6834 6.90237 15.3166 6.90237 15.7071 7.29289Z\"\n fill=\"black\"\n />\n</svg>\n","import { Component, Input, OnChanges } from '@angular/core';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { Icon } from '../icon/icon.component';\nimport { IconContext } from '../types';\n\n/**\n * The `IconPlaceholder` component displays the [default icons](./IconComponent.mdx) unless a [custom template](../services/CustomTemplatesService.mdx) is provided. This component is used by the SDK internally, you likely won't need to use it.\n */\n@Component({\n selector: 'stream-icon-placeholder',\n templateUrl: './icon-placeholder.component.html',\n styles: [],\n})\nexport class IconPlaceholderComponent implements OnChanges {\n /**\n * The icon to display, the list of [supported icons](https://github.com/GetStream/stream-chat-angular/tree/master/projects/stream-chat-angular/src/lib/icon/icon.component.ts) can be found on GitHub.\n */\n @Input() icon: Icon | undefined;\n /**\n * The size of the icon (in pixels)\n */\n @Input() size: number | undefined;\n iconContext: IconContext = { icon: undefined, size: undefined };\n\n constructor(public customTemplatesService: CustomTemplatesService) {}\n\n ngOnChanges(): void {\n this.iconContext = {\n icon: this.icon,\n size: this.size,\n };\n }\n}\n","<ng-template #defaultIcon let-icon=\"icon\" let-size=\"size\">\n <stream-icon [icon]=\"icon\" [size]=\"size\"></stream-icon>\n</ng-template>\n<ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.iconTemplate$ | async) || defaultIcon;\n context: iconContext\n \"\n></ng-container>\n","import { Component, Input } from '@angular/core';\nimport { v4 as uuidv4 } from 'uuid';\n\n/**\n * The `LoadingIndicator` component displays a spinner to indicate that an action is in progress.\n */\n@Component({\n selector: 'stream-loading-indicator',\n templateUrl: './loading-indicator.component.html',\n styles: [],\n})\nexport class LoadingIndicatorComponent {\n /**\n * The size of the indicator (in pixels)\n */\n @Input() size = 15;\n /**\n * The color of the indicator\n */\n @Input()\n color = `var(--str-chat__loading-indicator-color, var(--str-chat__primary-color, '#006CFF'))`;\n\n linearGradientId = uuidv4();\n\n constructor() {}\n}\n","<div class=\"str-chat__loading-indicator\">\n <svg\n [attr.height]=\"size\"\n viewBox=\"0 0 30 30\"\n [attr.width]=\"size\"\n data-testid=\"loading-indicator\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <linearGradient\n id=\"{{ linearGradientId }}\"\n x1=\"50%\"\n x2=\"50%\"\n y1=\"0%\"\n y2=\"100%\"\n >\n <stop offset=\"0%\" stop-color=\"#FFF\" stop-opacity=\"0\" />\n <stop\n data-testid=\"stop-color\"\n offset=\"100%\"\n [attr.stop-color]=\"color\"\n stop-opacity=\"1\"\n [ngStyle]=\"{ stopColor: color }\"\n />\n </linearGradient>\n </defs>\n <path\n d=\"M2.518 23.321l1.664-1.11A12.988 12.988 0 0 0 15 28c7.18 0 13-5.82 13-13S22.18 2 15 2V0c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-5.206 0-9.792-2.652-12.482-6.679z\"\n [attr.fill]=\"'url(#' + linearGradientId + ')'\"\n fillRule=\"evenodd\"\n />\n </svg>\n</div>\n","import { Component, Input } from '@angular/core';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { LoadingIndicatorContext } from '../types';\n\n/**\n * The `LoadingInficatorPlaceholder` component displays the [default loading indicator](./LoadingIndicatorComponent.mdx) unless a [custom template](../services/CustomTemplatesService.mdx) is provided. This component is used by the SDK internally, you likely won't need to use it.\n */\n@Component({\n selector: 'stream-loading-indicator-placeholder',\n templateUrl: './loading-indicator-placeholder.component.html',\n styles: [],\n})\nexport class LoadingIndicatorPlaceholderComponent {\n /**\n * The size of the indicator (in pixels)\n */\n @Input() size = 15;\n /**\n * The color of the indicator\n */\n @Input()\n color = `var(--str-chat__loading-indicator-color, var(--str-chat__primary-color, '#006CFF'))`;\n\n constructor(public customTemplatesService: CustomTemplatesService) {}\n\n getLoadingIndicatorContext(): LoadingIndicatorContext {\n return {\n size: this.size,\n color: this.color,\n };\n }\n}\n","<ng-template #defaultLoadingIndicator let-size=\"size\" let-color=\"color\">\n <stream-loading-indicator\n [size]=\"size\"\n [color]=\"color\"\n ></stream-loading-indicator>\n</ng-template>\n<ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.loadingIndicatorTemplate$ | async) ||\n defaultLoadingIndicator;\n context: getLoadingIndicatorContext()\n \"\n></ng-container>\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport {\n CustomMessageActionItem,\n DefaultStreamChatGenerics,\n MessageActionItem,\n MessageActionsClickDetails,\n StreamMessage,\n} from './types';\nimport { ChatClientService } from './chat-client.service';\nimport { NotificationService } from './notification.service';\nimport { ChannelService } from './channel.service';\n\n/**\n * The message actions service provides customization options for the [message actions](../../components/MessageActionsBoxComponent)\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MessageActionsService<\n T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics\n> {\n /**\n * Default actions - these are the actions that are handled by the built-in component\n */\n readonly defaultActions: MessageActionItem<T>[] = [\n {\n actionName: 'mark-unread',\n actionLabelOrTranslationKey: 'streamChat.Mark as unread',\n actionHandler: (message: StreamMessage<T>) =>\n this.channelService.markMessageUnread(message.id),\n isVisible: (\n enabledActions: string[],\n isMine: boolean,\n message: StreamMessage<T>\n ) => enabledActions.indexOf('read-events') !== -1 && !message.parent_id,\n },\n {\n actionName: 'quote',\n actionLabelOrTranslationKey: 'streamChat.Reply',\n actionHandler: (message: StreamMessage<T>) =>\n this.channelService.selectMessageToQuote(message),\n isVisible: (enabledActions: string[]) =>\n enabledActions.indexOf('quote-message') !== -1,\n },\n {\n actionName: 'pin',\n actionLabelOrTranslationKey: (message: StreamMessage<T>) =>\n message.pinned ? 'streamChat.Unpin' : 'streamChat.Pin',\n actionHandler: (message: StreamMessage<T>) =>\n message.pinned\n ? this.channelService.unpinMessage(message)\n : this.channelService.pinMessage(message),\n isVisible: (enabledActions: string[]) =>\n enabledActions.indexOf('pin-message') !== -1,\n },\n {\n actionName: 'flag',\n actionLabelOrTranslationKey: 'streamChat.Flag',\n actionHandler: async (message: StreamMessage<T>) => {\n try {\n await this.chatClientService.flagMessage(message.id);\n this.notificationService.addTemporaryNotification(\n 'streamChat.Message has been successfully flagged',\n 'success'\n );\n } catch (err) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error adding flag'\n );\n }\n },\n isVisible: (enabledActions: string[], isMine: boolean) =>\n enabledActions.indexOf('flag-message') !== -1 && !isMine,\n },\n {\n actionName: 'edit',\n actionLabelOrTranslationKey: 'streamChat.Edit Message',\n actionHandler: (message: StreamMessage<T>) => {\n this.messageToEdit$.next(message);\n },\n isVisible: (enabledActions: string[], isMine: boolean) =>\n (enabledActions.indexOf('update-own-message') !== -1 && isMine) ||\n enabledActions.indexOf('update-any-message') !== -1,\n },\n {\n actionName: 'delete',\n actionLabelOrTranslationKey: 'streamChat.Delete',\n actionHandler: async (message: StreamMessage<T>) => {\n try {\n await this.channelService.deleteMessage(message);\n } catch (error) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error deleting message'\n );\n }\n },\n isVisible: (enabledActions: string[], isMine: boolean) =>\n ((enabledActions.indexOf('delete') !== -1 ||\n enabledActions.indexOf('delete-own-message') !== -1) &&\n isMine) ||\n enabledActions.indexOf('delete-any') !== -1 ||\n enabledActions.indexOf('delete-any-message') !== -1,\n },\n ];\n /**\n * The built-in components will handle changes to this observable.\n */\n messageToEdit$ = new BehaviorSubject<StreamMessage<T> | undefined>(undefined);\n /**\n * You can pass your own custom actions that will be displayed inside the built-in message actions component\n */\n customActions$ = new BehaviorSubject<CustomMessageActionItem[]>([]);\n /**\n * By default the [`MessageComponent`](../../components/MessageComponent) will display the [`MessageActionsBoxComponent`](../../components/MessageActionsBoxComponent). You can override that behavior by providing your own event handler.\n */\n customActionClickHandler?: (details: MessageActionsClickDetails<T>) => void;\n\n constructor(\n private chatClientService: ChatClientService,\n private notificationService: NotificationService,\n private channelService: ChannelService\n ) {}\n\n /**\n * This method returns how many authorized actions are available to the given message\n *\n * @param message\n * @param enabledActions\n * @returns the count\n */\n getAuthorizedMessageActionsCount(\n message: StreamMessage<T>,\n enabledActions: string[]\n ) {\n const customActions = this.customActions$.getValue() || [];\n const allActions = [...this.defaultActions, ...customActions];\n const currentUserId = this.chatClientService.chatClient.user?.id;\n const isMine = message.user_id === currentUserId;\n\n return allActions.filter((item) =>\n item.isVisible(enabledActions, isMine, message)\n ).length;\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n TemplateRef,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport {\n CustomMessageActionItem,\n MessageActionBoxItemContext,\n MessageActionItem,\n MessageInputContext,\n StreamMessage,\n} from '../types';\nimport { MessageActionsService } from '../message-actions.service';\n/**\n * The `MessageActionsBox` component displays a list of message actions (i.e edit), that can be opened or closed. You can find the [list of the supported actions](../concepts/message-interactions.mdx) in the message interaction guide.\n */\n@Component({\n selector: 'stream-message-actions-box',\n templateUrl: './message-actions-box.component.html',\n styles: [],\n})\nexport class MessageActionsBoxComponent\n implements OnInit, OnChanges, OnDestroy, AfterViewInit\n{\n /**\n * Indicates if the list should be opened or closed. Adding a UI element to open and close the list is the parent's component responsibility.\n * @deprecated No need for this since [theme-v2](../theming/introduction.mdx)\n */\n @Input() isOpen = false;\n /**\n * Indicates if the message actions are belonging to a message that was sent by the current user or not.\n */\n @Input() isMine = false;\n /**\n * The message the actions will be executed on\n */\n @Input() message: StreamMessage | undefined;\n /**\n * The list of [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) that are enabled for the current user, the list of [supported interactions](../concepts/message-interactions.mdx) can be found in our message interaction guide. Unathorized actions won't be displayed on the UI.\n */\n @Input() enabledActions: string[] = [];\n /**\n * A list of custom message actions to be displayed in the action box\n *\n * In the next major release this will be released with `messageReactionsService.customActions$`\n *\n * More information: https://getstream.io/chat/docs/sdk/angular/services/MessageActionsService\n */\n @Input() customActions: CustomMessageActionItem[] = [];\n /**\n * The number of authorized actions (it can be less or equal than the number of enabled actions)\n *\n * @deprecated components should use `messageReactionsService.getAuthorizedMessageActionsCount` method\n *\n * More information: https://getstream.io/chat/docs/sdk/angular/services/MessageActionsService\n */\n @Output() readonly displayedActionsCount = new EventEmitter<number>();\n /**\n * An event which emits `true` if the edit message modal is open, and `false` when it is closed.\n *\n * @deprecated components should use `messageReactionsService.messageToEdit$` Observable\n *\n * More information: https://getstream.io/chat/docs/sdk/angular/services/MessageActionsService\n */\n @Output() readonly isEditing = new EventEmitter<boolean>();\n messageInputTemplate: TemplateRef<MessageInputContext> | undefined;\n messageActionItemTemplate:\n | TemplateRef<MessageActionBoxItemContext>\n | undefined;\n visibleMessageActionItems: (MessageActionItem | CustomMessageActionItem)[] =\n [];\n isEditModalOpen = false;\n private readonly messageActionItems: MessageActionItem[];\n private subscriptions: Subscription[] = [];\n private isViewInited = false;\n constructor(\n public readonly customTemplatesService: CustomTemplatesService,\n private messageActionsService: MessageActionsService,\n private cdRef: ChangeDetectorRef\n ) {\n this.messageActionItems = this.messageActionsService.defaultActions;\n }\n\n ngOnInit(): void {\n this.subscriptions.push(\n this.messageActionsService.messageToEdit$.subscribe((m) => {\n let isEditModalOpen = false;\n if (m && m.id === this.message?.id) {\n isEditModalOpen = true;\n }\n if (isEditModalOpen !== this.isEditModalOpen) {\n this.isEditModalOpen = isEditModalOpen;\n this.isEditing.emit(this.isEditModalOpen);\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n })\n );\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (\n changes.isMine ||\n changes.enabledActions ||\n changes.message ||\n changes.customActions\n ) {\n this.setVisibleActions();\n }\n }\n\n ngAfterViewInit(): void {\n this.isViewInited = true;\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n getActionLabel(\n actionLabelOrTranslationKey: ((message: StreamMessage) => string) | string\n ) {\n return typeof actionLabelOrTranslationKey === 'string'\n ? actionLabelOrTranslationKey\n : actionLabelOrTranslationKey(this.message!);\n }\n\n getMessageActionTemplateContext(\n item: MessageActionItem | CustomMessageActionItem\n ): MessageActionBoxItemContext<any> {\n return {\n actionHandler: item.actionHandler,\n isMine: this.isMine,\n actionName: item.actionName,\n message: this.message,\n actionLabelOrTranslationKey: item.actionLabelOrTranslationKey,\n };\n }\n\n trackByActionName(\n _: number,\n item: MessageActionItem | CustomMessageActionItem\n ) {\n return item.actionName;\n }\n\n private setVisibleActions() {\n this.visibleMessageActionItems = [\n ...this.messageActionItems,\n ...this.customActions,\n ].filter((item) =>\n item.isVisible(this.enabledActions, this.isMine, this.message!)\n );\n this.displayedActionsCount.emit(this.visibleMessageActionItems.length);\n }\n}\n","<div\n #actionBox\n data-testid=\"action-box\"\n class=\"str-chat__message-actions-box str-chat__message-actions-box-angular\"\n [class.str-chat__message-actions-box--open]=\"true\"\n>\n <ul class=\"str-chat__message-actions-list\">\n <ng-container\n *ngFor=\"let item of visibleMessageActionItems; trackBy: trackByActionName\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageActionsBoxItemTemplate$ | async) ||\n defaultMessageActionItem;\n context: getMessageActionTemplateContext(item)\n \"\n ></ng-container>\n </ng-container>\n </ul>\n</div>\n\n<ng-template\n #defaultMessageActionItem\n let-actionName=\"actionName\"\n let-actionHandler=\"actionHandler\"\n let-actionLabelOrTranslationKey=\"actionLabelOrTranslationKey\"\n>\n <button\n class=\"str-chat__message-actions-list-item-button\"\n [attr.data-testid]=\"actionName + '-action'\"\n (click)=\"actionHandler(message, isMine)\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ getActionLabel(actionLabelOrTranslationKey) | translate }}\n </li>\n </button>\n</ng-template>\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\n\n/**\n * The `Modal` component displays its content in an overlay. The modal can be closed with a close button, if the user clicks outside of the modal content, or if the escape button is pressed. The modal can also be closed from outside.\n */\n@Component({\n selector: 'stream-modal',\n templateUrl: './modal.component.html',\n styles: [],\n})\nexport class ModalComponent implements OnChanges {\n /**\n * If `true` the modal will be displayed, if `false` the modal will be hidden\n */\n @Input() isOpen = false;\n /**\n * The content of the modal (can also be provided using `ng-content`)\n */\n @Input() content: TemplateRef<void> | undefined;\n /**\n * Emits `true` if the modal becomes visible, and `false` if the modal is closed.\n */\n @Output() readonly isOpenChange = new EventEmitter<boolean>();\n @ViewChild('modalInner') private innerContainer:\n | ElementRef<HTMLElement>\n | undefined;\n\n constructor() {}\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.isOpen) {\n if (this.isOpen) {\n window.addEventListener('keyup', this.watchForEscPress);\n setTimeout(\n () => window.addEventListener('click', this.watchForOutsideClicks),\n 0\n );\n } else {\n this.stopWatchForOutsideClicks();\n this.stopWatchForEscPress();\n }\n }\n }\n\n close() {\n this.isOpen = false;\n this.isOpenChange.emit(false);\n this.stopWatchForOutsideClicks();\n this.stopWatchForEscPress();\n }\n\n private watchForEscPress = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n this.close();\n }\n };\n\n private stopWatchForEscPress = () => {\n window.removeEventListener('keyup', this.watchForEscPress);\n };\n\n private watchForOutsideClicks = (event: Event) => {\n if (!this.innerContainer?.nativeElement.contains(event.target as Node)) {\n this.close();\n }\n };\n\n private stopWatchForOutsideClicks() {\n window.removeEventListener('click', this.watchForOutsideClicks);\n }\n}\n","<div\n data-testid=\"modal\"\n class=\"str-chat__modal str-chat__modal--{{ isOpen ? 'open' : 'close' }}\"\n>\n <div\n data-testid=\"close\"\n class=\"str-chat__modal__close-button\"\n (click)=\"close()\"\n (keyup.enter)=\"close()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </div>\n <div class=\"str-chat__modal__inner\" #modalInner>\n <ng-container *ngIf=\"content; else elseContent\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </ng-container>\n <ng-template #elseContent>\n <ng-content></ng-content>\n </ng-template>\n </div>\n</div>\n","import { InjectionToken, Type } from '@angular/core';\nimport { TextareaInterface } from './message-input/textarea.interface';\n\nexport const textareaInjectionToken = new InjectionToken<\n Type<TextareaInterface>\n>('textareaInjectionToken');\n","import {\n ComponentRef,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n ViewContainerRef,\n} from '@angular/core';\nimport { Directive } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { UserResponse } from 'stream-chat';\nimport { TextareaInterface } from './textarea.interface';\n\n@Directive({\n selector: '[streamTextarea]',\n})\nexport class TextareaDirective implements OnChanges {\n @Input() componentRef:\n | ComponentRef<TextareaInterface & Partial<OnChanges>>\n | undefined;\n @Input() areMentionsEnabled: boolean | undefined;\n @Input() mentionScope?: 'channel' | 'application';\n @Input() inputMode!: 'mobile' | 'desktop';\n @Input() value = '';\n @Input() placeholder: string | undefined;\n @Input() autoFocus!: boolean;\n @Output() readonly valueChange = new EventEmitter<string>();\n @Output() readonly send = new EventEmitter<void>();\n @Output() readonly userMentions = new EventEmitter<UserResponse[]>();\n private subscriptions: Subscription[] = [];\n private unpropagatedChanges: SimpleChanges[] = [];\n constructor(public viewContainerRef: ViewContainerRef) {}\n\n ngOnChanges(changes: SimpleChanges): void {\n this.unpropagatedChanges.push(changes);\n if (!this.componentRef) {\n return;\n }\n if (changes.componentRef) {\n this.subscriptions.forEach((s) => s.unsubscribe());\n if (this.componentRef) {\n this.subscriptions.push(\n this.componentRef.instance.valueChange.subscribe((value) =>\n this.valueChange.next(value)\n )\n );\n this.subscriptions.push(\n this.componentRef.instance.send.subscribe((value) =>\n this.send.next(value)\n )\n );\n if (this.componentRef.instance.userMentions) {\n this.subscriptions.push(\n this.componentRef.instance.userMentions.subscribe((value) =>\n this.userMentions.next(value)\n )\n );\n }\n this.componentRef.instance.areMentionsEnabled = this.areMentionsEnabled;\n this.componentRef.instance.mentionScope = this.mentionScope;\n this.componentRef.instance.value = this.value;\n this.componentRef.instance.placeholder = this.placeholder;\n this.componentRef.instance.inputMode = this.inputMode;\n this.componentRef.instance.autoFocus = this.autoFocus;\n }\n }\n if (changes.areMentionsEnabled) {\n this.componentRef.instance.areMentionsEnabled = this.areMentionsEnabled;\n }\n if (changes.mentionScope) {\n this.componentRef.instance.mentionScope = this.mentionScope;\n }\n if (changes.value) {\n this.componentRef.instance.value = this.value;\n }\n if (changes.placeholder) {\n this.componentRef.instance.placeholder = this.placeholder;\n }\n if (changes.inputMode) {\n this.componentRef.instance.inputMode = this.inputMode;\n }\n if (changes.autoFocus) {\n this.componentRef.instance.autoFocus = this.autoFocus;\n }\n // ngOnChanges not called for dynamic components since we don't use template binding\n let changesToPropagate = {};\n this.unpropagatedChanges.forEach(\n (c) => (changesToPropagate = { ...changesToPropagate, ...c })\n );\n // eslint-disable-next-line @angular-eslint/no-lifecycle-call\n this.componentRef.instance.ngOnChanges?.(changesToPropagate);\n this.unpropagatedChanges = [];\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n/**\n * If you have an emoji picker in your application, you can propagate the selected emoji to the textarea using this service, more info can be found in [custom emoji picker guide](../code-examples/emoji-picker.mdx)\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class EmojiInputService {\n /**\n * If you have an emoji picker in your application, you can propagate the selected emoji to the textarea using this Subject, more info can be found in [custom emoji picker guide](../code-examples/emoji-picker.mdx)\n */\n emojiInput$ = new Subject<string>();\n\n constructor() {}\n}\n","import { Injectable } from '@angular/core';\n\n/**\n * The `MessageInputConfigService` is used to keep a consistent configuration among the different [`MessageInput`](../components/MessageInputComponent.mdx) components if your UI has more than one input component.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MessageInputConfigService {\n /**\n * If file upload is enabled, the user can open a file selector from the input. Please note that the user also needs to have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).\n */\n isFileUploadEnabled: boolean | undefined = true;\n /**\n * If true, users can mention other users in messages. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work.\n */\n areMentionsEnabled: boolean | undefined = true;\n /**\n * If `false`, users can only upload one attachment per message\n */\n isMultipleFileUploadEnabled: boolean | undefined = true;\n /**\n * The scope for user mentions, either members of the current channel of members of the application\n */\n mentionScope: 'channel' | 'application' | undefined = 'channel';\n\n /**\n * In `desktop` mode the `Enter` key will trigger message sending, in `mobile` mode the `Enter` key will insert a new line to the message input.\n */\n inputMode: 'desktop' | 'mobile' = 'desktop';\n\n constructor() {}\n}\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n NgZone,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\n\n/**\n * This component can be used to visualize the wave bar of a voice recording\n */\n@Component({\n selector: 'stream-voice-recording-wavebar',\n templateUrl: './voice-recording-wavebar.component.html',\n styles: [],\n})\nexport class VoiceRecordingWavebarComponent\n implements OnInit, OnChanges, AfterViewInit\n{\n /**\n * The audio element that plays the voice recording\n */\n @Input() audioElement?: HTMLAudioElement;\n /**\n * The waveform data to visualize\n */\n @Input() waveFormData: number[] = [];\n /**\n * The duration of the voice recording in seconds\n */\n @Input() duration?: number;\n resampledWaveFormData: number[] = [];\n progress: number = 0;\n isDragging = false;\n private sampleSize: number = 40;\n @ViewChild('container', { static: true })\n private container?: ElementRef<HTMLElement>;\n private isViewInited = false;\n\n constructor(private ngZone: NgZone, private cdRef: ChangeDetectorRef) {}\n\n ngOnInit(): void {\n this.containerSizeChanged();\n if (this.container?.nativeElement) {\n this.ngZone.runOutsideAngular(() => {\n new ResizeObserver(() => {\n this.containerSizeChanged();\n }).observe(this.container!.nativeElement);\n });\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.waveFormData) {\n this.resampledWaveFormData =\n this.waveFormData.length > this.sampleSize\n ? this.downsample()\n : this.upsample();\n }\n if (changes.audioElement) {\n this.ngZone.runOutsideAngular(() => {\n this.audioElement?.addEventListener('timeupdate', () => {\n const progress =\n (this.audioElement?.currentTime || 0) / (this.duration || 0) || 0;\n if (Math.abs(progress - this.progress) >= 0.02) {\n this.ngZone.run(() => {\n this.progress = progress;\n this.cdRef.detectChanges();\n });\n }\n });\n });\n }\n }\n\n ngAfterViewInit(): void {\n this.isViewInited = true;\n }\n\n seek(event: any) {\n const containerWidth =\n this.container?.nativeElement?.getBoundingClientRect().width || 0;\n const containerStart =\n this.container?.nativeElement?.getBoundingClientRect()?.x || 0;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const progress = (event.x - containerStart) / containerWidth;\n\n if (!isNaN(progress) && this.audioElement) {\n const duration = this.duration || 0;\n const time = duration * progress;\n this.audioElement.currentTime = time;\n }\n }\n\n trackByIndex(index: number) {\n return index;\n }\n\n private containerSizeChanged() {\n if (!this.container?.nativeElement) {\n return;\n }\n const containerWidth = this.container.nativeElement.clientWidth;\n if (containerWidth === 0) {\n return;\n }\n const barWidth = +getComputedStyle(this.container.nativeElement)\n .getPropertyValue('--str-chat__voice-recording-amplitude-bar-width')\n .replace('px', '');\n const barGap = +getComputedStyle(this.container.nativeElement)\n .getPropertyValue('--str-chat__voice-recording-amplitude-bar-gap-width')\n .replace('px', '');\n if (!isNaN(barWidth) && !isNaN(barGap)) {\n const sampleSize = Math.floor(containerWidth / (barWidth + barGap));\n if (\n sampleSize !== this.sampleSize &&\n !isNaN(sampleSize) &&\n sampleSize !== Infinity\n ) {\n this.ngZone.run(() => {\n this.sampleSize = sampleSize;\n this.resampledWaveFormData =\n this.waveFormData.length > this.sampleSize\n ? this.downsample()\n : this.upsample();\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n });\n }\n }\n }\n\n private downsample() {\n if (this.waveFormData.length <= this.sampleSize) {\n return this.waveFormData;\n }\n\n if (this.sampleSize === 1) return [this.mean(this.waveFormData)];\n\n const result: number[] = [];\n // bucket size adjusted due to the fact that the first and the last item in the original data array is kept in target output\n const bucketSize = (this.waveFormData.length - 2) / (this.sampleSize - 2);\n let lastSelectedPointIndex = 0;\n result.push(this.waveFormData[lastSelectedPointIndex]); // Always add the first point\n let maxAreaPoint, maxArea, triangleArea;\n\n for (\n let bucketIndex = 1;\n bucketIndex < this.sampleSize - 1;\n bucketIndex++\n ) {\n const previousBucketRefPoint = this.waveFormData[lastSelectedPointIndex];\n const nextBucketMean = this.getNextBucketMean(\n this.waveFormData,\n bucketIndex,\n bucketSize\n );\n\n const currentBucketStartIndex =\n Math.floor((bucketIndex - 1) * bucketSize) + 1;\n const nextBucketStartIndex = Math.floor(bucketIndex * bucketSize) + 1;\n const countUnitsBetweenAtoC =\n 1 + nextBucketStartIndex - currentBucketStartIndex;\n\n maxArea = triangleArea = -1;\n\n for (\n let currentPointIndex = currentBucketStartIndex;\n currentPointIndex < nextBucketStartIndex;\n currentPointIndex++\n ) {\n const countUnitsBetweenAtoB =\n Math.abs(currentPointIndex - currentBucketStartIndex) + 1;\n const countUnitsBetweenBtoC =\n countUnitsBetweenAtoC - countUnitsBetweenAtoB;\n const currentPointValue = this.waveFormData[currentPointIndex];\n\n triangleArea = this.triangleAreaHeron(\n this.triangleBase(\n Math.abs(previousBucketRefPoint - currentPointValue),\n countUnitsBetweenAtoB\n ),\n this.triangleBase(\n Math.abs(currentPointValue - nextBucketMean),\n countUnitsBetweenBtoC\n ),\n this.triangleBase(\n Math.abs(previousBucketRefPoint - nextBucketMean),\n countUnitsBetweenAtoC\n )\n );\n\n if (triangleArea > maxArea) {\n maxArea = triangleArea;\n maxAreaPoint = this.waveFormData[currentPointIndex];\n lastSelectedPointIndex = currentPointIndex;\n }\n }\n\n if (typeof maxAreaPoint !== 'undefined') result.push(maxAreaPoint);\n }\n\n result.push(this.waveFormData[this.waveFormData.length - 1]); // Always add the last point\n\n return result;\n }\n\n private upsample = () => {\n if (this.sampleSize === this.waveFormData.length) return this.waveFormData;\n\n // eslint-disable-next-line prefer-const\n let [bucketSize, remainder] = this.divMod(\n this.sampleSize,\n this.waveFormData.length\n );\n const result: number[] = [];\n\n for (let i = 0; i < this.waveFormData.length; i++) {\n const extra = remainder && remainder-- ? 1 : 0;\n result.push(...Array(bucketSize + extra).fill(this.waveFormData[i]));\n }\n return result;\n };\n\n private getNextBucketMean = (\n data: number[],\n currentBucketIndex: number,\n bucketSize: number\n ) => {\n const nextBucketStartIndex =\n Math.floor(currentBucketIndex * bucketSize) + 1;\n let nextNextBucketStartIndex =\n Math.floor((currentBucketIndex + 1) * bucketSize) + 1;\n nextNextBucketStartIndex =\n nextNextBucketStartIndex < data.length\n ? nextNextBucketStartIndex\n : data.length;\n\n return this.mean(\n data.slice(nextBucketStartIndex, nextNextBucketStartIndex)\n );\n };\n\n private mean = (values: number[]) =>\n values.reduce((acc, value) => acc + value, 0) / values.length;\n\n private triangleAreaHeron = (a: number, b: number, c: number) => {\n const s = (a + b + c) / 2;\n return Math.sqrt(s * (s - a) * (s - b) * (s - c));\n };\n\n private triangleBase = (a: number, b: number) =>\n Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n\n private divMod = (num: number, divisor: number) => {\n return [Math.floor(num / divisor), num % divisor];\n };\n}\n","<div\n class=\"str-chat__wave-progress-bar__track\"\n #container\n data-testid=\"wave-progress-bar-track\"\n (mousedown)=\"isDragging = true\"\n (mouseup)=\"isDragging = false\"\n (mouseleave)=\"isDragging = false\"\n (mousemove)=\"isDragging ? seek($event) : null\"\n (click)=\"seek($event)\"\n (keyup.enter)=\"seek($event)\"\n role=\"progressbar\"\n>\n <div\n *ngFor=\"\n let dataPoint of resampledWaveFormData;\n let i = index;\n trackBy: trackByIndex\n \"\n class=\"str-chat__wave-progress-bar__amplitude-bar\"\n [class.str-chat__wave-progress-bar__amplitude-bar--active]=\"\n progress > i / resampledWaveFormData.length\n \"\n [style.--str-chat__wave-progress-bar__amplitude-bar-height]=\"\n dataPoint ? dataPoint * 100 + '%' : '0%'\n \"\n ></div>\n <div\n class=\"str-chat__wave-progress-bar__progress-indicator\"\n data-testid=\"wave-progress-bar-progress-indicator\"\n [ngStyle]=\"{ 'inset-inline-start': progress * 100 + '%' }\"\n ></div>\n</div>\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n NgZone,\n OnChanges,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\nimport { Attachment } from 'stream-chat';\nimport { DefaultStreamChatGenerics } from '../types';\nimport prettybytes from 'pretty-bytes';\n\n/**\n * This component can be used to display an attachment with type `voiceRecording`. The component allows playing the attachment inside the browser.\n */\n@Component({\n selector: 'stream-voice-recording',\n templateUrl: './voice-recording.component.html',\n styles: [],\n})\nexport class VoiceRecordingComponent implements OnChanges, AfterViewInit {\n /**\n * The voice recording attachment\n */\n @Input() attachment?: Attachment<DefaultStreamChatGenerics>;\n fileSize: string = '';\n secondsElapsedFormatted: string;\n durationFormatted: string = '';\n secondsElapsed = 0;\n isError = false;\n @ViewChild('audioElement')\n private audioElement?: ElementRef<HTMLAudioElement>;\n\n constructor(private ngZone: NgZone, private cdRef: ChangeDetectorRef) {\n this.secondsElapsedFormatted = this.getFormattedDuration(\n this.secondsElapsed\n );\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.attachment) {\n this.fileSize = this.getFileSize();\n this.durationFormatted = this.getFormattedDuration(\n this.attachment?.duration\n );\n }\n }\n\n ngAfterViewInit(): void {\n // timeupdate fired frequntly so we optimize change detections\n this.ngZone.runOutsideAngular(() => {\n this.audioElement?.nativeElement.addEventListener('timeupdate', () => {\n const secondsElapsed = this.audioElement?.nativeElement?.ended\n ? this.attachment?.duration || 0\n : Math.round(this.audioElement?.nativeElement?.currentTime || 0);\n if (this.secondsElapsed !== secondsElapsed) {\n this.ngZone.run(() => {\n this.secondsElapsed = secondsElapsed;\n this.secondsElapsedFormatted = this.getFormattedDuration(\n this.secondsElapsed\n );\n this.cdRef.detectChanges();\n });\n }\n });\n });\n }\n\n async togglePlay() {\n if (!this.audioElement || !this.attachment?.asset_url) {\n return;\n }\n try {\n this.audioElement?.nativeElement.paused\n ? await this.audioElement.nativeElement.play()\n : this.audioElement.nativeElement.pause();\n this.isError = false;\n } catch (e) {\n this.isError = true;\n }\n }\n\n setPlaybackRate() {\n if (!this.audioElement?.nativeElement) {\n return;\n }\n let playbackRate = this.audioElement?.nativeElement?.playbackRate + 0.5;\n if (playbackRate > 2) {\n playbackRate = 1;\n }\n this.audioElement.nativeElement.playbackRate = playbackRate;\n }\n\n private getFormattedDuration(duration?: number) {\n if (duration === undefined || duration <= 0) return '00:00';\n\n const [hours, hoursLeftover] = this.divMod(duration, 3600);\n const [minutes, seconds] = this.divMod(hoursLeftover, 60);\n const roundedSeconds = Math.ceil(seconds);\n\n const prependHrsZero = hours.toString().length === 1 ? '0' : '';\n const prependMinZero = minutes.toString().length === 1 ? '0' : '';\n const prependSecZero = roundedSeconds.toString().length === 1 ? '0' : '';\n const minSec = `${prependMinZero}${minutes}:${prependSecZero}${roundedSeconds}`;\n\n return hours ? `${prependHrsZero}${hours}:` + minSec : minSec;\n }\n\n private getFileSize() {\n if (\n this.attachment?.file_size === undefined ||\n this.attachment?.file_size === null\n ) {\n return '';\n }\n return prettybytes(Number(this.attachment.file_size || 0));\n }\n\n private divMod(num: number, divisor: number) {\n return [Math.floor(num / divisor), num % divisor];\n }\n}\n","<div\n class=\"str-chat__message-attachment__voice-recording-widget\"\n [class.str-chat__message-attachment__voice-recording-widget--error]=\"isError\"\n data-testid=\"voice-recording-widget\"\n>\n <!-- Empty event handlers to trigger change detection -->\n <audio\n #audioElement\n (play)=\"(null)\"\n (pause)=\"(null)\"\n (ended)=\"(null)\"\n (error)=\"isError = true\"\n (abort)=\"isError = true\"\n >\n <source\n data-testid=\"audio-source\"\n [src]=\"attachment?.asset_url\"\n [type]=\"attachment?.mime_type\"\n />\n </audio>\n <button\n class=\"str-chat__message-attachment-audio-widget--play-button\"\n data-testid=\"play-button\"\n (click)=\"togglePlay()\"\n >\n <stream-icon-placeholder\n [icon]=\"audioElement?.paused ? 'play' : 'pause'\"\n ></stream-icon-placeholder>\n </button>\n <div class=\"str-chat__message-attachment__voice-recording-widget__metadata\">\n <div class=\"str-chat__message-attachment-voice-recording-widget--first-row\">\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__title\"\n data-testid=\"voice-recording-title\"\n [title]=\"attachment?.title\"\n >\n {{ attachment?.title }}\n </div>\n </div>\n\n <ng-container *ngIf=\"isError; else state\">\n <div\n class=\"\n str-chat__message-attachment__voice-recording-widget__error-message\n \"\n >\n <stream-icon-placeholder\n [size]=\"20\"\n icon=\"error\"\n ></stream-icon-placeholder>\n <span data-testid=\"error-message\">{{\n \"streamChat.Error playing audio\" | translate\n }}</span>\n </div>\n </ng-container>\n <ng-template #state>\n <div\n class=\"\n str-chat__message-attachment__voice-recording-widget__audio-state\n \"\n >\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__timer\"\n >\n <span\n data-testid=\"duration\"\n *ngIf=\"!!attachment?.duration; else fileSizeTemplate\"\n >\n {{\n secondsElapsed > 0 || !audioElement.paused\n ? secondsElapsedFormatted\n : durationFormatted\n }}</span\n >\n <ng-template #fileSizeTemplate>\n <span\n class=\"str-chat__message-attachment-file--item-size\"\n data-testid=\"file-size-indicator\"\n >\n {{ fileSize }}\n </span>\n </ng-template>\n </div>\n <stream-voice-recording-wavebar\n *ngIf=\"attachment?.waveform_data && attachment?.duration\"\n [waveFormData]=\"attachment?.waveform_data || []\"\n [duration]=\"attachment?.duration\"\n [audioElement]=\"audioElement\"\n ></stream-voice-recording-wavebar>\n </div>\n </ng-template>\n </div>\n <div\n class=\"str-chat__message-attachment__voice-recording-widget__right-section\"\n >\n <button\n *ngIf=\"!audioElement?.paused; else fileIcon\"\n class=\"str-chat__message_attachment__playback-rate-button\"\n data-testid=\"playback-rate-button\"\n (click)=\"setPlaybackRate()\"\n >\n {{ audioElement?.playbackRate | number: \"1.1-1\" }}x\n </button>\n <ng-template #fileIcon>\n <stream-icon-placeholder\n icon=\"audio-file\"\n [size]=\"40\"\n ></stream-icon-placeholder>\n </ng-template>\n </div>\n</div>\n","import {\n Component,\n EventEmitter,\n HostBinding,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { Action, Attachment } from 'stream-chat';\nimport {\n ModalContext,\n DefaultStreamChatGenerics,\n AttachmentConfigration,\n VideoAttachmentConfiguration,\n ImageAttachmentConfiguration,\n AttachmentContext,\n} from '../types';\nimport prettybytes from 'pretty-bytes';\nimport { isImageAttachment } from '../is-image-attachment';\nimport { ChannelService } from '../channel.service';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { AttachmentConfigurationService } from '../attachment-configuration.service';\nimport { ThemeService } from '../theme.service';\n\n/**\n * The `AttachmentList` component displays the attachments of a message\n */\n@Component({\n selector: 'stream-attachment-list',\n templateUrl: './attachment-list.component.html',\n styles: [],\n})\nexport class AttachmentListComponent implements OnChanges {\n /**\n * The id of the message the attachments belong to\n */\n @Input() messageId: string | undefined;\n /**\n * The parent id of the message the attachments belong to\n */\n @Input() parentMessageId: string | undefined;\n /**\n * The attachments to display\n */\n @Input() attachments: Attachment<DefaultStreamChatGenerics>[] = [];\n /**\n * Emits the state of the image carousel window\n */\n @Output() readonly imageModalStateChange = new EventEmitter<\n 'opened' | 'closed'\n >();\n @HostBinding() class = 'str-chat__attachment-list-angular-host';\n orderedAttachments: Attachment<DefaultStreamChatGenerics>[] = [];\n imagesToView: Attachment<DefaultStreamChatGenerics>[] = [];\n imagesToViewCurrentIndex = 0;\n themeVersion: '1' | '2';\n @ViewChild('modalContent', { static: true })\n private modalContent!: TemplateRef<void>;\n private attachmentConfigurations: Map<\n Attachment,\n | AttachmentConfigration\n | VideoAttachmentConfiguration\n | ImageAttachmentConfiguration\n > = new Map();\n\n constructor(\n public readonly customTemplatesService: CustomTemplatesService,\n private channelService: ChannelService,\n private attachmentConfigurationService: AttachmentConfigurationService,\n themeService: ThemeService\n ) {\n this.themeVersion = themeService.themeVersion;\n }\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.attachments) {\n const images = this.attachments.filter(this.isImage);\n const containsGallery = images.length >= 2;\n this.orderedAttachments = [\n ...(containsGallery ? this.createGallery(images) : images),\n ...this.attachments.filter((a) => this.isVideo(a)),\n ...this.attachments.filter((a) => this.isVoiceMessage(a)),\n ...this.attachments.filter((a) => this.isFile(a)),\n ];\n this.attachmentConfigurations = new Map();\n // Display link attachments only if there are no other attachments\n // Giphy-s always sent without other attachments\n if (this.orderedAttachments.length === 0) {\n this.orderedAttachments.push(\n ...this.attachments.filter((a) => this.isCard(a))\n );\n }\n }\n }\n\n trackByUrl(_: number, attachment: Attachment) {\n return (\n attachment.image_url ||\n attachment.img_url ||\n attachment.asset_url ||\n attachment.thumb_url\n );\n }\n\n isImage(attachment: Attachment) {\n return isImageAttachment(attachment);\n }\n\n isSvg(attachment: Attachment) {\n const filename = attachment.fallback || '';\n return !!filename.toLowerCase().endsWith('.svg');\n }\n\n isFile(attachment: Attachment) {\n return attachment.type === 'file';\n }\n\n isGallery(attachment: Attachment) {\n return attachment.type === 'gallery';\n }\n\n isVideo(attachment: Attachment) {\n return (\n attachment.type === 'video' &&\n attachment.asset_url &&\n !attachment.og_scrape_url // links from video share services (such as YouTube or Facebook) are can't be played\n );\n }\n\n isCard(attachment: Attachment) {\n return (\n !attachment.type ||\n (attachment.type === 'image' && !this.isImage(attachment)) ||\n attachment.type === 'giphy'\n );\n }\n\n isVoiceMessage(attachment: Attachment) {\n return attachment.type === 'voiceRecording';\n }\n\n hasFileSize(attachment: Attachment<DefaultStreamChatGenerics>) {\n return (\n attachment.file_size && Number.isFinite(Number(attachment.file_size))\n );\n }\n\n getFileSize(attachment: Attachment<DefaultStreamChatGenerics>) {\n return prettybytes(Number(attachment.file_size!));\n }\n\n getModalContext(): ModalContext {\n return {\n isOpen: this.imagesToView && this.imagesToView.length > 0,\n isOpenChangeHandler: (isOpen) => (isOpen ? null : this.closeImageModal()),\n content: this.modalContent,\n };\n }\n\n trimUrl(url?: string | null) {\n if (url !== undefined && url !== null) {\n const [trimmedUrl] = url\n .replace(/^(?:https?:\\/\\/)?(?:www\\.)?/i, '')\n .split('/');\n\n return trimmedUrl;\n }\n return null;\n }\n\n sendAction(action: Action) {\n void this.channelService.sendAction(\n this.messageId!,\n {\n [action.name!]: action.value!,\n },\n this.parentMessageId\n );\n }\n\n trackByActionValue(_: number, item: Action) {\n return item.value;\n }\n\n openImageModal(attachments: Attachment[], selectedIndex = 0) {\n this.imageModalStateChange.next('opened');\n this.imagesToView = attachments;\n this.imagesToViewCurrentIndex = selectedIndex;\n }\n\n stepImages(dir: -1 | 1) {\n this.imagesToViewCurrentIndex += dir * 1;\n }\n\n trackByImageUrl(_: number, item: Attachment) {\n return item.image_url || item.img_url || item.thumb_url;\n }\n\n getAttachmentContext(\n attachment: Attachment<DefaultStreamChatGenerics>\n ): AttachmentContext {\n return { attachment };\n }\n\n getImageAttachmentConfiguration(\n attachment: Attachment,\n type: 'gallery' | 'single',\n element: HTMLElement\n ): ImageAttachmentConfiguration {\n const existingConfiguration = this.attachmentConfigurations.get(attachment);\n if (existingConfiguration) {\n return existingConfiguration as ImageAttachmentConfiguration;\n }\n const configuration =\n this.attachmentConfigurationService.getImageAttachmentConfiguration(\n attachment,\n type,\n element\n );\n this.attachmentConfigurations.set(attachment, configuration);\n return configuration;\n }\n\n getCarouselImageAttachmentConfiguration(\n attachment: Attachment,\n element: HTMLElement\n ) {\n return this.attachmentConfigurationService.getImageAttachmentConfiguration(\n attachment,\n 'carousel',\n element\n );\n }\n\n getVideoAttachmentConfiguration(\n attachment: Attachment,\n element: HTMLElement\n ): VideoAttachmentConfiguration {\n const existingConfiguration = this.attachmentConfigurations.get(attachment);\n if (existingConfiguration) {\n return existingConfiguration as VideoAttachmentConfiguration;\n }\n const configuration =\n this.attachmentConfigurationService.getVideoAttachmentConfiguration(\n attachment,\n element\n );\n this.attachmentConfigurations.set(attachment, configuration);\n return configuration;\n }\n\n getCardAttachmentConfiguration(attachment: Attachment) {\n const existingConfiguration = this.attachmentConfigurations.get(attachment);\n if (existingConfiguration) {\n return existingConfiguration;\n }\n if (attachment.type === 'giphy') {\n return this.attachmentConfigurationService.getGiphyAttachmentConfiguration(\n attachment\n );\n } else {\n const configuration =\n this.attachmentConfigurationService.getScrapedImageAttachmentConfiguration(\n attachment\n );\n this.attachmentConfigurations.set(attachment, configuration);\n return configuration;\n }\n }\n\n get isImageModalPrevButtonVisible() {\n return this.imagesToViewCurrentIndex !== 0;\n }\n\n get isImageModalNextButtonVisible() {\n return this.imagesToViewCurrentIndex !== this.imagesToView.length - 1;\n }\n\n private createGallery(images: Attachment[]) {\n return [\n {\n type: 'gallery',\n images,\n },\n ];\n }\n\n private closeImageModal() {\n this.imageModalStateChange.next('closed');\n this.imagesToView = [];\n }\n}\n","<div *ngIf=\"orderedAttachments.length > 0\" class=\"str-chat__attachment-list\">\n <ng-container\n *ngFor=\"let attachment of orderedAttachments; trackBy: trackByUrl\"\n >\n <div\n data-testclass=\"attachment-container\"\n class=\"str-chat__message-attachment str-chat__message-attachment--{{\n attachment.type\n }} str-chat__message-attachment-dynamic-size\"\n [class.str-chat__message-attachment--card]=\"isCard(attachment)\"\n [class.str-chat-angular__message-attachment-file-single]=\"\n isFile(attachment)\n \"\n [class.str-chat__message-attachment--voice-recording]=\"\n isVoiceMessage(attachment)\n \"\n [class.str-chat__message-attachment-with-actions]=\"\n attachment.actions && attachment.actions.length > 0\n \"\n [class.str-chat__message-attachment--svg-image]=\"isSvg(attachment)\"\n >\n <ng-container *ngIf=\"isImage(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.imageAttachmentTemplate$ | async) ||\n defaultImage;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultImage let-attachmentContext=\"attachment\">\n <img\n #imgElement\n class=\"str-chat__message-attachment--img\"\n data-testclass=\"image\"\n [src]=\"\n getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).url\n \"\n [alt]=\"attachmentContext?.fallback\"\n (click)=\"openImageModal([attachmentContext])\"\n (keyup.enter)=\"openImageModal([attachmentContext])\"\n [style.--original-height]=\"\n getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).originalHeight\n \"\n [style.--original-width]=\"\n getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).originalWidth\n \"\n [ngStyle]=\"{\n height: getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).height,\n width: getImageAttachmentConfiguration(\n attachmentContext,\n 'single',\n imgElement\n ).width\n }\"\n />\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isGallery(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.galleryAttachmentTemplate$ | async) ||\n defaultGallery;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultGallery let-attachmentContext=\"attachment\">\n <div\n class=\"str-chat__gallery\"\n data-testid=\"image-gallery\"\n [class.str-chat__gallery--square]=\"\n (attachmentContext?.images)!.length > 3\n \"\n [class.str-chat__gallery-two-rows]=\"\n (attachmentContext?.images)!.length > 2\n \"\n >\n <ng-container\n *ngFor=\"\n let galleryImage of attachmentContext.images;\n let index = index;\n let isLast = last;\n trackBy: trackByImageUrl\n \"\n >\n <button\n *ngIf=\"index < 3 || (index === 3 && isLast)\"\n class=\"str-chat__gallery-image\"\n data-testclass=\"gallery-image\"\n (click)=\"openImageModal(attachmentContext.images!, index)\"\n (keyup.enter)=\"openImageModal(attachmentContext.images!, index)\"\n [class.str-chat__message-attachment--svg-image]=\"\n isSvg(galleryImage)\n \"\n >\n <img\n fetchpriority=\"low\"\n loading=\"lazy\"\n #imgElement\n [src]=\"\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).url\n \"\n [alt]=\"galleryImage.fallback\"\n [style.--original-height]=\"\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).originalHeight\n \"\n [style.--original-width]=\"\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).originalWidth\n \"\n [ngStyle]=\"{\n height: getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).height,\n width: getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n imgElement\n ).width\n }\"\n />\n </button>\n <button\n #element\n *ngIf=\"index === 3 && !isLast\"\n class=\"str-chat__gallery-placeholder\"\n data-testclass=\"gallery-image\"\n data-testid=\"more-image-button\"\n (click)=\"openImageModal(attachmentContext.images!, index)\"\n (keyup.enter)=\"openImageModal(attachmentContext.images!, index)\"\n [class.str-chat__message-attachment--svg-image]=\"\n isSvg(galleryImage)\n \"\n [style.--original-height]=\"\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).originalHeight\n \"\n [style.--original-width]=\"\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).originalWidth\n \"\n [ngStyle]=\"{\n 'background-image':\n 'url(' +\n getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).url +\n ')',\n height: getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).height,\n width: getImageAttachmentConfiguration(\n galleryImage,\n 'gallery',\n element\n ).width\n }\"\n >\n <p\n [innerHTML]=\"\n 'streamChat.{{ imageCount }} more'\n | translate\n : { imageCount: attachmentContext!.images!.length - 4 }\n \"\n ></p>\n </button>\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isVideo(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.videoAttachmentTemplate$ | async) ||\n defaultVideo;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultVideo let-attachmentContext=\"attachment\">\n <div\n class=\"str-chat__player-wrapper\"\n data-testclass=\"video-attachment-parent\"\n [style.--original-height]=\"\n getVideoAttachmentConfiguration(attachmentContext, videoElement)\n .originalHeight\n \"\n [style.--original-width]=\"\n getVideoAttachmentConfiguration(attachmentContext, videoElement)\n .originalWidth\n \"\n [ngStyle]=\"{\n height: getVideoAttachmentConfiguration(\n attachmentContext,\n videoElement\n ).height,\n width: getVideoAttachmentConfiguration(\n attachmentContext,\n videoElement\n ).width\n }\"\n >\n <video\n #videoElement\n class=\"str-chat__video-angular\"\n controls\n data-testclass=\"video-attachment\"\n [src]=\"\n getVideoAttachmentConfiguration(attachmentContext, videoElement)\n .url\n \"\n [poster]=\"\n getVideoAttachmentConfiguration(attachmentContext, videoElement)\n .thumbUrl\n \"\n ></video>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isFile(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.fileAttachmentTemplate$ | async) ||\n defaultFile;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultFile let-attachmentContext=\"attachment\">\n <div\n class=\"\n str-chat__message-attachment-file--item\n str-chat-angular__message-attachment-file-single\n \"\n >\n <stream-icon-placeholder\n *ngIf=\"themeVersion === '1'\"\n icon=\"file\"\n [size]=\"30\"\n ></stream-icon-placeholder>\n <stream-icon-placeholder\n *ngIf=\"themeVersion === '2'\"\n icon=\"unspecified-filetype\"\n [size]=\"30\"\n ></stream-icon-placeholder>\n <div class=\"str-chat__message-attachment-file--item-text\">\n <a\n class=\"str-chat__message-attachment-file--item-first-row\"\n data-testclass=\"file-link\"\n href=\"{{ attachmentContext.asset_url }}\"\n target=\"_blank\"\n >\n <div\n data-testclass=\"file-title\"\n class=\"str-chat__message-attachment-file--item-name\"\n >\n {{ attachmentContext.title }}\n </div>\n <stream-icon-placeholder\n class=\"str-chat__message-attachment-download-icon\"\n icon=\"download\"\n ></stream-icon-placeholder>\n </a>\n <span\n class=\"str-chat__message-attachment-file--item-size\"\n data-testclass=\"size\"\n *ngIf=\"hasFileSize(attachmentContext)\"\n >{{ getFileSize(attachmentContext) }}</span\n >\n </div>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isVoiceMessage(attachment)\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.voiceRecordingAttachmentTemplate$\n | async) || defaultRecording;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultRecording>\n <stream-voice-recording\n data-testclass=\"voice-recording\"\n [attachment]=\"attachment\"\n ></stream-voice-recording>\n </ng-template>\n </ng-container>\n <ng-container\n *ngIf=\"\n isCard(attachment) &&\n getCardAttachmentConfiguration(attachment) as attachmentConfiguration\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.cardAttachmentTemplate$ | async) ||\n defaultCard;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultCard let-attachmentContext=\"attachment\">\n <div\n class=\"str-chat__message-attachment-card str-chat__message-attachment-card--{{\n attachmentContext.type\n }}\"\n >\n <div\n *ngIf=\"attachmentConfiguration.url\"\n class=\"str-chat__message-attachment-card--header\"\n >\n <img\n fetchpriority=\"low\"\n loading=\"lazy\"\n data-testclass=\"card-img\"\n alt=\"{{ attachmentConfiguration.url }}\"\n src=\"{{ attachmentConfiguration.url }}\"\n [ngStyle]=\"{\n height: attachmentConfiguration.height,\n width: attachmentConfiguration.width\n }\"\n />\n </div>\n <div class=\"str-chat__message-attachment-card--content\">\n <div class=\"str-chat__message-attachment-card--flex\">\n <div\n *ngIf=\"attachmentContext.title\"\n data-testclass=\"card-title\"\n class=\"str-chat__message-attachment-card--title\"\n >\n {{ attachmentContext.title }}\n </div>\n <div\n *ngIf=\"attachmentContext.text\"\n class=\"str-chat__message-attachment-card--text\"\n data-testclass=\"card-text\"\n >\n {{ attachmentContext.text }}\n </div>\n <a\n class=\"str-chat__message-attachment-card--url\"\n *ngIf=\"\n attachmentContext.title_link ||\n attachmentContext.og_scrape_url\n \"\n data-testclass=\"url-link\"\n noopener\n noreferrer\n href=\"{{\n attachmentContext.title_link ||\n attachmentContext.og_scrape_url\n }}\"\n target=\"_blank\"\n >\n {{\n trimUrl(\n attachmentContext.title_link ||\n attachmentContext.og_scrape_url\n )\n }}\n </a>\n </div>\n </div>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"attachment.actions && attachment.actions.length > 0\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.attachmentActionsTemplate$ | async) ||\n defaultActions;\n context: getAttachmentContext(attachment)\n \"\n ></ng-container>\n <ng-template #defaultActions let-attachmentContext=\"attachment\">\n <div class=\"str-chat__message-attachment-actions\">\n <div class=\"str-chat__message-attachment-actions-form\">\n <button\n *ngFor=\"\n let action of attachmentContext.actions;\n trackBy: trackByActionValue\n \"\n class=\"str-chat__message-attachment-actions-button str-chat__message-attachment-actions-button--{{\n action.style\n }}\"\n data-testclass=\"attachment-action\"\n (click)=\"sendAction(action)\"\n (keyup.enter)=\"sendAction(action)\"\n >\n {{ action.text }}\n </button>\n </div>\n </div>\n </ng-template>\n </ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"imagesToView && imagesToView.length > 0\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: getModalContext()\n \"\n ></ng-container>\n </ng-container>\n</div>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n class=\"stream-chat-angular__image-modal-host\"\n [isOpen]=\"isOpen\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n [content]=\"content\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #modalContent>\n <div class=\"stream-chat-angular__image-modal str-chat__image-carousel\">\n <img\n #imgElement\n class=\"\n stream-chat-angular__image-modal-image\n str-chat__image-carousel-image\n \"\n data-testid=\"modal-image\"\n [src]=\"\n getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).url\n \"\n [style.--original-height]=\"\n getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).originalHeight\n \"\n [style.--original-width]=\"\n getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).originalWidth\n \"\n [alt]=\"imagesToView[imagesToViewCurrentIndex].fallback\"\n [ngStyle]=\"{\n width: getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).width,\n height: getCarouselImageAttachmentConfiguration(\n imagesToView[imagesToViewCurrentIndex],\n imgElement\n ).height\n }\"\n />\n <div>\n <button\n class=\"\n stream-chat-angular__image-modal-stepper\n str-chat__image-carousel-stepper str-chat__image-carousel-stepper-prev\n \"\n [ngStyle]=\"{\n visibility: isImageModalPrevButtonVisible ? 'visible' : 'hidden'\n }\"\n data-testid=\"image-modal-prev\"\n type=\"button\"\n (click)=\"stepImages(-1)\"\n (keyup.enter)=\"stepImages(-1)\"\n >\n <stream-icon-placeholder icon=\"arrow-left\"></stream-icon-placeholder>\n </button>\n <button\n class=\"\n stream-chat-angular__image-modal-stepper\n str-chat__image-carousel-stepper str-chat__image-carousel-stepper-next\n \"\n type=\"button\"\n [ngStyle]=\"{\n visibility: isImageModalNextButtonVisible ? 'visible' : 'hidden'\n }\"\n data-testid=\"image-modal-next\"\n (click)=\"stepImages(1)\"\n (keyup.enter)=\"stepImages(1)\"\n >\n <stream-icon-placeholder icon=\"arrow-right\"></stream-icon-placeholder>\n </button>\n </div>\n </div>\n</ng-template>\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { ThemeService } from '../theme.service';\nimport { AttachmentUpload } from '../types';\n\n/**\n * The `AttachmentPreviewList` component displays a preview of the attachments uploaded to a message. Users can delete attachments using the preview component, or retry upload if it failed previously.\n */\n@Component({\n selector: 'stream-attachment-preview-list',\n templateUrl: './attachment-preview-list.component.html',\n styles: [],\n})\nexport class AttachmentPreviewListComponent {\n /**\n * A stream that emits the current file uploads and their states\n */\n @Input() attachmentUploads$: Observable<AttachmentUpload[]> | undefined;\n /**\n * An output to notify the parent component if the user tries to retry a failed upload\n */\n @Output() readonly retryAttachmentUpload = new EventEmitter<File>();\n /**\n * An output to notify the parent component if the user wants to delete a file\n */\n @Output() readonly deleteAttachment = new EventEmitter<AttachmentUpload>();\n themeVersion: '1' | '2';\n\n constructor(themeService: ThemeService) {\n this.themeVersion = themeService.themeVersion;\n }\n\n attachmentUploadRetried(file: File) {\n this.retryAttachmentUpload.emit(file);\n }\n\n attachmentDeleted(upload: AttachmentUpload) {\n this.deleteAttachment.emit(upload);\n }\n\n trackByFile(_: number, item: AttachmentUpload) {\n return item.file;\n }\n}\n","<div\n class=\"rfu-image-previewer\"\n *ngIf=\"(attachmentUploads$ | async)?.length && themeVersion === '1'\"\n>\n <ng-container\n *ngFor=\"\n let attachmentUpload of attachmentUploads$ | async;\n trackBy: trackByFile\n \"\n >\n <div\n *ngIf=\"attachmentUpload.type === 'image'\"\n class=\"rfu-image-previewer__image\"\n [class.rfu-image-previewer__image--loaded]=\"\n attachmentUpload.state === 'success'\n \"\n data-testclass=\"attachment-image-preview\"\n >\n <div\n *ngIf=\"attachmentUpload.state === 'error'\"\n class=\"rfu-image-previewer__retry\"\n (click)=\"attachmentUploadRetried(attachmentUpload.file)\"\n (keyup.enter)=\"attachmentUploadRetried(attachmentUpload.file)\"\n data-testclass=\"upload-retry\"\n >\n <stream-icon-placeholder icon=\"retry\"></stream-icon-placeholder>\n </div>\n <div class=\"rfu-thumbnail__wrapper\">\n <div class=\"rfu-thumbnail__overlay\">\n <div\n class=\"rfu-icon-button\"\n data-testclass=\"file-delete\"\n role=\"button\"\n (click)=\"attachmentDeleted(attachmentUpload)\"\n (keyup.enter)=\"attachmentDeleted(attachmentUpload)\"\n >\n <stream-icon-placeholder\n icon=\"close-no-outline\"\n ></stream-icon-placeholder>\n </div>\n </div>\n <img\n *ngIf=\"attachmentUpload.url || attachmentUpload.previewUri\"\n src=\"{{\n attachmentUpload.url\n ? attachmentUpload.url\n : attachmentUpload.previewUri\n }}\"\n alt=\"{{ attachmentUpload.file.name }}\"\n class=\"rfu-thumbnail__image\"\n data-testclass=\"attachment-image\"\n />\n </div>\n <stream-loading-indicator-placeholder\n data-testclass=\"loading-indicator\"\n color=\"rgba(255,255,255,0.7)\"\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n ></stream-loading-indicator-placeholder>\n </div>\n <div\n class=\"rfu-file-previewer\"\n *ngIf=\"\n attachmentUpload.type === 'file' || attachmentUpload.type === 'video'\n \"\n data-testclass=\"attachment-file-preview\"\n >\n <ol>\n <li\n class=\"rfu-file-previewer__file\"\n [class.rfu-file-previewer__file--uploading]=\"\n attachmentUpload.state === 'uploading'\n \"\n [class.rfu-file-previewer__file--failed]=\"\n attachmentUpload.state === 'error'\n \"\n >\n <stream-icon-placeholder icon=\"file\"></stream-icon-placeholder>\n\n <a\n data-testclass=\"file-download-link\"\n href=\"{{ attachmentUpload.url }}\"\n (click)=\"attachmentUpload.url ? null : $event.preventDefault()\"\n (keyup.enter)=\"\n attachmentUpload.url ? null : $event.preventDefault()\n \"\n download\n >\n {{ attachmentUpload.file.name }}\n <ng-container *ngIf=\"attachmentUpload.state === 'error'\">\n <div\n data-testclass=\"upload-retry\"\n class=\"rfu-file-previewer__failed\"\n (click)=\"attachmentUploadRetried(attachmentUpload.file)\"\n (keyup.enter)=\"attachmentUploadRetried(attachmentUpload.file)\"\n translate\n >\n streamChat.failed\n </div>\n <div\n class=\"rfu-file-previewer__retry\"\n (click)=\"attachmentUploadRetried(attachmentUpload.file)\"\n (keyup.enter)=\"attachmentUploadRetried(attachmentUpload.file)\"\n translate\n >\n streamChat.retry\n </div>\n </ng-container>\n </a>\n\n <span\n data-testclass=\"file-delete\"\n class=\"rfu-file-previewer__close-button\"\n (click)=\"attachmentDeleted(attachmentUpload)\"\n (keyup.enter)=\"attachmentDeleted(attachmentUpload)\"\n >\n <stream-icon-placeholder\n icon=\"close-no-outline\"\n ></stream-icon-placeholder>\n </span>\n <div\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n class=\"rfu-file-previewer__loading-indicator\"\n >\n <stream-loading-indicator-placeholder></stream-loading-indicator-placeholder>\n </div>\n </li>\n </ol>\n </div>\n </ng-container>\n</div>\n\n<div\n class=\"str-chat__attachment-preview-list\"\n *ngIf=\"(attachmentUploads$ | async)?.length && themeVersion === '2'\"\n>\n <div class=\"str-chat__attachment-list-scroll-container\">\n <ng-container\n *ngFor=\"\n let attachmentUpload of attachmentUploads$ | async;\n trackBy: trackByFile\n \"\n >\n <div\n *ngIf=\"attachmentUpload.type === 'image'\"\n class=\"str-chat__attachment-preview-image\"\n data-testclass=\"attachment-image-preview\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n deleteButton;\n context: { attachmentUpload: attachmentUpload }\n \"\n ></ng-container>\n <div\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n class=\"str-chat__attachment-preview-image-loading\"\n >\n <stream-loading-indicator-placeholder\n data-testclass=\"loading-indicator\"\n [size]=\"18\"\n ></stream-loading-indicator-placeholder>\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n retryButton;\n context: { attachmentUpload: attachmentUpload }\n \"\n ></ng-container>\n <img\n *ngIf=\"attachmentUpload.url || attachmentUpload.previewUri\"\n src=\"{{\n attachmentUpload.url\n ? attachmentUpload.url\n : attachmentUpload.previewUri\n }}\"\n alt=\"{{ attachmentUpload.file.name }}\"\n class=\"str-chat__attachment-preview-thumbnail\"\n data-testclass=\"attachment-image\"\n />\n </div>\n <div\n class=\"str-chat__attachment-preview-file\"\n *ngIf=\"\n attachmentUpload.type === 'file' || attachmentUpload.type === 'video'\n \"\n data-testclass=\"attachment-file-preview\"\n >\n <stream-icon-placeholder\n icon=\"unspecified-filetype\"\n ></stream-icon-placeholder>\n\n <div class=\"str-chat__attachment-preview-file-end\">\n <div class=\"str-chat__attachment-preview-file-name\">\n {{ attachmentUpload.file.name }}\n </div>\n <a\n *ngIf=\"attachmentUpload.state === 'success'\"\n class=\"str-chat__attachment-preview-file-download\"\n data-testclass=\"file-download-link\"\n href=\"{{ attachmentUpload.url }}\"\n (click)=\"attachmentUpload.url ? null : $event.preventDefault()\"\n (keyup.enter)=\"\n attachmentUpload.url ? null : $event.preventDefault()\n \"\n download\n >\n <stream-icon-placeholder icon=\"download\"></stream-icon-placeholder>\n </a>\n <stream-loading-indicator-placeholder\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n data-testclass=\"loading-indicator\"\n [size]=\"18\"\n ></stream-loading-indicator-placeholder>\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n deleteButton;\n context: { attachmentUpload: attachmentUpload }\n \"\n ></ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n retryButton;\n context: { attachmentUpload: attachmentUpload }\n \"\n ></ng-container>\n </div>\n </ng-container>\n </div>\n</div>\n\n<ng-template #deleteButton let-attachmentUpload=\"attachmentUpload\">\n <div\n class=\"str-chat__attachment-preview-delete\"\n data-testclass=\"file-delete\"\n role=\"button\"\n (click)=\"attachmentDeleted(attachmentUpload)\"\n (keyup.enter)=\"attachmentDeleted(attachmentUpload)\"\n >\n <stream-icon-placeholder icon=\"close-no-outline\"></stream-icon-placeholder>\n </div>\n</ng-template>\n\n<ng-template #retryButton let-attachmentUpload=\"attachmentUpload\">\n <div\n *ngIf=\"attachmentUpload.state === 'error'\"\n class=\"str-chat__attachment-preview-error str-chat__attachment-preview-error-{{\n attachmentUpload.type === 'image' ? 'image' : 'file'\n }}\"\n (click)=\"attachmentUploadRetried(attachmentUpload.file)\"\n (keyup.enter)=\"attachmentUploadRetried(attachmentUpload.file)\"\n data-testclass=\"upload-retry\"\n >\n <stream-icon-placeholder icon=\"retry\"></stream-icon-placeholder>\n </div>\n</ng-template>\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ComponentFactoryResolver,\n ComponentRef,\n ElementRef,\n EventEmitter,\n HostBinding,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n TemplateRef,\n Type,\n ViewChild,\n} from '@angular/core';\nimport { ChatClientService } from '../chat-client.service';\nimport { combineLatest, Observable, Subject, Subscription, timer } from 'rxjs';\nimport { first, map, take, tap } from 'rxjs/operators';\nimport { AppSettings, Channel, UserResponse } from 'stream-chat';\nimport { AttachmentService } from '../attachment.service';\nimport { ChannelService } from '../channel.service';\nimport { textareaInjectionToken } from '../injection-tokens';\nimport { NotificationService } from '../notification.service';\nimport {\n AttachmentPreviewListContext,\n AttachmentUpload,\n CustomAttachmentUploadContext,\n DefaultStreamChatGenerics,\n EmojiPickerContext,\n StreamMessage,\n} from '../types';\nimport { MessageInputConfigService } from './message-input-config.service';\nimport { TextareaDirective } from './textarea.directive';\nimport { TextareaInterface } from './textarea.interface';\nimport { isImageFile } from '../is-image-file';\nimport { EmojiInputService } from './emoji-input.service';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { ThemeService } from '../theme.service';\nimport { v4 as uuidv4 } from 'uuid';\n\n/**\n * The `MessageInput` component displays an input where users can type their messages and upload files, and sends the message to the active channel. The component can be used to compose new messages or update existing ones. To send messages, the chat user needs to have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).\n */\n@Component({\n selector: 'stream-message-input',\n templateUrl: './message-input.component.html',\n styles: [],\n providers: [AttachmentService, EmojiInputService],\n})\nexport class MessageInputComponent\n implements OnInit, OnChanges, OnDestroy, AfterViewInit\n{\n /**\n * If file upload is enabled, the user can open a file selector from the input. Please note that the user also needs to have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript). If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() isFileUploadEnabled: boolean | undefined;\n /**\n * If true, users can mention other users in messages. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work. If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() areMentionsEnabled: boolean | undefined;\n /**\n * The scope for user mentions, either members of the current channel of members of the application. If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() mentionScope: 'channel' | 'application' | undefined;\n /**\n * Determines if the message is being dispalyed in a channel or in a [thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript).\n */\n @Input() mode: 'thread' | 'main' = 'main';\n /**\n * If true, users can select multiple files to upload. If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() isMultipleFileUploadEnabled: boolean | undefined;\n /**\n * The message to edit\n */\n @Input() message: StreamMessage | undefined;\n /**\n * An observable that can be used to trigger message sending from the outside\n */\n @Input() sendMessage$: Observable<void> | undefined;\n /**\n * In `desktop` mode the `Enter` key will trigger message sending, in `mobile` mode the `Enter` key will insert a new line to the message input. If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() inputMode: 'desktop' | 'mobile';\n /**\n * Enables or disables auto focus on the textarea element\n */\n @Input() autoFocus = true;\n /**\n * Emits when a message was successfuly sent or updated\n */\n @Output() readonly messageUpdate = new EventEmitter<{\n message: StreamMessage;\n }>();\n @HostBinding() class = 'str-chat__message-input-angular-host';\n isFileUploadAuthorized: boolean | undefined;\n canSendLinks: boolean | undefined;\n canSendMessages: boolean | undefined;\n attachmentUploads$: Observable<AttachmentUpload[]>;\n attachmentUploadInProgressCounter$: Observable<number>;\n textareaValue = '';\n textareaRef: ComponentRef<TextareaInterface & Partial<OnChanges>> | undefined;\n mentionedUsers: UserResponse[] = [];\n quotedMessage: undefined | StreamMessage;\n typingStart$ = new Subject<void>();\n cooldown$: Observable<number> | undefined;\n isCooldownInProgress = false;\n emojiPickerTemplate: TemplateRef<EmojiPickerContext> | undefined;\n customAttachmentUploadTemplate:\n | TemplateRef<CustomAttachmentUploadContext>\n | undefined;\n attachmentPreviewListTemplate:\n | TemplateRef<AttachmentPreviewListContext>\n | undefined;\n textareaPlaceholder: string;\n themeVersion: '1' | '2';\n fileInputId = uuidv4();\n @ViewChild('fileInput') private fileInput!: ElementRef<HTMLInputElement>;\n @ViewChild(TextareaDirective, { static: false })\n private textareaAnchor!: TextareaDirective;\n private subscriptions: Subscription[] = [];\n private hideNotification: Function | undefined;\n private isViewInited = false;\n private appSettings: AppSettings | undefined;\n private channel: Channel<DefaultStreamChatGenerics> | undefined;\n private sendMessageSubcription: Subscription | undefined;\n private readonly defaultTextareaPlaceholder = 'streamChat.Type your message';\n private readonly slowModeTextareaPlaceholder = 'streamChat.Slow Mode ON';\n constructor(\n private channelService: ChannelService,\n private notificationService: NotificationService,\n private attachmentService: AttachmentService,\n private configService: MessageInputConfigService,\n @Inject(textareaInjectionToken)\n private textareaType: Type<TextareaInterface>,\n private componentFactoryResolver: ComponentFactoryResolver,\n private cdRef: ChangeDetectorRef,\n private chatClient: ChatClientService,\n private emojiInputService: EmojiInputService,\n private customTemplatesService: CustomTemplatesService,\n themeService: ThemeService\n ) {\n this.themeVersion = themeService.themeVersion;\n this.textareaPlaceholder = this.defaultTextareaPlaceholder;\n this.subscriptions.push(\n this.attachmentService.attachmentUploadInProgressCounter$.subscribe(\n (counter) => {\n if (counter === 0 && this.hideNotification) {\n this.hideNotification();\n this.hideNotification = undefined;\n }\n }\n )\n );\n this.subscriptions.push(\n this.channelService.activeChannel$.subscribe((channel) => {\n if (channel && this.channel && channel.id !== this.channel.id) {\n this.textareaValue = '';\n this.attachmentService.resetAttachmentUploads();\n }\n const capabilities = channel?.data?.own_capabilities as string[];\n if (capabilities) {\n this.isFileUploadAuthorized =\n capabilities.indexOf('upload-file') !== -1;\n this.canSendLinks = capabilities.indexOf('send-links') !== -1;\n this.channel = channel;\n this.setCanSendMessages();\n }\n })\n );\n this.subscriptions.push(\n this.chatClient.appSettings$.subscribe(\n (appSettings) => (this.appSettings = appSettings)\n )\n );\n this.subscriptions.push(\n this.channelService.messageToQuote$.subscribe((m) => {\n const isThreadReply = m && m.parent_id;\n if (\n (this.mode === 'thread' && isThreadReply) ||\n (this.mode === 'thread' && this.quotedMessage && !m) ||\n (this.mode === 'main' && !isThreadReply)\n ) {\n this.quotedMessage = m;\n }\n })\n );\n this.attachmentUploads$ = this.attachmentService.attachmentUploads$;\n this.attachmentUploadInProgressCounter$ =\n this.attachmentService.attachmentUploadInProgressCounter$;\n this.isFileUploadEnabled = this.configService.isFileUploadEnabled;\n this.isMultipleFileUploadEnabled =\n this.configService.isMultipleFileUploadEnabled;\n this.areMentionsEnabled = this.configService.areMentionsEnabled;\n this.mentionScope = this.configService.mentionScope;\n this.inputMode = this.configService.inputMode;\n\n this.subscriptions.push(\n this.typingStart$.subscribe(\n () => void this.channelService.typingStarted(this.parentMessageId)\n )\n );\n\n this.subscriptions.push(\n combineLatest([\n this.channelService.latestMessageDateByUserByChannels$,\n this.channelService.activeChannel$,\n ])\n .pipe(\n map(\n ([latestMessages, channel]): [\n Date | undefined,\n Channel<DefaultStreamChatGenerics> | undefined\n ] => [latestMessages[channel?.cid || ''], channel!]\n )\n )\n .subscribe(([latestMessageDate, channel]) => {\n const cooldown =\n (channel?.data?.cooldown as number) &&\n latestMessageDate &&\n Math.round(\n (channel?.data?.cooldown as number) -\n (new Date().getTime() - latestMessageDate.getTime()) / 1000\n );\n if (\n cooldown &&\n cooldown > 0 &&\n (channel?.data?.own_capabilities as string[]).includes('slow-mode')\n ) {\n this.startCooldown(cooldown);\n } else if (this.isCooldownInProgress) {\n this.stopCooldown();\n }\n })\n );\n }\n\n ngOnInit(): void {\n this.subscriptions.push(\n this.customTemplatesService.emojiPickerTemplate$.subscribe((template) => {\n this.emojiPickerTemplate = template;\n this.cdRef.detectChanges();\n })\n );\n this.subscriptions.push(\n this.customTemplatesService.attachmentPreviewListTemplate$.subscribe(\n (template) => {\n this.attachmentPreviewListTemplate = template;\n this.cdRef.detectChanges();\n }\n )\n );\n this.subscriptions.push(\n this.customTemplatesService.customAttachmentUploadTemplate$.subscribe(\n (template) => {\n this.customAttachmentUploadTemplate = template;\n this.cdRef.detectChanges();\n }\n )\n );\n }\n\n ngAfterViewInit(): void {\n this.isViewInited = true;\n this.initTextarea();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.message) {\n this.attachmentService.resetAttachmentUploads();\n if (this.isUpdate) {\n this.attachmentService.createFromAttachments(\n this.message!.attachments || []\n );\n this.textareaValue = this.message!.text || '';\n }\n }\n if (changes.isFileUploadEnabled) {\n this.configService.isFileUploadEnabled = this.isFileUploadEnabled;\n }\n if (changes.isMultipleFileUploadEnabled) {\n this.configService.isMultipleFileUploadEnabled =\n this.isMultipleFileUploadEnabled;\n }\n if (changes.areMentionsEnabled) {\n this.configService.areMentionsEnabled = this.areMentionsEnabled;\n }\n if (changes.mentionScope) {\n this.configService.mentionScope = this.mentionScope;\n }\n if (changes.mode) {\n this.setCanSendMessages();\n }\n if (changes.inputMode) {\n this.configService.inputMode = this.inputMode;\n }\n if (changes.sendMessage$) {\n if (this.sendMessageSubcription) {\n this.sendMessageSubcription.unsubscribe();\n }\n if (this.sendMessage$) {\n this.sendMessageSubcription = this.sendMessage$.subscribe(\n () => void this.messageSent()\n );\n }\n }\n }\n\n ngOnDestroy(): void {\n if (this.sendMessageSubcription) {\n this.sendMessageSubcription.unsubscribe();\n }\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n async messageSent() {\n if (this.isCooldownInProgress) {\n return;\n }\n let attachmentUploadInProgressCounter!: number;\n this.attachmentService.attachmentUploadInProgressCounter$\n .pipe(first())\n .subscribe((counter) => (attachmentUploadInProgressCounter = counter));\n if (attachmentUploadInProgressCounter > 0) {\n if (!this.hideNotification) {\n this.hideNotification =\n this.notificationService.addPermanentNotification(\n 'streamChat.Wait until all attachments have uploaded'\n );\n }\n return;\n }\n const attachments = this.attachmentService.mapToAttachments();\n let text = this.textareaValue;\n text = text.replace(/^\\n+/g, ''); // leading empty lines\n text = text.replace(/\\n+$/g, ''); // ending empty lines\n const textContainsOnlySpaceChars = !text.replace(/ /g, ''); //spcae\n if (\n (!text || textContainsOnlySpaceChars) &&\n (!attachments || attachments.length === 0)\n ) {\n return;\n }\n if (textContainsOnlySpaceChars) {\n text = '';\n }\n if (this.containsLinks && !this.canSendLinks) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Sending links is not allowed in this conversation'\n );\n return;\n }\n if (!this.isUpdate) {\n this.textareaValue = '';\n }\n try {\n const message = await (this.isUpdate\n ? this.channelService.updateMessage({\n ...this.message!,\n text: text,\n attachments: attachments,\n })\n : this.channelService.sendMessage(\n text,\n attachments,\n this.mentionedUsers,\n this.parentMessageId,\n this.quotedMessage?.id\n ));\n this.messageUpdate.emit({ message });\n if (!this.isUpdate) {\n this.attachmentService.resetAttachmentUploads();\n }\n } catch (error) {\n if (this.isUpdate) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Edit message request failed'\n );\n }\n }\n void this.channelService.typingStopped(this.parentMessageId);\n if (this.quotedMessage) {\n this.deselectMessageToQuote();\n }\n }\n\n get containsLinks() {\n return /(?:(?:https?|ftp):\\/\\/)?[\\w/\\-?=%.]+\\.[\\w/\\-&?=%.]+/.test(\n this.textareaValue\n );\n }\n\n get quotedMessageAttachments() {\n const originalAttachments = this.quotedMessage?.attachments;\n return originalAttachments && originalAttachments.length\n ? [originalAttachments[0]]\n : [];\n }\n\n get disabledTextareaText() {\n if (!this.canSendMessages) {\n return this.mode === 'thread'\n ? \"streamChat.You can't send thread replies in this channel\"\n : \"streamChat.You can't send messages in this channel\";\n }\n return '';\n }\n\n async filesSelected(fileList: FileList | null) {\n if (!(await this.areAttachemntsValid(fileList))) {\n return;\n }\n await this.attachmentService.filesSelected(fileList);\n this.clearFileInput();\n }\n\n deselectMessageToQuote() {\n this.channelService.selectMessageToQuote(undefined);\n }\n\n getEmojiPickerContext(): EmojiPickerContext {\n return {\n emojiInput$: this.emojiInputService.emojiInput$,\n };\n }\n\n getAttachmentPreviewListContext(): AttachmentPreviewListContext {\n return {\n attachmentUploads$: this.attachmentService.attachmentUploads$,\n deleteUploadHandler: this.deleteUpload.bind(this),\n retryUploadHandler: this.retryUpload.bind(this),\n };\n }\n\n getAttachmentUploadContext(): CustomAttachmentUploadContext {\n return {\n isMultipleFileUploadEnabled: this.isMultipleFileUploadEnabled,\n attachmentService: this.attachmentService,\n };\n }\n\n private deleteUpload(upload: AttachmentUpload) {\n if (this.isUpdate) {\n // Delay delete to avoid modal detecting this click as outside click\n setTimeout(() => {\n void this.attachmentService.deleteAttachment(upload);\n });\n } else {\n void this.attachmentService.deleteAttachment(upload);\n }\n }\n\n private retryUpload(file: File) {\n void this.attachmentService.retryAttachmentUpload(file);\n }\n\n private clearFileInput() {\n this.fileInput.nativeElement.value = '';\n }\n\n private get isUpdate() {\n return !!this.message;\n }\n\n private initTextarea() {\n // cleanup previously built textarea\n if (!this.canSendMessages) {\n this.textareaRef = undefined;\n }\n\n if (!this.canSendMessages || this.textareaRef || !this.textareaAnchor) {\n return;\n }\n\n const componentFactory =\n this.componentFactoryResolver.resolveComponentFactory(this.textareaType);\n this.textareaRef =\n this.textareaAnchor.viewContainerRef.createComponent<any>(\n componentFactory\n );\n this.cdRef.detectChanges();\n }\n\n private async areAttachemntsValid(fileList: FileList | null) {\n if (!fileList) {\n return true;\n }\n if (!this.appSettings) {\n await this.chatClient.getAppSettings();\n }\n let isValid = true;\n Array.from(fileList).forEach((f) => {\n let hasBlockedExtension: boolean;\n let hasBlockedMimeType: boolean;\n let hasNotAllowedExtension: boolean;\n let hasNotAllowedMimeType: boolean;\n if (isImageFile(f)) {\n hasBlockedExtension =\n !!this.appSettings?.image_upload_config?.blocked_file_extensions?.find(\n (ext) => f.name.endsWith(ext)\n );\n hasBlockedMimeType =\n !!this.appSettings?.image_upload_config?.blocked_mime_types?.find(\n (type) => f.type === type\n );\n hasNotAllowedExtension =\n !!this.appSettings?.image_upload_config?.allowed_file_extensions\n ?.length &&\n !this.appSettings?.image_upload_config?.allowed_file_extensions?.find(\n (ext) => f.name.endsWith(ext)\n );\n hasNotAllowedMimeType =\n !!this.appSettings?.image_upload_config?.allowed_mime_types?.length &&\n !this.appSettings?.image_upload_config?.allowed_mime_types?.find(\n (type) => f.type === type\n );\n } else {\n hasBlockedExtension =\n !!this.appSettings?.file_upload_config?.blocked_file_extensions?.find(\n (ext) => f.name.endsWith(ext)\n );\n hasBlockedMimeType =\n !!this.appSettings?.file_upload_config?.blocked_mime_types?.find(\n (type) => f.type === type\n );\n hasNotAllowedExtension =\n !!this.appSettings?.file_upload_config?.allowed_file_extensions\n ?.length &&\n !this.appSettings?.file_upload_config?.allowed_file_extensions?.find(\n (ext) => f.name.endsWith(ext)\n );\n hasNotAllowedMimeType =\n !!this.appSettings?.file_upload_config?.allowed_mime_types?.length &&\n !this.appSettings?.file_upload_config?.allowed_mime_types?.find(\n (type) => f.type === type\n );\n }\n if (\n hasBlockedExtension ||\n hasBlockedMimeType ||\n hasNotAllowedExtension ||\n hasNotAllowedMimeType\n ) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error uploading file, extension not supported',\n undefined,\n undefined,\n { name: f.name, ext: f.type }\n );\n isValid = false;\n }\n });\n return isValid;\n }\n\n private setCanSendMessages() {\n const capabilities = this.channel?.data?.own_capabilities as string[];\n if (!capabilities) {\n this.canSendMessages = false;\n } else {\n this.canSendMessages =\n capabilities.indexOf(\n this.mode === 'main' ? 'send-message' : 'send-reply'\n ) !== -1;\n }\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n this.initTextarea();\n }\n }\n\n private get parentMessageId() {\n let parentMessageId: string | undefined = undefined;\n if (this.mode === 'thread') {\n this.channelService.activeParentMessageId$\n .pipe(first())\n .subscribe((id) => (parentMessageId = id));\n }\n\n return parentMessageId;\n }\n\n private startCooldown(cooldown: number) {\n this.textareaPlaceholder = this.slowModeTextareaPlaceholder;\n this.isCooldownInProgress = true;\n this.cooldown$ = timer(0, 1000).pipe(\n take(cooldown + 1),\n map((v) => cooldown - v),\n tap((v) => {\n if (v === 0) {\n this.stopCooldown();\n }\n })\n );\n }\n\n private stopCooldown() {\n this.cooldown$ = undefined;\n this.isCooldownInProgress = false;\n this.textareaPlaceholder = this.defaultTextareaPlaceholder;\n }\n}\n","<div\n *ngIf=\"themeVersion !== '2'\"\n class=\"{{\n mode === 'main' ? 'str-chat__input-flat' : 'str-chat__small-message-input'\n }}\"\n [class.str-chat__input-flat-has-attachments]=\"\n (attachmentUploads$ | async)!.length > 0\n \"\n [class.str-chat__input-flat-quoted]=\"!!quotedMessage\"\n>\n <div class=\"quoted-message-preview\" *ngIf=\"quotedMessage\">\n <div class=\"quoted-message-preview-header\">\n <div>{{ \"streamChat.Reply to Message\" | translate }}</div>\n <button\n class=\"str-chat__square-button\"\n data-testid=\"remove-quote\"\n (click)=\"deselectMessageToQuote()\"\n (keyup.enter)=\"deselectMessageToQuote()\"\n >\n <stream-icon-placeholder\n icon=\"close-no-outline\"\n ></stream-icon-placeholder>\n </button>\n </div>\n <div class=\"quoted-message-preview-content\">\n <stream-avatar-placeholder\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"quotedMessage?.user?.image\"\n [name]=\"quotedMessage?.user?.name || quotedMessage?.user?.id\"\n [size]=\"20\"\n type=\"user\"\n location=\"quoted-message-sender\"\n [user]=\"quotedMessage?.user || undefined\"\n ></stream-avatar-placeholder>\n <div class=\"quoted-message-preview-content-inner\">\n <stream-attachment-list\n *ngIf=\"\n quotedMessage?.attachments && quotedMessage?.attachments?.length\n \"\n [attachments]=\"quotedMessageAttachments\"\n [messageId]=\"quotedMessage?.id\"\n ></stream-attachment-list>\n <div\n data-testid=\"quoted-message-text\"\n [innerHTML]=\"\n message?.quoted_message?.translation ||\n quotedMessage?.html ||\n quotedMessage?.text\n \"\n ></div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__input-flat-wrapper\">\n <div\n class=\"{{\n mode === 'main'\n ? 'str-chat__input-flat--textarea-wrapper'\n : 'str-chat__small-message-input--textarea-wrapper'\n }}\"\n >\n <ng-template\n #defaultAttachmentsPreview\n let-attachmentUploads$=\"attachmentUploads$\"\n let-retryUploadHandler=\"retryUploadHandler\"\n let-deleteUploadHandler=\"deleteUploadHandler\"\n >\n <stream-attachment-preview-list\n [attachmentUploads$]=\"attachmentUploads$\"\n (retryAttachmentUpload)=\"retryUploadHandler($event)\"\n (deleteAttachment)=\"deleteUploadHandler($event)\"\n class=\"rfu-image-previewer-angular-host\"\n ></stream-attachment-preview-list>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n attachmentPreviewListTemplate || defaultAttachmentsPreview;\n context: getAttachmentPreviewListContext()\n \"\n ></ng-container>\n <div class=\"rta str-chat__textarea str-chat-angular__textarea\">\n <ng-container *ngIf=\"emojiPickerTemplate\" data-testid=\"emoji-picker\">\n <div\n class=\"\n str-chat__input-flat-emojiselect\n str-chat-angular__emojiselect\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n emojiPickerTemplate;\n context: getEmojiPickerContext()\n \"\n ></ng-container>\n </div>\n </ng-container>\n <ng-container *ngIf=\"canSendMessages; else disabledTextarea\">\n <ng-container\n streamTextarea\n [(value)]=\"textareaValue\"\n (valueChange)=\"typingStart$.next()\"\n (send)=\"messageSent()\"\n [componentRef]=\"textareaRef\"\n (userMentions)=\"mentionedUsers = $event\"\n [areMentionsEnabled]=\"areMentionsEnabled\"\n [mentionScope]=\"mentionScope\"\n [placeholder]=\"textareaPlaceholder\"\n [inputMode]=\"inputMode\"\n [autoFocus]=\"autoFocus\"\n ></ng-container>\n </ng-container>\n <ng-template #disabledTextarea>\n <textarea\n disabled\n rows=\"1\"\n [value]=\"disabledTextareaText | translate\"\n class=\"rta__textarea str-chat__textarea__textarea\"\n data-testid=\"disabled-textarea\"\n ></textarea>\n </ng-template>\n </div>\n <ng-container\n *ngIf=\"isFileUploadEnabled && isFileUploadAuthorized && canSendMessages\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n customAttachmentUploadTemplate || defaultAttachmentUpload;\n context: getAttachmentUploadContext()\n \"\n ></ng-container>\n <ng-template #defaultAttachmentUpload>\n <div\n class=\"str-chat__fileupload-wrapper\"\n data-testid=\"file-upload-button\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Attach files\" | translate }}\n </div>\n <div class=\"rfu-file-upload-button\">\n <label>\n <input\n #fileInput\n type=\"file\"\n class=\"rfu-file-input\"\n data-testid=\"file-input\"\n [multiple]=\"isMultipleFileUploadEnabled\"\n (change)=\"filesSelected(fileInput.files)\"\n />\n <span class=\"str-chat__input-flat-fileupload\">\n <stream-icon-placeholder\n icon=\"file-upload\"\n ></stream-icon-placeholder>\n </span>\n </label>\n </div>\n </div>\n </ng-template>\n </ng-container>\n </div>\n <button\n *ngIf=\"canSendMessages && !isCooldownInProgress\"\n data-testid=\"send-button\"\n class=\"str-chat__send-button\"\n (click)=\"messageSent()\"\n (keyup.enter)=\"messageSent()\"\n >\n <stream-icon-placeholder\n class=\"str-chat__send-button-angular\"\n icon=\"send\"\n ></stream-icon-placeholder>\n </button>\n <div\n class=\"str-chat__input-flat-cooldown\"\n *ngIf=\"isCooldownInProgress\"\n data-testid=\"cooldown-timer\"\n >\n <div class=\"str-chat__message-input-cooldown-text\">\n {{ cooldown$ | async }}\n </div>\n </div>\n </div>\n</div>\n\n<div\n *ngIf=\"themeVersion === '2'\"\n class=\"str-chat__message-input str-chat-angular__message-input\"\n>\n <div *ngIf=\"quotedMessage\" class=\"str-chat__quoted-message-preview-header\">\n <div class=\"str-chat__quoted-message-reply-to-message\">\n {{ \"streamChat.Reply to Message\" | translate }}\n </div>\n <button\n class=\"str-chat__quoted-message-remove\"\n data-testid=\"remove-quote\"\n (click)=\"deselectMessageToQuote()\"\n (keyup.enter)=\"deselectMessageToQuote()\"\n >\n <stream-icon-placeholder\n icon=\"close-no-outline\"\n ></stream-icon-placeholder>\n </button>\n </div>\n <ng-container *ngIf=\"canSendMessages; else notAllowed\">\n <div\n class=\"\n str-chat__message-input-inner\n str-chat-angular__message-input-inner\n \"\n >\n <ng-container\n *ngIf=\"isFileUploadEnabled && isFileUploadAuthorized && canSendMessages\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n customAttachmentUploadTemplate || defaultAttachmentUpload;\n context: getAttachmentUploadContext()\n \"\n ></ng-container>\n <ng-template #defaultAttachmentUpload>\n <div\n class=\"str-chat__file-input-container\"\n data-testid=\"file-upload-button\"\n >\n <input\n #fileInput\n type=\"file\"\n class=\"str-chat__file-input\"\n data-testid=\"file-input\"\n [multiple]=\"isMultipleFileUploadEnabled\"\n (change)=\"filesSelected(fileInput.files)\"\n id=\"{{ fileInputId }}\"\n />\n <label class=\"str-chat__file-input-label\" for=\"{{ fileInputId }}\">\n <stream-icon-placeholder icon=\"attach\"></stream-icon-placeholder>\n </label>\n </div>\n </ng-template>\n </ng-container>\n <div class=\"str-chat__message-textarea-container\">\n <div\n data-testid=\"quoted-message-container\"\n class=\"str-chat__quoted-message-preview\"\n *ngIf=\"quotedMessage\"\n >\n <stream-avatar-placeholder\n data-testid=\"qouted-message-avatar\"\n class=\"\n str-chat-angular__avatar-host\n str-chat__message-sender-avatar\n \"\n [imageUrl]=\"quotedMessage?.user?.image\"\n [name]=\"quotedMessage?.user?.name || quotedMessage?.user?.id\"\n [size]=\"20\"\n type=\"user\"\n location=\"quoted-message-sender\"\n [user]=\"quotedMessage?.user || undefined\"\n ></stream-avatar-placeholder>\n <div\n class=\"\n quoted-message-preview-content-inner\n str-chat__quoted-message-bubble\n \"\n >\n <stream-attachment-list\n *ngIf=\"\n quotedMessage?.attachments && quotedMessage?.attachments?.length\n \"\n [attachments]=\"quotedMessageAttachments\"\n [messageId]=\"quotedMessage?.id\"\n ></stream-attachment-list>\n <div\n class=\"str-chat__quoted-message-text\"\n data-testid=\"quoted-message-text\"\n [innerHTML]=\"\n quotedMessage?.translation ||\n quotedMessage?.html ||\n quotedMessage?.text\n \"\n ></div>\n </div>\n </div>\n <ng-template\n #defaultAttachmentsPreview\n let-attachmentUploads$=\"attachmentUploads$\"\n let-retryUploadHandler=\"retryUploadHandler\"\n let-deleteUploadHandler=\"deleteUploadHandler\"\n >\n <stream-attachment-preview-list\n [attachmentUploads$]=\"attachmentUploads$\"\n (retryAttachmentUpload)=\"retryUploadHandler($event)\"\n (deleteAttachment)=\"deleteUploadHandler($event)\"\n class=\"str-chat__attachment-preview-list-angular-host\"\n ></stream-attachment-preview-list>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n attachmentPreviewListTemplate || defaultAttachmentsPreview;\n context: getAttachmentPreviewListContext()\n \"\n ></ng-container>\n <div class=\"str-chat__message-textarea-with-emoji-picker\">\n <ng-container\n streamTextarea\n [(value)]=\"textareaValue\"\n (valueChange)=\"typingStart$.next()\"\n (send)=\"messageSent()\"\n [componentRef]=\"textareaRef\"\n (userMentions)=\"mentionedUsers = $event\"\n [areMentionsEnabled]=\"areMentionsEnabled\"\n [mentionScope]=\"mentionScope\"\n [inputMode]=\"inputMode\"\n [autoFocus]=\"autoFocus\"\n [placeholder]=\"textareaPlaceholder\"\n ></ng-container>\n <ng-container *ngIf=\"emojiPickerTemplate\" data-testid=\"emoji-picker\">\n <ng-container\n *ngTemplateOutlet=\"\n emojiPickerTemplate;\n context: getEmojiPickerContext()\n \"\n ></ng-container>\n </ng-container>\n </div>\n </div>\n <button\n *ngIf=\"canSendMessages && !isCooldownInProgress && !message\"\n [disabled]=\"\n (attachmentUploadInProgressCounter$ | async)! > 0 ||\n (!textareaValue && (attachmentUploads$ | async)!.length === 0)\n \"\n data-testid=\"send-button\"\n class=\"str-chat__send-button\"\n (click)=\"messageSent()\"\n (keyup.enter)=\"messageSent()\"\n >\n <stream-icon-placeholder icon=\"send\"></stream-icon-placeholder>\n </button>\n <div\n class=\"str-chat__message-input-cooldown\"\n *ngIf=\"isCooldownInProgress\"\n data-testid=\"cooldown-timer\"\n >\n {{ cooldown$ | async }}\n </div>\n </div>\n </ng-container>\n <ng-template #notAllowed>\n <div\n class=\"str-chat__message-input-not-allowed\"\n data-testid=\"disabled-textarea\"\n >\n {{ disabledTextareaText | translate }}\n </div>\n </ng-template>\n</div>\n","import { Component, Input, TemplateRef } from '@angular/core';\nimport { NotificationType } from '../types';\n\n/**\n * The `Notification` component displays a notification within the [`NotificationList`](./NotificationListComponent.mdx)\n */\n@Component({\n selector: 'stream-notification',\n templateUrl: './notification.component.html',\n styles: [],\n})\nexport class NotificationComponent {\n /**\n * The type of the notification\n */\n @Input() type: NotificationType | undefined;\n /**\n * The content of the notification (can also be provided using `ng-content`)\n */\n @Input() content: TemplateRef<void> | undefined;\n\n constructor() {}\n}\n","<div\n class=\"str-chat__custom-notification notification-{{\n type\n }} str-chat__notification\"\n data-testid=\"custom-notification\"\n>\n <ng-container *ngIf=\"content; else elseContent\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </ng-container>\n <ng-template #elseContent>\n <ng-content></ng-content>\n </ng-template>\n</div>\n","import { Component } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { NotificationService } from '../notification.service';\nimport { ThemeService } from '../theme.service';\nimport { NotificationPayload } from '../types';\n\n/**\n * The `NotificationList` component displays the list of active notifications.\n */\n@Component({\n selector: 'stream-notification-list',\n templateUrl: './notification-list.component.html',\n styles: [],\n})\nexport class NotificationListComponent {\n notifications$: Observable<NotificationPayload[]>;\n themeVersion: '1' | '2';\n theme$: Observable<string>;\n\n constructor(\n public readonly customTemplatesService: CustomTemplatesService,\n private notificationService: NotificationService,\n private themeService: ThemeService\n ) {\n this.notifications$ = this.notificationService.notifications$;\n this.theme$ = this.themeService.theme$;\n this.themeVersion = this.themeService.themeVersion;\n }\n\n trackById(_: number, item: NotificationPayload) {\n return item.id;\n }\n\n getNotificationContentContext(notification: NotificationPayload) {\n return {\n ...notification.templateContext,\n dismissFn: notification.dismissFn,\n };\n }\n}\n","<div\n class=\"str-chat__theme-{{ theme$ | async }} str-chat__list-notifications\"\n [class.str-chat]=\"themeVersion === '2'\"\n data-testid=\"notification-list\"\n>\n <ng-container\n *ngFor=\"let notification of notifications$ | async; trackBy: trackById\"\n >\n <ng-template #notificationContent>\n <div\n *ngIf=\"notification.text !== undefined\"\n data-testclass=\"notification-content\"\n >\n {{ notification.text | translate: notification.translateParams }}\n </div>\n <ng-container *ngIf=\"notification.template !== undefined\">\n <ng-container\n *ngTemplateOutlet=\"\n notification.template;\n context: getNotificationContentContext(notification)\n \"\n ></ng-container>\n </ng-container>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.notificationTemplate$ | async) ||\n defaultNotification;\n context: { type: notification.type, content: notificationContent }\n \"\n ></ng-container>\n </ng-container>\n</div>\n\n<ng-template #defaultNotification let-type=\"type\" let-content=\"content\">\n <stream-notification [type]=\"type\" [content]=\"content\"></stream-notification>\n</ng-template>\n","import {\n Component,\n HostBinding,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { MessageInputContext, ModalContext, StreamMessage } from '../types';\nimport { Observable, Subject, Subscription } from 'rxjs';\nimport { MessageActionsService } from '../message-actions.service';\n\n/**\n * The edit message form displays a modal that's opened when a user edits a message. The component uses the [`MessageActionsService`](../../services/MessageActionsService) to know which message is being edited.\n *\n * By default this is displayed within the [`stream-channel` component](../../components/ChannelComponent).\n */\n@Component({\n selector: 'stream-edit-message-form',\n templateUrl: './edit-message-form.component.html',\n styles: [],\n})\nexport class EditMessageFormComponent implements OnInit, OnDestroy {\n @HostBinding() class = 'str-chat-angular__edit-message-form';\n sendMessage$: Observable<void>;\n isModalOpen = false;\n message?: StreamMessage;\n @ViewChild('editMessageForm', { static: true })\n private modalContent!: TemplateRef<void>;\n private sendMessageSubject = new Subject<void>();\n private subscriptions: Subscription[] = [];\n\n constructor(\n readonly customTemplatesService: CustomTemplatesService,\n private messageActionsService: MessageActionsService\n ) {\n this.sendMessage$ = this.sendMessageSubject.asObservable();\n }\n\n ngOnInit(): void {\n this.messageActionsService.messageToEdit$.subscribe((message) => {\n if ((message && !this.isModalOpen) || (!message && this.isModalOpen)) {\n this.message = message;\n this.isModalOpen = !!message;\n }\n });\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n getEditModalContext(): ModalContext {\n return {\n isOpen: this.isModalOpen,\n isOpenChangeHandler: (isOpen) => {\n this.isModalOpen = isOpen;\n if (!this.isModalOpen) {\n this.dismissed();\n }\n },\n content: this.modalContent,\n };\n }\n\n getMessageInputContext(): MessageInputContext {\n return {\n message: this.message,\n messageUpdateHandler: () => {\n this.dismissed();\n },\n isFileUploadEnabled: undefined,\n areMentionsEnabled: undefined,\n isMultipleFileUploadEnabled: undefined,\n mentionScope: undefined,\n mode: undefined,\n sendMessage$: this.sendMessage$,\n };\n }\n\n sendClicked() {\n this.sendMessageSubject.next();\n }\n\n dismissed() {\n this.isModalOpen = false;\n this.message = undefined;\n this.messageActionsService.messageToEdit$.next(undefined);\n }\n}\n","<ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: getEditModalContext()\n \"\n></ng-container>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n [isOpen]=\"isOpen\"\n *ngIf=\"isOpen\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n [content]=\"content\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #editMessageForm>\n <div class=\"str-chat__edit-message-form\">\n <ng-template\n #defaultInput\n let-messageInput=\"message\"\n let-messageUpdateHandler=\"messageUpdateHandler\"\n let-sendMessage$Input=\"sendMessage$\"\n >\n <stream-message-input\n [message]=\"messageInput\"\n (messageUpdate)=\"messageUpdateHandler()\"\n [sendMessage$]=\"sendMessage$Input\"\n ></stream-message-input>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageInputTemplate$ | async) || defaultInput;\n context: getMessageInputContext()\n \"\n >\n </ng-container>\n\n <stream-notification-list></stream-notification-list>\n <div\n class=\"\n str-chat__message-team-form-footer\n str-chat__message-team-form-footer-angular\n \"\n >\n <div class=\"str-chat__edit-message-form-options\">\n <button\n class=\"str-chat__edit-message-cancel\"\n translate\n data-testid=\"cancel-button\"\n (click)=\"dismissed()\"\n >\n streamChat.Cancel\n </button>\n <button\n type=\"submit\"\n translate\n class=\"str-chat__edit-message-send\"\n data-testid=\"send-button\"\n (click)=\"sendClicked()\"\n (keyup.enter)=\"sendClicked()\"\n >\n streamChat.Send\n </button>\n </div>\n </div>\n </div>\n</ng-template>\n","import { Component, HostBinding, OnDestroy } from '@angular/core';\nimport { ChannelService } from '../channel.service';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { Subscription } from 'rxjs';\nimport { MessageActionsService } from '../message-actions.service';\nimport { StreamMessage } from '../types';\n\n/**\n * The component watches for the [`channelService.bouncedMessage$` stream](../../services/ChannelService/#bouncedmessage) and opens the bounce modal if a message is emitted.\n *\n * To bounce messages, you need to set up [semantic filters for moderation](https://getstream.io/automated-moderation/docs/automod_configuration/?q=semantic%20filters).\n */\n@Component({\n selector: 'stream-message-bounce-prompt',\n templateUrl: './message-bounce-prompt.component.html',\n styles: [],\n})\nexport class MessageBouncePromptComponent implements OnDestroy {\n @HostBinding() class = 'str-chat__message-bounce-prompt';\n isModalOpen = false;\n message?: StreamMessage;\n private subscriptions: Subscription[] = [];\n\n constructor(\n private channelService: ChannelService,\n readonly customTemplatesService: CustomTemplatesService,\n private messageActionsService: MessageActionsService\n ) {\n this.subscriptions.push(\n this.channelService.bouncedMessage$.subscribe((m) => {\n if (m !== this.message) {\n this.message = m;\n if (this.message) {\n this.isModalOpen = true;\n }\n }\n })\n );\n }\n\n messageBounceModalOpenChanged = (isOpen: boolean) => {\n this.isModalOpen = isOpen;\n if (!isOpen) {\n this.message = undefined;\n this.channelService.bouncedMessage$.next(undefined);\n }\n };\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n async resendMessage() {\n this.isModalOpen = false;\n await this.channelService.resendMessage(this.message!);\n this.message = undefined;\n this.channelService.bouncedMessage$.next(undefined);\n }\n\n async deleteMessage() {\n if (!this.message) {\n return;\n }\n this.isModalOpen = false;\n await this.channelService.deleteMessage(this.message, true);\n this.message = undefined;\n this.channelService.bouncedMessage$.next(undefined);\n }\n\n editMessage() {\n this.isModalOpen = false;\n this.messageActionsService.messageToEdit$.next(this.message);\n this.message = undefined;\n this.channelService.bouncedMessage$.next(undefined);\n }\n}\n","<ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: {\n message: message,\n isOpen: isModalOpen,\n isOpenChangeHandler: messageBounceModalOpenChanged,\n content: modalContent\n }\n \"\n></ng-container>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n [isOpen]=\"isOpen\"\n *ngIf=\"isOpen\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n [content]=\"content\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #modalContent>\n <div\n class=\"str-chat__message-bounce-prompt\"\n data-testid=\"message-bounce-prompt\"\n >\n <div class=\"str-chat__message-bounce-prompt-header\">\n {{\n \"streamChat.This message did not meet our content guidelines\"\n | translate\n }}\n </div>\n <div class=\"str-chat__message-bounce-actions\">\n <button\n class=\"str-chat__message-bounce-edit\"\n data-testid=\"message-bounce-edit\"\n (click)=\"editMessage()\"\n (keyup.enter)=\"editMessage()\"\n type=\"button\"\n >\n {{ \"streamChat.Edit Message\" | translate }}\n </button>\n <button\n class=\"str-chat__message-bounce-send\"\n data-testid=\"message-bounce-send\"\n (click)=\"resendMessage()\"\n (keyup.enter)=\"resendMessage()\"\n >\n {{ \"streamChat.Send Anyway\" | translate }}\n </button>\n <button\n class=\"str-chat__message-bounce-delete\"\n data-testid=\"message-bounce-delete\"\n (click)=\"deleteMessage()\"\n (keyup.enter)=\"deleteMessage()\"\n >\n {{ \"streamChat.Delete\" | translate }}\n </button>\n </div>\n </div>\n</ng-template>\n","import { Component } from '@angular/core';\nimport { combineLatest, Observable, Subscription } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { ChannelService } from '../channel.service';\nimport { ThemeService } from '../theme.service';\nimport { CustomTemplatesService } from '../custom-templates.service';\n\n/**\n * The `Channel` component is a container component that displays the [`ChannelHeader`](./ChannelHeaderComponent.mdx), [`MessageList`](./MessageListComponent.mdx), [`NotificationList`](./NotificationListComponent.mdx) and [`MessageInput`](./MessageInputComponent.mdx) components. You can also provide the [`Thread`](./ThreadComponent.mdx) component to use message [threads](https://getstream.io/chat/docs/javascript/threads/?language=javascript).\n */\n@Component({\n selector: 'stream-channel',\n templateUrl: './channel.component.html',\n styles: [],\n})\nexport class ChannelComponent {\n isError$: Observable<boolean>;\n isInitializing$: Observable<boolean>;\n isActiveThread$: Observable<boolean>;\n isActiveChannel$: Observable<boolean>;\n subscriptions: Subscription[] = [];\n theme$: Observable<string>;\n\n constructor(\n private channelService: ChannelService,\n private themeService: ThemeService,\n readonly customTemplatesService: CustomTemplatesService\n ) {\n this.isError$ = combineLatest([\n this.channelService.channelQueryState$,\n this.channelService.activeChannel$,\n ]).pipe(\n map(([state, activeChannel]) => {\n return !activeChannel && state?.state === 'error';\n })\n );\n this.isInitializing$ = combineLatest([\n this.channelService.channelQueryState$,\n this.channelService.activeChannel$,\n ]).pipe(\n map(([state, activeChannel]) => {\n return !activeChannel && state?.state === 'in-progress';\n })\n );\n this.isActiveThread$ = this.channelService.activeParentMessageId$.pipe(\n map((id) => !!id)\n );\n this.theme$ = this.themeService.theme$;\n this.isActiveChannel$ = this.channelService.activeChannel$.pipe(\n map((c) => !!c)\n );\n }\n}\n","<div\n class=\"str-chat str-chat-channel messaging str-chat__channel str-chat__theme-{{\n theme$ | async\n }}\"\n>\n <div\n class=\"str-chat__container\"\n *ngIf=\"\n (isError$ | async) === false &&\n (isInitializing$ | async) === false &&\n (isActiveChannel$ | async) === true;\n else noChannel\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.editMessageFormTemplate$ | async) ||\n defaultEditMessageForm\n \"\n ></ng-container>\n <ng-template #defaultEditMessageForm>\n <stream-edit-message-form></stream-edit-message-form>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageBouncePromptTemplate$ | async) ||\n defaultMessageBouncePrompt\n \"\n ></ng-container>\n <ng-template #defaultMessageBouncePrompt>\n <stream-message-bounce-prompt></stream-message-bounce-prompt>\n </ng-template>\n <div class=\"str-chat__main-panel\">\n <ng-content></ng-content>\n </div>\n <ng-content\n *ngIf=\"isActiveThread$ | async\"\n select='[name=\"thread\"]'\n ></ng-content>\n </div>\n <ng-template #noChannel>\n <div\n class=\"str-chat__empty-channel\"\n *ngIf=\"\n (isInitializing$ | async) === false &&\n ((isError$ | async) === true || (isActiveChannel$ | async) === false)\n \"\n >\n <stream-icon icon=\"chat-bubble\"></stream-icon>\n <p class=\"str-chat__empty-channel-text\">\n {{ \"streamChat.No chats here yet…\" | translate }}\n </p>\n <div class=\"str-chat__empty-channel-notifications\">\n <stream-notification-list></stream-notification-list>\n </div>\n </div>\n <div\n *ngIf=\"\n (isInitializing$ | async) === true &&\n (isError$ | async) === false &&\n (isActiveChannel$ | async) === false\n \"\n class=\"str-chat__loading-channel\"\n >\n <div class=\"str-chat__loading-channel-header\">\n <div class=\"str-chat__loading-channel-header-avatar\"></div>\n <div class=\"str-chat__loading-channel-header-end\">\n <div class=\"str-chat__loading-channel-header-name\"></div>\n <div class=\"str-chat__loading-channel-header-info\"></div>\n </div>\n </div>\n <div class=\"str-chat__loading-channel-message-list\">\n <div class=\"str-chat__loading-channel-message\">\n <div class=\"str-chat__loading-channel-message-avatar\"></div>\n <div class=\"str-chat__loading-channel-message-end\">\n <div class=\"str-chat__loading-channel-message-sender\"></div>\n <div class=\"str-chat__loading-channel-message-last-row\">\n <div class=\"str-chat__loading-channel-message-text\"></div>\n <div class=\"str-chat__loading-channel-message-date\"></div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__loading-channel-message\">\n <div class=\"str-chat__loading-channel-message-avatar\"></div>\n <div class=\"str-chat__loading-channel-message-end\">\n <div class=\"str-chat__loading-channel-message-sender\"></div>\n <div class=\"str-chat__loading-channel-message-last-row\">\n <div class=\"str-chat__loading-channel-message-text\"></div>\n <div class=\"str-chat__loading-channel-message-date\"></div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__loading-channel-message\">\n <div class=\"str-chat__loading-channel-message-avatar\"></div>\n <div class=\"str-chat__loading-channel-message-end\">\n <div class=\"str-chat__loading-channel-message-sender\"></div>\n <div class=\"str-chat__loading-channel-message-last-row\">\n <div class=\"str-chat__loading-channel-message-text\"></div>\n <div class=\"str-chat__loading-channel-message-date\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__loading-channel-message-input-row\">\n <div class=\"str-chat__loading-channel-message-input\"></div>\n <div class=\"str-chat__loading-channel-message-send\"></div>\n </div>\n </div>\n </ng-template>\n</div>\n","import { UserResponse } from 'stream-chat';\n\nexport const listUsers = (users: UserResponse[]) => {\n let outStr = '';\n\n const slicedArr = users.map((item) => item.name || item.id).slice(0, 5);\n const restLength = users.length - slicedArr.length;\n\n const commaSeparatedUsers = slicedArr.join(', ');\n outStr = commaSeparatedUsers;\n if (restLength > 0) {\n outStr += ` +${restLength}`;\n }\n\n return outStr;\n};\n","import { Channel, UserResponse } from 'stream-chat';\nimport { listUsers } from './list-users';\nimport { DefaultStreamChatGenerics } from './types';\n\nexport const getChannelDisplayText = (\n channel: Channel<DefaultStreamChatGenerics>,\n currentUser: UserResponse<DefaultStreamChatGenerics>\n) => {\n if (channel.data?.name) {\n return channel.data.name;\n }\n if (channel.state.members && Object.keys(channel.state.members).length > 0) {\n const members = Object.values(channel.state.members)\n .map((m) => m.user || { id: m.user_id! })\n .filter((m) => m.id !== currentUser?.id);\n return listUsers(members);\n }\n return channel.id;\n};\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { distinctUntilChanged, filter, first } from 'rxjs/operators';\n\n/**\n * The `ChannelListToggleService` can be used to toggle the channel list.\n *\n * @deprecated This service can only be used with [theming-v1](../concepts/theming-and-css.mdx), if you are using [thmeing-v2](../theming/introduction.mdx) please refer to our [responsive layout guide](../code-examples/responsive-layout.mdx)\n */\n@Injectable({ providedIn: 'root' })\nexport class ChannelListToggleService {\n /**\n * Emits `true` if the channel list is in open state, otherwise it emits `false`\n */\n isOpen$: Observable<boolean>;\n private isOpenSubject = new BehaviorSubject<boolean>(false);\n private menuElement: HTMLElement | undefined;\n\n constructor() {\n this.isOpen$ = this.isOpenSubject\n .asObservable()\n .pipe(distinctUntilChanged());\n this.isOpen$.pipe(filter((s) => s)).subscribe(() => {\n this.watchForOutsideClicks();\n });\n }\n\n /**\n * Opens the channel list.\n */\n open() {\n this.isOpenSubject.next(true);\n }\n\n /**\n * Closes the channel list.\n */\n close() {\n this.isOpenSubject.next(false);\n }\n\n /**\n * Opens the channel list if it was closed, and closes if it was opened.\n */\n toggle() {\n this.isOpenSubject.getValue() ? this.close() : this.open();\n }\n\n /**\n * Sets the channel list element, on mobile screen size if the user opens the channel list, and clicks outside, the service automatically closes the channel list if a reference to the HTML element is provided.\n * @param element\n */\n setMenuElement(element: HTMLElement | undefined) {\n this.menuElement = element;\n }\n\n /**\n * This method should be called if a channel was selected, if on mobile, the channel list will be closed.\n */\n channelSelected() {\n this.close();\n }\n\n private watchForOutsideClicks() {\n if (!this.menuElement) {\n return;\n }\n const eventHandler = (event: Event) => {\n if (!this.menuElement!.contains(event.target as Node)) {\n this.close();\n window.removeEventListener('click', eventHandler);\n }\n };\n window.addEventListener('click', eventHandler);\n this.isOpen$\n .pipe(\n filter((s) => !s),\n first()\n )\n .subscribe(() => window.removeEventListener('click', eventHandler));\n }\n}\n","import {\n ChangeDetectorRef,\n Component,\n OnDestroy,\n OnInit,\n TemplateRef,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { Channel } from 'stream-chat';\nimport { ChannelListToggleService } from '../channel-list/channel-list-toggle.service';\nimport { ChannelService } from '../channel.service';\nimport { ChatClientService } from '../chat-client.service';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { getChannelDisplayText } from '../get-channel-display-text';\nimport {\n ChannelActionsContext,\n ChannelHeaderInfoContext,\n DefaultStreamChatGenerics,\n} from '../types';\n\n/**\n * The `ChannelHeader` component displays the avatar and name of the currently active channel along with member and watcher information. You can read about [the difference between members and watchers](https://getstream.io/chat/docs/javascript/watch_channel/?language=javascript#watchers-vs-members) in the platform documentation. Please note that number of watchers is only displayed if the user has [`connect-events` capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript)\n */\n@Component({\n selector: 'stream-channel-header',\n templateUrl: './channel-header.component.html',\n styles: [],\n})\nexport class ChannelHeaderComponent implements OnInit, OnDestroy {\n channelActionsTemplate?: TemplateRef<ChannelActionsContext>;\n channelHeaderInfoTemplate?: TemplateRef<ChannelHeaderInfoContext>;\n activeChannel: Channel<DefaultStreamChatGenerics> | undefined;\n canReceiveConnectEvents: boolean | undefined;\n private subscriptions: Subscription[] = [];\n\n constructor(\n private channelService: ChannelService,\n private channelListToggleService: ChannelListToggleService,\n private customTemplatesService: CustomTemplatesService,\n private cdRef: ChangeDetectorRef,\n private chatClientService: ChatClientService\n ) {\n this.channelService.activeChannel$.subscribe((c) => {\n this.activeChannel = c;\n const capabilities = this.activeChannel?.data\n ?.own_capabilities as string[];\n if (!capabilities) {\n return;\n }\n this.canReceiveConnectEvents =\n capabilities.indexOf('connect-events') !== -1;\n });\n }\n ngOnInit(): void {\n this.subscriptions.push(\n this.customTemplatesService.channelActionsTemplate$.subscribe(\n (template) => {\n this.channelActionsTemplate = template;\n this.cdRef.detectChanges();\n }\n )\n );\n this.subscriptions.push(\n this.customTemplatesService.channelHeaderInfoTemplate$.subscribe(\n (template) => {\n this.channelHeaderInfoTemplate = template;\n this.cdRef.detectChanges();\n }\n )\n );\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n toggleMenu(event: Event) {\n event.stopPropagation();\n this.channelListToggleService.toggle();\n }\n\n getChannelActionsContext(): ChannelActionsContext {\n return { channel: this.activeChannel! };\n }\n\n getChannelInfoContext(): ChannelHeaderInfoContext {\n return { channel: this.activeChannel! };\n }\n\n get memberCountParam() {\n return { memberCount: this.activeChannel?.data?.member_count || 0 };\n }\n\n get watcherCountParam() {\n return { watcherCount: this.activeChannel?.state?.watcher_count || 0 };\n }\n\n get displayText() {\n if (!this.activeChannel) {\n return '';\n }\n return getChannelDisplayText(\n this.activeChannel,\n this.chatClientService.chatClient.user!\n );\n }\n\n get avatarName() {\n return this.activeChannel?.data?.name;\n }\n}\n","<div class=\"str-chat__header-livestream str-chat__channel-header\">\n <div\n class=\"str-chat__header-hamburger\"\n (click)=\"toggleMenu($event)\"\n (keyup.enter)=\"toggleMenu($event)\"\n >\n <stream-icon-placeholder icon=\"menu\"></stream-icon-placeholder>\n </div>\n <ng-content></ng-content>\n <stream-avatar-placeholder\n imageUrl=\"{{ activeChannel?.data?.image }}\"\n name=\"{{ avatarName }}\"\n type=\"channel\"\n location=\"channel-header\"\n [channel]=\"activeChannel\"\n [size]=\"40\"\n ></stream-avatar-placeholder>\n <div class=\"str-chat__header-livestream-left str-chat__channel-header-end\">\n <p\n data-testid=\"name\"\n class=\"\n str-chat__header-livestream-left--title str-chat__channel-header-title\n \"\n >\n {{ displayText }}\n </p>\n <ng-container\n *ngTemplateOutlet=\"\n channelHeaderInfoTemplate || defaultChannelInfo;\n context: getChannelInfoContext()\n \"\n ></ng-container>\n <ng-template #defaultChannelInfo>\n <p\n data-testid=\"info\"\n class=\"\n str-chat__header-livestream-left--members\n str-chat__channel-header-info\n \"\n >\n {{'streamChat.{{ memberCount }} members' | translate:memberCountParam}}\n {{canReceiveConnectEvents ? ('streamChat.{{ watcherCount }} online' |\n translate:watcherCountParam) : ''}}\n </p>\n </ng-template>\n </div>\n <ng-container *ngIf=\"channelActionsTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n channelActionsTemplate;\n context: getChannelActionsContext()\n \"\n ></ng-container>\n </ng-container>\n</div>\n","export const isOnSeparateDate = (date1: Date, date2: Date) => {\n if (date1.getDate() !== date2.getDate()) {\n return true;\n } else if (\n date1.getFullYear() !== date2.getFullYear() ||\n date1.getMonth() !== date2.getMonth()\n ) {\n return true;\n }\n return false;\n};\n","import { Injectable } from '@angular/core';\n\n/**\n * The message service contains configuration options related to displaying the message content\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MessageService {\n /**\n * Decides if the message content should be formatted as text or HTML\n *\n * If you display messages as text the following parts are still be displayed as HTML:\n * - user mentions -> you can customize this with your own template using the [`customTemplatesService.mentionTemplate$`](https://getstream.io/chat/docs/sdk/angular/services/CustomTemplatesService/#mentiontemplate)\n * - links -> you can customize this by providing you own [`customLinkRenderer`](#customlinkrenderer) method\n */\n displayAs: 'text' | 'html' = 'text';\n\n /**\n * You can provide a custom method to display links\n *\n * @param url the url the link should refer to\n * @returns the HTML markup as a string for the link\n */\n customLinkRenderer?: (url: string) => string;\n\n constructor() {}\n}\n","import Dayjs from 'dayjs';\nimport calendar from 'dayjs/plugin/calendar';\nimport relativeTime from 'dayjs/plugin/relativeTime';\n\nDayjs.extend(calendar);\nDayjs.extend(relativeTime);\n\nexport const parseDate = (\n date: Date,\n format: 'date' | 'date-time' | 'time' = 'date-time'\n) => {\n const parsedTime = Dayjs(date);\n\n switch (format) {\n case 'date': {\n return parsedTime.calendar(null, {\n sameDay: '[Today]', // The same day ( Today at 2:30 AM )\n nextDay: '[Tomorrow]', // The next day ( Tomorrow at 2:30 AM )\n nextWeek: 'dddd', // The next week ( Sunday at 2:30 AM )\n lastDay: '[Yesterday]', // The day before ( Yesterday at 2:30 AM )\n lastWeek: '[Last] dddd', // Last week ( Last Monday at 2:30 AM )\n sameElse: 'MM/DD/YYYY', // Everything else ( 10/17/2011 )\n });\n }\n case 'date-time': {\n return parsedTime.calendar();\n }\n case 'time': {\n return parsedTime.format('h:mm A');\n }\n }\n};\n","import { Injectable } from '@angular/core';\nimport { parseDate } from './parse-date';\n\n/**\n * The `DateParserService` parses dates into user-friendly string representations.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DateParserService {\n /**\n * Custom parser to override `parseTime`\n */\n customTimeParser?: (date: Date) => string;\n /**\n * Custom parser to override `parseDate`\n */\n customDateParser?: (date: Date) => string;\n /**\n * Custom parser to override `parseDateTime`\n */\n customDateTimeParser?: (date: Date) => string;\n\n constructor() {}\n\n /**\n * Return a user-friendly string representation of the time\n * @param date\n * @returns The parsed time\n */\n parseTime(date: Date) {\n if (this.customTimeParser) {\n return this.customTimeParser(date);\n }\n return parseDate(date, 'time');\n }\n\n /**\n * Return a user-friendly string representation of the date (year, month and date)\n * @param date\n * @returns The parsed date\n */\n parseDate(date: Date) {\n if (this.customDateParser) {\n return this.customDateParser(date);\n }\n return parseDate(date, 'date');\n }\n\n /**\n * Return a user-friendly string representation of the date and time\n * @param date\n * @returns The parsed date\n */\n parseDateTime(date: Date) {\n if (this.customDateTimeParser) {\n return this.customDateTimeParser(date);\n }\n return parseDate(date, 'date-time');\n }\n}\n","import { Component, Input, NgZone, OnDestroy, OnInit } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { filter } from 'rxjs/operators';\nimport { Channel, Event, FormatMessageResponse } from 'stream-chat';\nimport { ChannelService } from '../channel.service';\nimport { getChannelDisplayText } from '../get-channel-display-text';\nimport { DefaultStreamChatGenerics } from '../types';\nimport { ChatClientService } from '../chat-client.service';\nimport { getMessageTranslation } from '../get-message-translation';\nimport { MessageService } from '../message.service';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { getReadBy } from '../read-by';\nimport { isOnSeparateDate } from '../is-on-separate-date';\nimport { DateParserService } from '../date-parser.service';\n\n/**\n * The `ChannelPreview` component displays a channel preview in the channel list, it consists of the image, name and latest message of the channel.\n */\n@Component({\n selector: 'stream-channel-preview',\n templateUrl: './channel-preview.component.html',\n styles: [],\n})\nexport class ChannelPreviewComponent implements OnInit, OnDestroy {\n /**\n * The channel to be displayed\n */\n @Input() channel: Channel<DefaultStreamChatGenerics> | undefined;\n isActive = false;\n isUnreadMessageWasCalled = false;\n isUnread = false;\n unreadCount: number | undefined;\n latestMessageText: string = 'streamChat.Nothing yet...';\n latestMessageStatus?: 'delivered' | 'read';\n latestMessageTime?: string;\n latestMessage?: FormatMessageResponse<DefaultStreamChatGenerics>;\n displayAs: 'text' | 'html';\n userId?: string;\n private subscriptions: (Subscription | { unsubscribe: () => void })[] = [];\n private canSendReadEvents = true;\n\n constructor(\n private channelService: ChannelService,\n private ngZone: NgZone,\n private chatClientService: ChatClientService,\n messageService: MessageService,\n public customTemplatesService: CustomTemplatesService,\n private dateParser: DateParserService\n ) {\n this.displayAs = messageService.displayAs;\n }\n\n ngOnInit(): void {\n this.subscriptions.push(\n this.chatClientService.user$.subscribe((user) => {\n if (user?.id !== this.userId) {\n this.userId = user?.id;\n }\n })\n );\n this.subscriptions.push(\n this.channelService.activeChannel$.subscribe(\n (activeChannel) =>\n (this.isActive = activeChannel?.id === this.channel?.id)\n )\n );\n const messages = this.channel?.state?.latestMessages;\n if (messages && messages.length > 0) {\n this.setLatestMessage(messages[messages.length - 1]);\n }\n this.updateUnreadState();\n const capabilities =\n (this.channel?.data?.own_capabilities as string[]) || [];\n this.canSendReadEvents = capabilities.indexOf('read-events') !== -1;\n this.subscriptions.push(\n this.channel!.on('message.new', this.handleMessageEvent.bind(this))\n );\n this.subscriptions.push(\n this.channel!.on('message.updated', this.handleMessageEvent.bind(this))\n );\n this.subscriptions.push(\n this.channel!.on('message.deleted', this.handleMessageEvent.bind(this))\n );\n this.subscriptions.push(\n this.channel!.on('channel.truncated', this.handleMessageEvent.bind(this))\n );\n this.subscriptions.push(\n this.channel!.on('message.read', () =>\n this.ngZone.run(() => {\n this.isUnreadMessageWasCalled = false;\n this.updateUnreadState();\n })\n )\n );\n this.subscriptions.push(\n this.chatClientService.events$\n .pipe(\n filter(\n (e) =>\n e.eventType === 'notification.mark_unread' &&\n this.channel!.id === e.event?.channel_id\n )\n )\n .subscribe(() => {\n this.ngZone.run(() => {\n this.isUnreadMessageWasCalled = true;\n this.updateUnreadState();\n });\n })\n );\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n get avatarImage() {\n return this.channel?.data?.image;\n }\n\n get avatarName() {\n return this.channel?.data?.name;\n }\n\n get title() {\n if (!this.channel) {\n return '';\n }\n return getChannelDisplayText(\n this.channel,\n this.chatClientService.chatClient.user!\n );\n }\n\n setAsActiveChannel(): void {\n void this.channelService.setAsActiveChannel(this.channel!);\n }\n\n private handleMessageEvent(event: Event) {\n this.ngZone.run(() => {\n if (this.channel?.state.latestMessages.length === 0) {\n this.latestMessage = undefined;\n this.latestMessageStatus = undefined;\n this.latestMessageText = 'streamChat.Nothing yet...';\n this.latestMessageTime = undefined;\n return;\n }\n const latestMessage =\n this.channel?.state.latestMessages[\n this.channel?.state.latestMessages.length - 1\n ];\n if (!event.message || latestMessage?.id !== event.message.id) {\n return;\n }\n this.setLatestMessage(latestMessage);\n this.updateUnreadState();\n });\n }\n\n private setLatestMessage(\n message?: FormatMessageResponse<DefaultStreamChatGenerics>\n ) {\n this.latestMessage = message;\n if (message?.deleted_at) {\n this.latestMessageText = 'streamChat.Message deleted';\n } else if (message?.text) {\n this.latestMessageText =\n getMessageTranslation(\n message,\n this.channel,\n this.chatClientService.chatClient.user\n ) || message.text;\n } else if (message?.attachments && message.attachments.length) {\n this.latestMessageText = 'streamChat.🏙 Attachment...';\n }\n if (this.latestMessage && this.latestMessage.type === 'regular') {\n this.latestMessageTime = isOnSeparateDate(\n new Date(),\n this.latestMessage.created_at\n )\n ? this.dateParser.parseDate(this.latestMessage.created_at)\n : this.dateParser.parseTime(this.latestMessage.created_at);\n } else {\n this.latestMessageTime = undefined;\n }\n }\n\n private updateUnreadState() {\n if (\n this.channel &&\n this.latestMessage &&\n this.latestMessage.user?.id === this.userId &&\n this.latestMessage.status === 'received' &&\n this.latestMessage.type === 'regular'\n ) {\n this.latestMessageStatus =\n getReadBy(this.latestMessage, this.channel).length > 0\n ? 'read'\n : 'delivered';\n } else {\n this.latestMessageStatus = undefined;\n }\n if (\n (this.isActive && !this.isUnreadMessageWasCalled) ||\n !this.canSendReadEvents\n ) {\n this.unreadCount = 0;\n this.isUnread = false;\n return;\n }\n this.unreadCount = this.channel!.countUnread();\n this.isUnread = !!this.unreadCount;\n }\n}\n","<button\n class=\"str-chat__channel-preview-messenger str-chat__channel-preview\"\n [class.str-chat__channel-preview-messenger--active]=\"isActive\"\n [class.str-chat__channel-preview--active]=\"isActive\"\n [class.str-chat__channel-preview-messenger--unread]=\"isUnread\"\n (click)=\"setAsActiveChannel()\"\n data-testid=\"channel-preview-container\"\n>\n <div class=\"str-chat__channel-preview-messenger--left\">\n <stream-avatar-placeholder\n name=\"{{ avatarName }}\"\n imageUrl=\"{{ avatarImage }}\"\n type=\"channel\"\n [channel]=\"channel\"\n location=\"channel-preview\"\n [size]=\"49\"\n ></stream-avatar-placeholder>\n </div>\n <div\n class=\"\n str-chat__channel-preview-messenger--right str-chat__channel-preview-end\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.channelPreviewInfoTemplate$ | async) ||\n defaultChannelInfo;\n context: {\n channelDisplayTitle: title,\n channel: channel,\n unreadCount: unreadCount,\n latestMessageText: latestMessageText,\n latestMessageStatus: latestMessageStatus,\n latestMessageTime: latestMessageTime,\n latestMessage: latestMessage\n }\n \"\n ></ng-container>\n <ng-template\n #defaultChannelInfo\n let-channelDisplayTitle=\"channelDisplayTitle\"\n let-unreadCount=\"unreadCount\"\n let-latestMessageText=\"latestMessageText\"\n let-latestMessageStatus=\"latestMessageStatus\"\n let-latestMessageTime=\"latestMessageTime\"\n >\n <div class=\"str-chat__channel-preview-end-first-row\">\n <div class=\"str-chat__channel-preview-messenger--name\">\n <span data-testid=\"channel-preview-title\">{{\n channelDisplayTitle\n }}</span>\n </div>\n <div\n data-testid=\"unread-badge\"\n *ngIf=\"unreadCount\"\n class=\"str-chat__channel-preview-unread-badge\"\n >\n {{ unreadCount }}\n </div>\n </div>\n <div class=\"str-chat__channel-preview-end-second-row\">\n <div\n data-testid=\"latest-message\"\n class=\"str-chat__channel-preview-messenger--last-message\"\n >\n <ng-container *ngIf=\"displayAs === 'text'; else asHTML\">\n {{ latestMessageText | translate }}\n </ng-container>\n <ng-template #asHTML>\n <span\n data-testid=\"html-content\"\n [innerHTML]=\"latestMessageText | translate\"\n ></span>\n </ng-template>\n </div>\n <div\n data-testid=\"latest-message-status\"\n *ngIf=\"latestMessageStatus\"\n class=\"str-chat__channel-preview-messenger--status str-chat__channel-preview-messenger--status-{{\n latestMessageStatus\n }}\"\n >\n <stream-icon-placeholder\n [icon]=\"\n latestMessageStatus === 'delivered'\n ? 'delivered-icon'\n : 'read-icon'\n \"\n ></stream-icon-placeholder>\n </div>\n <div\n data-testid=\"latest-message-time\"\n class=\"str-chat__channel-preview-messenger--time\"\n *ngIf=\"latestMessageTime\"\n >\n {{ latestMessageTime }}\n </div>\n </div>\n </ng-template>\n </div>\n</button>\n","import {\n AfterViewInit,\n Component,\n ElementRef,\n OnDestroy,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { Observable, Subscription } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { Channel } from 'stream-chat';\nimport { ChannelService } from '../channel.service';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { ThemeService } from '../theme.service';\nimport { ChannelPreviewContext, DefaultStreamChatGenerics } from '../types';\nimport { ChannelListToggleService } from './channel-list-toggle.service';\n\n/**\n * The `ChannelList` component renders the list of channels.\n */\n@Component({\n selector: 'stream-channel-list',\n templateUrl: './channel-list.component.html',\n styles: [],\n})\nexport class ChannelListComponent implements AfterViewInit, OnDestroy {\n channels$: Observable<Channel<DefaultStreamChatGenerics>[] | undefined>;\n isError$: Observable<boolean>;\n isInitializing$: Observable<boolean>;\n isLoadingMoreChannels = false;\n isOpen$: Observable<boolean>;\n hasMoreChannels$: Observable<boolean>;\n customChannelPreviewTemplate: TemplateRef<ChannelPreviewContext> | undefined;\n theme$: Observable<string>;\n subscriptions: Subscription[] = [];\n @ViewChild('container') private container!: ElementRef<HTMLElement>;\n\n constructor(\n private channelService: ChannelService,\n private channelListToggleService: ChannelListToggleService,\n private customTemplatesService: CustomTemplatesService,\n private themeService: ThemeService\n ) {\n this.theme$ = this.themeService.theme$;\n this.isOpen$ = this.channelListToggleService.isOpen$;\n this.channels$ = this.channelService.channels$;\n this.hasMoreChannels$ = this.channelService.hasMoreChannels$;\n this.isError$ = this.channelService.channelQueryState$.pipe(\n map((s) => !this.isLoadingMoreChannels && s?.state === 'error')\n );\n this.isInitializing$ = this.channelService.channelQueryState$.pipe(\n map((s) => !this.isLoadingMoreChannels && s?.state === 'in-progress')\n );\n this.subscriptions.push(\n this.customTemplatesService.channelPreviewTemplate$.subscribe(\n (template) => (this.customChannelPreviewTemplate = template)\n )\n );\n }\n ngAfterViewInit(): void {\n this.channelListToggleService.setMenuElement(this.container.nativeElement);\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n async loadMoreChannels() {\n this.isLoadingMoreChannels = true;\n await this.channelService.loadMoreChannels();\n this.isLoadingMoreChannels = false;\n }\n\n trackByChannelId(index: number, item: Channel<DefaultStreamChatGenerics>) {\n return item.cid;\n }\n\n channelSelected() {\n this.channelListToggleService.channelSelected();\n }\n}\n","<div\n #container\n data-testid=\"channel-list-container\"\n class=\"str-chat str-chat__channel-list str-chat-channel-list messaging str-chat__theme-{{\n theme$ | async\n }}\"\n [class.str-chat-channel-list--open]=\"(isOpen$ | async) === true\"\n>\n <div\n *ngIf=\"\n (isError$ | async) === false && (isInitializing$ | async) === false;\n else statusIndicator\n \"\n class=\"str-chat__channel-list-messenger\"\n >\n <div class=\"str-chat__channel-list-messenger__main\">\n <ng-content select=\"[channel-list-top]\"></ng-content>\n <div\n class=\"str-chat__channel-list-empty\"\n *ngIf=\"!(channels$ | async)?.length\"\n >\n <stream-icon icon=\"chat-bubble\"></stream-icon>\n <p data-testid=\"empty-channel-list-indicator\">\n {{ \"streamChat.You have no channels currently\" | translate }}\n </p>\n </div>\n <p\n *ngIf=\"!(channels$ | async)?.length\"\n class=\"str-chat__channel-list-empty-v1\"\n data-testid=\"empty-channel-list-indicator\"\n >\n {{ \"streamChat.You have no channels currently\" | translate }}\n </p>\n <ng-container\n *ngFor=\"let channel of channels$ | async; trackBy: trackByChannelId\"\n >\n <ng-template #defaultTemplate let-channelInput=\"channel\">\n <stream-channel-preview\n data-testclass=\"channel-preview\"\n [channel]=\"channelInput\"\n ></stream-channel-preview>\n </ng-template>\n <div (click)=\"channelSelected()\" (keyup.enter)=\"channelSelected()\">\n <ng-container\n *ngTemplateOutlet=\"\n customChannelPreviewTemplate || defaultTemplate;\n context: { channel: channel }\n \"\n ></ng-container>\n </div>\n </ng-container>\n <div\n *ngIf=\"hasMoreChannels$ | async\"\n class=\"str-chat__load-more-button\"\n (click)=\"loadMoreChannels()\"\n (keyup.enter)=\"loadMoreChannels()\"\n data-testid=\"load-more\"\n >\n <button\n class=\"str-chat__load-more-button__button str-chat__cta-button\"\n data-testid=\"load-more-button\"\n [disabled]=\"isLoadingMoreChannels\"\n >\n <span *ngIf=\"!isLoadingMoreChannels; else loadingIndicator\">{{\n \"Load more\" | translate\n }}</span>\n <ng-template #loadingIndicator\n ><stream-loading-indicator-placeholder></stream-loading-indicator-placeholder\n ></ng-template>\n </button>\n </div>\n <ng-content select=\"[channel-list-bottom]\"></ng-content>\n </div>\n </div>\n</div>\n\n<ng-template #statusIndicator>\n <ng-container *ngIf=\"isError$ | async\">\n <ng-container *ngTemplateOutlet=\"chatDown\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"isInitializing$ | async\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #chatDown>\n <div data-testid=\"chatdown-container\" class=\"str-chat__down\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n <div class=\"str-chat__down-main\">\n <stream-icon-placeholder\n icon=\"connection-error\"\n ></stream-icon-placeholder>\n <h1>{{ \"streamChat.Connection error\" | translate }}</h1>\n <h3>\n {{\n \"streamChat.Error connecting to chat, refresh the page to try again.\"\n | translate\n }}\n </h3>\n </div>\n </div>\n</ng-template>\n\n<ng-template #loadingChannels>\n <div data-testid=\"loading-indicator\" class=\"str-chat__loading-channels\">\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #loadingChannel>\n <div\n class=\"str-chat__loading-channels-item str-chat__channel-preview-loading\"\n >\n <div class=\"str-chat__loading-channels-avatar\"></div>\n <div\n class=\"\n str-chat__loading-channels-meta str-chat__channel-preview-end-loading\n \"\n >\n <div class=\"str-chat__loading-channels-username\"></div>\n <div class=\"str-chat__loading-channels-status\"></div>\n </div>\n </div>\n</ng-template>\n","import { Injectable } from '@angular/core';\nimport { MessageReactionClickDetails, MessageReactionType } from './types';\nimport { BehaviorSubject } from 'rxjs';\n\n/**\n * The `MessageReactionsService` provides customization options to message [reactions](https://getstream.io/chat/docs/javascript/send_reaction/?language=javascript).\n *\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MessageReactionsService {\n /**\n * The enabled [reactions](https://getstream.io/chat/docs/javascript/send_reaction/?language=javascript) and the associated emoji\n *\n * You can provide any string as a reaction. The emoji can be provided as a string, if you want to use custom images for reactions you have to provide a [custom reactions UI](../../services/CustomTemplatesService/#messagereactionstemplate)\n */\n reactions$ = new BehaviorSubject<{ [key in MessageReactionType]: string }>({\n like: '👍',\n angry: '😠',\n love: '❤️',\n haha: '😂',\n wow: '😮',\n sad: '😞',\n });\n /**\n * By default the [`MessageReactionsComponent`](../../components/MessageReactionsComponent) will display the reacting users when a reaction is clicked. You can override this with your own UI by providing a custom event handler.\n *\n * The event handler can retrieve all reactions of a message inside the active channel using the [`channelService.getMessageReactions` method](../../services/ChannelService/#getmessagereactions)\n */\n customReactionClickHandler?: (details: MessageReactionClickDetails) => void;\n\n constructor() {}\n\n /**\n * Sets the enabled reactions\n */\n set reactions(reactions: { [key in MessageReactionType]: string }) {\n this.reactions$.next(reactions);\n }\n\n /**\n * Get the currently enabled reactions\n */\n get reactions() {\n return this.reactions$.getValue();\n }\n}\n","import {\n AfterViewChecked,\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\nimport { ReactionResponse, UserResponse } from 'stream-chat';\nimport { ChannelService } from '../channel.service';\nimport { MessageReactionType, DefaultStreamChatGenerics } from '../types';\nimport { NgxPopperjsTriggers, NgxPopperjsPlacements } from 'ngx-popperjs';\nimport { MessageReactionsService } from '../message-reactions.service';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { ThemeService } from '../theme.service';\nimport { Subscription } from 'rxjs';\n\n/**\n * The `MessageReactions` component displays the reactions of a message, the current user can add and remove reactions. You can read more about [message reactions](https://getstream.io/chat/docs/javascript/send_reaction/?language=javascript) in the platform documentation.\n */\n@Component({\n selector: 'stream-message-reactions',\n templateUrl: './message-reactions.component.html',\n})\nexport class MessageReactionsComponent\n implements AfterViewChecked, OnChanges, OnInit, AfterViewInit, OnDestroy\n{\n /**\n * The id of the message the reactions belong to\n */\n @Input() messageId: string | undefined;\n /**\n * The number of reactions grouped by [reaction types](https://github.com/GetStream/stream-chat-angular/tree/master/projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.ts)\n */\n @Input() messageReactionCounts: { [key in MessageReactionType]?: number } =\n {};\n /**\n * Indicates if the selector should be opened or closed. Adding a UI element to open and close the selector is the parent's component responsibility.\n */\n @Input() isSelectorOpen: boolean = false;\n /**\n * List of reactions of a [message](../types/stream-message.mdx), used to display the users of a reaction type.\n */\n @Input() latestReactions: ReactionResponse<DefaultStreamChatGenerics>[] = [];\n /**\n * List of the user's own reactions of a [message](../types/stream-message.mdx), used to display the users of a reaction type.\n */\n @Input() ownReactions: ReactionResponse<DefaultStreamChatGenerics>[] = [];\n /**\n * Indicates if the selector should be opened or closed. Adding a UI element to open and close the selector is the parent's component responsibility.\n */\n @Output() readonly isSelectorOpenChange = new EventEmitter<boolean>();\n tooltipPositions: { arrow: number; tooltip: number } | undefined;\n tooltipText: string | undefined;\n @ViewChild('selectorContainer') private selectorContainer:\n | ElementRef<HTMLElement>\n | undefined;\n @ViewChild('selectorTooltip') private selectorTooltip:\n | ElementRef<HTMLElement>\n | undefined;\n currentTooltipTarget: HTMLElement | undefined;\n popperTriggerHover = NgxPopperjsTriggers.hover;\n popperPlacementAuto = NgxPopperjsPlacements.AUTO;\n selectedReactionType: string | undefined;\n isLoading = true;\n reactions: ReactionResponse[] = [];\n shouldHandleReactionClick = true;\n existingReactions: string[] = [];\n reactionsCount: number = 0;\n reactionOptions: string[] = [];\n private subscriptions: Subscription[] = [];\n private isViewInited = false;\n\n constructor(\n private cdRef: ChangeDetectorRef,\n private channelService: ChannelService,\n private messageReactionsService: MessageReactionsService,\n public customTemplatesService: CustomTemplatesService,\n private themeService: ThemeService\n ) {}\n\n ngOnInit(): void {\n this.subscriptions.push(\n this.messageReactionsService.reactions$.subscribe((reactions) => {\n this.reactionOptions = Object.keys(reactions);\n this.setExistingReactions();\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n })\n );\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes.isSelectorOpen) {\n this.isSelectorOpen\n ? setTimeout(() => this.watchForOutsideClicks()) // setTimeout: wait for current click to bubble up, and only watch for clicks after that\n : this.stopWatchForOutsideClicks();\n }\n if (changes.messageReactionCounts) {\n this.setExistingReactions();\n }\n if (changes.messageReactionCounts && this.messageReactionCounts) {\n const reactionsCount = Object.keys(this.messageReactionCounts).reduce(\n (acc, key) => acc + (this.messageReactionCounts[key] || 0),\n 0\n );\n this.shouldHandleReactionClick =\n reactionsCount <= ChannelService.MAX_MESSAGE_REACTIONS_TO_FETCH ||\n !!this.messageReactionsService.customReactionClickHandler;\n }\n }\n\n ngAfterViewInit(): void {\n this.isViewInited = true;\n }\n\n ngAfterViewChecked(): void {\n if (this.tooltipText && !this.tooltipPositions) {\n this.setTooltipPosition();\n this.cdRef.detectChanges();\n }\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n getLatestUserByReaction(reactionType: MessageReactionType) {\n return this.latestReactions.find((r) => r.type === reactionType && r.user)\n ?.user;\n }\n\n getEmojiByReaction(reactionType: MessageReactionType) {\n return this.messageReactionsService.reactions[reactionType];\n }\n\n reactionSelected(reactionType: string) {\n if (!this.shouldHandleReactionClick) {\n return;\n }\n if (this.themeService.themeVersion === '1') {\n return;\n }\n if (!this.messageId) {\n return;\n }\n if (this.messageReactionsService.customReactionClickHandler) {\n this.messageReactionsService.customReactionClickHandler({\n messageId: this.messageId,\n reactionType: reactionType,\n });\n } else {\n this.selectedReactionType = reactionType;\n void this.fetchAllReactions();\n }\n }\n\n getUsersByReaction(reactionType: MessageReactionType) {\n return this.latestReactions\n .filter((r) => r.type === reactionType)\n .map((r) => r.user?.name || r.user?.id)\n .filter((i) => !!i)\n .join(', ');\n }\n\n getAllUsersByReaction(\n reactionType?: MessageReactionType\n ): UserResponse<DefaultStreamChatGenerics>[] {\n if (!reactionType) {\n return [];\n }\n\n const users = this.reactions\n .filter((r) => r.type === reactionType)\n .map((r) => r.user)\n .filter((i) => !!i) as UserResponse[];\n\n users.sort((u1, u2) => {\n const name1 = u1.name?.toLowerCase();\n const name2 = u2.name?.toLowerCase();\n\n if (!name1) {\n return 1;\n }\n\n if (!name2) {\n return -1;\n }\n\n if (name1 === name2) {\n return 0;\n }\n\n if (name1 < name2) {\n return -1;\n } else {\n return 1;\n }\n });\n\n return users;\n }\n\n showTooltip(event: Event, reactionType: MessageReactionType) {\n this.currentTooltipTarget = event.target as HTMLElement;\n this.tooltipText = this.getUsersByReaction(reactionType);\n }\n\n hideTooltip() {\n this.tooltipText = undefined;\n this.currentTooltipTarget = undefined;\n this.tooltipPositions = undefined;\n }\n\n trackByMessageReaction(index: number, item: MessageReactionType) {\n return item;\n }\n\n trackByUserId(index: number, item: UserResponse) {\n return item.id;\n }\n\n async react(type: MessageReactionType) {\n this.ownReactions.find((r) => r.type === type)\n ? await this.channelService.removeReaction(this.messageId!, type)\n : await this.channelService.addReaction(this.messageId!, type);\n this.isSelectorOpenChange.emit(false);\n }\n\n isOwnReaction(reactionType: MessageReactionType) {\n return !!this.ownReactions.find((r) => r.type === reactionType);\n }\n\n isOpenChange = (isOpen: boolean) => {\n this.selectedReactionType = isOpen ? this.selectedReactionType : undefined;\n };\n\n private eventHandler = (event: Event) => {\n if (!this.selectorContainer?.nativeElement.contains(event.target as Node)) {\n this.isSelectorOpenChange.emit(false);\n }\n };\n\n private watchForOutsideClicks() {\n window.addEventListener('click', this.eventHandler);\n }\n\n private stopWatchForOutsideClicks() {\n window.removeEventListener('click', this.eventHandler);\n }\n\n private setTooltipPosition() {\n const tooltip = this.selectorTooltip?.nativeElement.getBoundingClientRect();\n const target = this.currentTooltipTarget?.getBoundingClientRect();\n\n const container =\n this.selectorContainer?.nativeElement.getBoundingClientRect();\n\n if (!tooltip || !target || !container) return;\n\n const tooltipPosition =\n tooltip.width === container.width || tooltip.x < container.x\n ? 0\n : target.left + target.width / 2 - container.left - tooltip.width / 2;\n\n const arrowPosition =\n target.x - tooltip.x + target.width / 2 - tooltipPosition;\n\n this.tooltipPositions = {\n tooltip: tooltipPosition,\n arrow: arrowPosition,\n };\n }\n\n private async fetchAllReactions() {\n if (!this.messageId) {\n return;\n }\n this.isLoading = true;\n try {\n this.reactions = await this.channelService.getMessageReactions(\n this.messageId\n );\n } catch (error) {\n this.selectedReactionType = undefined;\n } finally {\n this.isLoading = false;\n this.cdRef.detectChanges();\n }\n }\n\n private setExistingReactions() {\n this.existingReactions = Object.keys(this.messageReactionCounts)\n .filter((k) => this.reactionOptions.indexOf(k) !== -1)\n .filter((k) => this.messageReactionCounts[k]! > 0);\n this.reactionsCount = this.existingReactions.reduce(\n (total, reaction) => total + this.messageReactionCounts[reaction]!,\n 0\n );\n }\n}\n","<div\n *ngIf=\"existingReactions.length > 0\"\n class=\"str-chat__reaction-list str-chat__message-reactions-container\"\n [class.str-chat__reaction-list--reverse]=\"true\"\n [class.str-chat__reaction-list-hidden]=\"isSelectorOpen\"\n data-testid=\"reaction-list\"\n>\n <ul class=\"str-chat__message-reactions\">\n <li\n class=\"str-chat__message-reaction\"\n *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n [ngStyle]=\"{ cursor: shouldHandleReactionClick ? 'pointer' : 'default' }\"\n [class.str-chat__message-reaction-own]=\"isOwnReaction(reactionType)\"\n data-testclass=\"emoji\"\n (click)=\"reactionSelected(reactionType)\"\n (keyup.enter)=\"reactionSelected(reactionType)\"\n >\n <span class=\"emoji str-chat__message-reaction-emoji\">\n {{ getEmojiByReaction(reactionType) }}&nbsp;\n </span>\n <span\n data-testclass=\"reaction-list-reaction-count\"\n class=\"str-chat__message-reaction-count\"\n >\n {{ messageReactionCounts[reactionType] }}\n </span>\n </li>\n <li>\n <span\n data-testid=\"reactions-count\"\n class=\"str-chat__reaction-list--counter\"\n >{{ reactionsCount }}</span\n >\n </li>\n </ul>\n</div>\n\n<div\n #selectorContainer\n class=\"str-chat__reaction-selector str-chat__message-reaction-selector\"\n *ngIf=\"isSelectorOpen\"\n data-testid=\"reaction-selector\"\n>\n <div\n *ngIf=\"tooltipText\"\n data-testid=\"tooltip\"\n #selectorTooltip\n class=\"str-chat__reaction-selector-tooltip\"\n [ngStyle]=\"{\n left: tooltipPositions?.tooltip + 'px',\n visibility: tooltipPositions ? 'visible' : 'hidden'\n }\"\n >\n <div\n class=\"arrow\"\n [ngStyle]=\"{ left: tooltipPositions?.arrow + 'px' }\"\n ></div>\n <span class=\"latest-user-username\">\n {{ tooltipText }}\n </span>\n </div>\n <ul\n class=\"str-chat__message-reactions-list str-chat__message-reactions-options\"\n >\n <li\n class=\"\n str-chat__message-reactions-option\n str-chat__message-reactions-list-item\n str-chat__emoji\n \"\n *ngFor=\"\n let reactionType of reactionOptions;\n trackBy: trackByMessageReaction\n \"\n [class.str-chat__message-reactions-option-selected]=\"\n isOwnReaction(reactionType)\n \"\n data-testclass=\"emoji-option\"\n (click)=\"react(reactionType)\"\n (keyup.enter)=\"react(reactionType)\"\n >\n <div\n *ngIf=\"getLatestUserByReaction(reactionType) as user\"\n class=\"latest-user str-chat__message-reactions-last-user\"\n (click)=\"hideTooltip()\"\n (keyup.enter)=\"hideTooltip()\"\n (mouseenter)=\"showTooltip($event, reactionType)\"\n (mouseleave)=\"hideTooltip()\"\n attr.data-testid=\"{{ reactionType }}-last-user\"\n >\n <stream-avatar-placeholder\n attr.data-testid=\"{{ reactionType }}-avatar\"\n [imageUrl]=\"user.image\"\n [name]=\"user.name || user.id\"\n [size]=\"20\"\n location=\"reaction\"\n ></stream-avatar-placeholder>\n </div>\n <span\n class=\"\n emoji\n str-chat__emoji-selector-emoji-angular\n str-chat__message-reaction-emoji\n \"\n >\n {{ getEmojiByReaction(reactionType) }}\n </span>\n <span\n *ngIf=\"\n messageReactionCounts[reactionType] &&\n messageReactionCounts[reactionType]! > 0\n \"\n class=\"str-chat__message-reactions-list-item__count\"\n attr.data-testid=\"{{ reactionType }}-reaction-count\"\n >\n {{ messageReactionCounts[reactionType] }}\n </span>\n </li>\n </ul>\n</div>\n\n<ng-container *ngIf=\"selectedReactionType\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: {\n isOpen: !!selectedReactionType,\n messageId: messageId,\n reactionType: selectedReactionType,\n isOpenChangeHandler: isOpenChange,\n content: modalContent\n }\n \"\n ></ng-container>\n</ng-container>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-messageId=\"messageId\"\n let-reactionType=\"reactionType\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n class=\"str-chat__message-reactions-details-modal\"\n [isOpen]=\"isOpen\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n [content]=\"content\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #modalContent>\n <div class=\"str-chat__message-reactions-details\">\n <div class=\"str-chat__message-reactions-details-reaction-types\">\n <div\n class=\"str-chat__message-reactions-details-reaction-type\"\n *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n [ngStyle]=\"{\n cursor: shouldHandleReactionClick ? 'pointer' : 'default'\n }\"\n attr.data-testid=\"reaction-details-selector-{{ reactionType }}\"\n [class.str-chat__message-reactions-details-reaction-type--selected]=\"\n reactionType === selectedReactionType\n \"\n (click)=\"selectedReactionType = reactionType; allUsers.scrollTop = 0\"\n (keyup.enter)=\"\n selectedReactionType = reactionType; allUsers.scrollTop = 0\n \"\n >\n <span class=\"emoji str-chat__message-reaction-emoji\">\n {{ getEmojiByReaction(reactionType) }}&nbsp;\n </span>\n <span class=\"str-chat__message-reaction-count\">\n {{ messageReactionCounts[reactionType] }}\n </span>\n </div>\n </div>\n <div\n class=\"\n emoji\n str-chat__message-reaction-emoji str-chat__message-reaction-emoji-big\n \"\n >\n {{ getEmojiByReaction(selectedReactionType!) }}\n </div>\n <div\n #allUsers\n data-testid=\"all-reacting-users\"\n class=\"str-chat__message-reactions-details-reacting-users\"\n >\n <stream-loading-indicator\n *ngIf=\"isLoading; else reactions\"\n ></stream-loading-indicator>\n <ng-template #reactions>\n <div\n class=\"str-chat__message-reactions-details-reacting-user\"\n *ngFor=\"\n let user of getAllUsersByReaction(selectedReactionType);\n trackBy: trackByUserId\n \"\n >\n <stream-avatar-placeholder\n data-testclass=\"avatar\"\n class=\"str-chat__avatar str-chat__avatar--circle\"\n [size]=\"30\"\n [imageUrl]=\"user.image\"\n [name]=\"user.name\"\n type=\"user\"\n location=\"reaction\"\n [user]=\"user\"\n ></stream-avatar-placeholder>\n <span\n data-testclass=\"reaction-user-username\"\n class=\"str-chat__user-item--name\"\n >{{ user.name }}</span\n >\n </div>\n </ng-template>\n </div>\n </div>\n</ng-template>\n","import {\n Component,\n ElementRef,\n Input,\n OnChanges,\n SimpleChanges,\n ViewChild,\n OnDestroy,\n OnInit,\n ChangeDetectorRef,\n ChangeDetectionStrategy,\n NgZone,\n AfterViewInit,\n} from '@angular/core';\nimport { Attachment, UserResponse } from 'stream-chat';\nimport { ChannelService } from '../channel.service';\nimport { ChatClientService } from '../chat-client.service';\nimport {\n AttachmentListContext,\n MentionTemplateContext,\n MessageActionsBoxContext,\n MessageReactionsContext,\n DefaultStreamChatGenerics,\n StreamMessage,\n DeliveredStatusContext,\n SendingStatusContext,\n ReadStatusContext,\n CustomMessageActionItem,\n SystemMessageContext,\n CustomMetadataContext,\n} from '../types';\nimport emojiRegex from 'emoji-regex';\nimport { Subscription } from 'rxjs';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { listUsers } from '../list-users';\nimport { ThemeService } from '../theme.service';\nimport {\n NgxPopperjsTriggers,\n NgxPopperjsPlacements,\n NgxPopperjsContentComponent,\n} from 'ngx-popperjs';\nimport { DateParserService } from '../date-parser.service';\nimport { MessageService } from '../message.service';\nimport { MessageActionsService } from '../message-actions.service';\n\ntype MessagePart = {\n content: string;\n type: 'text' | 'mention';\n user?: UserResponse;\n};\n\n/**\n * The `Message` component displays a message with additional information such as sender and date, and enables [interaction with the message (i.e. edit or react)](../concepts/message-interactions.mdx).\n */\n@Component({\n selector: 'stream-message',\n templateUrl: './message.component.html',\n styles: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MessageComponent\n implements OnInit, OnChanges, OnDestroy, AfterViewInit\n{\n /**\n * The message to be displayed\n */\n @Input() message: StreamMessage | undefined;\n /**\n * The list of [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) that are enabled for the current user, the list of [supported interactions](../concepts/message-interactions.mdx) can be found in our message interaction guide. Unathorized actions won't be displayed on the UI. The [`MessageList`](./MessageListComponent.mdx) component automatically sets this based on [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).\n */\n @Input() enabledMessageActions: string[] = [];\n /**\n * If `true`, the message status (sending, sent, who read the message) is displayed.\n */\n @Input() isLastSentMessage: boolean | undefined;\n /**\n * Determines if the message is being dispalyed in a channel or in a [thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript).\n */\n @Input() mode: 'thread' | 'main' = 'main';\n /**\n * Highlighting is used to add visual emphasize to a message when jumping to the message\n */\n @Input() isHighlighted = false;\n /**\n * A list of custom message actions to be displayed in the action box\n *\n * @deprecated please use the [`MessageActionsService`](https://getstream.io/chat/docs/sdk/angular/services/MessageActionsService) to set this property.\n */\n @Input() customActions: CustomMessageActionItem[] = [];\n readonly themeVersion: '1' | '2';\n canReceiveReadEvents: boolean | undefined;\n canReactToMessage: boolean | undefined;\n isActionBoxOpen = false;\n isEditedFlagOpened = false;\n isReactionSelectorOpen = false;\n visibleMessageActionsCount = 0;\n messageTextParts: MessagePart[] | undefined = [];\n messageText?: string;\n popperTriggerClick = NgxPopperjsTriggers.click;\n popperTriggerHover = NgxPopperjsTriggers.hover;\n popperPlacementAuto = NgxPopperjsPlacements.AUTO;\n popperPlacementTop = NgxPopperjsPlacements.TOP;\n shouldDisplayTranslationNotice = false;\n displayedMessageTextContent: 'original' | 'translation' = 'original';\n imageAttachmentModalState: 'opened' | 'closed' = 'closed';\n shouldDisplayThreadLink = false;\n isSentByCurrentUser = false;\n readByText = '';\n displayAs: 'text' | 'html';\n lastReadUser: UserResponse<DefaultStreamChatGenerics> | undefined = undefined;\n isOnlyReadByMe = false;\n isReadByMultipleUsers = false;\n isMessageDeliveredAndRead = false;\n parsedDate = '';\n pasedEditedDate = '';\n areOptionsVisible = false;\n hasAttachment = false;\n hasReactions = false;\n replyCountParam: { replyCount: number | undefined } = {\n replyCount: undefined,\n };\n canDisplayReadStatus = false;\n private quotedMessageAttachments: Attachment[] | undefined;\n private subscriptions: Subscription[] = [];\n private isViewInited = false;\n private userId?: string;\n @ViewChild('container') private container:\n | ElementRef<HTMLElement>\n | undefined;\n private readonly urlRegexp =\n /(?:(?:https?|ftp|file):\\/\\/|www\\.|ftp\\.)(?:\\([-A-Z0-9+&@#/%=~_|$?!:,.]*\\)|[-A-Z0-9+&@#/%=~_|$?!:,.])*(?:\\([-A-Z0-9+&@#/%=~_|$?!:,.]*\\)|[A-Z0-9+&@#/%=~_|$])/gim;\n private emojiRegexp = new RegExp(emojiRegex(), 'g');\n\n constructor(\n private chatClientService: ChatClientService,\n private channelService: ChannelService,\n public customTemplatesService: CustomTemplatesService,\n private cdRef: ChangeDetectorRef,\n themeService: ThemeService,\n private dateParser: DateParserService,\n private ngZone: NgZone,\n private messageService: MessageService,\n private messageActionsService: MessageActionsService\n ) {\n this.themeVersion = themeService.themeVersion;\n this.displayAs = this.messageService.displayAs;\n }\n\n ngOnInit(): void {\n this.subscriptions.push(\n this.chatClientService.user$.subscribe((u) => {\n if (u?.id !== this.userId) {\n this.userId = u?.id;\n this.setIsSentByCurrentUser();\n this.setLastReadUser();\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n })\n );\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.message) {\n this.shouldDisplayTranslationNotice = false;\n this.displayedMessageTextContent = 'original';\n this.createMessageParts();\n const originalAttachments = this.message?.quoted_message?.attachments;\n this.quotedMessageAttachments =\n originalAttachments && originalAttachments.length\n ? [originalAttachments[0]]\n : [];\n this.setIsSentByCurrentUser();\n this.setLastReadUser();\n this.readByText = this.message?.readBy\n ? listUsers(this.message.readBy)\n : '';\n this.isOnlyReadByMe = !!(\n this.message &&\n this.message.readBy &&\n this.message.readBy.length === 0\n );\n this.isReadByMultipleUsers = !!(\n this.message &&\n this.message.readBy &&\n this.message.readBy.length > 1\n );\n this.isMessageDeliveredAndRead = !!(\n this.message &&\n this.message.readBy &&\n this.message.status === 'received' &&\n this.message.readBy.length > 0\n );\n this.parsedDate =\n (this.message &&\n this.message.created_at &&\n this.dateParser.parseDateTime(this.message.created_at)) ||\n '';\n this.pasedEditedDate =\n (this.message &&\n this.message.message_text_updated_at &&\n this.dateParser.parseDateTime(\n new Date(this.message.message_text_updated_at)\n )) ||\n '';\n this.hasAttachment =\n !!this.message?.attachments && !!this.message.attachments.length;\n this.hasReactions =\n !!this.message?.reaction_counts &&\n Object.keys(this.message.reaction_counts).length > 0;\n this.replyCountParam = { replyCount: this.message?.reply_count };\n }\n if (changes.enabledMessageActions) {\n this.canReactToMessage =\n this.enabledMessageActions.indexOf('send-reaction') !== -1;\n this.canReceiveReadEvents =\n this.enabledMessageActions.indexOf('read-events') !== -1;\n this.canDisplayReadStatus =\n this.canReceiveReadEvents !== false &&\n this.enabledMessageActions.indexOf('read-events') !== -1;\n }\n if (changes.message || changes.enabledMessageActions || changes.mode) {\n this.shouldDisplayThreadLink =\n !!this.message?.reply_count && this.mode !== 'thread';\n }\n if (changes.message || changes.mode) {\n this.areOptionsVisible = this.message\n ? !(\n !this.message.type ||\n this.message.type === 'error' ||\n this.message.type === 'system' ||\n this.message.type === 'ephemeral' ||\n this.message.status === 'failed' ||\n this.message.status === 'sending' ||\n (this.mode === 'thread' && !this.message.parent_id)\n )\n : false;\n }\n if (\n changes.message ||\n changes.enabledMessageActions ||\n changes.customActions\n ) {\n if (this.message) {\n this.visibleMessageActionsCount =\n this.messageActionsService.getAuthorizedMessageActionsCount(\n this.message,\n this.enabledMessageActions\n );\n } else {\n this.visibleMessageActionsCount = 0;\n }\n }\n }\n\n ngAfterViewInit(): void {\n this.isViewInited = true;\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n messageActionsClicked() {\n if (!this.message) {\n return;\n }\n if (this.messageActionsService.customActionClickHandler) {\n this.messageActionsService.customActionClickHandler({\n message: this.message,\n enabledActions: this.enabledMessageActions,\n customActions: this.customActions,\n isMine: this.isSentByCurrentUser,\n });\n } else {\n this.isActionBoxOpen = !this.isActionBoxOpen;\n }\n }\n\n messageActionsBoxClicked(popperContent: NgxPopperjsContentComponent) {\n popperContent.hide();\n }\n\n getAttachmentListContext(): AttachmentListContext {\n return {\n messageId: this.message?.id || '',\n attachments: this.message?.attachments || [],\n parentMessageId: this.message?.parent_id,\n imageModalStateChangeHandler: (state) =>\n (this.imageAttachmentModalState = state),\n };\n }\n\n getMessageContext(): SystemMessageContext {\n return {\n message: this.message,\n enabledMessageActions: this.enabledMessageActions,\n isHighlighted: this.isHighlighted,\n isLastSentMessage: this.isLastSentMessage,\n mode: this.mode,\n customActions: this.customActions,\n parsedDate: this.parsedDate,\n };\n }\n\n getQuotedMessageAttachmentListContext(): AttachmentListContext {\n return {\n messageId: this.message?.quoted_message?.id || '',\n attachments: this.quotedMessageAttachments!,\n parentMessageId: this?.message?.quoted_message?.parent_id,\n };\n }\n\n getMessageReactionsContext(): MessageReactionsContext {\n return {\n messageReactionCounts: this.message?.reaction_counts || {},\n latestReactions: this.message?.latest_reactions || [],\n isSelectorOpen: this.isReactionSelectorOpen,\n isSelectorOpenChangeHandler: (isOpen) =>\n (this.isReactionSelectorOpen = isOpen),\n messageId: this.message?.id,\n ownReactions: this.message?.own_reactions || [],\n };\n }\n\n messageClicked() {\n if (\n this.message?.status === 'failed' &&\n this.message?.errorStatusCode !== 403\n ) {\n this.resendMessage();\n } else if (\n this.message?.type === 'error' &&\n this.message?.moderation_details\n ) {\n this.openMessageBouncePrompt();\n } else {\n this.isEditedFlagOpened = !this.isEditedFlagOpened;\n }\n }\n\n resendMessage() {\n void this.channelService.resendMessage(this.message!);\n }\n\n setAsActiveParentMessage() {\n void this.channelService.setAsActiveParentMessage(this.message);\n }\n\n getMentionContext(messagePart: MessagePart): MentionTemplateContext {\n return {\n content: messagePart.content,\n user: messagePart.user!,\n };\n }\n\n getMessageActionsBoxContext(): MessageActionsBoxContext {\n return {\n isOpen: this.isActionBoxOpen,\n isMine: this.isSentByCurrentUser,\n enabledActions: this.enabledMessageActions,\n message: this.message,\n displayedActionsCountChaneHanler: (count) => {\n this.visibleMessageActionsCount = count;\n // message action box changes UI bindings in parent, so we'll have to rerun change detection\n this.cdRef.detectChanges();\n },\n displayedActionsCountChangeHandler: (count) => {\n this.visibleMessageActionsCount = count;\n // message action box changes UI bindings in parent, so we'll have to rerun change detection\n this.cdRef.detectChanges();\n },\n customActions: this.customActions || [],\n };\n }\n\n getDeliveredStatusContext(): DeliveredStatusContext {\n return {\n message: this.message!,\n };\n }\n\n getSendingStatusContext(): SendingStatusContext {\n return {\n message: this.message!,\n };\n }\n\n getReadStatusContext(): ReadStatusContext {\n return {\n message: this.message!,\n readByText: this.readByText,\n };\n }\n\n getMessageMetadataContext(): CustomMetadataContext {\n return {\n message: this.message!,\n };\n }\n\n jumpToMessage(messageId: string, parentMessageId?: string) {\n void this.channelService.jumpToMessage(messageId, parentMessageId);\n }\n\n displayTranslatedMessage() {\n this.createMessageParts(true);\n }\n\n displayOriginalMessage() {\n this.createMessageParts(false);\n }\n\n openMessageBouncePrompt() {\n this.channelService.bouncedMessage$.next(this.message);\n }\n\n private createMessageParts(shouldTranslate = true) {\n this.messageTextParts = undefined;\n this.messageText = undefined;\n let content = this.getMessageContent(shouldTranslate);\n if (\n (!this.message!.mentioned_users ||\n this.message!.mentioned_users.length === 0) &&\n !content?.match(this.emojiRegexp) &&\n !content?.match(this.urlRegexp)\n ) {\n this.messageTextParts = undefined;\n this.messageText = content;\n return;\n }\n if (!content) {\n return;\n }\n if (\n !this.message!.mentioned_users ||\n this.message!.mentioned_users.length === 0\n ) {\n content = this.fixEmojiDisplay(content);\n content = this.wrapLinksWithAnchorTag(content);\n this.messageTextParts = [{ content, type: 'text' }];\n } else {\n this.messageTextParts = [];\n let text = content;\n this.message!.mentioned_users.forEach((user) => {\n const mention = `@${user.name || user.id}`;\n const precedingText = text.substring(0, text.indexOf(mention));\n let formattedPrecedingText = this.fixEmojiDisplay(precedingText);\n formattedPrecedingText = this.wrapLinksWithAnchorTag(\n formattedPrecedingText\n );\n this.messageTextParts!.push({\n content: formattedPrecedingText,\n type: 'text',\n });\n this.messageTextParts!.push({\n content: mention,\n type: 'mention',\n user,\n });\n text = text.replace(precedingText + mention, '');\n });\n if (text) {\n text = this.fixEmojiDisplay(text);\n text = this.wrapLinksWithAnchorTag(text);\n this.messageTextParts.push({ content: text, type: 'text' });\n }\n }\n }\n\n private getMessageContent(shouldTranslate: boolean) {\n const originalContent = this.message?.text;\n if (shouldTranslate) {\n const translation = this.message?.translation;\n if (translation) {\n this.shouldDisplayTranslationNotice = true;\n this.displayedMessageTextContent = 'translation';\n }\n return translation || originalContent;\n } else {\n this.displayedMessageTextContent = 'original';\n return originalContent;\n }\n }\n\n private fixEmojiDisplay(content: string) {\n // Wrap emojis in span to display emojis correctly in Chrome https://bugs.chromium.org/p/chromium/issues/detail?id=596223\n // Based on this: https://stackoverflow.com/questions/4565112/javascript-how-to-find-out-if-the-user-browser-is-chrome\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n const isChrome =\n !!(window as any).chrome && typeof (window as any).opr === 'undefined';\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n content = content.replace(\n this.emojiRegexp,\n (match) =>\n `<span ${\n isChrome ? 'class=\"str-chat__emoji-display-fix\"' : ''\n }>${match}</span>`\n );\n\n return content;\n }\n\n private wrapLinksWithAnchorTag(content: string) {\n if (this.displayAs === 'html') {\n return content;\n }\n content = content.replace(this.urlRegexp, (match) =>\n this.messageService.customLinkRenderer\n ? this.messageService.customLinkRenderer(match)\n : `<a href=\"${match}\" target=\"_blank\" rel=\"nofollow\">${match}</a>`\n );\n\n return content;\n }\n\n private setIsSentByCurrentUser() {\n this.isSentByCurrentUser = this.message?.user?.id === this.userId;\n }\n\n private setLastReadUser() {\n this.lastReadUser = this.message?.readBy?.filter(\n (u) => u.id !== this.userId\n )[0];\n }\n}\n","<div\n #container\n class=\"str-chat__message-simple str-chat__message str-chat__message--{{\n message?.type\n }} str-chat__message--{{ message?.status }} {{\n message?.text ? 'str-chat__message--has-text' : 'has-no-text'\n }}\"\n [class.str-chat__message--me]=\"isSentByCurrentUser\"\n [class.str-chat__message--other]=\"!isSentByCurrentUser\"\n [class.str-chat__message-simple--me]=\"isSentByCurrentUser\"\n [class.str-chat__message--has-attachment]=\"hasAttachment\"\n [class.str-chat__message--with-reactions]=\"hasReactions\"\n [class.str-chat__message--highlighted]=\"isHighlighted\"\n [class.str-chat__message-with-thread-link]=\"shouldDisplayThreadLink\"\n [class.str-chat__message-send-can-be-retried]=\"\n (message?.status === 'failed' && message?.errorStatusCode !== 403) ||\n (message?.type === 'error' && message?.moderation_details)\n \"\n data-testid=\"message-container\"\n>\n <ng-container *ngIf=\"!message?.deleted_at; else deletedMessage\">\n <ng-container *ngIf=\"message?.type !== 'system'; else systemMessage\">\n <ng-container *ngIf=\"themeVersion === '1'\">\n <ng-container *ngTemplateOutlet=\"messageStatus\"></ng-container>\n </ng-container>\n <stream-avatar-placeholder\n data-testid=\"avatar\"\n class=\"str-chat-angular__avatar-host str-chat__message-sender-avatar\"\n [imageUrl]=\"message?.user?.image\"\n [name]=\"message?.user?.name || message?.user?.id\"\n type=\"user\"\n location=\"message-sender\"\n [user]=\"message?.user || undefined\"\n ></stream-avatar-placeholder>\n <div class=\"str-chat__message-inner\">\n <div\n class=\"str-chat__message-simple__actions str-chat__message-options\"\n data-testid=\"message-options\"\n [class.str-chat__message-actions-open]=\"isActionBoxOpen\"\n *ngIf=\"areOptionsVisible\"\n >\n <div\n data-testid=\"message-actions-container\"\n #messageActionsToggle\n class=\"\n str-chat__message-actions-container\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--options\n \"\n [popper]=\"popperContent\"\n [popperTrigger]=\"popperTriggerClick\"\n [popperPlacement]=\"popperPlacementAuto\"\n [popperHideOnScroll]=\"false\"\n [popperHideOnClickOutside]=\"true\"\n [popperHideOnMouseLeave]=\"false\"\n [popperDisableAnimation]=\"true\"\n (popperOnHidden)=\"isActionBoxOpen = false\"\n >\n <popper-content #popperContent>\n <ng-template\n #defaultMessageActionsBox\n let-isOpen=\"isOpen\"\n let-isMine=\"isMine\"\n let-enabledActions=\"enabledActions\"\n let-messageInput=\"message\"\n let-customActions=\"customActions\"\n >\n <stream-message-actions-box\n (click)=\"messageActionsBoxClicked(popperContent)\"\n *ngIf=\"isOpen\"\n [isOpen]=\"isOpen\"\n [isMine]=\"isMine\"\n [enabledActions]=\"enabledActions\"\n [customActions]=\"customActions\"\n [message]=\"messageInput\"\n ></stream-message-actions-box>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageActionsBoxTemplate$ | async) ||\n defaultMessageActionsBox;\n context: getMessageActionsBoxContext()\n \"\n >\n </ng-container>\n </popper-content>\n <div\n class=\"str-chat__message-actions-box-button\"\n data-testid=\"action-icon\"\n (click)=\"messageActionsClicked()\"\n (keyup.enter)=\"messageActionsClicked()\"\n *ngIf=\"visibleMessageActionsCount > 0\"\n >\n <stream-icon-placeholder\n icon=\"action-icon\"\n class=\"str-chat__message-action-icon\"\n ></stream-icon-placeholder>\n </div>\n </div>\n <div\n *ngIf=\"\n enabledMessageActions.indexOf('send-reply') !== -1 &&\n mode === 'main'\n \"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--thread\n str-chat__message-reply-in-thread-button\n \"\n data-testid=\"reply-in-thread\"\n (click)=\"setAsActiveParentMessage()\"\n (keyup.enter)=\"setAsActiveParentMessage()\"\n >\n <stream-icon-placeholder\n class=\"str-chat__message-action-icon\"\n icon=\"reply-in-thread\"\n ></stream-icon-placeholder>\n </div>\n <div\n *ngIf=\"canReactToMessage\"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--reactions\n str-chat__message-reactions-button\n \"\n data-testid=\"reaction-icon\"\n (click)=\"isReactionSelectorOpen = !isReactionSelectorOpen\"\n (keyup.enter)=\"isReactionSelectorOpen = !isReactionSelectorOpen\"\n >\n <stream-icon-placeholder\n class=\"str-chat__message-action-icon\"\n icon=\"reaction-icon\"\n ></stream-icon-placeholder>\n </div>\n </div>\n <div class=\"str-chat__message-reactions-host\">\n <ng-template\n #defaultMessageReactions\n let-messageReactionCounts=\"messageReactionCounts\"\n let-latestReactions=\"latestReactions\"\n let-isSelectorOpen=\"isSelectorOpen\"\n let-isSelectorOpenChangeHandler=\"isSelectorOpenChangeHandler\"\n let-messageId=\"messageId\"\n let-ownReactions=\"ownReactions\"\n >\n <stream-message-reactions\n [messageReactionCounts]=\"messageReactionCounts\"\n [latestReactions]=\"latestReactions\"\n [isSelectorOpen]=\"isSelectorOpen\"\n (isSelectorOpenChange)=\"isSelectorOpenChangeHandler($event)\"\n [messageId]=\"messageId\"\n [ownReactions]=\"ownReactions\"\n ></stream-message-reactions>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.messageReactionsTemplate$ | async) ||\n defaultMessageReactions;\n context: getMessageReactionsContext()\n \"\n ></ng-container>\n </div>\n <div\n class=\"str-chat__message-bubble str-chat-angular__message-bubble\"\n [class.str-chat-angular__message-bubble--attachment-modal-open]=\"\n imageAttachmentModalState === 'opened'\n \"\n >\n <ng-container *ngIf=\"hasAttachment && !message?.quoted_message\">\n <ng-container\n *ngTemplateOutlet=\"attachmentsTemplate\"\n ></ng-container>\n </ng-container>\n <div\n class=\"str-chat__message-text\"\n tabindex=\"0\"\n *ngIf=\"message?.text || (message?.quoted_message && hasAttachment)\"\n [class.str-chat__message-text--pointer-cursor]=\"\n (message?.status === 'failed' &&\n message?.errorStatusCode !== 403) ||\n (this.message?.type === 'error' &&\n this.message?.moderation_details) ||\n message?.message_text_updated_at\n \"\n (click)=\"messageClicked()\"\n (keyup.enter)=\"messageClicked()\"\n >\n <div\n data-testid=\"inner-message\"\n class=\"\n str-chat__message-text-inner str-chat__message-simple-text-inner\n \"\n [class.str-chat__message-light-text-inner--has-attachment]=\"\n hasAttachment\n \"\n >\n <ng-container *ngTemplateOutlet=\"quotedMessage\"></ng-container>\n <ng-container *ngIf=\"hasAttachment && message?.quoted_message\">\n <ng-container\n *ngTemplateOutlet=\"attachmentsTemplate\"\n ></ng-container>\n </ng-container>\n <div\n data-testid=\"client-error-message\"\n *ngIf=\"message?.type === 'error'\"\n class=\"\n str-chat__simple-message--error-message\n str-chat__message--error-message\n \"\n >\n <ng-container *ngIf=\"!message?.moderation_details\">{{\n \"streamChat.Error · Unsent\" | translate\n }}</ng-container>\n </div>\n <div\n data-testid=\"error-message\"\n *ngIf=\"message?.status === 'failed'\"\n class=\"\n str-chat__simple-message--error-message\n str-chat__message--error-message\n \"\n >\n {{\n (message?.errorStatusCode === 403\n ? \"streamChat.Message Failed · Unauthorized\"\n : \"streamChat.Message Failed · Click to try again\"\n ) | translate\n }}\n </div>\n <div data-testid=\"text\">\n <p>\n <ng-container *ngIf=\"messageTextParts; else defaultContent\">\n <!-- eslint-disable-next-line @angular-eslint/template/use-track-by-function -->\n <ng-container *ngFor=\"let part of messageTextParts\">\n <span\n *ngIf=\"part.type === 'text'; else mention\"\n [innerHTML]=\"part.content\"\n ></span>\n <ng-template #mention>\n <ng-template #defaultMention let-content=\"content\">\n <span class=\"str-chat__message-mention\">{{\n content\n }}</span>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.mentionTemplate$ | async) ||\n defaultMention;\n context: getMentionContext(part)\n \"\n ></ng-container>\n </ng-template>\n </ng-container>\n </ng-container>\n <ng-template #defaultContent>\n <ng-container *ngIf=\"displayAs === 'text'; else asHTML\">\n {{ messageText || \"\" }}\n </ng-container>\n <ng-template #asHTML\n ><span\n data-testid=\"html-content\"\n [innerHTML]=\"messageText\"\n ></span\n ></ng-template>\n </ng-template>\n </p>\n </div>\n </div>\n </div>\n <stream-icon-placeholder\n *ngIf=\"themeVersion === '2'\"\n class=\"str-chat__message-error-icon\"\n icon=\"error\"\n ></stream-icon-placeholder>\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n replyCountButton;\n context: { position: 'inside-message-bubble' }\n \"\n ></ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n messageDateAndSender;\n context: { position: 'inside-message-bubble' }\n \"\n ></ng-container>\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n replyCountButton;\n context: { position: 'outside-message-bubble', message: message }\n \"\n ></ng-container>\n\n <ng-container\n *ngTemplateOutlet=\"\n messageDateAndSender;\n context: { position: 'outside-message-bubble' }\n \"\n ></ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<ng-template #deletedMessage>\n <div data-testid=\"message-deleted-component\">\n <div class=\"str-chat__message--deleted-inner\" translate>\n streamChat.This message was deleted...\n </div>\n </div>\n</ng-template>\n\n<ng-template #systemMessage>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.systemMessageTemplate$ | async) ||\n defaultSystemMessage;\n context: getMessageContext()\n \"\n ></ng-container>\n <ng-template #defaultSystemMessage let-messageInput=\"message\">\n <div data-testid=\"system-message\" class=\"str-chat__message--system\">\n <div class=\"str-chat__message--system__text\">\n <div class=\"str-chat__message--system__line\"></div>\n <p>{{ messageInput?.text }}</p>\n <div class=\"str-chat__message--system__line\"></div>\n </div>\n <div class=\"str-chat__message--system__date\">\n {{ parsedDate }}\n </div>\n </div>\n </ng-template>\n</ng-template>\n\n<ng-template #quotedMessage>\n <div\n *ngIf=\"message?.quoted_message\"\n class=\"quoted-message str-chat__quoted-message-preview\"\n data-testid=\"quoted-message-container\"\n [class.mine]=\"isSentByCurrentUser\"\n (click)=\"\n jumpToMessage(\n (message?.quoted_message)!.id,\n message?.quoted_message?.parent_id\n )\n \"\n (keyup.enter)=\"\n jumpToMessage(\n (message?.quoted_message)!.id,\n message?.quoted_message?.parent_id\n )\n \"\n >\n <stream-avatar-placeholder\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host str-chat__message-sender-avatar\"\n [imageUrl]=\"message?.quoted_message?.user?.image\"\n [name]=\"\n message?.quoted_message?.user?.name || message?.quoted_message?.user?.id\n \"\n [size]=\"20\"\n type=\"user\"\n location=\"quoted-message-sender\"\n [user]=\"message?.quoted_message?.user || undefined\"\n ></stream-avatar-placeholder>\n <div class=\"quoted-message-inner str-chat__quoted-message-bubble\">\n <ng-container\n *ngIf=\"\n message?.quoted_message?.attachments &&\n message?.quoted_message?.attachments?.length\n \"\n >\n <ng-template\n #defaultAttachments\n let-messageId=\"messageId\"\n let-attachments=\"attachments\"\n let-parentMessageId=\"parentMessageId\"\n let-imageModalStateChangeHandler=\"imageModalStateChangeHandler\"\n >\n <stream-attachment-list\n [messageId]=\"messageId\"\n [attachments]=\"attachments\"\n [parentMessageId]=\"parentMessageId\"\n (imageModalStateChange)=\"imageModalStateChangeHandler($event)\"\n ></stream-attachment-list>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.attachmentListTemplate$ | async) ||\n defaultAttachments;\n context: getQuotedMessageAttachmentListContext()\n \"\n ></ng-container>\n </ng-container>\n <div\n data-testid=\"quoted-message-text\"\n [innerHTML]=\"\n message?.quoted_message?.translation ||\n message?.quoted_message?.html ||\n message?.quoted_message?.text\n \"\n ></div>\n </div>\n </div>\n</ng-template>\n\n<!-- We need these markups in slightly different positions in theme-v1 and theme-v2, this soultion makes that possible without duplicating the code -->\n<ng-template #messageDateAndSender let-position=\"position\">\n <ng-container\n *ngIf=\"\n (position === 'inside-message-bubble' && themeVersion === '1') ||\n (position === 'outside-message-bubble' && themeVersion === '2')\n \"\n >\n <div\n class=\"str-chat__translation-notice\"\n *ngIf=\"shouldDisplayTranslationNotice\"\n data-testid=\"translation-notice\"\n >\n <button\n data-testid=\"see-original\"\n *ngIf=\"displayedMessageTextContent === 'translation'\"\n (click)=\"displayOriginalMessage()\"\n (keyup.enter)=\"displayOriginalMessage()\"\n translate\n >\n streamChat.See original (automatically translated)\n </button>\n <button\n data-testid=\"see-translation\"\n *ngIf=\"displayedMessageTextContent === 'original'\"\n (click)=\"displayTranslatedMessage()\"\n (keyup.enter)=\"displayTranslatedMessage()\"\n translate\n >\n streamChat.See translation\n </button>\n </div>\n <ng-container\n *ngIf=\"customTemplatesService.customMessageMetadataTemplate$ | async\"\n >\n <div class=\"str-chat__custom-message-metadata\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.customMessageMetadataTemplate$ | async)!;\n context: getMessageMetadataContext()\n \"\n ></ng-container>\n </div>\n </ng-container>\n <div\n class=\"\n str-chat__message-data\n str-chat__message-simple-data\n str-chat__message-metadata\n \"\n >\n <ng-container *ngIf=\"themeVersion === '2'\">\n <ng-container *ngTemplateOutlet=\"messageStatus\"></ng-container>\n </ng-container>\n <span\n data-testid=\"sender\"\n *ngIf=\"!isSentByCurrentUser\"\n class=\"str-chat__message-simple-name str-chat__message-sender-name\"\n >\n {{ message?.user?.name ? message?.user?.name : message?.user?.id }}\n </span>\n <span\n data-testid=\"date\"\n class=\"str-chat__message-simple-timestamp str-chat__message-simple-time\"\n >\n {{ parsedDate }}\n </span>\n <ng-container *ngIf=\"message?.message_text_updated_at\">\n <span\n data-testid=\"edited-flag\"\n class=\"str-chat__mesage-simple-edited\"\n translate\n >streamChat.Edited</span\n >\n <div\n data-testid=\"edited-timestamp\"\n class=\"str-chat__message-edited-timestamp\"\n [ngClass]=\"{\n 'str-chat__message-edited-timestamp--open': isEditedFlagOpened,\n 'str-chat__message-edited-timestamp--collapsed': !isEditedFlagOpened\n }\"\n >\n <span translate>streamChat.Edited</span>\n <time\n dateTime=\"{{ message?.message_text_updated_at }}\"\n title=\"{{ message?.message_text_updated_at }}\"\n >\n {{ pasedEditedDate }}\n </time>\n </div>\n </ng-container>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #messageStatus>\n <ng-container\n *ngIf=\"\n isSentByCurrentUser &&\n ((isLastSentMessage && message?.status === 'received') ||\n message?.status === 'sending')\n \"\n >\n <ng-container *ngIf=\"message?.status === 'sending'; else sentStatus\">\n <ng-container *ngTemplateOutlet=\"sendingStatus\"></ng-container>\n </ng-container>\n <ng-template #sentStatus>\n <ng-container\n *ngIf=\"\n mode === 'main' && isMessageDeliveredAndRead && canDisplayReadStatus;\n else deliveredStatus\n \"\n >\n <ng-container *ngTemplateOutlet=\"readStatus\"></ng-container>\n </ng-container>\n </ng-template>\n <ng-template #deliveredStatus>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.deliveredStatusTemplate$ | async) ||\n defaultDeliveredStatus;\n context: getDeliveredStatusContext()\n \"\n ></ng-container>\n </ng-template>\n <ng-template #defaultDeliveredStatus>\n <span\n *ngIf=\"mode === 'main'\"\n class=\"\n str-chat__message-simple-status\n str-chat__message-simple-status-angular\n str-chat__message-status\n \"\n data-testid=\"delivered-indicator\"\n tabindex=\"0\"\n [popper]=\"popperContent\"\n [popperTrigger]=\"popperTriggerHover\"\n [popperPlacement]=\"popperPlacementTop\"\n [popperHideOnScroll]=\"false\"\n [popperHideOnClickOutside]=\"false\"\n (hover)=\"$event.stopPropagation()\"\n >\n <popper-content #popperContent>\n <div class=\"str-chat__tooltip str-chat__tooltip-angular\">\n {{ \"streamChat.Delivered\" | translate }}\n </div>\n </popper-content>\n <stream-icon-placeholder\n data-testid=\"delivered-icon\"\n icon=\"delivered-icon\"\n ></stream-icon-placeholder>\n </span>\n </ng-template>\n <ng-template #sendingStatus>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.sendingStatusTemplate$ | async) ||\n defaultSendingStatus;\n context: getSendingStatusContext()\n \"\n ></ng-container>\n </ng-template>\n <ng-template #defaultSendingStatus>\n <span\n class=\"\n str-chat__message-simple-status\n str-chat__message-simple-status-angular\n str-chat__message-status\n \"\n data-testid=\"sending-indicator\"\n tabindex=\"0\"\n [popper]=\"popperContent\"\n [popperTrigger]=\"popperTriggerHover\"\n [popperPlacement]=\"popperPlacementTop\"\n [popperHideOnScroll]=\"false\"\n [popperHideOnClickOutside]=\"false\"\n (hover)=\"$event.stopPropagation()\"\n >\n <popper-content #popperContent>\n <div class=\"str-chat__tooltip str-chat__tooltip-angular\">\n {{ \"streamChat.Sending...\" | translate }}\n </div>\n </popper-content>\n <stream-loading-indicator-placeholder\n data-testid=\"loading-indicator\"\n ></stream-loading-indicator-placeholder>\n </span>\n </ng-template>\n <ng-template #readStatus>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.readStatusTemplate$ | async) ||\n defaultReadStatus;\n context: getReadStatusContext()\n \"\n ></ng-container>\n </ng-template>\n <ng-template #defaultReadStatus let-readByText=\"readByText\">\n <span\n class=\"\n str-chat__message-simple-status\n str-chat__message-simple-status-angular\n str-chat__message-status\n \"\n data-testid=\"read-indicator\"\n tabindex=\"0\"\n [popper]=\"popperContent\"\n [popperTrigger]=\"popperTriggerHover\"\n [popperPlacement]=\"popperPlacementTop\"\n [popperHideOnScroll]=\"false\"\n [popperHideOnClickOutside]=\"false\"\n (hover)=\"$event.stopPropagation()\"\n >\n <popper-content #popperContent>\n <div\n class=\"str-chat__tooltip str-chat__tooltip-angular\"\n data-testid=\"read-by-tooltip\"\n >\n {{ readByText }}\n </div>\n </popper-content>\n <stream-icon-placeholder icon=\"read-icon\"></stream-icon-placeholder>\n </span>\n </ng-template>\n </ng-container>\n</ng-template>\n\n<ng-template #replyCountButton let-position=\"position\">\n <div\n *ngIf=\"\n (position === 'inside-message-bubble' && themeVersion === '1') ||\n (position === 'outside-message-bubble' && themeVersion === '2')\n \"\n class=\"\n str-chat__message-simple-reply-button\n str-chat__message-replies-count-button-wrapper\n \"\n >\n <button\n *ngIf=\"shouldDisplayThreadLink\"\n class=\"str-chat__message-replies-count-button\"\n data-testid=\"reply-count-button\"\n (click)=\"setAsActiveParentMessage()\"\n >\n <stream-icon-placeholder\n *ngIf=\"themeVersion === '1'\"\n stream-icon-placeholder\n icon=\"reply\"\n ></stream-icon-placeholder>\n {{message?.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </button>\n </div>\n</ng-template>\n\n<ng-template #attachmentsTemplate>\n <ng-template\n #defaultAttachments\n let-messageId=\"messageId\"\n let-attachments=\"attachments\"\n let-parentMessageId=\"parentMessageId\"\n let-imageModalStateChangeHandler=\"imageModalStateChangeHandler\"\n >\n <stream-attachment-list\n [messageId]=\"messageId\"\n [attachments]=\"attachments\"\n [parentMessageId]=\"parentMessageId\"\n (imageModalStateChange)=\"imageModalStateChangeHandler($event)\"\n ></stream-attachment-list>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.attachmentListTemplate$ | async) ||\n defaultAttachments;\n context: getAttachmentListContext()\n \"\n ></ng-container>\n</ng-template>\n","import {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n HostBinding,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { ThemeService } from '../../theme.service';\nimport { EmojiInputService } from '../emoji-input.service';\nimport { TextareaInterface } from '../textarea.interface';\n\n/**\n * The `Textarea` component is used by the [`MessageInput`](./MessageInputComponent.mdx) component to display the input HTML element where users can type their message.\n */\n@Component({\n selector: 'stream-textarea',\n templateUrl: './textarea.component.html',\n styles: [],\n})\nexport class TextareaComponent\n implements TextareaInterface, OnChanges, OnDestroy, AfterViewInit\n{\n @HostBinding() class =\n 'str-chat__textarea str-chat__message-textarea-angular-host';\n /**\n * The value of the input HTML element.\n */\n @Input() value = '';\n /**\n * Placeholder of the textarea\n */\n @Input() placeholder = '';\n /**\n * See [`MessageInputConfigService`](../services/MessageInputConfigService.mdx) for more information\n */\n @Input() inputMode!: 'desktop' | 'mobile';\n /**\n * Enables or disables auto focus on the textarea element\n */\n @Input() autoFocus = true;\n /**\n * Emits the current value of the input element when a user types.\n */\n @Output() readonly valueChange = new EventEmitter<string>();\n /**\n * Emits when a user triggers a message send event (this happens when they hit the `Enter` key).\n */\n @Output() readonly send = new EventEmitter<void>();\n @ViewChild('input') private messageInput!: ElementRef<HTMLInputElement>;\n private subscriptions: Subscription[] = [];\n\n constructor(\n private emojiInputService: EmojiInputService,\n private themeService: ThemeService\n ) {\n this.subscriptions.push(\n this.emojiInputService.emojiInput$.subscribe((emoji) => {\n this.messageInput.nativeElement.focus();\n const { selectionStart } = this.messageInput.nativeElement;\n this.messageInput.nativeElement.setRangeText(emoji);\n this.messageInput.nativeElement.selectionStart =\n selectionStart! + emoji.length;\n this.messageInput.nativeElement.selectionEnd =\n selectionStart! + emoji.length;\n this.inputChanged();\n })\n );\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.value && !this.value && this.messageInput) {\n this.messageInput.nativeElement.style.height = 'auto';\n }\n }\n\n ngAfterViewInit(): void {\n if (this.messageInput.nativeElement.scrollHeight > 0 && this.value) {\n this.adjustTextareaHeight();\n }\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n inputChanged() {\n this.valueChange.emit(this.messageInput.nativeElement.value);\n this.adjustTextareaHeight();\n }\n\n enterHit(event: Event) {\n if (this.inputMode === 'desktop') {\n event.preventDefault();\n this.send.next();\n }\n }\n\n private adjustTextareaHeight() {\n if (this.themeService.themeVersion === '2') {\n this.messageInput.nativeElement.style.height = '';\n this.messageInput.nativeElement.style.height = `${this.messageInput.nativeElement.scrollHeight}px`;\n }\n }\n}\n","<textarea\n [value]=\"value || ''\"\n [autofocus]=\"autoFocus\"\n data-testid=\"textarea\"\n #input\n placeholder=\"{{ placeholder | translate }}\"\n class=\"\n rta__textarea\n str-chat__textarea__textarea\n str-chat__angular-textarea\n str-chat__message-textarea\n \"\n rows=\"1\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"enterHit($event)\"\n></textarea>\n","import { Injectable } from '@angular/core';\nimport transliterate from '@stream-io/transliterate';\n\n/**\n * The `TransliterationService` wraps the [@sindresorhus/transliterate](https://www.npmjs.com/package/@sindresorhus/transliterate) library\n */\n@Injectable({ providedIn: 'root' })\nexport class TransliterationService {\n constructor() {}\n\n /**\n *\n * @param s the string to be transliterated\n * @returns the result of the transliteration\n */\n transliterate(s: string) {\n return transliterate(s);\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n HostBinding,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { MentionConfig, Mentions } from 'angular-mentions';\nimport {\n MentionAutcompleteListItemContext,\n MentionAutcompleteListItem,\n CommandAutocompleteListItemContext,\n} from '../../types';\n\nimport { BehaviorSubject, Subscription } from 'rxjs';\nimport { UserResponse } from 'stream-chat';\nimport { ChannelService } from '../../channel.service';\nimport { TextareaInterface } from '../textarea.interface';\nimport { ChatClientService } from '../../chat-client.service';\nimport { debounceTime } from 'rxjs/operators';\nimport { TransliterationService } from '../../transliteration.service';\nimport { EmojiInputService } from '../emoji-input.service';\nimport { CustomTemplatesService } from '../../custom-templates.service';\nimport { ThemeService } from '../../theme.service';\n\n/**\n * The `AutocompleteTextarea` component is used by the [`MessageInput`](./MessageInputComponent.mdx) component to display the input HTML element where users can type their message.\n */\n@Component({\n selector: 'stream-autocomplete-textarea',\n templateUrl: './autocomplete-textarea.component.html',\n styles: [],\n})\nexport class AutocompleteTextareaComponent\n implements TextareaInterface, OnChanges, AfterViewInit\n{\n @HostBinding() class =\n 'str-chat__textarea str-chat__message-textarea-angular-host';\n /**\n * The value of the input HTML element.\n */\n @Input() value = '';\n /**\n * Placeholder of the textarea\n */\n @Input() placeholder = '';\n /**\n * If true, users can mention other users in messages. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.\n */\n @Input() areMentionsEnabled: boolean | undefined = true;\n /**\n * See [`MessageInputConfigService`](../services/MessageInputConfigService.mdx) for more information\n */\n @Input() inputMode!: 'desktop' | 'mobile';\n /**\n * The scope for user mentions, either members of the current channel of members of the application. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.\n */\n @Input() mentionScope: 'channel' | 'application' = 'channel';\n /**\n * Enables or disables auto focus on the textarea element\n */\n @Input() autoFocus = true;\n /**\n * Emits the current value of the input element when a user types.\n */\n @Output() readonly valueChange = new EventEmitter<string>();\n /**\n * Emits when a user triggers a message send event (this happens when they hit the `Enter` key).\n */\n @Output() readonly send = new EventEmitter<void>();\n /**\n * Emits the array of users that are mentioned in the message, it is updated when a user mentions a new user or deletes a mention.\n */\n @Output() readonly userMentions = new EventEmitter<UserResponse[]>();\n mentionAutocompleteItemTemplate:\n | TemplateRef<MentionAutcompleteListItemContext>\n | undefined;\n commandAutocompleteItemTemplate:\n | TemplateRef<CommandAutocompleteListItemContext>\n | undefined;\n themeVersion: '1' | '2';\n private readonly autocompleteKey = 'autocompleteLabel';\n private readonly mentionTriggerChar = '@';\n private readonly commandTriggerChar = '/';\n autocompleteConfig: MentionConfig = {\n mentions: [],\n };\n @ViewChild('input') private messageInput!: ElementRef<HTMLInputElement>;\n private subscriptions: Subscription[] = [];\n private mentionedUsers: UserResponse[] = [];\n private userMentionConfig: Mentions = {\n triggerChar: this.mentionTriggerChar,\n dropUp: true,\n labelKey: this.autocompleteKey,\n returnTrigger: true,\n mentionFilter: (\n searchString: string,\n items: { autocompleteLabel: string }[]\n ) => this.filter(searchString, items),\n mentionSelect: (item, triggerChar) =>\n this.itemSelectedFromAutocompleteList(item, triggerChar),\n };\n private slashCommandConfig: Mentions = {\n triggerChar: this.commandTriggerChar,\n dropUp: true,\n labelKey: 'name',\n returnTrigger: true,\n mentionFilter: (\n searchString: string,\n items: { autocompleteLabel: string }[]\n ) => this.filter(searchString, items),\n mentionSelect: (item, triggerChar) =>\n this.itemSelectedFromAutocompleteList(item, triggerChar),\n };\n private searchTerm$ = new BehaviorSubject<string>('');\n\n constructor(\n private channelService: ChannelService,\n private chatClientService: ChatClientService,\n private transliterationService: TransliterationService,\n private emojiInputService: EmojiInputService,\n private customTemplatesService: CustomTemplatesService,\n private themeService: ThemeService,\n private cdRef: ChangeDetectorRef\n ) {\n this.searchTerm$.pipe(debounceTime(300)).subscribe((searchTerm) => {\n if (searchTerm.startsWith(this.mentionTriggerChar)) {\n void this.updateMentionOptions(searchTerm);\n }\n });\n this.subscriptions.push(\n this.channelService.activeChannel$.subscribe((channel) => {\n const commands = channel?.getConfig()?.commands || [];\n this.slashCommandConfig.items = commands.map((c) => ({\n ...c,\n [this.autocompleteKey]: c.name,\n type: 'command',\n }));\n this.mentionedUsers = [];\n this.userMentions.next([...this.mentionedUsers]);\n void this.updateMentionOptions(this.searchTerm$.getValue());\n })\n );\n this.subscriptions.push(\n this.emojiInputService.emojiInput$.subscribe((emoji) => {\n this.messageInput.nativeElement.focus();\n const { selectionStart } = this.messageInput.nativeElement;\n this.messageInput.nativeElement.setRangeText(emoji);\n this.messageInput.nativeElement.selectionStart =\n selectionStart! + emoji.length;\n this.messageInput.nativeElement.selectionEnd =\n selectionStart! + emoji.length;\n this.inputChanged();\n })\n );\n this.subscriptions.push(\n this.customTemplatesService.mentionAutocompleteItemTemplate$.subscribe(\n (template) => (this.mentionAutocompleteItemTemplate = template)\n )\n );\n this.subscriptions.push(\n this.customTemplatesService.commandAutocompleteItemTemplate$.subscribe(\n (template) => (this.commandAutocompleteItemTemplate = template)\n )\n );\n this.autocompleteConfig.mentions = [\n this.userMentionConfig,\n this.slashCommandConfig,\n ];\n this.themeVersion = this.themeService.themeVersion;\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.areMentionsEnabled) {\n if (this.areMentionsEnabled) {\n this.autocompleteConfig.mentions = [\n this.userMentionConfig,\n this.slashCommandConfig,\n ];\n this.autocompleteConfig = { ...this.autocompleteConfig };\n } else {\n this.autocompleteConfig.mentions = [this.slashCommandConfig];\n this.autocompleteConfig = { ...this.autocompleteConfig };\n }\n }\n if (changes.mentionScope) {\n void this.updateMentionOptions(this.searchTerm$.getValue());\n }\n if (changes.value && !this.value && this.messageInput) {\n this.messageInput.nativeElement.style.height = 'auto';\n this.chatClientService?.chatClient?.logger?.(\n 'info',\n '[Autocomplete textarea] Value reset, adjusting textarea height to auto'\n );\n this.updateMentionedUsersFromText();\n }\n }\n\n ngAfterViewInit(): void {\n this.chatClientService?.chatClient?.logger?.(\n 'info',\n '[Autocomplete textarea] View inited'\n );\n if (this.messageInput.nativeElement.scrollHeight > 0 && this.value) {\n this.adjustTextareaHeight();\n }\n }\n\n filter(searchString: string, items: { autocompleteLabel: string }[]) {\n return items.filter((item) =>\n this.transliterate(item.autocompleteLabel.toLowerCase()).includes(\n this.transliterate(searchString.toLowerCase())\n )\n );\n }\n\n itemSelectedFromAutocompleteList(\n item: MentionAutcompleteListItem,\n triggerChar = ''\n ) {\n if (triggerChar === this.mentionTriggerChar) {\n this.mentionedUsers.push((item.user ? item.user : item) as UserResponse);\n this.userMentions.next([...this.mentionedUsers]);\n }\n return triggerChar + item.autocompleteLabel + ' ';\n }\n\n autcompleteSearchTermChanged(searchTerm: string) {\n if (searchTerm === this.mentionTriggerChar) {\n void this.updateMentionOptions();\n } else {\n this.searchTerm$.next(searchTerm);\n }\n }\n\n inputChanged() {\n this.chatClientService?.chatClient?.logger?.(\n 'info',\n '[Autocomplete textarea] Input changed'\n );\n this.valueChange.emit(this.messageInput.nativeElement.value);\n this.adjustTextareaHeight();\n }\n\n inputLeft() {\n this.updateMentionedUsersFromText();\n }\n\n enterHit(event: Event) {\n if (this.inputMode === 'desktop') {\n event.preventDefault();\n this.updateMentionedUsersFromText();\n this.send.next();\n }\n }\n\n private adjustTextareaHeight() {\n if (this.themeVersion === '2') {\n this.chatClientService?.chatClient?.logger?.(\n 'info',\n `[Autocomplete textarea] Textarea height set from ${this.messageInput.nativeElement.style.height} to ${this.messageInput.nativeElement.scrollHeight}px`\n );\n this.messageInput.nativeElement.style.height = '';\n this.messageInput.nativeElement.style.height = `${this.messageInput.nativeElement.scrollHeight}px`;\n }\n }\n\n private transliterate(s: string) {\n if (this.transliterationService) {\n return this.transliterationService.transliterate(s);\n } else {\n return s;\n }\n }\n\n private async updateMentionOptions(searchTerm?: string) {\n if (!this.areMentionsEnabled) {\n return;\n }\n searchTerm = searchTerm?.replace(this.mentionTriggerChar, '');\n const request =\n this.mentionScope === 'application'\n ? (s: string) => this.chatClientService.autocompleteUsers(s)\n : (s: string) => this.channelService.autocompleteMembers(s);\n const result = await request(searchTerm || '');\n const items = this.filter(\n searchTerm || '',\n result.map((i) => {\n const user = (i.user ? i.user : i) as UserResponse;\n return {\n ...i,\n autocompleteLabel: user.name || user.id,\n type: 'mention',\n };\n })\n );\n this.userMentionConfig.items = items;\n this.autocompleteConfig.mentions = [\n this.userMentionConfig,\n this.slashCommandConfig,\n ];\n this.autocompleteConfig = { ...this.autocompleteConfig };\n this.cdRef.detectChanges();\n }\n\n private updateMentionedUsersFromText() {\n const updatedMentionedUsers: UserResponse[] = [];\n this.mentionedUsers.forEach((u) => {\n const key = u.name || u.id;\n if (this.value.includes(`${this.mentionTriggerChar}${key}`)) {\n updatedMentionedUsers.push(u);\n }\n });\n if (updatedMentionedUsers.length !== this.mentionedUsers.length) {\n this.userMentions.next([...updatedMentionedUsers]);\n this.mentionedUsers = updatedMentionedUsers;\n }\n }\n}\n","<textarea\n [value]=\"value || ''\"\n [autofocus]=\"autoFocus\"\n data-testid=\"textarea\"\n #input\n placeholder=\"{{ placeholder | translate }}\"\n class=\"\n rta__textarea\n str-chat__textarea__textarea\n str-chat__angular-textarea\n str-chat__message-textarea\n \"\n rows=\"1\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"enterHit($event)\"\n [mentionConfig]=\"autocompleteConfig\"\n (searchTerm)=\"autcompleteSearchTermChanged($event)\"\n [mentionListTemplate]=\"autocompleteItem\"\n (blur)=\"inputLeft()\"\n></textarea>\n<ng-template #autocompleteItem let-item=\"item\">\n <div class=\"rta rta__item str-chat__emojisearch__item\" [ngSwitch]=\"item.type\">\n <div class=\"rta__entity\" *ngSwitchCase=\"'mention'\">\n <ng-container\n *ngTemplateOutlet=\"\n mentionAutocompleteItemTemplate || defaultMentionTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n <div class=\"rta__entity\" *ngSwitchCase=\"'command'\">\n <ng-container\n *ngTemplateOutlet=\"\n commandAutocompleteItemTemplate || defaultCommandTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #defaultCommandTemplate let-item=\"item\">\n <div class=\"str-chat__slash-command\">\n <span class=\"str-chat__slash-command-header\">\n <strong\n class=\"str-chat__slash-command-name\"\n data-testclass=\"command-name\"\n >{{ item.name }}</strong\n >\n <span class=\"str-chat__slash-command-args\"\n >/{{ item.name }} {{ item.args }}</span\n >\n </span>\n <br />\n </div>\n</ng-template>\n\n<ng-template #defaultMentionTemplate let-item=\"item\">\n <div class=\"str-chat__user-item\">\n <stream-avatar-placeholder\n data-testclass=\"avatar\"\n class=\"str-chat__avatar str-chat__avatar--circle\"\n [ngStyle]=\"{ height: themeVersion === '2' ? 30 : 20 + 'px' }\"\n [size]=\"themeVersion === '2' ? 30 : 20\"\n [imageUrl]=\"item.image || item.user?.image\"\n [name]=\"item.autocompleteLabel\"\n type=\"user\"\n location=\"autocomplete-item\"\n [user]=\"item.user || item\"\n ></stream-avatar-placeholder>\n <span data-testclass=\"username\" class=\"str-chat__user-item--name\">{{\n item.autocompleteLabel\n }}</span>\n </div>\n</ng-template>\n","import { GroupStyleOptions, StreamMessage } from '../types';\n\nexport type GroupStyle = '' | 'middle' | 'top' | 'bottom' | 'single';\n\nexport const getGroupStyles = (\n message: StreamMessage,\n previousMessage?: StreamMessage,\n nextMessage?: StreamMessage,\n options: GroupStyleOptions = {\n noGroupByUser: false,\n lastReadMessageId: undefined,\n noGroupByReadState: false,\n }\n): GroupStyle => {\n if (\n options.noGroupByUser ||\n (message.attachments && message.attachments.length !== 0)\n )\n return 'single';\n\n const isTopMessage =\n !previousMessage ||\n !isOnSameDay(previousMessage.created_at, message.created_at) ||\n previousMessage.type === 'system' ||\n (previousMessage.attachments &&\n previousMessage.attachments?.length !== 0) ||\n message.user?.id !== previousMessage.user?.id ||\n previousMessage.type === 'error' ||\n previousMessage.deleted_at ||\n (previousMessage.id === options.lastReadMessageId &&\n !options.noGroupByReadState) ||\n previousMessage.message_text_updated_at ||\n (message.reaction_counts &&\n Object.keys(message.reaction_counts).length > 0);\n\n const isBottomMessage =\n !nextMessage ||\n !isOnSameDay(message.created_at, nextMessage.created_at) ||\n nextMessage.type === 'system' ||\n (nextMessage.attachments && nextMessage.attachments?.length !== 0) ||\n message.user?.id !== nextMessage.user?.id ||\n nextMessage.type === 'error' ||\n nextMessage.deleted_at ||\n (message.id === options.lastReadMessageId && !options.noGroupByReadState) ||\n message.message_text_updated_at ||\n (nextMessage.reaction_counts &&\n Object.keys(nextMessage.reaction_counts).length > 0);\n\n if (!isTopMessage && !isBottomMessage) {\n if (message.deleted_at || message.type === 'error') return 'single';\n return 'middle';\n }\n\n if (isBottomMessage) {\n if (isTopMessage || message.deleted_at || message.type === 'error')\n return 'single';\n return 'bottom';\n }\n\n if (isTopMessage) return 'top';\n\n return '';\n};\n\nconst isOnSameDay = (date1: Date, date2: Date) => {\n return (\n date1.getFullYear() === date2.getFullYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate()\n );\n};\n","import {\n AfterViewChecked,\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n HostBinding,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { ChannelService } from '../channel.service';\nimport { Observable, Subject, Subscription, combineLatest } from 'rxjs';\nimport { filter, map, shareReplay, tap, throttleTime } from 'rxjs/operators';\nimport {\n MessageContext,\n DefaultStreamChatGenerics,\n StreamMessage,\n TypingIndicatorContext,\n CustomMessageActionItem,\n DateSeparatorContext,\n UnreadMessagesNotificationContext,\n UnreadMessagesIndicatorContext,\n} from '../types';\nimport { ChatClientService } from '../chat-client.service';\nimport { getGroupStyles, GroupStyle } from './group-styles';\nimport { UserResponse } from 'stream-chat';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { listUsers } from '../list-users';\nimport { DateParserService } from '../date-parser.service';\nimport { MessageActionsService } from '../message-actions.service';\nimport { isOnSeparateDate } from '../is-on-separate-date';\n\n/**\n * The `MessageList` component renders a scrollable list of messages.\n */\n@Component({\n selector: 'stream-message-list',\n templateUrl: './message-list.component.html',\n styles: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MessageListComponent\n implements AfterViewChecked, OnChanges, OnInit, OnDestroy, AfterViewInit\n{\n /**\n * Determines if the message list should display channel messages or [thread messages](https://getstream.io/chat/docs/javascript/threads/?language=javascript).\n */\n @Input() mode: 'main' | 'thread' = 'main';\n /**\n * The direction of the messages in the list, `bottom-to-top` means newest message is at the bottom of the message list and users scroll upwards to load older messages\n */\n @Input() direction: 'bottom-to-top' | 'top-to-bottom' = 'bottom-to-top';\n /**\n * Determines what triggers the appearance of the message options: by default you can hover (click on mobile) anywhere in the row of the message (`message-row` option), or you can set `message-bubble`, in that case only a hover (click on mobile) in the message bubble will trigger the options to appear.\n */\n @Input() messageOptionsTrigger: 'message-row' | 'message-bubble' =\n 'message-row';\n /**\n * You can hide the \"jump to latest\" button while scrolling. A potential use-case for this input would be to [workaround a known issue on iOS Safar webview](https://github.com/GetStream/stream-chat-angular/issues/418)\n *\n */\n @Input() hideJumpToLatestButtonDuringScroll = false;\n /**\n * A list of custom message actions to be displayed in the message action box\n *\n * @deprecated please use the [`MessageActionsService`](https://getstream.io/chat/docs/sdk/angular/services/MessageActionsService) to set this property.\n */\n @Input() customMessageActions: CustomMessageActionItem<any>[] = [];\n /**\n * If `true` date separators will be displayed\n */\n @Input() displayDateSeparator = true;\n /**\n * If `true` unread indicator will be displayed\n */\n @Input() displayUnreadSeparator = true;\n /**\n * If date separators are displayed, you can set the horizontal position of the date text.\n */\n @Input() dateSeparatorTextPos: 'center' | 'right' | 'left' = 'center';\n /**\n * `last-message` option will open the message list at the last message, `last-read-message` will open the list at the last unread message. This option only works if mode is `main`.\n */\n @Input() openMessageListAt: 'last-message' | 'last-read-message' =\n 'last-message';\n /**\n * If the user has unread messages when they open the channel the UI shows the unread indicator / notification which features the unread count by default. This count will be increased every time a user receives a new message. If you don't want to show the unread count, you can turn that off.\n *\n * This is only applicable for `main` mode, as threads doesn't have read infromation.\n */\n @Input() hideUnreadCountForNotificationAndIndicator = false;\n /**\n * You can turn on and off the loading indicator that signals to users that more messages are being loaded to the message list\n */\n @Input() displayLoadingIndicator = true;\n /**\n * @internal\n */\n @Input() limitNumberOfMessagesInList = true;\n typingIndicatorTemplate: TemplateRef<TypingIndicatorContext> | undefined;\n messageTemplate: TemplateRef<MessageContext> | undefined;\n customDateSeparatorTemplate: TemplateRef<DateSeparatorContext> | undefined;\n customnewMessagesIndicatorTemplate:\n | TemplateRef<UnreadMessagesIndicatorContext>\n | undefined;\n customnewMessagesNotificationTemplate:\n | TemplateRef<UnreadMessagesNotificationContext>\n | undefined;\n emptyMainMessageListTemplate: TemplateRef<void> | null = null;\n emptyThreadMessageListTemplate: TemplateRef<void> | null = null;\n messages$!: Observable<StreamMessage[]>;\n enabledMessageActions: string[] = [];\n isEmpty = true;\n newMessageCountWhileBeingScrolled = 0;\n isUserScrolled: boolean | undefined;\n groupStyles: GroupStyle[] = [];\n isNextMessageOnSeparateDate: boolean[] = [];\n lastSentMessageId: string | undefined;\n parentMessage: StreamMessage | undefined;\n highlightedMessageId: string | undefined;\n isLoading = false;\n scrollEndTimeout: any;\n lastReadMessageId?: string;\n isUnreadNotificationVisible = true;\n firstUnreadMessageId?: string;\n unreadCount?: number;\n isJumpingToLatestUnreadMessage = false;\n isJumpToLatestButtonVisible = true;\n @ViewChild('scrollContainer')\n private scrollContainer!: ElementRef<HTMLElement>;\n @ViewChild('parentMessageElement')\n private parentMessageElement!: ElementRef<HTMLElement>;\n private latestMessage: { id: string; created_at: Date } | undefined;\n private hasNewMessages: boolean | undefined;\n private containerHeight: number | undefined;\n private oldestMessage: { id: string; created_at: Date } | undefined;\n private olderMassagesLoaded: boolean | undefined;\n private isNewMessageSentByUser: boolean | undefined;\n private subscriptions: Subscription[] = [];\n private newMessageSubscription: { unsubscribe: () => void } | undefined;\n private prevScrollTop: number | undefined;\n private usersTypingInChannel$!: Observable<\n UserResponse<DefaultStreamChatGenerics>[]\n >;\n private usersTypingInThread$!: Observable<\n UserResponse<DefaultStreamChatGenerics>[]\n >;\n private isLatestMessageInList = true;\n private channelId?: string;\n private parsedDates = new Map<Date, string>();\n private isViewInited = false;\n private checkIfUnreadNotificationIsVisibleTimeout?: any;\n private jumpToLatestButtonVisibilityTimeout?: any;\n private messageRemoveTimeout?: any;\n private removeOldMessagesSubscription?: Subscription;\n private isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n private forceRepaintSubject = new Subject<void>();\n\n @HostBinding('class')\n private get class() {\n return `str-chat-angular__main-panel-inner str-chat-angular__message-list-host str-chat__main-panel-inner ${\n this.isEmpty ? 'str-chat-angular__message-list-host--empty' : ''\n }`;\n }\n\n constructor(\n private channelService: ChannelService,\n private chatClientService: ChatClientService,\n private customTemplatesService: CustomTemplatesService,\n private dateParser: DateParserService,\n private ngZone: NgZone,\n private cdRef: ChangeDetectorRef,\n private messageActionsService: MessageActionsService\n ) {\n this.usersTypingInChannel$ = this.channelService.usersTypingInChannel$;\n this.usersTypingInThread$ = this.channelService.usersTypingInThread$;\n }\n\n messageNotificationJumpClicked = () => {\n this.jumpToFirstUnreadMessage();\n this.isUnreadNotificationVisible = false;\n };\n\n messageNotificationDismissClicked = () => {\n this.isUnreadNotificationVisible = false;\n };\n\n ngOnInit(): void {\n this.subscriptions.push(\n this.forceRepaintSubject.pipe(throttleTime(1000)).subscribe(() => {\n this.forceRepaint();\n })\n );\n this.subscriptions.push(\n this.channelService.activeChannel$.subscribe((channel) => {\n this.chatClientService.chatClient?.logger?.(\n 'info',\n `${channel?.cid || 'undefined'} selected`,\n { tags: `message list ${this.mode}` }\n );\n let isNewChannel = false;\n if (this.channelId !== channel?.id) {\n isNewChannel = true;\n if (this.checkIfUnreadNotificationIsVisibleTimeout) {\n clearTimeout(this.checkIfUnreadNotificationIsVisibleTimeout);\n }\n this.isUnreadNotificationVisible = false;\n this.chatClientService?.chatClient?.logger?.(\n 'info',\n `new channel is different from prev channel, reseting scroll state`,\n { tags: `message list ${this.mode}` }\n );\n this.parsedDates = new Map();\n if (this.messageRemoveTimeout) {\n clearTimeout(this.messageRemoveTimeout);\n }\n this.resetScrollState();\n this.channelId = channel?.id;\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n if (this.mode === 'main') {\n const lastReadMessageId =\n this.channelService.activeChannelLastReadMessageId;\n const unreadCount = this.channelService.activeChannelUnreadCount;\n if (\n lastReadMessageId !== this.lastReadMessageId ||\n unreadCount !== this.unreadCount\n ) {\n this.lastReadMessageId = lastReadMessageId;\n this.unreadCount = unreadCount || 0;\n if (isNewChannel && this.lastReadMessageId) {\n if (this.openMessageListAt === 'last-read-message') {\n this.jumpToFirstUnreadMessage();\n } else {\n // Wait till messages and the unread banner is rendered\n // If unread banner isn't visible on the screen, we display the unread notificaion\n setTimeout(() => {\n const bannerElement = document.getElementById(\n 'stream-chat-new-message-indicator'\n );\n if (\n !bannerElement ||\n bannerElement?.offsetTop <\n this.scrollContainer?.nativeElement?.scrollHeight -\n this.scrollContainer?.nativeElement?.clientHeight\n ) {\n this.isUnreadNotificationVisible = true;\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n }, 100);\n }\n }\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n } else if (this.lastReadMessageId) {\n this.lastReadMessageId = undefined;\n this.unreadCount = 0;\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n const capabilites = channel?.data?.own_capabilities as string[];\n const capabilitesString = [...(capabilites || [])].sort().join('');\n const enabledActionsString = [...(this.enabledMessageActions || [])]\n .sort()\n .join('');\n if (capabilitesString !== enabledActionsString) {\n this.enabledMessageActions = capabilites || [];\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n this.newMessageSubscription?.unsubscribe();\n if (channel) {\n this.newMessageSubscription = channel.on('message.new', (event) => {\n // If we display main channel messages and we're switched to an older message set -> use message.new event to update unread count and detect new messages sent by current user\n if (\n !event.message ||\n channel.state.messages === channel.state.latestMessages ||\n this.mode === 'thread'\n ) {\n return;\n }\n this.newMessageReceived({\n id: event.message.id,\n user: event.message.user,\n created_at: new Date(event.message.created_at || ''),\n });\n });\n }\n })\n );\n this.subscriptions.push(\n this.messageActionsService.customActions$.subscribe((actions) => {\n if (actions !== this.customMessageActions) {\n this.customMessageActions = actions;\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n })\n );\n this.subscriptions.push(\n this.channelService.activeParentMessage$.subscribe((message) => {\n if (\n message &&\n this.parentMessage &&\n message.id !== this.parentMessage.id &&\n this.mode === 'thread'\n ) {\n this.resetScrollState();\n }\n if (this.parentMessage === message) {\n return;\n }\n this.parentMessage = message;\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n })\n );\n this.subscriptions.push(\n this.customTemplatesService.messageTemplate$.subscribe((template) => {\n if (this.messageTemplate === template) {\n return;\n }\n this.messageTemplate = template;\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n })\n );\n this.subscriptions.push(\n this.customTemplatesService.dateSeparatorTemplate$.subscribe(\n (template) => {\n if (this.customDateSeparatorTemplate === template) {\n return;\n }\n this.customDateSeparatorTemplate = template;\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n )\n );\n this.subscriptions.push(\n this.customTemplatesService.newMessagesIndicatorTemplate$.subscribe(\n (template) => {\n if (this.customnewMessagesIndicatorTemplate === template) {\n return;\n }\n this.customnewMessagesIndicatorTemplate = template;\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n )\n );\n this.subscriptions.push(\n this.customTemplatesService.newMessagesNotificationTemplate$.subscribe(\n (template) => {\n if (this.customnewMessagesNotificationTemplate === template) {\n return;\n }\n this.customnewMessagesNotificationTemplate = template;\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n )\n );\n this.subscriptions.push(\n this.customTemplatesService.typingIndicatorTemplate$.subscribe(\n (template) => {\n if (this.typingIndicatorTemplate === template) {\n return;\n }\n this.typingIndicatorTemplate = template;\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n )\n );\n this.subscriptions.push(\n this.channelService.jumpToMessage$\n .pipe(filter((config) => !!config.id))\n .subscribe((config) => {\n let messageId: string | undefined = undefined;\n if (this.messageRemoveTimeout) {\n clearTimeout(this.messageRemoveTimeout);\n }\n if (this.mode === 'main') {\n messageId = config.parentId || config.id;\n } else if (config.parentId) {\n messageId = config.id;\n }\n this.chatClientService.chatClient?.logger?.(\n 'info',\n `Jumping to ${messageId || ''}`,\n { tags: `message list ${this.mode}` }\n );\n if (messageId) {\n if (messageId === 'latest') {\n this.scrollToLatestMessage();\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n }\n } else {\n if (this.isJumpingToLatestUnreadMessage) {\n this.scrollMessageIntoView(\n this.firstUnreadMessageId || messageId\n );\n this.highlightedMessageId =\n this.firstUnreadMessageId || messageId;\n } else {\n this.scrollMessageIntoView(messageId);\n this.highlightedMessageId = messageId;\n }\n }\n }\n this.channelService.clearMessageJump();\n })\n );\n this.subscriptions.push(\n this.customTemplatesService.emptyMainMessageListPlaceholder$.subscribe(\n (template) => {\n const isChanged = this.emptyMainMessageListTemplate !== template;\n this.emptyMainMessageListTemplate = template || null;\n if (isChanged && this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n )\n );\n this.subscriptions.push(\n this.customTemplatesService.emptyThreadMessageListPlaceholder$.subscribe(\n (template) => {\n const isChanged = this.emptyThreadMessageListTemplate !== template;\n this.emptyThreadMessageListTemplate = template || null;\n if (isChanged && this.isViewInited) {\n this.cdRef.detectChanges();\n }\n }\n )\n );\n this.setMessages$();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.mode || changes.direction) {\n this.setMessages$();\n }\n if (changes.direction) {\n if (this.scrollContainer?.nativeElement) {\n this.jumpToLatestMessage();\n }\n }\n if (changes.customMessageActions) {\n this.messageActionsService.customActions$.next(this.customMessageActions);\n }\n }\n\n ngAfterViewInit(): void {\n this.isViewInited = true;\n this.ngZone.runOutsideAngular(() => {\n this.scrollContainer.nativeElement.addEventListener('scroll', () =>\n this.scrolled()\n );\n });\n }\n\n ngAfterViewChecked() {\n if (this.highlightedMessageId) {\n // Turn off programatic scroll adjustments while jump to message is in progress\n this.hasNewMessages = false;\n this.olderMassagesLoaded = false;\n }\n if (this.direction === 'top-to-bottom') {\n if (\n this.hasNewMessages &&\n (this.isNewMessageSentByUser || !this.isUserScrolled)\n ) {\n this.isLatestMessageInList\n ? this.scrollToTop()\n : this.jumpToLatestMessage();\n this.hasNewMessages = false;\n this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;\n }\n } else {\n if (this.hasNewMessages) {\n if (!this.isUserScrolled || this.isNewMessageSentByUser) {\n this.chatClientService.chatClient?.logger?.(\n 'info',\n `User has new messages, and not scrolled or sent new messages, therefore we ${\n this.isLatestMessageInList ? 'scroll' : 'jump'\n } to latest message`,\n { tags: `message list ${this.mode}` }\n );\n this.isLatestMessageInList\n ? this.scrollToBottom()\n : this.jumpToLatestMessage();\n }\n this.hasNewMessages = false;\n this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;\n } else if (this.olderMassagesLoaded) {\n this.chatClientService.chatClient?.logger?.(\n 'info',\n `Older messages are loaded, we preserve the scroll position`,\n { tags: `message list ${this.mode}` }\n );\n this.preserveScrollbarPosition();\n this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;\n this.olderMassagesLoaded = false;\n } else if (\n this.getScrollPosition() !== 'bottom' &&\n !this.isUserScrolled &&\n !this.highlightedMessageId\n ) {\n this.chatClientService.chatClient?.logger?.(\n 'info',\n `Container grew and user didn't scroll therefore we ${\n this.isLatestMessageInList ? 'scroll' : 'jump'\n } to latest message`,\n { tags: `message list ${this.mode}` }\n );\n this.isLatestMessageInList\n ? this.scrollToBottom()\n : this.jumpToLatestMessage();\n this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;\n }\n }\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n this.newMessageSubscription?.unsubscribe();\n if (this.scrollEndTimeout) {\n clearTimeout(this.scrollEndTimeout);\n }\n if (this.checkIfUnreadNotificationIsVisibleTimeout) {\n clearTimeout(this.checkIfUnreadNotificationIsVisibleTimeout);\n }\n if (this.jumpToLatestButtonVisibilityTimeout) {\n clearTimeout(this.jumpToLatestButtonVisibilityTimeout);\n }\n if (this.messageRemoveTimeout) {\n clearTimeout(this.messageRemoveTimeout);\n }\n this.removeOldMessagesSubscription?.unsubscribe();\n }\n\n trackByMessageId(index: number, item: StreamMessage) {\n return item.id;\n }\n\n trackByUserId(index: number, user: UserResponse) {\n return user.id;\n }\n\n jumpToLatestMessage() {\n void this.channelService.jumpToMessage(\n 'latest',\n this.mode === 'thread' ? this.parentMessage?.id : undefined\n );\n }\n\n scrollToBottom(): void {\n this.scrollContainer.nativeElement.scrollTop =\n this.scrollContainer.nativeElement.scrollHeight + 0.1;\n if (this.isSafari) {\n this.forceRepaintSubject.next();\n }\n }\n\n scrollToTop() {\n this.scrollContainer.nativeElement.scrollTop = 0;\n }\n\n scrolled() {\n if (\n this.scrollContainer.nativeElement.scrollHeight ===\n this.scrollContainer.nativeElement.clientHeight\n ) {\n return;\n }\n const scrollPosition = this.getScrollPosition();\n this.chatClientService.chatClient?.logger?.(\n 'info',\n `Scrolled - scroll position: ${scrollPosition}, container height: ${this.scrollContainer.nativeElement.scrollHeight}`,\n { tags: `message list ${this.mode}` }\n );\n\n const isUserScrolled =\n (this.direction === 'bottom-to-top'\n ? scrollPosition !== 'bottom'\n : scrollPosition !== 'top') || !this.isLatestMessageInList;\n if (this.isUserScrolled !== isUserScrolled) {\n this.ngZone.run(() => {\n this.isUserScrolled = isUserScrolled;\n if (!this.isUserScrolled) {\n this.newMessageCountWhileBeingScrolled = 0;\n }\n this.cdRef.detectChanges();\n });\n }\n\n if (this.hideJumpToLatestButtonDuringScroll) {\n if (this.isJumpToLatestButtonVisible) {\n this.isJumpToLatestButtonVisible = false;\n this.cdRef.detectChanges();\n }\n if (this.jumpToLatestButtonVisibilityTimeout) {\n clearTimeout(this.jumpToLatestButtonVisibilityTimeout);\n }\n this.jumpToLatestButtonVisibilityTimeout = setTimeout(() => {\n if (this.isUserScrolled) {\n this.isJumpToLatestButtonVisible = true;\n this.jumpToLatestButtonVisibilityTimeout = undefined;\n this.cdRef.detectChanges();\n }\n }, 100);\n }\n\n if (this.shouldLoadMoreMessages(scrollPosition)) {\n this.ngZone.run(() => {\n this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;\n let direction: 'newer' | 'older';\n if (this.direction === 'top-to-bottom') {\n direction = scrollPosition === 'top' ? 'newer' : 'older';\n } else {\n direction = scrollPosition === 'top' ? 'older' : 'newer';\n }\n const result =\n this.mode === 'main'\n ? this.channelService.loadMoreMessages(direction)\n : this.channelService.loadMoreThreadReplies(direction);\n if (result) {\n this.chatClientService.chatClient?.logger?.(\n 'info',\n `Displaying loading indicator`,\n { tags: `message list ${this.mode}` }\n );\n this.isLoading = true;\n result.catch?.(() => {\n this.isLoading = false;\n });\n }\n this.cdRef.detectChanges();\n });\n }\n this.prevScrollTop = this.scrollContainer.nativeElement.scrollTop;\n }\n\n jumpToFirstUnreadMessage() {\n if (!this.lastReadMessageId) {\n return;\n }\n this.isJumpingToLatestUnreadMessage = true;\n void this.channelService.jumpToMessage(this.lastReadMessageId);\n }\n\n getTypingIndicatorContext(): TypingIndicatorContext {\n return {\n usersTyping$: this.usersTyping$,\n };\n }\n\n getTypingIndicatorText(users: UserResponse[]) {\n const text = listUsers(users);\n\n return text;\n }\n\n isSentByCurrentUser(message?: StreamMessage) {\n if (!message) {\n return false;\n }\n return message.user?.id === this.chatClientService.chatClient.user?.id;\n }\n\n parseDate(date: Date) {\n if (this.parsedDates.has(date)) {\n return this.parsedDates.get(date);\n }\n const parsedDate = this.dateParser.parseDate(date);\n this.parsedDates.set(date, parsedDate);\n return parsedDate;\n }\n\n get replyCountParam() {\n return { replyCount: this.parentMessage?.reply_count };\n }\n\n get emptyListTemplate() {\n return this.mode === 'main'\n ? this.emptyMainMessageListTemplate\n : this.emptyThreadMessageListTemplate;\n }\n\n private preserveScrollbarPosition() {\n this.scrollContainer.nativeElement.scrollTop =\n (this.prevScrollTop || 0) +\n (this.scrollContainer.nativeElement.scrollHeight - this.containerHeight!);\n }\n\n private forceRepaint() {\n // Solves the issue of empty screen on Safari when scrolling\n this.scrollContainer.nativeElement.style.display = 'none';\n this.scrollContainer.nativeElement.offsetHeight; // no need to store this anywhere, the reference is enough\n this.scrollContainer.nativeElement.style.display = '';\n }\n\n private getScrollPosition(): 'top' | 'bottom' | 'middle' {\n let position: 'top' | 'bottom' | 'middle' = 'middle';\n if (\n Math.floor(this.scrollContainer.nativeElement.scrollTop) <=\n (this.parentMessageElement?.nativeElement.clientHeight || 0) &&\n (this.prevScrollTop === undefined ||\n this.prevScrollTop >\n (this.parentMessageElement?.nativeElement.clientHeight || 0))\n ) {\n position = 'top';\n } else if (\n Math.ceil(this.scrollContainer.nativeElement.scrollTop) +\n this.scrollContainer.nativeElement.clientHeight +\n 1 >=\n this.scrollContainer.nativeElement.scrollHeight\n ) {\n position = 'bottom';\n }\n\n return position;\n }\n\n private shouldLoadMoreMessages(scrollPosition: 'top' | 'bottom' | 'middle') {\n return (\n scrollPosition !== 'middle' &&\n !this.highlightedMessageId &&\n !this.isLoading\n );\n }\n\n private setMessages$() {\n this.messages$ = (\n this.mode === 'main'\n ? this.channelService.activeChannelMessages$\n : this.channelService.activeThreadMessages$\n ).pipe(\n tap((messages) => {\n this.isLoading = false;\n if (messages.length === 0) {\n this.chatClientService.chatClient?.logger?.(\n 'info',\n `Empty messages array, reseting scroll state`,\n {\n tags: `message list ${this.mode}`,\n }\n );\n this.resetScrollState();\n return;\n }\n if (this.isEmpty) {\n // cdRef.detectChanges() isn't enough here, test will fail\n setTimeout(() => (this.isEmpty = false), 0);\n }\n this.chatClientService.chatClient?.logger?.(\n 'info',\n `Received one or more messages`,\n {\n tags: `message list ${this.mode}`,\n }\n );\n const currentLatestMessageInState = messages[messages.length - 1];\n this.newMessageReceived(currentLatestMessageInState);\n const currentOldestMessage = messages[0];\n if (\n !this.oldestMessage ||\n !messages.find((m) => m.id === this.oldestMessage!.id)\n ) {\n this.oldestMessage = currentOldestMessage;\n } else if (\n this.oldestMessage.created_at.getTime() >\n currentOldestMessage.created_at.getTime()\n ) {\n this.oldestMessage = currentOldestMessage;\n this.olderMassagesLoaded = true;\n }\n }),\n tap((messages) => {\n if (\n this.isJumpingToLatestUnreadMessage &&\n !this.firstUnreadMessageId &&\n this.lastReadMessageId\n ) {\n const lastReadIndex = messages.findIndex(\n (m) => m.id === this.lastReadMessageId\n );\n this.firstUnreadMessageId =\n messages[lastReadIndex + 1]?.id || this.lastReadMessageId;\n }\n }),\n tap(\n (messages) =>\n (this.lastSentMessageId = [...messages]\n .reverse()\n .find(\n (m) =>\n m.user?.id === this.chatClientService.chatClient?.user?.id &&\n m.status !== 'sending'\n )?.id)\n ),\n tap((messages) => {\n this.isLatestMessageInList =\n !this.latestMessage ||\n messages.length === 0 ||\n messages[messages.length - 1].id === this.latestMessage.id ||\n this.mode === 'thread';\n if (!this.isLatestMessageInList) {\n this.isUserScrolled = true;\n }\n }),\n map((messages) =>\n this.direction === 'bottom-to-top' ? messages : [...messages].reverse()\n ),\n tap((messages) => {\n this.groupStyles = messages.map((m, i) =>\n getGroupStyles(m, messages[i - 1], messages[i + 1], {\n lastReadMessageId: this.lastReadMessageId,\n })\n );\n this.isNextMessageOnSeparateDate = messages.map((m, i) =>\n this.checkIfOnSeparateDates(m, messages[i + 1])\n );\n }),\n shareReplay(1)\n );\n this.removeOldMessagesSubscription?.unsubscribe();\n this.removeOldMessagesSubscription = combineLatest([\n this.channelService.jumpToMessage$,\n this.messages$,\n ]).subscribe(([jumpToMessage, messages]) => {\n if (\n this.limitNumberOfMessagesInList &&\n this.mode === 'main' &&\n messages.length >\n ChannelService.MAX_MESSAGE_COUNT_IN_MESSAGE_LIST * 0.5 &&\n !this.isUserScrolled &&\n !jumpToMessage?.id &&\n this.isLatestMessageInList\n ) {\n if (this.messageRemoveTimeout) {\n clearTimeout(this.messageRemoveTimeout);\n }\n if (\n messages.length >= ChannelService.MAX_MESSAGE_COUNT_IN_MESSAGE_LIST\n ) {\n this.channelService.removeOldMessageFromMessageList();\n } else {\n this.messageRemoveTimeout = setTimeout(() => {\n if (\n this.limitNumberOfMessagesInList &&\n this.mode === 'main' &&\n messages.length >\n ChannelService.MAX_MESSAGE_COUNT_IN_MESSAGE_LIST * 0.5 &&\n !this.isUserScrolled &&\n !this.highlightedMessageId &&\n this.isLatestMessageInList\n ) {\n this.channelService.removeOldMessageFromMessageList();\n }\n }, 1500);\n }\n }\n });\n }\n\n private resetScrollState() {\n this.isEmpty = true;\n this.latestMessage = undefined;\n this.hasNewMessages = true;\n this.isUserScrolled = false;\n this.containerHeight = undefined;\n this.olderMassagesLoaded = false;\n this.oldestMessage = undefined;\n this.newMessageCountWhileBeingScrolled = 0;\n this.prevScrollTop = undefined;\n this.isNewMessageSentByUser = undefined;\n this.isLatestMessageInList = true;\n }\n\n private get usersTyping$() {\n return this.mode === 'thread'\n ? this.usersTypingInThread$\n : this.usersTypingInChannel$;\n }\n\n private scrollMessageIntoView(messageId: string, withRetry = true) {\n const element = document.getElementById(messageId);\n if (!element && withRetry) {\n // If the message was newly inserted into activeChannelMessages$, the message will be rendered after the current change detection cycle -> wait for this cycle to complete\n setTimeout(() => this.scrollMessageIntoView(messageId, false));\n } else if (element) {\n element.scrollIntoView({\n block: 'center',\n });\n setTimeout(() => {\n this.highlightedMessageId = undefined;\n this.firstUnreadMessageId = undefined;\n this.isJumpingToLatestUnreadMessage = false;\n this.cdRef.detectChanges();\n }, 1000);\n }\n }\n\n private scrollToLatestMessage(withRetry = true) {\n if (document.getElementById(this.latestMessage!.id)) {\n this.direction === 'bottom-to-top'\n ? this.scrollToBottom()\n : this.scrollToTop();\n } else if (withRetry) {\n // If the message was newly inserted into activeChannelMessages$, the message will be rendered after the current change detection cycle -> wait for this cycle to complete\n setTimeout(() => this.scrollToLatestMessage(false), 0);\n }\n }\n\n private newMessageReceived(message: {\n id: string;\n created_at: Date;\n user?: { id: string } | null;\n }) {\n const latestMessages =\n this.channelService.activeChannel?.state?.latestMessages;\n if (\n !this.latestMessage ||\n this.latestMessage.created_at?.getTime() < message.created_at.getTime() ||\n (this.mode === 'main' &&\n latestMessages &&\n this.latestMessage &&\n latestMessages[latestMessages.length - 1]?.id !== this.latestMessage.id)\n ) {\n this.chatClientService.chatClient?.logger?.(\n 'info',\n `Received new message`,\n { tags: `message list ${this.mode}` }\n );\n const isNewChannel = !this.latestMessage;\n this.latestMessage = message;\n this.hasNewMessages = true;\n this.isNewMessageSentByUser =\n message.user?.id === this.chatClientService.chatClient?.user?.id;\n if (this.isUserScrolled) {\n this.newMessageCountWhileBeingScrolled++;\n }\n if (\n !this.isNewMessageSentByUser &&\n this.unreadCount !== undefined &&\n !isNewChannel\n ) {\n this.unreadCount++;\n }\n this.cdRef.detectChanges();\n }\n }\n\n private checkIfOnSeparateDates(\n message?: StreamMessage,\n nextMessage?: StreamMessage\n ) {\n if (!message || !nextMessage) {\n return false;\n }\n return isOnSeparateDate(message.created_at, nextMessage.created_at);\n }\n}\n","<ng-container\n *ngIf=\"\n lastReadMessageId &&\n isUnreadNotificationVisible &&\n openMessageListAt === 'last-message' &&\n displayUnreadSeparator\n \"\n>\n <ng-container\n *ngTemplateOutlet=\"\n customnewMessagesNotificationTemplate ||\n defaultUnreadMessagesNotification;\n context: {\n unreadCount: unreadCount,\n onDismiss: messageNotificationDismissClicked,\n onJump: messageNotificationJumpClicked\n }\n \"\n ></ng-container>\n</ng-container>\n<ng-template\n #defaultUnreadMessagesNotification\n let-unreadCount=\"unreadCount\"\n let-onDismiss=\"onDismiss\"\n let-onJump=\"onJump\"\n>\n <div\n class=\"str-chat__unread-messages-notification\"\n data-testid=\"unread-messages-notification\"\n >\n <button\n data-testid=\"unread-messages-notification-jump-to-message\"\n (click)=\"onJump()\"\n >\n <ng-container\n *ngIf=\"\n unreadCount > 0 && !hideUnreadCountForNotificationAndIndicator;\n else noUnreadCount\n \"\n >\n {{\n (unreadCount === 1\n ? \"streamChat.\\{\\{count\\}\\} unread message\"\n : \"streamChat.\\{\\{count\\}\\} unread messages\"\n ) | translate: { count: unreadCount }\n }}\n </ng-container>\n <ng-template #noUnreadCount>\n {{ \"streamChat.Unread messages\" | translate }}\n </ng-template>\n </button>\n <button\n data-testid=\"unread-messages-notification-dismiss\"\n (click)=\"onDismiss()\"\n >\n <stream-icon-placeholder icon=\"close\"></stream-icon-placeholder>\n </button>\n </div>\n</ng-template>\n<div #scrollContainer data-testid=\"scroll-container\" class=\"str-chat__list\">\n <ng-container *ngIf=\"mode === 'main' && isEmpty && emptyListTemplate\">\n <ng-container *ngTemplateOutlet=\"emptyListTemplate\"></ng-container>\n </ng-container>\n <div class=\"str-chat__reverse-infinite-scroll str-chat__message-list-scroll\">\n <ul\n class=\"str-chat__ul\"\n [class.str-chat__message-options-in-bubble]=\"\n messageOptionsTrigger === 'message-bubble'\n \"\n >\n <li\n #parentMessageElement\n *ngIf=\"mode === 'thread' && parentMessage\"\n data-testid=\"parent-message\"\n class=\"str-chat__parent-message-li\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: parentMessage, index: 'parent' }\n \"\n ></ng-container>\n <div data-testid=\"reply-count\" class=\"str-chat__thread-start\">\n {{parentMessage?.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </div>\n </li>\n <ng-container *ngIf=\"mode === 'thread' && isEmpty && emptyListTemplate\">\n <ng-container *ngTemplateOutlet=\"emptyListTemplate\"></ng-container>\n </ng-container>\n <stream-loading-indicator\n data-testid=\"top-loading-indicator\"\n *ngIf=\"\n isLoading && direction === 'bottom-to-top' && displayLoadingIndicator\n \"\n ></stream-loading-indicator>\n <ng-container *ngIf=\"messages$ | async as messages\">\n <ng-container\n *ngFor=\"\n let message of messages;\n let i = index;\n let isFirst = first;\n let isLast = last;\n trackBy: trackByMessageId\n \"\n >\n <ng-container *ngIf=\"isFirst\">\n <ng-container\n *ngTemplateOutlet=\"\n dateSeparator;\n context: {\n date: message.created_at,\n parsedDate: parseDate(message.created_at)\n }\n \"\n ></ng-container>\n </ng-container>\n <li\n tabindex=\"0\"\n data-testclass=\"message\"\n class=\"str-chat__li str-chat__li--{{ groupStyles[i] }}\"\n id=\"{{ message.id }}\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: message, index: i }\n \"\n ></ng-container>\n </li>\n <ng-container\n *ngIf=\"\n (lastReadMessageId === message?.id &&\n direction === 'bottom-to-top') ||\n (direction === 'top-to-bottom' &&\n lastReadMessageId === messages[i + 1]?.id)\n \"\n >\n <li\n *ngIf=\"displayUnreadSeparator\"\n id=\"stream-chat-new-message-indicator\"\n data-testid=\"new-messages-indicator\"\n class=\"str-chat__li str-chat__unread-messages-separator-wrapper\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n customnewMessagesIndicatorTemplate ||\n defaultNewMessagesIndicator;\n context: { unreadCount: unreadCount }\n \"\n ></ng-container>\n </li>\n </ng-container>\n <ng-container *ngIf=\"isNextMessageOnSeparateDate[i]\">\n <ng-container\n *ngTemplateOutlet=\"\n dateSeparator;\n context: {\n date: messages[i + 1].created_at,\n parsedDate: parseDate(messages[i + 1].created_at)\n }\n \"\n ></ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n <stream-loading-indicator\n data-testid=\"bottom-loading-indicator\"\n *ngIf=\"\n isLoading && direction === 'top-to-bottom' && displayLoadingIndicator\n \"\n ></stream-loading-indicator>\n </ul>\n <ng-template #defaultTypingIndicator let-usersTyping$=\"usersTyping$\">\n <!-- eslint-disable-next-line @angular-eslint/template/no-any -->\n <ng-container *ngIf=\"$any(usersTyping$ | async) as users\">\n <div\n *ngIf=\"users.length > 0\"\n data-testid=\"typing-indicator\"\n class=\"str-chat__typing-indicator str-chat__typing-indicator--typing\"\n >\n <div class=\"str-chat__typing-indicator__dots\">\n <span class=\"str-chat__typing-indicator__dot\"></span>\n <span class=\"str-chat__typing-indicator__dot\"></span>\n <span class=\"str-chat__typing-indicator__dot\"></span>\n </div>\n <div\n data-testid=\"typing-users\"\n class=\"str-chat__typing-indicator__users\"\n >\n {{\n users.length === 1\n ? (\"streamChat.user is typing\"\n | translate: { user: getTypingIndicatorText(users) })\n : (\"streamChat.users are typing\"\n | translate: { users: getTypingIndicatorText(users) })\n }}\n </div>\n </div>\n </ng-container>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n typingIndicatorTemplate || defaultTypingIndicator;\n context: getTypingIndicatorContext()\n \"\n ></ng-container>\n </div>\n</div>\n<div class=\"str-chat__jump-to-latest-message\">\n <button\n data-testid=\"scroll-to-latest\"\n *ngIf=\"isUserScrolled && isJumpToLatestButtonVisible\"\n class=\"\n str-chat__message-notification-scroll-to-latest\n str-chat__message-notification-scroll-to-latest-right\n str-chat__circle-fab\n \"\n (keyup.enter)=\"jumpToLatestMessage()\"\n (click)=\"jumpToLatestMessage()\"\n >\n <stream-icon\n class=\"str-chat__jump-to-latest-icon str-chat__circle-fab-icon\"\n [icon]=\"direction === 'bottom-to-top' ? 'arrow-down' : 'arrow-up'\"\n ></stream-icon>\n <div\n *ngIf=\"newMessageCountWhileBeingScrolled > 0\"\n class=\"\n str-chat__message-notification\n str-chat__message-notification-scroll-to-latest-unread-count\n str-chat__jump-to-latest-unread-count\n \"\n >\n {{ newMessageCountWhileBeingScrolled }}\n </div>\n </button>\n</div>\n\n<ng-template #messageTemplateContainer let-message=\"message\" let-index=\"index\">\n <ng-template\n #defaultMessageTemplate\n let-messageInput=\"message\"\n let-isLastSentMessage=\"isLastSentMessage\"\n let-enabledMessageActions=\"enabledMessageActions\"\n let-mode=\"mode\"\n let-isHighlighted=\"isHighlighted\"\n let-customActions=\"customActions\"\n >\n <stream-message\n [message]=\"messageInput\"\n [isLastSentMessage]=\"isLastSentMessage\"\n [enabledMessageActions]=\"enabledMessageActions\"\n [mode]=\"mode\"\n [isHighlighted]=\"isHighlighted\"\n [customActions]=\"customActions\"\n ></stream-message>\n </ng-template>\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplate || defaultMessageTemplate;\n context: {\n message: message,\n isLastSentMessage: !!(\n lastSentMessageId && message?.id === lastSentMessageId\n ),\n enabledMessageActions: enabledMessageActions,\n mode: mode,\n isHighlighted: message?.id === highlightedMessageId,\n customActions: customMessageActions\n }\n \"\n ></ng-container>\n</ng-template>\n\n<ng-template #dateSeparator let-date=\"date\" let-parsedDate=\"parsedDate\">\n <ng-container *ngIf=\"displayDateSeparator\">\n <ng-container\n *ngTemplateOutlet=\"\n customDateSeparatorTemplate || defaultDateSeparator;\n context: {\n date: date,\n parsedDate: parsedDate\n }\n \"\n ></ng-container>\n </ng-container>\n\n <ng-template\n #defaultDateSeparator\n let-date=\"date\"\n let-parsedDate=\"parsedDate\"\n >\n <div data-testid=\"date-separator\" class=\"str-chat__date-separator\">\n <hr\n *ngIf=\"\n dateSeparatorTextPos === 'right' || dateSeparatorTextPos === 'center'\n \"\n class=\"str-chat__date-separator-line\"\n />\n <div class=\"str-chat__date-separator-date\">\n {{ parsedDate }}\n </div>\n <hr\n *ngIf=\"\n dateSeparatorTextPos === 'left' || dateSeparatorTextPos === 'center'\n \"\n class=\"str-chat__date-separator-line\"\n />\n </div>\n </ng-template>\n</ng-template>\n\n<ng-template #defaultNewMessagesIndicator let-unreadCount=\"unreadCount\">\n <div class=\"str-chat__unread-messages-separator\">\n <ng-container\n *ngIf=\"\n unreadCount > 0 && !hideUnreadCountForNotificationAndIndicator;\n else noUnreadCount\n \"\n >\n {{\n (unreadCount === 1\n ? \"streamChat.\\{\\{count\\}\\} unread message\"\n : \"streamChat.\\{\\{count\\}\\} unread messages\"\n ) | translate: { count: unreadCount }\n }}\n </ng-container>\n <ng-template #noUnreadCount>\n {{ \"streamChat.Unread messages\" | translate }}\n </ng-template>\n </div>\n</ng-template>\n","import { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n/**\n * The `ImageLoadService` is used to position the scrollbar in the message list\n * @deprecated - This class is no longer used by SDK components as image sizes are fixed\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ImageLoadService {\n /**\n * A subject that can be used to notify the message list if an image attachment finished loading\n */\n imageLoad$ = new Subject<void>();\n\n constructor() {}\n}\n","import { Component, HostBinding, OnDestroy } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { Channel } from 'stream-chat';\nimport { ChatClientService } from '../chat-client.service';\nimport { ChannelService } from '../channel.service';\nimport { CustomTemplatesService } from '../custom-templates.service';\nimport { getChannelDisplayText } from '../get-channel-display-text';\nimport {\n DefaultStreamChatGenerics,\n StreamMessage,\n ThreadHeaderContext,\n} from '../types';\n\n/**\n * The `Thread` component represents a [message thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript), it is a container component that displays a thread with a header, [`MessageList`](./MessageListComponent.mdx) and [`MessageInput`](./MessageInputComponent.mdx) components.\n */\n@Component({\n selector: 'stream-thread',\n templateUrl: './thread.component.html',\n styles: [],\n})\nexport class ThreadComponent implements OnDestroy {\n @HostBinding('class') private class = 'str-chat__thread';\n parentMessage: StreamMessage | undefined;\n channel: Channel<DefaultStreamChatGenerics> | undefined;\n private subscriptions: Subscription[] = [];\n\n constructor(\n public customTemplatesService: CustomTemplatesService,\n private channelService: ChannelService,\n private chatClientService: ChatClientService\n ) {\n this.subscriptions.push(\n this.channelService.activeParentMessage$.subscribe(\n (parentMessage) => (this.parentMessage = parentMessage)\n )\n );\n this.subscriptions.push(\n this.channelService.activeChannel$.subscribe(\n (channel) => (this.channel = channel)\n )\n );\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n getThreadHeaderContext(): ThreadHeaderContext {\n return {\n parentMessage: this.parentMessage,\n closeThreadHandler: () => this.closeThread(),\n };\n }\n\n closeThread() {\n void this.channelService.setAsActiveParentMessage(undefined);\n }\n\n get channelName() {\n if (!this.channel || !this.chatClientService.chatClient.user) {\n return '';\n }\n return getChannelDisplayText(\n this.channel,\n this.chatClientService.chatClient.user\n );\n }\n}\n","<div class=\"str-chat__thread-container\">\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.threadHeaderTemplate$ | async) ||\n defaultThreadHeader;\n context: getThreadHeaderContext()\n \"\n ></ng-container>\n <ng-content></ng-content>\n</div>\n\n<ng-template\n #defaultThreadHeader\n let-parentMessage=\"parentMessage\"\n let-closeThreadHandler=\"closeThreadHandler\"\n>\n <div class=\"str-chat__thread-header\">\n <div class=\"str-chat__thread-header-details\">\n <div class=\"str-chat__thread-header-name\" translate>\n streamChat.Thread\n </div>\n <div\n class=\"str-chat__thread-header-channel-name\"\n data-testid=\"channel-name\"\n >\n {{ channelName }}\n </div>\n </div>\n <button\n class=\"str-chat__square-button str-chat__close-thread-button\"\n data-testid=\"close-button\"\n (click)=\"closeThreadHandler()\"\n >\n <stream-icon-placeholder\n icon=\"close-no-outline\"\n ></stream-icon-placeholder>\n </button>\n </div>\n</ng-template>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { AvatarComponent } from './avatar/avatar.component';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { AvatarPlaceholderComponent } from './avatar-placeholder/avatar-placeholder.component';\n\n@NgModule({\n declarations: [AvatarComponent, AvatarPlaceholderComponent],\n imports: [CommonModule, TranslateModule],\n exports: [AvatarComponent, AvatarPlaceholderComponent],\n})\nexport class StreamAvatarModule {}\n","import { NgModule } from '@angular/core';\nimport { ChannelComponent } from './channel/channel.component';\nimport { ChannelHeaderComponent } from './channel-header/channel-header.component';\nimport { ChannelListComponent } from './channel-list/channel-list.component';\nimport { ChannelPreviewComponent } from './channel-preview/channel-preview.component';\nimport { MessageComponent } from './message/message.component';\nimport { MessageInputComponent } from './message-input/message-input.component';\nimport { MessageListComponent } from './message-list/message-list.component';\nimport { CommonModule } from '@angular/common';\nimport { LoadingIndicatorComponent } from './loading-indicator/loading-indicator.component';\nimport { IconComponent } from './icon/icon.component';\nimport { MessageActionsBoxComponent } from './message-actions-box/message-actions-box.component';\nimport { AttachmentListComponent } from './attachment-list/attachment-list.component';\nimport { MessageReactionsComponent } from './message-reactions/message-reactions.component';\nimport { NotificationComponent } from './notification/notification.component';\nimport { NotificationListComponent } from './notification-list/notification-list.component';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { AttachmentPreviewListComponent } from './attachment-preview-list/attachment-preview-list.component';\nimport { ModalComponent } from './modal/modal.component';\nimport { TextareaDirective } from './message-input/textarea.directive';\nimport { StreamAvatarModule } from './stream-avatar.module';\nimport { ThreadComponent } from './thread/thread.component';\nimport { IconPlaceholderComponent } from './icon-placeholder/icon-placeholder.component';\nimport { LoadingIndicatorPlaceholderComponent } from './loading-indicator-placeholder/loading-indicator-placeholder.component';\nimport { NgxPopperjsModule } from 'ngx-popperjs';\nimport { EditMessageFormComponent } from './edit-message-form/edit-message-form.component';\nimport { MessageBouncePromptComponent } from './message-bounce-prompt/message-bounce-prompt.component';\nimport { VoiceRecordingComponent } from './voice-recording/voice-recording.component';\nimport { VoiceRecordingWavebarComponent } from './voice-recording/voice-recording-wavebar/voice-recording-wavebar.component';\n\n@NgModule({\n declarations: [\n ChannelComponent,\n ChannelHeaderComponent,\n ChannelListComponent,\n ChannelPreviewComponent,\n MessageComponent,\n MessageInputComponent,\n MessageListComponent,\n LoadingIndicatorComponent,\n IconComponent,\n MessageActionsBoxComponent,\n AttachmentListComponent,\n MessageReactionsComponent,\n NotificationComponent,\n NotificationListComponent,\n AttachmentPreviewListComponent,\n ModalComponent,\n TextareaDirective,\n ThreadComponent,\n IconPlaceholderComponent,\n LoadingIndicatorPlaceholderComponent,\n EditMessageFormComponent,\n MessageBouncePromptComponent,\n VoiceRecordingComponent,\n VoiceRecordingWavebarComponent,\n ],\n imports: [\n CommonModule,\n TranslateModule,\n StreamAvatarModule,\n NgxPopperjsModule,\n ],\n exports: [\n ChannelComponent,\n ChannelHeaderComponent,\n ChannelListComponent,\n ChannelPreviewComponent,\n MessageComponent,\n MessageInputComponent,\n MessageListComponent,\n LoadingIndicatorComponent,\n IconComponent,\n MessageActionsBoxComponent,\n AttachmentListComponent,\n MessageReactionsComponent,\n NotificationComponent,\n NotificationListComponent,\n AttachmentPreviewListComponent,\n ModalComponent,\n StreamAvatarModule,\n ThreadComponent,\n IconPlaceholderComponent,\n LoadingIndicatorPlaceholderComponent,\n EditMessageFormComponent,\n MessageBouncePromptComponent,\n VoiceRecordingComponent,\n VoiceRecordingWavebarComponent,\n ],\n})\nexport class StreamChatModule {}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { AutocompleteTextareaComponent } from './message-input/autocomplete-textarea/autocomplete-textarea.component';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { MentionModule } from 'angular-mentions';\nimport { StreamAvatarModule } from './stream-avatar.module';\nimport { textareaInjectionToken } from './injection-tokens';\n\n@NgModule({\n declarations: [AutocompleteTextareaComponent],\n imports: [CommonModule, TranslateModule, MentionModule, StreamAvatarModule],\n exports: [AutocompleteTextareaComponent],\n providers: [\n {\n provide: textareaInjectionToken,\n useValue: AutocompleteTextareaComponent,\n },\n ],\n})\nexport class StreamAutocompleteTextareaModule {}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { TextareaComponent } from './message-input/textarea/textarea.component';\nimport { textareaInjectionToken } from './injection-tokens';\n\n@NgModule({\n declarations: [TextareaComponent],\n imports: [CommonModule, TranslateModule],\n exports: [TextareaComponent],\n providers: [\n {\n provide: textareaInjectionToken,\n useValue: TextareaComponent,\n },\n ],\n})\nexport class StreamTextareaModule {}\n","/*\n * Public API Surface of stream-chat-angular\n */\n\nexport * from './lib/chat-client.service';\nexport * from './lib/channel.service';\nexport * from './lib/theme.service';\nexport * from './lib/attachment.service';\nexport * from './lib/attachment-configuration.service';\nexport * from './lib/stream-i18n.service';\nexport * from './lib/avatar/avatar.component';\nexport * from './lib/avatar-placeholder/avatar-placeholder.component';\nexport * from './lib/icon/icon.component';\nexport * from './lib/icon-placeholder/icon-placeholder.component';\nexport * from './lib/loading-indicator/loading-indicator.component';\nexport * from './lib/loading-indicator-placeholder/loading-indicator-placeholder.component';\nexport * from './lib/message-actions-box/message-actions-box.component';\nexport * from './lib/channel/channel.component';\nexport * from './lib/channel-header/channel-header.component';\nexport * from './lib/channel-preview/channel-preview.component';\nexport * from './lib/channel-list/channel-list.component';\nexport * from './lib/channel-list/channel-list-toggle.service';\nexport * from './lib/message/message.component';\nexport * from './lib/parse-date';\nexport * from './lib/list-users';\nexport * from './lib/message-input/message-input.component';\nexport * from './lib/edit-message-form/edit-message-form.component';\nexport * from './lib/message-bounce-prompt/message-bounce-prompt.component';\nexport * from './lib/message-input/textarea/textarea.component';\nexport * from './lib/message-input/autocomplete-textarea/autocomplete-textarea.component';\nexport * from './lib/message-input/message-input-config.service';\nexport * from './lib/message-input/textarea.directive';\nexport * from './lib/message-input/textarea.interface';\nexport * from './lib/message-input/emoji-input.service';\nexport * from './lib/message-list/message-list.component';\nexport * from './lib/message-list/image-load.service';\nexport * from './lib/message-list/group-styles';\nexport * from './lib/attachment-list/attachment-list.component';\nexport * from './lib/attachment-preview-list/attachment-preview-list.component';\nexport * from './lib/message-reactions/message-reactions.component';\nexport * from './lib/notification/notification.component';\nexport * from './lib/notification-list/notification-list.component';\nexport * from './lib/thread/thread.component';\nexport * from './lib/modal/modal.component';\nexport * from './lib/read-by';\nexport * from './lib/get-message-translation';\nexport * from './lib/get-channel-display-text';\nexport * from './lib/is-image-attachment';\nexport * from './lib/is-image-file';\nexport * from './lib/message-preview';\nexport * from './lib/notification.service';\nexport * from './lib/transliteration.service';\nexport * from './lib/stream-chat.module';\nexport * from './lib/stream-avatar.module';\nexport * from './lib/stream-autocomplete-textarea.module';\nexport * from './lib/stream-textarea.module';\nexport * from './lib/injection-tokens';\nexport * from './lib/custom-templates.service';\nexport * from './lib/message-reactions.service';\nexport * from './lib/date-parser.service';\nexport * from './lib/types';\nexport * from './lib/message.service';\nexport * from './lib/message-actions.service';\nexport * from './lib/voice-recording/voice-recording.component';\nexport * from './lib/voice-recording/voice-recording-wavebar/voice-recording-wavebar.component';\nexport * from './lib/is-on-separate-date';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["BehaviorSubject","Injectable","ReplaySubject","StreamChat","take","uuidv4","shareReplay","map","combineLatest","first","filter","Component","Input","EventEmitter","Output","ViewChild","InjectionToken","Directive","Subject","prettybytes","HostBinding","timer","tap","Inject","distinctUntilChanged","Dayjs","calendar","relativeTime","NgxPopperjsTriggers","NgxPopperjsPlacements","emojiRegex","ChangeDetectionStrategy","transliterate","debounceTime","throttleTime","CommonModule","TranslateModule","NgModule","NgxPopperjsModule","MentionModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA;;;;;;;;;;;;;;IAcA;IAEA,IAAI,aAAa,GAAG,UAAS,CAAC,EAAE,CAAC;QAC7B,aAAa,GAAG,MAAM,CAAC,cAAc;aAChC,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;YAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC;gBAAE,IAAI,MAAM,CAA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