@posiwise/messaging-module 0.0.98 → 0.0.99
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,643 +1,870 @@
|
|
|
1
|
-
import { ScrollingModule } from
|
|
2
|
-
import * as i3 from
|
|
3
|
-
import { CommonModule } from
|
|
4
|
-
import * as i0 from
|
|
5
|
-
import {
|
|
6
|
-
import * as i4 from
|
|
7
|
-
import { FormsModule } from
|
|
8
|
-
import * as i1
|
|
9
|
-
import { RouterModule } from
|
|
10
|
-
import * as
|
|
11
|
-
import { PipesModule } from
|
|
12
|
-
import { NgxFileDropModule } from
|
|
13
|
-
import * as
|
|
14
|
-
import { InfiniteScrollModule } from
|
|
15
|
-
import * as
|
|
16
|
-
import { AutoCompleteModule } from
|
|
17
|
-
import * as i5 from
|
|
18
|
-
import { ProgressSpinnerModule } from
|
|
19
|
-
import * as
|
|
20
|
-
import { PickerModule } from
|
|
21
|
-
import { EmojiModule } from
|
|
22
|
-
import { AppBaseComponent } from
|
|
23
|
-
import * as i1 from
|
|
24
|
-
import { PermissionService } from
|
|
25
|
-
import { ATTACHMENT_TYPE, ChatUser, Conversation, SOCKET_TYPE } from
|
|
26
|
-
import groupBy from
|
|
27
|
-
import sortBy from
|
|
28
|
-
import uniqBy from
|
|
29
|
-
import moment from
|
|
30
|
-
import { lastValueFrom } from
|
|
31
|
-
import * as i2 from
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
.then(ok => {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: ChatBoxComponent, isStandalone: false, selector: "ng-component", viewQueries: [{ propertyName: "messageInputRef", first: true, predicate: ["messageInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"chat-application mt-5\">\n <div class=\"content-overlay\"></div>\n\n @if (isChatLoading) {\n <div class=\"text-center\">\n <p-progressSpinner> </p-progressSpinner>\n </div>\n }\n\n @if (!isChatLoading) {\n <div class=\"chat-sidebar float-start d-none d-sm-none d-md-block d-lg-block\">\n <div class=\"chat-sidebar-content\">\n <div class=\"chat-fixed-search p-2\">\n <div class=\"d-flex\">\n <p-autoComplete appendTo=\"body\" inputId=\"chatbox-search-member\"\n [(ngModel)]=\"searchText\"\n #searchTxt\n placeholder=\"Search members...\"\n [ngModelOptions]=\"{ standalone: true }\"\n optionLabel=\"first_name\"\n (onSelect)=\"onMemberSelection(searchText)\"\n [suggestions]=\"recipients\"\n (completeMethod)=\"recipientSearch()\">\n <ng-template let-item\n pTemplate=\"item\">\n <div>\n {{ item.first_name + ' ' }}\n {{ item.last_name ? item.last_name : '' }}\n </div>\n </ng-template>\n </p-autoComplete>\n </div>\n </div>\n\n <!-- Thread/conversation List -->\n <div id=\"users-list\"\n class=\"list-group position-relative\">\n @if (conversations?.length) {\n <div class=\"users-list-padding\">\n @for (conversation of conversations; track trackConversationKey(conversation)) {\n <a class=\"list-group-item no-border\"\n (click)=\"onParticipantClick(conversation)\">\n <div class=\"d-flex\">\n <span class=\"avatar avatar-md avatar-away\">\n @if (conversation?.to?.avatar) {\n <img [src]=\"conversation.to?.avatar\"\n width=\"40\"\n height=\"40\"\n role=\"presentation\"\n (error)=\"onImgError($event, '/assets/img/icons/male.png')\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar me-2\">\n <strong>{{\n conversation?.participants\n ? conversation.to?.slug.charAt(0).toUpperCase()\n : conversation.to?.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n }\n </span>\n <div class=\"clearfix\">\n <h6 class=\"list-group-item-heading mb-1\">\n {{\n conversation.to?.name\n ? conversation.to?.name\n : conversation.to?.slug\n }}\n <span class=\"font-small-3 float-end ms-5 ps-5\">\n @if (conversation?.unread_count) {\n <span class=\"badge bg-primary rounded-pill bg-primary mx-1\">\n {{ conversation.unread_count }}\n </span>\n }\n {{ conversation.created_at | date: 'shortTime' }}\n </span>\n </h6>\n <p class=\"list-group-item-text text-muted\">\n {{ conversation?.latest_message?.body | textTruncate: 25 }}\n </p>\n </div>\n </div>\n </a>\n }\n </div>\n }\n </div>\n </div>\n </div>\n\n @if (conversations?.length) {\n <!-- Chat Header -->\n @if (otherUser) {\n <div class=\"chat-name p-2 bg-white\">\n <div class=\"d-flex\">\n <span class=\"chat-app-sidebar-toggle ft-align-justify font-large-1 me-2 d-none d-block d-sm-block d-md-none\"\n (keydown.enter)=\"toggleSidebar()\"\n (click)=\"toggleSidebar()\"></span>\n <div class=\"clearfix\">\n @if (currentConversation?.to?.avatar) {\n <img [src]=\"currentConversation?.to?.avatar\"\n width=\"40\"\n height=\"40\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\"\n role=\"presentation\"\n (error)=\"onImgError($event, '/assets/img/icons/male.png')\" />\n } @else {\n @if (currentUser) {\n <div class=\"dummy-avatar me-2\">\n <strong>{{\n otherUser?.name\n ? otherUser.name.charAt(0).toUpperCase()\n : otherUser.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n }\n }\n\n @if (currentUser) {\n <strong class=\"mt-2\">{{\n otherUser.name ? otherUser.name : otherUser.slug\n }}</strong>\n }\n </div>\n </div>\n </div>\n }\n\n <!-- Chat Window -->\n <div class=\"chat-app-window\"\n id=\"chats-wrapper\"\n #scrollMe\n infinite-scroll\n [infiniteScrollDistance]=\"scrollDistance\"\n [scrollWindow]=\"false\"\n [infiniteScrollUpDistance]=\"scrollUpDistance\"\n [infiniteScrollThrottle]=\"throttle\"\n [alwaysCallback]=\"true\"\n (scrolledUp)=\"onUp($event, selectedConversationId)\">\n <div class=\"chats\">\n <!-- Shows Message -->\n @if (!isLoaded) {\n <div class=\"spinner\"></div>\n }\n @if (messagesGroupedByDate) {\n @for (item of ObjectKeys(messagesGroupedByDate); track item) {\n <strong class=\"badge bg-secondary mb-1\">{{\n messagesGroupedByDate[item][0]?.created_at | date\n }}</strong>\n <!-- Every Message -->\n @for (message of messagesGroupedByDate[item]; track message.id) {\n <div class=\"chat\"\n [ngClass]=\"{\n 'chat-left ms-2': message.sender_id !== currentUser.id,\n 'me-2': message.sender_id === currentUser.id\n }\">\n @if (message.body || message.attachment?.url) {\n <div class=\"chat-avatar\">\n <a class=\"avatar\"\n data-toggle=\"tooltip\"\n data-placement=\"right\"\n data-original-title=\"\">\n <!-- Setting up Avatar Image for Logged In User -->\n @if (message.sender_id === currentUser.id) {\n @if (currentUserImg) {\n <img [src]=\"currentUserImg\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar bg-brown\">\n <strong>{{\n currentUser?.name\n ? currentUser.name\n .charAt(0)\n .toUpperCase()\n : currentUser.slug\n .charAt(0)\n .toUpperCase()\n }}\n </strong>\n </div>\n }\n }\n\n <!-- Participant -->\n @if (message.sender_id !== currentUser.id) {\n @if (currentUser && otherUser?.avatar) {\n <img [src]=\"otherUser?.avatar\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar\">\n <strong>{{\n otherUser?.name\n ? otherUser.name\n .charAt(0)\n .toUpperCase()\n : otherUser.slug\n .charAt(0)\n .toUpperCase()\n }}</strong>\n </div>\n }\n }\n </a>\n </div>\n <div class=\"chat-body\">\n @if (!message?.attachment?.url) {\n <div class=\"chat-content attachment\">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n @if (message.sender_id === currentUser.id) {\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n (click)=\"onDeleteMessage(message)\"\n (keydown.enter)=\"onDeleteMessage(message)\"\n ></i>\n }\n @if (message.sender_id === currentUser.id && message.is_open) {\n <i\n class=\"fa fa-check-double msg-double-check\"\n ></i>\n }\n <p>{{ message.body }}</p>\n </div>\n } @else {\n <div class=\"chat-content with-attachment\">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n @if (message.sender_id === currentUser.id) {\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n (click)=\"onDeleteMessage(message)\"\n (keydown.enter)=\"onDeleteMessage(message)\"\n ></i>\n }\n @if (message.attachment) {\n <div class=\"message-attachment\">\n <i>\n @if (message?.messageType === ATTACHMENT_TYPE.IMG) {\n <img\n [src]=\"message.attachment.url\"\n class=\"img-thumbnail\"\n alt=\"message attachment\"\n />\n }\n @if (message?.messageType === ATTACHMENT_TYPE.VIDEO) {\n <video\n width=\"320\"\n height=\"240\"\n controls\n class=\"img-thumbnail\"\n >\n <source\n [src]=\"message.attachment.url\"\n type=\"video/mp4\"\n />\n <track kind=\"subtitles\" srclang=\"en\" label=\"English\" />\n Your browser does not support the video\n tag.\n </video>\n }\n <a\n [attr.href]=\"message.attachment.url\"\n target=\"_blank\"\n >\n <i\n class=\"fa fa-file-download me-2\"\n aria-hidden=\"true\"\n ></i>\n {{\n message.attachment.url\n | common: 'filename'\n }}</a>\n </i>\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n }\n }\n\n @if (!messagesGroupedByDate && isLoaded) {\n <div class=\"mt-3 text-center\">No message history.</div>\n }\n\n @if (isFileUploading) {\n <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>\n }\n\n <!-- Shows Metadata of the file being uploaded -->\n <div class=\"compose-message-attachment\">\n <div class=\"m-0\">\n @for (item of attachedFiles; track $index) {\n <div class=\"card px-3 py-2 m-0 mb-1\">\n <div class=\"card-body\">\n <div class=\"d-inline-block file-name\">{{ item.name }}</div>\n <div class=\"d-inline-block file-size\">{{ item.size }}</div>\n <div class=\"d-inline-block float-end file-remove\"\n (keydown.enter)=\"onRemoveAttachment(item)\"\n (click)=\"onRemoveAttachment(item)\">\n\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n\n <div [hidden]=\"!showEmoji\">\n <emoji-mart title=\"Pick your emoji\u2026\"\n set=\"facebook\"\n [showPreview]=\"false\"\n (emojiSelect)=\"onEmojiSelect($event)\"\n [emojiSize]=\"30\">\n </emoji-mart>\n </div>\n\n <!-- Compose Text box area -->\n <div class=\"chat-app-form bg-blue-grey bg-lighten-5\">\n <form class=\"chat-app-input row\">\n <fieldset class=\"mb-3 position-relative has-icon-left col-10 m-0 mb-1\">\n <div class=\"form-control-position emoji-container\">\n <button type=\"button\" class=\"emoji-toggle-btn\" aria-label=\"Insert emoji\" (click)=\"showEmoji = !showEmoji\">\uD83D\uDE42</button>\n </div>\n <label for=\"chatbox-message-input\" class=\"visually-hidden\">Type your message</label>\n <input type=\"text\"\n id=\"chatbox-message-input\"\n name=\"chatbox-message-input\"\n class=\"form-control\"\n autocomplete=\"off\"\n placeholder=\"Type your message here...\"\n (keydown.enter)=\"onSendMessage(); $event.preventDefault()\"\n #messageInput\n aria-label=\"Type your message here...\" />\n <div class=\"form-control-position control-position-right\">\n <div class=\"image-upload\">\n <label for=\"file-input\">\n <span class=\"visually-hidden\">Attach file</span>\n <i class=\"fa fa-paperclip\" aria-hidden=\"true\"></i>\n <input\n id=\"file-input\"\n name=\"file-input\"\n type=\"file\"\n (change)=\"fileChangeListener($event)\"\n size=\"60\"\n aria-label=\"File Input\" />\n </label>\n </div>\n </div>\n </fieldset>\n\n <fieldset class=\"mb-3 position-relative has-icon-left col-2 m-0 mb-1\">\n <button type=\"button\"\n class=\"btn btn-primary d-lg-flex align-items-center btn-send\"\n (click)=\"onSendMessage()\">\n <i class=\"fa fa-paper-plane\"></i><span class=\"d-none d-lg-block ms-1\">Send</span>\n </button>\n </fieldset>\n </form>\n </div>\n } @else {\n <div class=\"container-fluid pw-tab overflow-hidden no-message-center\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body text-center mt-5\">\n <div>\n <img src=\"/assets/img/icons/empty-chat-icon.png\"\n alt=\"No Chat\" />\n </div>\n <div class=\"h4 mt-4\">No messages yet!</div>\n <div class=\"mt-3\">\n <p>It looks like you haven't shared or received any messages yet.</p>\n <p>\n Start typing the name of the member you want to send a message to\n in the chat search field and send them a message.\n </p>\n </div>\n </div>\n </div>\n </div>\n }\n }\n</div>\n", styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}:host ::ng-deep .chat-application{height:calc(100vh - 92px);position:relative}#drift-widget-container{display:none!important}#file-input{height:0;visibility:hidden;width:0}.message-attachment{color:#fff}.emoji-toggle-btn{background:transparent;border:0;color:#676767;cursor:pointer;font-size:20px;line-height:1;padding:4px 6px}.compose-message-attachment{bottom:0;color:#676767;left:0;position:absolute;width:55%}.compose-message-attachment .file-name{font-size:14px;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:400px}.compose-message-attachment .file-size{width:100px}.compose-message-attachment .file-remove{width:45px}.compose-message-attachment .file-remove i{margin-left:37px;margin-top:7px}.fa-spinner{font-size:24px}.fa-paperclip{font-size:19px;margin-top:7px;width:13px}.dummy-avatar{background-color:#ff586b;border-radius:50%;color:#fff;font-size:18px;height:40px;line-height:40px;text-align:center;width:40px;display:inline-block}.card{border:1px solid rgb(204,204,204)}.msg-double-check{color:#4fc3f7;font-size:10px;left:-13px;position:absolute;top:11px}.btn-delete{display:none;left:-85px;position:absolute;top:11px}.chat-body:hover .btn-delete{display:block!important}.bg-brown{background-color:#cc6000}.btn-send{border-radius:5px;padding:7px 13px}@keyframes spinner{to{transform:rotate(360deg)}}.spinner{animation:spinner .6s linear infinite!important;border:3px solid rgb(204,204,204);border-radius:50%;border-top-color:#000;box-sizing:border-box;content:\"\";height:50px;left:50%;margin-left:-10px;margin-top:-10px;position:absolute;top:10%;width:50px}@media(min-width:768px){.no-message-center{margin-left:auto;width:calc(100% - 300px)}}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i5.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "directive", type: i6.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i7.AutoComplete, selector: "p-autoComplete, p-autocomplete, p-auto-complete", inputs: ["minLength", "minQueryLength", "delay", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "showClear", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "addOnTab", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "overlayOptions", "suggestions", "optionLabel", "optionValue", "id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "selectOnFocus", "searchLocale", "optionDisabled", "focusOnHover", "typeahead", "addOnBlur", "separator", "appendTo", "motionOptions"], outputs: ["completeMethod", "onSelect", "onUnselect", "onAdd", "onFocus", "onBlur", "onDropdownClick", "onClear", "onInputKeydown", "onKeyUp", "onShow", "onHide", "onLazyLoad"] }, { kind: "component", type: i8.PickerComponent, selector: "emoji-mart", inputs: ["perLine", "totalFrequentLines", "i18n", "style", "title", "emoji", "darkMode", "color", "hideObsolete", "categories", "activeCategories", "set", "skin", "isNative", "emojiSize", "sheetSize", "emojisToShowFilter", "showPreview", "emojiTooltip", "autoFocus", "custom", "hideRecent", "imageUrlFn", "include", "exclude", "notFoundEmoji", "categoriesIcons", "searchIcons", "useButton", "enableFrequentEmojiSort", "enableSearch", "showSingleCategory", "virtualize", "virtualizeOffset", "recent", "backgroundImageFn"], outputs: ["emojiClick", "emojiSelect", "skinChange"] }, { kind: "directive", type: i9.InfiniteScrollDirective, selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]", inputs: ["infiniteScrollDistance", "infiniteScrollUpDistance", "infiniteScrollThrottle", "infiniteScrollDisabled", "infiniteScrollContainer", "scrollWindow", "immediateCheck", "horizontal", "alwaysCallback", "fromRoot"], outputs: ["scrolled", "scrolledUp"] }, { kind: "pipe", type: i3.DatePipe, name: "date" }, { kind: "pipe", type: i10.TextTruncatePipe, name: "textTruncate" }, { kind: "pipe", type: i10.CommonPipe, name: "common" }] }); }
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
args: [{ standalone: false, template: "<div class=\"chat-application mt-5\">\n <div class=\"content-overlay\"></div>\n\n @if (isChatLoading) {\n <div class=\"text-center\">\n <p-progressSpinner> </p-progressSpinner>\n </div>\n }\n\n @if (!isChatLoading) {\n <div class=\"chat-sidebar float-start d-none d-sm-none d-md-block d-lg-block\">\n <div class=\"chat-sidebar-content\">\n <div class=\"chat-fixed-search p-2\">\n <div class=\"d-flex\">\n <p-autoComplete appendTo=\"body\" inputId=\"chatbox-search-member\"\n [(ngModel)]=\"searchText\"\n #searchTxt\n placeholder=\"Search members...\"\n [ngModelOptions]=\"{ standalone: true }\"\n optionLabel=\"first_name\"\n (onSelect)=\"onMemberSelection(searchText)\"\n [suggestions]=\"recipients\"\n (completeMethod)=\"recipientSearch()\">\n <ng-template let-item\n pTemplate=\"item\">\n <div>\n {{ item.first_name + ' ' }}\n {{ item.last_name ? item.last_name : '' }}\n </div>\n </ng-template>\n </p-autoComplete>\n </div>\n </div>\n\n <!-- Thread/conversation List -->\n <div id=\"users-list\"\n class=\"list-group position-relative\">\n @if (conversations?.length) {\n <div class=\"users-list-padding\">\n @for (conversation of conversations; track trackConversationKey(conversation)) {\n <a class=\"list-group-item no-border\"\n (click)=\"onParticipantClick(conversation)\">\n <div class=\"d-flex\">\n <span class=\"avatar avatar-md avatar-away\">\n @if (conversation?.to?.avatar) {\n <img [src]=\"conversation.to?.avatar\"\n width=\"40\"\n height=\"40\"\n role=\"presentation\"\n (error)=\"onImgError($event, '/assets/img/icons/male.png')\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar me-2\">\n <strong>{{\n conversation?.participants\n ? conversation.to?.slug.charAt(0).toUpperCase()\n : conversation.to?.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n }\n </span>\n <div class=\"clearfix\">\n <h6 class=\"list-group-item-heading mb-1\">\n {{\n conversation.to?.name\n ? conversation.to?.name\n : conversation.to?.slug\n }}\n <span class=\"font-small-3 float-end ms-5 ps-5\">\n @if (conversation?.unread_count) {\n <span class=\"badge bg-primary rounded-pill bg-primary mx-1\">\n {{ conversation.unread_count }}\n </span>\n }\n {{ conversation.created_at | date: 'shortTime' }}\n </span>\n </h6>\n <p class=\"list-group-item-text text-muted\">\n {{ conversation?.latest_message?.body | textTruncate: 25 }}\n </p>\n </div>\n </div>\n </a>\n }\n </div>\n }\n </div>\n </div>\n </div>\n\n @if (conversations?.length) {\n <!-- Chat Header -->\n @if (otherUser) {\n <div class=\"chat-name p-2 bg-white\">\n <div class=\"d-flex\">\n <span class=\"chat-app-sidebar-toggle ft-align-justify font-large-1 me-2 d-none d-block d-sm-block d-md-none\"\n (keydown.enter)=\"toggleSidebar()\"\n (click)=\"toggleSidebar()\"></span>\n <div class=\"clearfix\">\n @if (currentConversation?.to?.avatar) {\n <img [src]=\"currentConversation?.to?.avatar\"\n width=\"40\"\n height=\"40\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\"\n role=\"presentation\"\n (error)=\"onImgError($event, '/assets/img/icons/male.png')\" />\n } @else {\n @if (currentUser) {\n <div class=\"dummy-avatar me-2\">\n <strong>{{\n otherUser?.name\n ? otherUser.name.charAt(0).toUpperCase()\n : otherUser.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n }\n }\n\n @if (currentUser) {\n <strong class=\"mt-2\">{{\n otherUser.name ? otherUser.name : otherUser.slug\n }}</strong>\n }\n </div>\n </div>\n </div>\n }\n\n <!-- Chat Window -->\n <div class=\"chat-app-window\"\n id=\"chats-wrapper\"\n #scrollMe\n infinite-scroll\n [infiniteScrollDistance]=\"scrollDistance\"\n [scrollWindow]=\"false\"\n [infiniteScrollUpDistance]=\"scrollUpDistance\"\n [infiniteScrollThrottle]=\"throttle\"\n [alwaysCallback]=\"true\"\n (scrolledUp)=\"onUp($event, selectedConversationId)\">\n <div class=\"chats\">\n <!-- Shows Message -->\n @if (!isLoaded) {\n <div class=\"spinner\"></div>\n }\n @if (messagesGroupedByDate) {\n @for (item of ObjectKeys(messagesGroupedByDate); track item) {\n <strong class=\"badge bg-secondary mb-1\">{{\n messagesGroupedByDate[item][0]?.created_at | date\n }}</strong>\n <!-- Every Message -->\n @for (message of messagesGroupedByDate[item]; track message.id) {\n <div class=\"chat\"\n [ngClass]=\"{\n 'chat-left ms-2': message.sender_id !== currentUser.id,\n 'me-2': message.sender_id === currentUser.id\n }\">\n @if (message.body || message.attachment?.url) {\n <div class=\"chat-avatar\">\n <a class=\"avatar\"\n data-toggle=\"tooltip\"\n data-placement=\"right\"\n data-original-title=\"\">\n <!-- Setting up Avatar Image for Logged In User -->\n @if (message.sender_id === currentUser.id) {\n @if (currentUserImg) {\n <img [src]=\"currentUserImg\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar bg-brown\">\n <strong>{{\n currentUser?.name\n ? currentUser.name\n .charAt(0)\n .toUpperCase()\n : currentUser.slug\n .charAt(0)\n .toUpperCase()\n }}\n </strong>\n </div>\n }\n }\n\n <!-- Participant -->\n @if (message.sender_id !== currentUser.id) {\n @if (currentUser && otherUser?.avatar) {\n <img [src]=\"otherUser?.avatar\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar\">\n <strong>{{\n otherUser?.name\n ? otherUser.name\n .charAt(0)\n .toUpperCase()\n : otherUser.slug\n .charAt(0)\n .toUpperCase()\n }}</strong>\n </div>\n }\n }\n </a>\n </div>\n <div class=\"chat-body\">\n @if (!message?.attachment?.url) {\n <div class=\"chat-content attachment\">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n @if (message.sender_id === currentUser.id) {\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n (click)=\"onDeleteMessage(message)\"\n (keydown.enter)=\"onDeleteMessage(message)\"\n ></i>\n }\n @if (message.sender_id === currentUser.id && message.is_open) {\n <i\n class=\"fa fa-check-double msg-double-check\"\n ></i>\n }\n <p>{{ message.body }}</p>\n </div>\n } @else {\n <div class=\"chat-content with-attachment\">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n @if (message.sender_id === currentUser.id) {\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n (click)=\"onDeleteMessage(message)\"\n (keydown.enter)=\"onDeleteMessage(message)\"\n ></i>\n }\n @if (message.attachment) {\n <div class=\"message-attachment\">\n <i>\n @if (message?.messageType === ATTACHMENT_TYPE.IMG) {\n <img\n [src]=\"message.attachment.url\"\n class=\"img-thumbnail\"\n alt=\"message attachment\"\n />\n }\n @if (message?.messageType === ATTACHMENT_TYPE.VIDEO) {\n <video\n width=\"320\"\n height=\"240\"\n controls\n class=\"img-thumbnail\"\n >\n <source\n [src]=\"message.attachment.url\"\n type=\"video/mp4\"\n />\n <track kind=\"subtitles\" srclang=\"en\" label=\"English\" />\n Your browser does not support the video\n tag.\n </video>\n }\n <a\n [attr.href]=\"message.attachment.url\"\n target=\"_blank\"\n >\n <i\n class=\"fa fa-file-download me-2\"\n aria-hidden=\"true\"\n ></i>\n {{\n message.attachment.url\n | common: 'filename'\n }}</a>\n </i>\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n }\n }\n\n @if (!messagesGroupedByDate && isLoaded) {\n <div class=\"mt-3 text-center\">No message history.</div>\n }\n\n @if (isFileUploading) {\n <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>\n }\n\n <!-- Shows Metadata of the file being uploaded -->\n <div class=\"compose-message-attachment\">\n <div class=\"m-0\">\n @for (item of attachedFiles; track $index) {\n <div class=\"card px-3 py-2 m-0 mb-1\">\n <div class=\"card-body\">\n <div class=\"d-inline-block file-name\">{{ item.name }}</div>\n <div class=\"d-inline-block file-size\">{{ item.size }}</div>\n <div class=\"d-inline-block float-end file-remove\"\n (keydown.enter)=\"onRemoveAttachment(item)\"\n (click)=\"onRemoveAttachment(item)\">\n\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n\n <div [hidden]=\"!showEmoji\">\n <emoji-mart title=\"Pick your emoji\u2026\"\n set=\"facebook\"\n [showPreview]=\"false\"\n (emojiSelect)=\"onEmojiSelect($event)\"\n [emojiSize]=\"30\">\n </emoji-mart>\n </div>\n\n <!-- Compose Text box area -->\n <div class=\"chat-app-form bg-blue-grey bg-lighten-5\">\n <form class=\"chat-app-input row\">\n <fieldset class=\"mb-3 position-relative has-icon-left col-10 m-0 mb-1\">\n <div class=\"form-control-position emoji-container\">\n <button type=\"button\" class=\"emoji-toggle-btn\" aria-label=\"Insert emoji\" (click)=\"showEmoji = !showEmoji\">\uD83D\uDE42</button>\n </div>\n <label for=\"chatbox-message-input\" class=\"visually-hidden\">Type your message</label>\n <input type=\"text\"\n id=\"chatbox-message-input\"\n name=\"chatbox-message-input\"\n class=\"form-control\"\n autocomplete=\"off\"\n placeholder=\"Type your message here...\"\n (keydown.enter)=\"onSendMessage(); $event.preventDefault()\"\n #messageInput\n aria-label=\"Type your message here...\" />\n <div class=\"form-control-position control-position-right\">\n <div class=\"image-upload\">\n <label for=\"file-input\">\n <span class=\"visually-hidden\">Attach file</span>\n <i class=\"fa fa-paperclip\" aria-hidden=\"true\"></i>\n <input\n id=\"file-input\"\n name=\"file-input\"\n type=\"file\"\n (change)=\"fileChangeListener($event)\"\n size=\"60\"\n aria-label=\"File Input\" />\n </label>\n </div>\n </div>\n </fieldset>\n\n <fieldset class=\"mb-3 position-relative has-icon-left col-2 m-0 mb-1\">\n <button type=\"button\"\n class=\"btn btn-primary d-lg-flex align-items-center btn-send\"\n (click)=\"onSendMessage()\">\n <i class=\"fa fa-paper-plane\"></i><span class=\"d-none d-lg-block ms-1\">Send</span>\n </button>\n </fieldset>\n </form>\n </div>\n } @else {\n <div class=\"container-fluid pw-tab overflow-hidden no-message-center\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body text-center mt-5\">\n <div>\n <img src=\"/assets/img/icons/empty-chat-icon.png\"\n alt=\"No Chat\" />\n </div>\n <div class=\"h4 mt-4\">No messages yet!</div>\n <div class=\"mt-3\">\n <p>It looks like you haven't shared or received any messages yet.</p>\n <p>\n Start typing the name of the member you want to send a message to\n in the chat search field and send them a message.\n </p>\n </div>\n </div>\n </div>\n </div>\n }\n }\n</div>\n", styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}:host ::ng-deep .chat-application{height:calc(100vh - 92px);position:relative}#drift-widget-container{display:none!important}#file-input{height:0;visibility:hidden;width:0}.message-attachment{color:#fff}.emoji-toggle-btn{background:transparent;border:0;color:#676767;cursor:pointer;font-size:20px;line-height:1;padding:4px 6px}.compose-message-attachment{bottom:0;color:#676767;left:0;position:absolute;width:55%}.compose-message-attachment .file-name{font-size:14px;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:400px}.compose-message-attachment .file-size{width:100px}.compose-message-attachment .file-remove{width:45px}.compose-message-attachment .file-remove i{margin-left:37px;margin-top:7px}.fa-spinner{font-size:24px}.fa-paperclip{font-size:19px;margin-top:7px;width:13px}.dummy-avatar{background-color:#ff586b;border-radius:50%;color:#fff;font-size:18px;height:40px;line-height:40px;text-align:center;width:40px;display:inline-block}.card{border:1px solid rgb(204,204,204)}.msg-double-check{color:#4fc3f7;font-size:10px;left:-13px;position:absolute;top:11px}.btn-delete{display:none;left:-85px;position:absolute;top:11px}.chat-body:hover .btn-delete{display:block!important}.bg-brown{background-color:#cc6000}.btn-send{border-radius:5px;padding:7px 13px}@keyframes spinner{to{transform:rotate(360deg)}}.spinner{animation:spinner .6s linear infinite!important;border:3px solid rgb(204,204,204);border-radius:50%;border-top-color:#000;box-sizing:border-box;content:\"\";height:50px;left:50%;margin-left:-10px;margin-top:-10px;position:absolute;top:10%;width:50px}@media(min-width:768px){.no-message-center{margin-left:auto;width:calc(100% - 300px)}}\n"] }]
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
1
|
+
import { ScrollingModule } from "@angular/cdk/scrolling";
|
|
2
|
+
import * as i3 from "@angular/common";
|
|
3
|
+
import { CommonModule } from "@angular/common";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import { Component, NgModule, ViewChild } from "@angular/core";
|
|
6
|
+
import * as i4 from "@angular/forms";
|
|
7
|
+
import { FormsModule } from "@angular/forms";
|
|
8
|
+
import * as i1 from "@angular/router";
|
|
9
|
+
import { RouterModule } from "@angular/router";
|
|
10
|
+
import * as i9 from "@posiwise/pipes";
|
|
11
|
+
import { PipesModule } from "@posiwise/pipes";
|
|
12
|
+
import { NgxFileDropModule } from "ngx-file-drop";
|
|
13
|
+
import * as i8 from "ngx-infinite-scroll";
|
|
14
|
+
import { InfiniteScrollModule } from "ngx-infinite-scroll";
|
|
15
|
+
import * as i6 from "primeng/autocomplete";
|
|
16
|
+
import { AutoCompleteModule } from "primeng/autocomplete";
|
|
17
|
+
import * as i5 from "primeng/progressspinner";
|
|
18
|
+
import { ProgressSpinnerModule } from "primeng/progressspinner";
|
|
19
|
+
import * as i7 from "@ctrl/ngx-emoji-mart";
|
|
20
|
+
import { PickerModule } from "@ctrl/ngx-emoji-mart";
|
|
21
|
+
import { EmojiModule } from "@ctrl/ngx-emoji-mart/ngx-emoji";
|
|
22
|
+
import { AppBaseComponent } from "@posiwise/app-base-component";
|
|
23
|
+
import * as i1$1 from "@posiwise/common-services";
|
|
24
|
+
import { PermissionService } from "@posiwise/common-services";
|
|
25
|
+
import { ATTACHMENT_TYPE, ChatUser, Conversation, SOCKET_TYPE } from "@posiwise/common-utilities";
|
|
26
|
+
import groupBy from "lodash/groupBy";
|
|
27
|
+
import sortBy from "lodash/sortBy";
|
|
28
|
+
import uniqBy from "lodash/uniqBy";
|
|
29
|
+
import moment from "moment";
|
|
30
|
+
import { lastValueFrom } from "rxjs";
|
|
31
|
+
import * as i2 from "@posiwise/shared-components";
|
|
32
|
+
var ChatBoxComponent = class ChatBoxComponent extends AppBaseComponent {
|
|
33
|
+
constructor(elRef, mailboxService, profileService, socketService, scriptLoader, injector, cdr, confirmDialog) {
|
|
34
|
+
super(injector);
|
|
35
|
+
this.elRef = elRef;
|
|
36
|
+
this.mailboxService = mailboxService;
|
|
37
|
+
this.profileService = profileService;
|
|
38
|
+
this.socketService = socketService;
|
|
39
|
+
this.scriptLoader = scriptLoader;
|
|
40
|
+
this.cdr = cdr;
|
|
41
|
+
this.confirmDialog = confirmDialog;
|
|
42
|
+
this.ObjectKeys = Object.keys;
|
|
43
|
+
this.showEmoji = false;
|
|
44
|
+
this.pristineConversation = [];
|
|
45
|
+
this.isDrift = true;
|
|
46
|
+
this.units = [
|
|
47
|
+
"B",
|
|
48
|
+
"KB",
|
|
49
|
+
"MB",
|
|
50
|
+
"GB",
|
|
51
|
+
"TB",
|
|
52
|
+
"PB"
|
|
53
|
+
];
|
|
54
|
+
this.initialLoad = true;
|
|
55
|
+
this.selectedIndex = 0;
|
|
56
|
+
this.totalMessages = 0;
|
|
57
|
+
this.currentThreads = [];
|
|
58
|
+
this.conversations = [];
|
|
59
|
+
this.messagesGroupedByDate = {};
|
|
60
|
+
this.recipients = [];
|
|
61
|
+
this.files = [];
|
|
62
|
+
this.attachedFiles = [];
|
|
63
|
+
this.isChatLoading = true;
|
|
64
|
+
this.currentPage = 1;
|
|
65
|
+
this.isLoaded = true;
|
|
66
|
+
this.throttle = 300;
|
|
67
|
+
this.scrollUpDistance = 2;
|
|
68
|
+
this.scrollDistance = 1;
|
|
69
|
+
this.ATTACHMENT_TYPE = ATTACHMENT_TYPE;
|
|
70
|
+
}
|
|
71
|
+
onImgError(event, fallbackSrc) {
|
|
72
|
+
const img = event.target;
|
|
73
|
+
if (!img) return;
|
|
74
|
+
if (img.src?.endsWith(fallbackSrc)) return;
|
|
75
|
+
img.src = fallbackSrc;
|
|
76
|
+
}
|
|
77
|
+
onUp(_ev, conversationId) {
|
|
78
|
+
this.currentPage++;
|
|
79
|
+
const totalPages = Math.ceil(this.totalMessages / 10);
|
|
80
|
+
if (this.currentPage <= totalPages) this.loadMore(conversationId, this.currentPage);
|
|
81
|
+
}
|
|
82
|
+
ngOnInit() {
|
|
83
|
+
this.waitForJQuery(() => {
|
|
84
|
+
this.scriptLoader.loadScriptOnce("head", "/assets/js/chat.js");
|
|
85
|
+
});
|
|
86
|
+
this.listenToNewMessage();
|
|
87
|
+
this.subscriptionId = PermissionService.selectedSubscription?.id;
|
|
88
|
+
this.userStore().subscribe((resp) => {
|
|
89
|
+
this.currentUser = resp;
|
|
90
|
+
if (this.currentUser) this.mailboxService.getConversations().subscribe((response) => {
|
|
91
|
+
if (response?.length) {
|
|
92
|
+
let raw;
|
|
93
|
+
if (this.conversations.length > 0) raw = this.conversations.find((x) => x?.id === null);
|
|
94
|
+
response.forEach((x) => {
|
|
95
|
+
x.datetime = x.latest_message.created_at;
|
|
96
|
+
});
|
|
97
|
+
const chats = sortBy(response, "datetime").reverse();
|
|
98
|
+
this.pristineConversation = chats;
|
|
99
|
+
this.conversations = [...chats];
|
|
100
|
+
if (raw) this.conversations.unshift(raw);
|
|
101
|
+
this.parseConversation();
|
|
102
|
+
setTimeout(() => this.filterConversations());
|
|
103
|
+
}
|
|
104
|
+
if (this.initialLoad) this.checkIfNewConversation();
|
|
105
|
+
else this.activateThread();
|
|
106
|
+
this.cdr.markForCheck();
|
|
107
|
+
}).add(() => {
|
|
108
|
+
this.isChatLoading = false;
|
|
109
|
+
this.initialLoad = false;
|
|
110
|
+
this.cdr.markForCheck();
|
|
111
|
+
});
|
|
112
|
+
this.cdr.markForCheck();
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
filterConversations() {
|
|
116
|
+
this.conversations = this.conversations.filter((conversation) => conversation.to);
|
|
117
|
+
}
|
|
118
|
+
ngDoCheck() {
|
|
119
|
+
if (window["jQuery"] && this.isDrift) {
|
|
120
|
+
if ($("#drift-widget-container").length > 0 && $("#drift-widget-container:visible")) {
|
|
121
|
+
this.isDrift = false;
|
|
122
|
+
$("#drift-widget-container").hide();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
ngOnDestroy() {
|
|
127
|
+
if (window["jQuery"]) $(".drift-widget-container").show();
|
|
128
|
+
}
|
|
129
|
+
parseConversation() {
|
|
130
|
+
this.conversations.forEach((element, index) => {
|
|
131
|
+
element.to = element.participants.find((x) => x?.id !== this.currentUser?.id);
|
|
132
|
+
element.from = element.participants.find((x) => x?.id === this.currentUser?.id);
|
|
133
|
+
if (index === 0) this.currentUserImg = element.from?.avatar ?? "/assets/img/icons/male.png";
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
activateThread() {
|
|
137
|
+
setTimeout(() => {
|
|
138
|
+
if (window["jQuery"]) {
|
|
139
|
+
const selector = `.list-group-item:nth-child(${this.selectedIndex + 1})`;
|
|
140
|
+
$(selector).removeClass("no-border").addClass("list-group-item bg-blue-grey bg-lighten-5 border-right-primary border-right-2");
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
checkIfNewConversation() {
|
|
145
|
+
this.route.fragment.subscribe((fragment) => {
|
|
146
|
+
if (fragment) {
|
|
147
|
+
const existingConversation = this.conversations.find((x) => x.to?.slug === fragment);
|
|
148
|
+
if (existingConversation) {
|
|
149
|
+
this.otherUser = existingConversation.to;
|
|
150
|
+
this.setActive(existingConversation);
|
|
151
|
+
} else this.newParticipant(fragment);
|
|
152
|
+
} else if (this.conversations.length > 0) this.router.navigate(["/message"], { fragment: this.conversations[0].to?.slug });
|
|
153
|
+
this.cdr.markForCheck();
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
onParticipantClick(conversation) {
|
|
157
|
+
this.otherUser = conversation.participants.find((x) => x?.id !== this.currentUser?.id);
|
|
158
|
+
const slug = this.otherUser?.slug;
|
|
159
|
+
this.clearUnreadCount();
|
|
160
|
+
this.router.navigate(["/message"], { fragment: slug });
|
|
161
|
+
}
|
|
162
|
+
newParticipant(slug) {
|
|
163
|
+
this.profileService.getUserProfile(slug).subscribe((response) => {
|
|
164
|
+
this.otherUser = response;
|
|
165
|
+
const to = new ChatUser(response?.id, response?.first_name, response?.slug, response?.email, response?.avatar ? response?.avatar[0]?.url : "", /* @__PURE__ */ new Date());
|
|
166
|
+
const from = new ChatUser(this.currentUser?.id, this.currentUser?.firstName, this.currentUser?.slug, this.currentUser?.email, this.currentUser?.avatar ? this.currentUser?.avatar[0].url : "/assets/img/icons/male.png", /* @__PURE__ */ new Date());
|
|
167
|
+
const newConversation = new Conversation(null, 1, null, "chat", [to, from], null, 0, from, to);
|
|
168
|
+
this.conversations.unshift(newConversation);
|
|
169
|
+
this.setActive(this.conversations[0]);
|
|
170
|
+
this.cdr.markForCheck();
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
setActive(conversation) {
|
|
174
|
+
this.currentPage = 0;
|
|
175
|
+
this.currentThreads = [];
|
|
176
|
+
this.totalMessages = 0;
|
|
177
|
+
this.otherUser = conversation.participants.find((x) => x?.id !== this.currentUser?.id);
|
|
178
|
+
this.selectedConversationId = conversation?.id;
|
|
179
|
+
this.currentConversation = conversation;
|
|
180
|
+
const allAnchors = this.elRef.nativeElement.getElementsByClassName("list-group-item");
|
|
181
|
+
Array.from(allAnchors).forEach((item) => {
|
|
182
|
+
item.setAttribute("class", "list-group-item no-border");
|
|
183
|
+
});
|
|
184
|
+
const index = this.conversations.findIndex((x) => x?.to?.id === this.otherUser?.id) || 0;
|
|
185
|
+
setTimeout(() => {
|
|
186
|
+
if (window["jQuery"]) {
|
|
187
|
+
$(`.list-group-item:nth-child(${index + 1})`).removeClass("no-border").addClass("list-group-item bg-blue-grey bg-lighten-5 border-right-primary border-right-2");
|
|
188
|
+
this.selectedIndex = $(".list-group-item.border-right-2").index();
|
|
189
|
+
}
|
|
190
|
+
}, 500);
|
|
191
|
+
this.markAsRead(conversation?.id);
|
|
192
|
+
this.getMessage(conversation?.id);
|
|
193
|
+
}
|
|
194
|
+
search(searchTxt) {
|
|
195
|
+
if (searchTxt?.value?.length > 2) this.conversations = this.pristineConversation.filter((x) => x.to.slug.includes(searchTxt.value) ?? x.to?.email.includes(searchTxt.value));
|
|
196
|
+
else this.conversations = this.pristineConversation;
|
|
197
|
+
}
|
|
198
|
+
listenToNewMessage() {
|
|
199
|
+
this.socketService.webSocket$.subscribe((result) => {
|
|
200
|
+
if (result.event === SOCKET_TYPE.MSG) {
|
|
201
|
+
if (result?.new_conversation === "false") {
|
|
202
|
+
const newMessage = result?.data;
|
|
203
|
+
newMessage.formattedDate = moment(new Date(newMessage.created_at)).format("YYYYMMDD");
|
|
204
|
+
const conversation = this.conversations.find((x) => x?.id === result?.id);
|
|
205
|
+
if (conversation) {
|
|
206
|
+
conversation.latest_message = result.data;
|
|
207
|
+
conversation.created_at = newMessage.created_at;
|
|
208
|
+
conversation.unread_count += 1;
|
|
209
|
+
}
|
|
210
|
+
if (newMessage.conversation_id === this.selectedConversationId && newMessage.formattedDate in this.messagesGroupedByDate) {
|
|
211
|
+
this.messagesGroupedByDate[newMessage.formattedDate].push(newMessage);
|
|
212
|
+
this.animateOnScroll();
|
|
213
|
+
}
|
|
214
|
+
} else if (result && typeof result.new_conversation === "object") {
|
|
215
|
+
this.conversations.unshift(result.new_conversation);
|
|
216
|
+
this.parseConversation();
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
this.cdr.markForCheck();
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
getMessage(messageId, reload = true) {
|
|
223
|
+
if (reload) this.messagesGroupedByDate = null;
|
|
224
|
+
if (messageId) {
|
|
225
|
+
this.isLoaded = false;
|
|
226
|
+
this.mailboxService.getMessages(messageId).subscribe((response) => {
|
|
227
|
+
if (response) {
|
|
228
|
+
this.totalMessages = response.object_count;
|
|
229
|
+
this.currentThreads = response.messages;
|
|
230
|
+
if (!this.conversations.some((x) => x?.id === response?.id)) this.conversations.find((x) => x?.id === null).id = response?.id;
|
|
231
|
+
const messages = sortBy(response.messages, "created_at");
|
|
232
|
+
messages.forEach((msg) => {
|
|
233
|
+
msg.messageType = msg.attachment.url ? this.getMessageType(msg.attachment.url) : null;
|
|
234
|
+
});
|
|
235
|
+
this.messagesGroupedByDate = groupBy(messages, (o) => {
|
|
236
|
+
return moment(o.created_at).format("YYYYMMDD");
|
|
237
|
+
});
|
|
238
|
+
const current = this.conversations.find((x) => x?.id === response?.id).latest_message;
|
|
239
|
+
if (current) {
|
|
240
|
+
current.body = response.messages[0].body;
|
|
241
|
+
current.created_at = response.messages[0].created_at;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
this.cdr.markForCheck();
|
|
245
|
+
}).add(() => {
|
|
246
|
+
this.isChatLoading = false;
|
|
247
|
+
this.isLoaded = true;
|
|
248
|
+
this.animateOnScroll();
|
|
249
|
+
this.cdr.markForCheck();
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
loadMore(conversationId, pageNumber, pageSize = 10) {
|
|
254
|
+
this.mailboxService.getMessages(conversationId, pageNumber, pageSize).subscribe((response) => {
|
|
255
|
+
if (response) {
|
|
256
|
+
this.currentThreads = uniqBy(this.currentThreads.concat(response.messages), "id");
|
|
257
|
+
const messages = sortBy(this.currentThreads, "created_at");
|
|
258
|
+
this.messagesGroupedByDate = groupBy(messages, (o) => {
|
|
259
|
+
return moment(o.created_at).format("YYYYMMDD");
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
this.cdr.markForCheck();
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
clearUnreadCount() {
|
|
266
|
+
this.mailboxService.decrementUnreadCount(this.currentConversation?.unread_count);
|
|
267
|
+
if (this.currentConversation?.["unread_count"]) this.currentConversation["unread_count"] = 0;
|
|
268
|
+
}
|
|
269
|
+
onSendMessage() {
|
|
270
|
+
const text = this.messageInputRef.nativeElement.value;
|
|
271
|
+
const formData = new FormData();
|
|
272
|
+
formData.append("to", this.otherUser?.email);
|
|
273
|
+
formData.append("message", text);
|
|
274
|
+
formData.append("type", "1");
|
|
275
|
+
formData.append("subscription_id", `${this.subscriptionId}`);
|
|
276
|
+
if (this.files?.length) {
|
|
277
|
+
this.isFileUploading = true;
|
|
278
|
+
formData.append("file", this.files[0], this.files[0].name);
|
|
279
|
+
}
|
|
280
|
+
if (text || this.files.length > 0) this.mailboxService.postMessage(formData).subscribe((response) => {
|
|
281
|
+
this.files = [];
|
|
282
|
+
this.attachedFiles = [];
|
|
283
|
+
this.messageInputRef.nativeElement.value = "";
|
|
284
|
+
this.messageInputRef.nativeElement.focus();
|
|
285
|
+
this.getMessage(response.conversation_id, false);
|
|
286
|
+
this.cdr.markForCheck();
|
|
287
|
+
}).add(() => {
|
|
288
|
+
this.isFileUploading = false;
|
|
289
|
+
this.cdr.markForCheck();
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
markAsRead(conversationId) {
|
|
293
|
+
if (conversationId) {
|
|
294
|
+
this.clearUnreadCount();
|
|
295
|
+
this.mailboxService.markAsRead(conversationId).subscribe(() => {
|
|
296
|
+
this.conversations.find((x) => x?.id === conversationId).unread_count = 0;
|
|
297
|
+
this.cdr.markForCheck();
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
transform(bytes = 0, precision = 2) {
|
|
302
|
+
if (Number.isNaN(Number.parseFloat(String(bytes))) || !Number.isFinite(bytes)) return "?";
|
|
303
|
+
let unit = 0;
|
|
304
|
+
while (bytes >= 1024) {
|
|
305
|
+
bytes /= 1024;
|
|
306
|
+
unit++;
|
|
307
|
+
}
|
|
308
|
+
return `${bytes.toFixed(+precision)} ${this.units[unit]}`;
|
|
309
|
+
}
|
|
310
|
+
dropped(files) {
|
|
311
|
+
for (const droppedFile of files) if (droppedFile.fileEntry.isFile) droppedFile.fileEntry.file((file) => {
|
|
312
|
+
this.files.push(file);
|
|
313
|
+
this.attachedFiles.push({
|
|
314
|
+
name: file.name,
|
|
315
|
+
size: this.transform(Number(file.size))
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
onRemoveAttachment(item) {
|
|
320
|
+
this.files = this.files.filter((x) => x.name !== item.name);
|
|
321
|
+
this.attachedFiles = this.attachedFiles.filter((x) => x.name !== item.name);
|
|
322
|
+
}
|
|
323
|
+
fileOver(_event) {
|
|
324
|
+
console.log();
|
|
325
|
+
}
|
|
326
|
+
onEmojiSelect($event) {
|
|
327
|
+
this.messageInputRef.nativeElement.value += $event.emoji.native;
|
|
328
|
+
this.showEmoji = false;
|
|
329
|
+
}
|
|
330
|
+
fileChangeListener($event) {
|
|
331
|
+
const file = $event.target.files[0];
|
|
332
|
+
this.files.push(file);
|
|
333
|
+
this.attachedFiles.push({
|
|
334
|
+
name: file.name,
|
|
335
|
+
size: this.transform(Number(file.size / 1024))
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
toggleSidebar() {
|
|
339
|
+
if (window["jQuery"]) {
|
|
340
|
+
$(".chat-sidebar").removeClass("d-none d-sm-none").addClass("d-block d-sm-block");
|
|
341
|
+
$(".content-overlay").addClass("show");
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
trackByMessageId(_index, item) {
|
|
345
|
+
return item?.id;
|
|
346
|
+
}
|
|
347
|
+
trackConversationKey(conversation) {
|
|
348
|
+
return conversation?.id ?? conversation?.to?.slug ?? conversation?.to?.id ?? "";
|
|
349
|
+
}
|
|
350
|
+
animateOnScroll() {
|
|
351
|
+
setTimeout(() => {
|
|
352
|
+
if (window["jQuery"] && $("#chats-wrapper")?.length) $("#chats-wrapper").stop().animate({ scrollTop: $("#chats-wrapper")[0].scrollHeight }, 800);
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
getMessageType(filename) {
|
|
356
|
+
switch (this.getExtension(filename).toLowerCase()) {
|
|
357
|
+
case "jpg":
|
|
358
|
+
case "gif":
|
|
359
|
+
case "bmp":
|
|
360
|
+
case "png": return ATTACHMENT_TYPE.IMG;
|
|
361
|
+
case "m4v":
|
|
362
|
+
case "avi":
|
|
363
|
+
case "mpg":
|
|
364
|
+
case "mp4": return ATTACHMENT_TYPE.VIDEO;
|
|
365
|
+
default: return "";
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
getExtension(filename) {
|
|
369
|
+
const parts = filename.split(".");
|
|
370
|
+
return parts[parts.length - 1];
|
|
371
|
+
}
|
|
372
|
+
recipientSearch() {
|
|
373
|
+
lastValueFrom(this.mailboxService.getRecipient({
|
|
374
|
+
page: 1,
|
|
375
|
+
page_size: 20,
|
|
376
|
+
subscription_id: PermissionService.selectedSubscription?.id,
|
|
377
|
+
search: this.searchText
|
|
378
|
+
})).then((response) => {
|
|
379
|
+
this.recipients = response.filter((x) => x?.id !== this.currentUser?.id);
|
|
380
|
+
this.cdr.markForCheck();
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
onMemberSelection(member) {
|
|
384
|
+
this.otherUser = member;
|
|
385
|
+
this.router.navigate(["/message"], { fragment: member.slug });
|
|
386
|
+
}
|
|
387
|
+
onDeleteMessage(message) {
|
|
388
|
+
this.confirmDialog.confirmDelete({
|
|
389
|
+
textKey: "Common.Confirm.Delete.TextSimple",
|
|
390
|
+
textParams: { entityType: "message" }
|
|
391
|
+
}).then((ok) => {
|
|
392
|
+
if (!ok) return;
|
|
393
|
+
this.mailboxService.deleteMessage(this.selectedConversationId, message?.id).subscribe((response) => {
|
|
394
|
+
if (response?.status_code === 200) {
|
|
395
|
+
const createdAt = moment(message.created_at).format("YYYYMMDD");
|
|
396
|
+
for (const property in this.messagesGroupedByDate) if (property === createdAt) this.messagesGroupedByDate[property] = this.messagesGroupedByDate[property].filter((x) => x?.id !== message?.id);
|
|
397
|
+
}
|
|
398
|
+
this.cdr.markForCheck();
|
|
399
|
+
});
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
waitForJQuery(callback) {
|
|
403
|
+
let attempts = 0;
|
|
404
|
+
const maxAttempts = 100;
|
|
405
|
+
const checkJQuery = () => {
|
|
406
|
+
if (window["jQuery"]) {
|
|
407
|
+
console.log("jQuery detected, loading chat.js");
|
|
408
|
+
callback();
|
|
409
|
+
} else if (attempts < maxAttempts) {
|
|
410
|
+
attempts++;
|
|
411
|
+
setTimeout(checkJQuery, 100);
|
|
412
|
+
} else {
|
|
413
|
+
console.log("jQuery not available, loading it now for chatbox");
|
|
414
|
+
this.loadJQueryForChatbox(callback);
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
checkJQuery();
|
|
418
|
+
}
|
|
419
|
+
loadJQueryForChatbox(callback) {
|
|
420
|
+
const jquerySrc = "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js";
|
|
421
|
+
const script = document.createElement("script");
|
|
422
|
+
script.src = jquerySrc;
|
|
423
|
+
script.crossOrigin = "anonymous";
|
|
424
|
+
script.async = false;
|
|
425
|
+
script.onload = () => {
|
|
426
|
+
console.log("jQuery loaded for chatbox");
|
|
427
|
+
callback();
|
|
428
|
+
};
|
|
429
|
+
script.onerror = () => {
|
|
430
|
+
console.error("Failed to load jQuery for chatbox");
|
|
431
|
+
const fallbackScript = document.createElement("script");
|
|
432
|
+
fallbackScript.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js";
|
|
433
|
+
fallbackScript.integrity = "sha384-vtXRMe3mGCbOeY7l30aIg8H9p3GdeSe4IFlP6G8JMa7o7lXvnz3GFKzPxzJdPfGK";
|
|
434
|
+
fallbackScript.crossOrigin = "anonymous";
|
|
435
|
+
fallbackScript.async = false;
|
|
436
|
+
fallbackScript.onload = () => {
|
|
437
|
+
console.log("jQuery loaded from Google CDN for chatbox");
|
|
438
|
+
callback();
|
|
439
|
+
};
|
|
440
|
+
fallbackScript.onerror = () => {
|
|
441
|
+
console.error("All jQuery CDNs failed for chatbox");
|
|
442
|
+
};
|
|
443
|
+
document.head.appendChild(fallbackScript);
|
|
444
|
+
};
|
|
445
|
+
document.head.appendChild(script);
|
|
446
|
+
}
|
|
447
|
+
static {
|
|
448
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
449
|
+
minVersion: "12.0.0",
|
|
450
|
+
version: "22.2.0",
|
|
451
|
+
ngImport: i0,
|
|
452
|
+
type: ChatBoxComponent,
|
|
453
|
+
deps: [
|
|
454
|
+
{ token: i0.ElementRef },
|
|
455
|
+
{ token: i1$1.MailBoxService },
|
|
456
|
+
{ token: i1$1.ProfileService },
|
|
457
|
+
{ token: i1$1.WebsocketService },
|
|
458
|
+
{ token: i1$1.ScriptLoaderService },
|
|
459
|
+
{ token: i0.Injector },
|
|
460
|
+
{ token: i0.ChangeDetectorRef },
|
|
461
|
+
{ token: i2.ConfirmDialogService }
|
|
462
|
+
],
|
|
463
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
static {
|
|
467
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
468
|
+
minVersion: "17.0.0",
|
|
469
|
+
version: "22.2.0",
|
|
470
|
+
type: ChatBoxComponent,
|
|
471
|
+
isStandalone: false,
|
|
472
|
+
selector: "ng-component",
|
|
473
|
+
viewQueries: [{
|
|
474
|
+
propertyName: "messageInputRef",
|
|
475
|
+
first: true,
|
|
476
|
+
predicate: ["messageInput"],
|
|
477
|
+
descendants: true
|
|
478
|
+
}],
|
|
479
|
+
usesInheritance: true,
|
|
480
|
+
ngImport: i0,
|
|
481
|
+
template: "<div class=\"chat-application mt-5\">\n <div class=\"content-overlay\"></div>\n\n @if (isChatLoading) {\n <div class=\"text-center\">\n <p-progress-spinner> </p-progress-spinner>\n </div>\n }\n\n @if (!isChatLoading) {\n <div class=\"chat-sidebar float-start d-none d-sm-none d-md-block d-lg-block\">\n <div class=\"chat-sidebar-content\">\n <div class=\"chat-fixed-search p-2\">\n <div class=\"d-flex\">\n <p-auto-complete appendTo=\"body\" inputId=\"chatbox-search-member\"\n [(ngModel)]=\"searchText\"\n #searchTxt\n placeholder=\"Search members...\"\n [ngModelOptions]=\"{ standalone: true }\"\n optionLabel=\"first_name\"\n (onSelect)=\"onMemberSelection(searchText)\"\n [suggestions]=\"recipients\"\n (completeMethod)=\"recipientSearch()\">\n <ng-template let-item #item>\n <div>\n {{ item.first_name + ' ' }}\n {{ item.last_name ? item.last_name : '' }}\n </div>\n </ng-template>\n </p-auto-complete>\n </div>\n </div>\n\n <!-- Thread/conversation List -->\n <div id=\"users-list\"\n class=\"list-group position-relative\">\n @if (conversations?.length) {\n <div class=\"users-list-padding\">\n @for (conversation of conversations; track trackConversationKey(conversation)) {\n <a class=\"list-group-item no-border\"\n (click)=\"onParticipantClick(conversation)\">\n <div class=\"d-flex\">\n <span class=\"avatar avatar-md avatar-away\">\n @if (conversation?.to?.avatar) {\n <img [src]=\"conversation.to?.avatar\"\n width=\"40\"\n height=\"40\"\n role=\"presentation\"\n (error)=\"onImgError($event, '/assets/img/icons/male.png')\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar me-2\">\n <strong>{{\n conversation?.participants\n ? conversation.to?.slug.charAt(0).toUpperCase()\n : conversation.to?.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n }\n </span>\n <div class=\"clearfix\">\n <h6 class=\"list-group-item-heading mb-1\">\n {{\n conversation.to?.name\n ? conversation.to?.name\n : conversation.to?.slug\n }}\n <span class=\"font-small-3 float-end ms-5 ps-5\">\n @if (conversation?.unread_count) {\n <span class=\"badge bg-primary rounded-pill bg-primary mx-1\">\n {{ conversation.unread_count }}\n </span>\n }\n {{ conversation.created_at | date: 'shortTime' }}\n </span>\n </h6>\n <p class=\"list-group-item-text text-muted\">\n {{ conversation?.latest_message?.body | textTruncate: 25 }}\n </p>\n </div>\n </div>\n </a>\n }\n </div>\n }\n </div>\n </div>\n </div>\n\n @if (conversations?.length) {\n <!-- Chat Header -->\n @if (otherUser) {\n <div class=\"chat-name p-2 bg-white\">\n <div class=\"d-flex\">\n <span class=\"chat-app-sidebar-toggle ft-align-justify font-large-1 me-2 d-none d-block d-sm-block d-md-none\"\n (keydown.enter)=\"toggleSidebar()\"\n (click)=\"toggleSidebar()\"></span>\n <div class=\"clearfix\">\n @if (currentConversation?.to?.avatar) {\n <img [src]=\"currentConversation?.to?.avatar\"\n width=\"40\"\n height=\"40\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\"\n role=\"presentation\"\n (error)=\"onImgError($event, '/assets/img/icons/male.png')\" />\n } @else {\n @if (currentUser) {\n <div class=\"dummy-avatar me-2\">\n <strong>{{\n otherUser?.name\n ? otherUser.name.charAt(0).toUpperCase()\n : otherUser.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n }\n }\n\n @if (currentUser) {\n <strong class=\"mt-2\">{{\n otherUser.name ? otherUser.name : otherUser.slug\n }}</strong>\n }\n </div>\n </div>\n </div>\n }\n\n <!-- Chat Window -->\n <div class=\"chat-app-window\"\n id=\"chats-wrapper\"\n #scrollMe\n infinite-scroll\n [infiniteScrollDistance]=\"scrollDistance\"\n [scrollWindow]=\"false\"\n [infiniteScrollUpDistance]=\"scrollUpDistance\"\n [infiniteScrollThrottle]=\"throttle\"\n [alwaysCallback]=\"true\"\n (scrolledUp)=\"onUp($event, selectedConversationId)\">\n <div class=\"chats\">\n <!-- Shows Message -->\n @if (!isLoaded) {\n <div class=\"spinner\"></div>\n }\n @if (messagesGroupedByDate) {\n @for (item of ObjectKeys(messagesGroupedByDate); track item) {\n <strong class=\"badge bg-secondary mb-1\">{{\n messagesGroupedByDate[item][0]?.created_at | date\n }}</strong>\n <!-- Every Message -->\n @for (message of messagesGroupedByDate[item]; track message.id) {\n <div class=\"chat\"\n [ngClass]=\"{\n 'chat-left ms-2': message.sender_id !== currentUser.id,\n 'me-2': message.sender_id === currentUser.id\n }\">\n @if (message.body || message.attachment?.url) {\n <div class=\"chat-avatar\">\n <a class=\"avatar\"\n data-toggle=\"tooltip\"\n data-placement=\"right\"\n data-original-title=\"\">\n <!-- Setting up Avatar Image for Logged In User -->\n @if (message.sender_id === currentUser.id) {\n @if (currentUserImg) {\n <img [src]=\"currentUserImg\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar bg-brown\">\n <strong>{{\n currentUser?.name\n ? currentUser.name\n .charAt(0)\n .toUpperCase()\n : currentUser.slug\n .charAt(0)\n .toUpperCase()\n }}\n </strong>\n </div>\n }\n }\n\n <!-- Participant -->\n @if (message.sender_id !== currentUser.id) {\n @if (currentUser && otherUser?.avatar) {\n <img [src]=\"otherUser?.avatar\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar\">\n <strong>{{\n otherUser?.name\n ? otherUser.name\n .charAt(0)\n .toUpperCase()\n : otherUser.slug\n .charAt(0)\n .toUpperCase()\n }}</strong>\n </div>\n }\n }\n </a>\n </div>\n <div class=\"chat-body\">\n @if (!message?.attachment?.url) {\n <div class=\"chat-content attachment\">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n @if (message.sender_id === currentUser.id) {\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n (click)=\"onDeleteMessage(message)\"\n (keydown.enter)=\"onDeleteMessage(message)\"\n ></i>\n }\n @if (message.sender_id === currentUser.id && message.is_open) {\n <i\n class=\"fa fa-check-double msg-double-check\"\n ></i>\n }\n <p>{{ message.body }}</p>\n </div>\n } @else {\n <div class=\"chat-content with-attachment\">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n @if (message.sender_id === currentUser.id) {\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n (click)=\"onDeleteMessage(message)\"\n (keydown.enter)=\"onDeleteMessage(message)\"\n ></i>\n }\n @if (message.attachment) {\n <div class=\"message-attachment\">\n <i>\n @if (message?.messageType === ATTACHMENT_TYPE.IMG) {\n <img\n [src]=\"message.attachment.url\"\n class=\"img-thumbnail\"\n alt=\"message attachment\"\n />\n }\n @if (message?.messageType === ATTACHMENT_TYPE.VIDEO) {\n <video\n width=\"320\"\n height=\"240\"\n controls\n class=\"img-thumbnail\"\n >\n <source\n [src]=\"message.attachment.url\"\n type=\"video/mp4\"\n />\n <track kind=\"subtitles\" srclang=\"en\" label=\"English\" />\n Your browser does not support the video\n tag.\n </video>\n }\n <a\n [attr.href]=\"message.attachment.url\"\n target=\"_blank\"\n >\n <i\n class=\"fa fa-file-download me-2\"\n aria-hidden=\"true\"\n ></i>\n {{\n message.attachment.url\n | common: 'filename'\n }}</a>\n </i>\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n }\n }\n\n @if (!messagesGroupedByDate && isLoaded) {\n <div class=\"mt-3 text-center\">No message history.</div>\n }\n\n @if (isFileUploading) {\n <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>\n }\n\n <!-- Shows Metadata of the file being uploaded -->\n <div class=\"compose-message-attachment\">\n <div class=\"m-0\">\n @for (item of attachedFiles; track $index) {\n <div class=\"card px-3 py-2 m-0 mb-1\">\n <div class=\"card-body\">\n <div class=\"d-inline-block file-name\">{{ item.name }}</div>\n <div class=\"d-inline-block file-size\">{{ item.size }}</div>\n <div class=\"d-inline-block float-end file-remove\"\n (keydown.enter)=\"onRemoveAttachment(item)\"\n (click)=\"onRemoveAttachment(item)\">\n\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n\n <div [hidden]=\"!showEmoji\">\n <emoji-mart title=\"Pick your emoji…\"\n set=\"facebook\"\n [showPreview]=\"false\"\n (emojiSelect)=\"onEmojiSelect($event)\"\n [emojiSize]=\"30\">\n </emoji-mart>\n </div>\n\n <!-- Compose Text box area -->\n <div class=\"chat-app-form bg-blue-grey bg-lighten-5\">\n <form class=\"chat-app-input row\">\n <fieldset class=\"mb-3 position-relative has-icon-left col-10 m-0 mb-1\">\n <div class=\"form-control-position emoji-container\">\n <button type=\"button\" class=\"emoji-toggle-btn\" aria-label=\"Insert emoji\" (click)=\"showEmoji = !showEmoji\">🙂</button>\n </div>\n <label for=\"chatbox-message-input\" class=\"visually-hidden\">Type your message</label>\n <input type=\"text\"\n id=\"chatbox-message-input\"\n name=\"chatbox-message-input\"\n class=\"form-control\"\n autocomplete=\"off\"\n placeholder=\"Type your message here...\"\n (keydown.enter)=\"onSendMessage(); $event.preventDefault()\"\n #messageInput\n aria-label=\"Type your message here...\" />\n <div class=\"form-control-position control-position-right\">\n <div class=\"image-upload\">\n <label for=\"file-input\">\n <span class=\"visually-hidden\">Attach file</span>\n <i class=\"fa fa-paperclip\" aria-hidden=\"true\"></i>\n <input\n id=\"file-input\"\n name=\"file-input\"\n type=\"file\"\n (change)=\"fileChangeListener($event)\"\n size=\"60\"\n aria-label=\"File Input\" />\n </label>\n </div>\n </div>\n </fieldset>\n\n <fieldset class=\"mb-3 position-relative has-icon-left col-2 m-0 mb-1\">\n <button type=\"button\"\n class=\"btn btn-primary d-lg-flex align-items-center btn-send\"\n (click)=\"onSendMessage()\">\n <i class=\"fa fa-paper-plane\"></i><span class=\"d-none d-lg-block ms-1\">Send</span>\n </button>\n </fieldset>\n </form>\n </div>\n } @else {\n <div class=\"container-fluid pw-tab overflow-hidden no-message-center\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body text-center mt-5\">\n <div>\n <img src=\"/assets/img/icons/empty-chat-icon.png\"\n alt=\"No Chat\" />\n </div>\n <div class=\"h4 mt-4\">No messages yet!</div>\n <div class=\"mt-3\">\n <p>It looks like you haven't shared or received any messages yet.</p>\n <p>\n Start typing the name of the member you want to send a message to\n in the chat search field and send them a message.\n </p>\n </div>\n </div>\n </div>\n </div>\n }\n }\n</div>\n",
|
|
482
|
+
styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}:host ::ng-deep .chat-application{height:calc(100vh - 92px);position:relative}#drift-widget-container{display:none!important}#file-input{height:0;visibility:hidden;width:0}.message-attachment{color:#fff}.emoji-toggle-btn{background:transparent;border:0;color:#676767;cursor:pointer;font-size:20px;line-height:1;padding:4px 6px}.compose-message-attachment{bottom:0;color:#676767;left:0;position:absolute;width:55%}.compose-message-attachment .file-name{font-size:14px;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:400px}.compose-message-attachment .file-size{width:100px}.compose-message-attachment .file-remove{width:45px}.compose-message-attachment .file-remove i{margin-left:37px;margin-top:7px}.fa-spinner{font-size:24px}.fa-paperclip{font-size:19px;margin-top:7px;width:13px}.dummy-avatar{background-color:#ff586b;border-radius:50%;color:#fff;font-size:18px;height:40px;line-height:40px;text-align:center;width:40px;display:inline-block}.card{border:1px solid rgb(204,204,204)}.msg-double-check{color:#4fc3f7;font-size:10px;left:-13px;position:absolute;top:11px}.btn-delete{display:none;left:-85px;position:absolute;top:11px}.chat-body:hover .btn-delete{display:block!important}.bg-brown{background-color:#cc6000}.btn-send{border-radius:5px;padding:7px 13px}@keyframes spinner{to{transform:rotate(360deg)}}.spinner{animation:spinner .6s linear infinite!important;border:3px solid rgb(204,204,204);border-radius:50%;border-top-color:#000;box-sizing:border-box;content:\"\";height:50px;left:50%;margin-left:-10px;margin-top:-10px;position:absolute;top:10%;width:50px}@media(min-width:768px){.no-message-center{margin-left:auto;width:calc(100% - 300px)}}\n"],
|
|
483
|
+
dependencies: [
|
|
484
|
+
{
|
|
485
|
+
kind: "directive",
|
|
486
|
+
type: i3.NgClass,
|
|
487
|
+
selector: "[ngClass]",
|
|
488
|
+
inputs: ["class", "ngClass"]
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
kind: "directive",
|
|
492
|
+
type: i4.ɵNgNoValidate,
|
|
493
|
+
selector: "form:not([ngNoForm]):not([ngNativeValidate])"
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
kind: "directive",
|
|
497
|
+
type: i4.NgControlStatus,
|
|
498
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
kind: "directive",
|
|
502
|
+
type: i4.NgControlStatusGroup,
|
|
503
|
+
selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
kind: "directive",
|
|
507
|
+
type: i4.NgModel,
|
|
508
|
+
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
509
|
+
inputs: [
|
|
510
|
+
"name",
|
|
511
|
+
"disabled",
|
|
512
|
+
"ngModel",
|
|
513
|
+
"ngModelOptions"
|
|
514
|
+
],
|
|
515
|
+
outputs: ["ngModelChange"],
|
|
516
|
+
exportAs: ["ngModel"]
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
kind: "directive",
|
|
520
|
+
type: i4.NgForm,
|
|
521
|
+
selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]",
|
|
522
|
+
inputs: ["ngFormOptions"],
|
|
523
|
+
outputs: ["ngSubmit"],
|
|
524
|
+
exportAs: ["ngForm"]
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
kind: "component",
|
|
528
|
+
type: i5.ProgressSpinner,
|
|
529
|
+
selector: "p-progress-spinner, p-progressspinner",
|
|
530
|
+
inputs: [
|
|
531
|
+
"value",
|
|
532
|
+
"strokeWidth",
|
|
533
|
+
"animationDuration",
|
|
534
|
+
"min",
|
|
535
|
+
"max",
|
|
536
|
+
"ariaLabel",
|
|
537
|
+
"fill"
|
|
538
|
+
]
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
kind: "component",
|
|
542
|
+
type: i6.AutoComplete,
|
|
543
|
+
selector: "p-autocomplete, p-auto-complete",
|
|
544
|
+
inputs: [
|
|
545
|
+
"minQueryLength",
|
|
546
|
+
"delay",
|
|
547
|
+
"panelStyle",
|
|
548
|
+
"panelStyleClass",
|
|
549
|
+
"inputStyle",
|
|
550
|
+
"inputId",
|
|
551
|
+
"inputStyleClass",
|
|
552
|
+
"placeholder",
|
|
553
|
+
"readonly",
|
|
554
|
+
"scrollHeight",
|
|
555
|
+
"lazy",
|
|
556
|
+
"virtualScroll",
|
|
557
|
+
"virtualScrollItemSize",
|
|
558
|
+
"virtualScrollOptions",
|
|
559
|
+
"autoHighlight",
|
|
560
|
+
"forceSelection",
|
|
561
|
+
"type",
|
|
562
|
+
"autoZIndex",
|
|
563
|
+
"baseZIndex",
|
|
564
|
+
"ariaLabel",
|
|
565
|
+
"dropdownAriaLabel",
|
|
566
|
+
"ariaLabelledBy",
|
|
567
|
+
"dropdownIcon",
|
|
568
|
+
"unique",
|
|
569
|
+
"group",
|
|
570
|
+
"completeOnFocus",
|
|
571
|
+
"showClear",
|
|
572
|
+
"dropdown",
|
|
573
|
+
"showEmptyMessage",
|
|
574
|
+
"dropdownMode",
|
|
575
|
+
"multiple",
|
|
576
|
+
"addOnTab",
|
|
577
|
+
"tabindex",
|
|
578
|
+
"dataKey",
|
|
579
|
+
"emptyMessage",
|
|
580
|
+
"autofocus",
|
|
581
|
+
"autocomplete",
|
|
582
|
+
"optionGroupChildren",
|
|
583
|
+
"optionGroupLabel",
|
|
584
|
+
"overlayOptions",
|
|
585
|
+
"suggestions",
|
|
586
|
+
"optionLabel",
|
|
587
|
+
"optionValue",
|
|
588
|
+
"id",
|
|
589
|
+
"searchMessage",
|
|
590
|
+
"emptySelectionMessage",
|
|
591
|
+
"selectionMessage",
|
|
592
|
+
"autoOptionFocus",
|
|
593
|
+
"selectOnFocus",
|
|
594
|
+
"searchLocale",
|
|
595
|
+
"optionDisabled",
|
|
596
|
+
"focusOnHover",
|
|
597
|
+
"typeahead",
|
|
598
|
+
"addOnBlur",
|
|
599
|
+
"separator",
|
|
600
|
+
"appendTo",
|
|
601
|
+
"motionOptions"
|
|
602
|
+
],
|
|
603
|
+
outputs: [
|
|
604
|
+
"completeMethod",
|
|
605
|
+
"onSelect",
|
|
606
|
+
"onUnselect",
|
|
607
|
+
"onAdd",
|
|
608
|
+
"onFocus",
|
|
609
|
+
"onBlur",
|
|
610
|
+
"onDropdownClick",
|
|
611
|
+
"onClear",
|
|
612
|
+
"onInputKeydown",
|
|
613
|
+
"onKeyUp",
|
|
614
|
+
"onShow",
|
|
615
|
+
"onHide",
|
|
616
|
+
"onLazyLoad"
|
|
617
|
+
]
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
kind: "component",
|
|
621
|
+
type: i7.PickerComponent,
|
|
622
|
+
selector: "emoji-mart",
|
|
623
|
+
inputs: [
|
|
624
|
+
"perLine",
|
|
625
|
+
"totalFrequentLines",
|
|
626
|
+
"i18n",
|
|
627
|
+
"style",
|
|
628
|
+
"title",
|
|
629
|
+
"emoji",
|
|
630
|
+
"darkMode",
|
|
631
|
+
"color",
|
|
632
|
+
"hideObsolete",
|
|
633
|
+
"categories",
|
|
634
|
+
"activeCategories",
|
|
635
|
+
"set",
|
|
636
|
+
"skin",
|
|
637
|
+
"isNative",
|
|
638
|
+
"emojiSize",
|
|
639
|
+
"sheetSize",
|
|
640
|
+
"emojisToShowFilter",
|
|
641
|
+
"showPreview",
|
|
642
|
+
"emojiTooltip",
|
|
643
|
+
"autoFocus",
|
|
644
|
+
"custom",
|
|
645
|
+
"hideRecent",
|
|
646
|
+
"imageUrlFn",
|
|
647
|
+
"include",
|
|
648
|
+
"exclude",
|
|
649
|
+
"notFoundEmoji",
|
|
650
|
+
"categoriesIcons",
|
|
651
|
+
"searchIcons",
|
|
652
|
+
"useButton",
|
|
653
|
+
"enableFrequentEmojiSort",
|
|
654
|
+
"enableSearch",
|
|
655
|
+
"showSingleCategory",
|
|
656
|
+
"virtualize",
|
|
657
|
+
"virtualizeOffset",
|
|
658
|
+
"recent",
|
|
659
|
+
"backgroundImageFn"
|
|
660
|
+
],
|
|
661
|
+
outputs: [
|
|
662
|
+
"emojiClick",
|
|
663
|
+
"emojiSelect",
|
|
664
|
+
"skinChange"
|
|
665
|
+
]
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
kind: "directive",
|
|
669
|
+
type: i8.InfiniteScrollDirective,
|
|
670
|
+
selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]",
|
|
671
|
+
inputs: [
|
|
672
|
+
"infiniteScrollDistance",
|
|
673
|
+
"infiniteScrollUpDistance",
|
|
674
|
+
"infiniteScrollThrottle",
|
|
675
|
+
"infiniteScrollDisabled",
|
|
676
|
+
"infiniteScrollContainer",
|
|
677
|
+
"scrollWindow",
|
|
678
|
+
"immediateCheck",
|
|
679
|
+
"horizontal",
|
|
680
|
+
"alwaysCallback",
|
|
681
|
+
"fromRoot"
|
|
682
|
+
],
|
|
683
|
+
outputs: ["scrolled", "scrolledUp"]
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
kind: "pipe",
|
|
687
|
+
type: i3.DatePipe,
|
|
688
|
+
name: "date"
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
kind: "pipe",
|
|
692
|
+
type: i9.TextTruncatePipe,
|
|
693
|
+
name: "textTruncate"
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
kind: "pipe",
|
|
697
|
+
type: i9.CommonPipe,
|
|
698
|
+
name: "common"
|
|
699
|
+
}
|
|
700
|
+
]
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
};
|
|
704
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
705
|
+
minVersion: "12.0.0",
|
|
706
|
+
version: "22.2.0",
|
|
707
|
+
ngImport: i0,
|
|
708
|
+
type: ChatBoxComponent,
|
|
709
|
+
decorators: [{
|
|
710
|
+
type: Component,
|
|
711
|
+
args: [{
|
|
712
|
+
standalone: false,
|
|
713
|
+
template: "<div class=\"chat-application mt-5\">\n <div class=\"content-overlay\"></div>\n\n @if (isChatLoading) {\n <div class=\"text-center\">\n <p-progress-spinner> </p-progress-spinner>\n </div>\n }\n\n @if (!isChatLoading) {\n <div class=\"chat-sidebar float-start d-none d-sm-none d-md-block d-lg-block\">\n <div class=\"chat-sidebar-content\">\n <div class=\"chat-fixed-search p-2\">\n <div class=\"d-flex\">\n <p-auto-complete appendTo=\"body\" inputId=\"chatbox-search-member\"\n [(ngModel)]=\"searchText\"\n #searchTxt\n placeholder=\"Search members...\"\n [ngModelOptions]=\"{ standalone: true }\"\n optionLabel=\"first_name\"\n (onSelect)=\"onMemberSelection(searchText)\"\n [suggestions]=\"recipients\"\n (completeMethod)=\"recipientSearch()\">\n <ng-template let-item #item>\n <div>\n {{ item.first_name + ' ' }}\n {{ item.last_name ? item.last_name : '' }}\n </div>\n </ng-template>\n </p-auto-complete>\n </div>\n </div>\n\n <!-- Thread/conversation List -->\n <div id=\"users-list\"\n class=\"list-group position-relative\">\n @if (conversations?.length) {\n <div class=\"users-list-padding\">\n @for (conversation of conversations; track trackConversationKey(conversation)) {\n <a class=\"list-group-item no-border\"\n (click)=\"onParticipantClick(conversation)\">\n <div class=\"d-flex\">\n <span class=\"avatar avatar-md avatar-away\">\n @if (conversation?.to?.avatar) {\n <img [src]=\"conversation.to?.avatar\"\n width=\"40\"\n height=\"40\"\n role=\"presentation\"\n (error)=\"onImgError($event, '/assets/img/icons/male.png')\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar me-2\">\n <strong>{{\n conversation?.participants\n ? conversation.to?.slug.charAt(0).toUpperCase()\n : conversation.to?.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n }\n </span>\n <div class=\"clearfix\">\n <h6 class=\"list-group-item-heading mb-1\">\n {{\n conversation.to?.name\n ? conversation.to?.name\n : conversation.to?.slug\n }}\n <span class=\"font-small-3 float-end ms-5 ps-5\">\n @if (conversation?.unread_count) {\n <span class=\"badge bg-primary rounded-pill bg-primary mx-1\">\n {{ conversation.unread_count }}\n </span>\n }\n {{ conversation.created_at | date: 'shortTime' }}\n </span>\n </h6>\n <p class=\"list-group-item-text text-muted\">\n {{ conversation?.latest_message?.body | textTruncate: 25 }}\n </p>\n </div>\n </div>\n </a>\n }\n </div>\n }\n </div>\n </div>\n </div>\n\n @if (conversations?.length) {\n <!-- Chat Header -->\n @if (otherUser) {\n <div class=\"chat-name p-2 bg-white\">\n <div class=\"d-flex\">\n <span class=\"chat-app-sidebar-toggle ft-align-justify font-large-1 me-2 d-none d-block d-sm-block d-md-none\"\n (keydown.enter)=\"toggleSidebar()\"\n (click)=\"toggleSidebar()\"></span>\n <div class=\"clearfix\">\n @if (currentConversation?.to?.avatar) {\n <img [src]=\"currentConversation?.to?.avatar\"\n width=\"40\"\n height=\"40\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\"\n role=\"presentation\"\n (error)=\"onImgError($event, '/assets/img/icons/male.png')\" />\n } @else {\n @if (currentUser) {\n <div class=\"dummy-avatar me-2\">\n <strong>{{\n otherUser?.name\n ? otherUser.name.charAt(0).toUpperCase()\n : otherUser.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n }\n }\n\n @if (currentUser) {\n <strong class=\"mt-2\">{{\n otherUser.name ? otherUser.name : otherUser.slug\n }}</strong>\n }\n </div>\n </div>\n </div>\n }\n\n <!-- Chat Window -->\n <div class=\"chat-app-window\"\n id=\"chats-wrapper\"\n #scrollMe\n infinite-scroll\n [infiniteScrollDistance]=\"scrollDistance\"\n [scrollWindow]=\"false\"\n [infiniteScrollUpDistance]=\"scrollUpDistance\"\n [infiniteScrollThrottle]=\"throttle\"\n [alwaysCallback]=\"true\"\n (scrolledUp)=\"onUp($event, selectedConversationId)\">\n <div class=\"chats\">\n <!-- Shows Message -->\n @if (!isLoaded) {\n <div class=\"spinner\"></div>\n }\n @if (messagesGroupedByDate) {\n @for (item of ObjectKeys(messagesGroupedByDate); track item) {\n <strong class=\"badge bg-secondary mb-1\">{{\n messagesGroupedByDate[item][0]?.created_at | date\n }}</strong>\n <!-- Every Message -->\n @for (message of messagesGroupedByDate[item]; track message.id) {\n <div class=\"chat\"\n [ngClass]=\"{\n 'chat-left ms-2': message.sender_id !== currentUser.id,\n 'me-2': message.sender_id === currentUser.id\n }\">\n @if (message.body || message.attachment?.url) {\n <div class=\"chat-avatar\">\n <a class=\"avatar\"\n data-toggle=\"tooltip\"\n data-placement=\"right\"\n data-original-title=\"\">\n <!-- Setting up Avatar Image for Logged In User -->\n @if (message.sender_id === currentUser.id) {\n @if (currentUserImg) {\n <img [src]=\"currentUserImg\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar bg-brown\">\n <strong>{{\n currentUser?.name\n ? currentUser.name\n .charAt(0)\n .toUpperCase()\n : currentUser.slug\n .charAt(0)\n .toUpperCase()\n }}\n </strong>\n </div>\n }\n }\n\n <!-- Participant -->\n @if (message.sender_id !== currentUser.id) {\n @if (currentUser && otherUser?.avatar) {\n <img [src]=\"otherUser?.avatar\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar\">\n <strong>{{\n otherUser?.name\n ? otherUser.name\n .charAt(0)\n .toUpperCase()\n : otherUser.slug\n .charAt(0)\n .toUpperCase()\n }}</strong>\n </div>\n }\n }\n </a>\n </div>\n <div class=\"chat-body\">\n @if (!message?.attachment?.url) {\n <div class=\"chat-content attachment\">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n @if (message.sender_id === currentUser.id) {\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n (click)=\"onDeleteMessage(message)\"\n (keydown.enter)=\"onDeleteMessage(message)\"\n ></i>\n }\n @if (message.sender_id === currentUser.id && message.is_open) {\n <i\n class=\"fa fa-check-double msg-double-check\"\n ></i>\n }\n <p>{{ message.body }}</p>\n </div>\n } @else {\n <div class=\"chat-content with-attachment\">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n @if (message.sender_id === currentUser.id) {\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n (click)=\"onDeleteMessage(message)\"\n (keydown.enter)=\"onDeleteMessage(message)\"\n ></i>\n }\n @if (message.attachment) {\n <div class=\"message-attachment\">\n <i>\n @if (message?.messageType === ATTACHMENT_TYPE.IMG) {\n <img\n [src]=\"message.attachment.url\"\n class=\"img-thumbnail\"\n alt=\"message attachment\"\n />\n }\n @if (message?.messageType === ATTACHMENT_TYPE.VIDEO) {\n <video\n width=\"320\"\n height=\"240\"\n controls\n class=\"img-thumbnail\"\n >\n <source\n [src]=\"message.attachment.url\"\n type=\"video/mp4\"\n />\n <track kind=\"subtitles\" srclang=\"en\" label=\"English\" />\n Your browser does not support the video\n tag.\n </video>\n }\n <a\n [attr.href]=\"message.attachment.url\"\n target=\"_blank\"\n >\n <i\n class=\"fa fa-file-download me-2\"\n aria-hidden=\"true\"\n ></i>\n {{\n message.attachment.url\n | common: 'filename'\n }}</a>\n </i>\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n }\n }\n\n @if (!messagesGroupedByDate && isLoaded) {\n <div class=\"mt-3 text-center\">No message history.</div>\n }\n\n @if (isFileUploading) {\n <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>\n }\n\n <!-- Shows Metadata of the file being uploaded -->\n <div class=\"compose-message-attachment\">\n <div class=\"m-0\">\n @for (item of attachedFiles; track $index) {\n <div class=\"card px-3 py-2 m-0 mb-1\">\n <div class=\"card-body\">\n <div class=\"d-inline-block file-name\">{{ item.name }}</div>\n <div class=\"d-inline-block file-size\">{{ item.size }}</div>\n <div class=\"d-inline-block float-end file-remove\"\n (keydown.enter)=\"onRemoveAttachment(item)\"\n (click)=\"onRemoveAttachment(item)\">\n\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n\n <div [hidden]=\"!showEmoji\">\n <emoji-mart title=\"Pick your emoji…\"\n set=\"facebook\"\n [showPreview]=\"false\"\n (emojiSelect)=\"onEmojiSelect($event)\"\n [emojiSize]=\"30\">\n </emoji-mart>\n </div>\n\n <!-- Compose Text box area -->\n <div class=\"chat-app-form bg-blue-grey bg-lighten-5\">\n <form class=\"chat-app-input row\">\n <fieldset class=\"mb-3 position-relative has-icon-left col-10 m-0 mb-1\">\n <div class=\"form-control-position emoji-container\">\n <button type=\"button\" class=\"emoji-toggle-btn\" aria-label=\"Insert emoji\" (click)=\"showEmoji = !showEmoji\">🙂</button>\n </div>\n <label for=\"chatbox-message-input\" class=\"visually-hidden\">Type your message</label>\n <input type=\"text\"\n id=\"chatbox-message-input\"\n name=\"chatbox-message-input\"\n class=\"form-control\"\n autocomplete=\"off\"\n placeholder=\"Type your message here...\"\n (keydown.enter)=\"onSendMessage(); $event.preventDefault()\"\n #messageInput\n aria-label=\"Type your message here...\" />\n <div class=\"form-control-position control-position-right\">\n <div class=\"image-upload\">\n <label for=\"file-input\">\n <span class=\"visually-hidden\">Attach file</span>\n <i class=\"fa fa-paperclip\" aria-hidden=\"true\"></i>\n <input\n id=\"file-input\"\n name=\"file-input\"\n type=\"file\"\n (change)=\"fileChangeListener($event)\"\n size=\"60\"\n aria-label=\"File Input\" />\n </label>\n </div>\n </div>\n </fieldset>\n\n <fieldset class=\"mb-3 position-relative has-icon-left col-2 m-0 mb-1\">\n <button type=\"button\"\n class=\"btn btn-primary d-lg-flex align-items-center btn-send\"\n (click)=\"onSendMessage()\">\n <i class=\"fa fa-paper-plane\"></i><span class=\"d-none d-lg-block ms-1\">Send</span>\n </button>\n </fieldset>\n </form>\n </div>\n } @else {\n <div class=\"container-fluid pw-tab overflow-hidden no-message-center\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body text-center mt-5\">\n <div>\n <img src=\"/assets/img/icons/empty-chat-icon.png\"\n alt=\"No Chat\" />\n </div>\n <div class=\"h4 mt-4\">No messages yet!</div>\n <div class=\"mt-3\">\n <p>It looks like you haven't shared or received any messages yet.</p>\n <p>\n Start typing the name of the member you want to send a message to\n in the chat search field and send them a message.\n </p>\n </div>\n </div>\n </div>\n </div>\n }\n }\n</div>\n",
|
|
714
|
+
styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}:host ::ng-deep .chat-application{height:calc(100vh - 92px);position:relative}#drift-widget-container{display:none!important}#file-input{height:0;visibility:hidden;width:0}.message-attachment{color:#fff}.emoji-toggle-btn{background:transparent;border:0;color:#676767;cursor:pointer;font-size:20px;line-height:1;padding:4px 6px}.compose-message-attachment{bottom:0;color:#676767;left:0;position:absolute;width:55%}.compose-message-attachment .file-name{font-size:14px;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:400px}.compose-message-attachment .file-size{width:100px}.compose-message-attachment .file-remove{width:45px}.compose-message-attachment .file-remove i{margin-left:37px;margin-top:7px}.fa-spinner{font-size:24px}.fa-paperclip{font-size:19px;margin-top:7px;width:13px}.dummy-avatar{background-color:#ff586b;border-radius:50%;color:#fff;font-size:18px;height:40px;line-height:40px;text-align:center;width:40px;display:inline-block}.card{border:1px solid rgb(204,204,204)}.msg-double-check{color:#4fc3f7;font-size:10px;left:-13px;position:absolute;top:11px}.btn-delete{display:none;left:-85px;position:absolute;top:11px}.chat-body:hover .btn-delete{display:block!important}.bg-brown{background-color:#cc6000}.btn-send{border-radius:5px;padding:7px 13px}@keyframes spinner{to{transform:rotate(360deg)}}.spinner{animation:spinner .6s linear infinite!important;border:3px solid rgb(204,204,204);border-radius:50%;border-top-color:#000;box-sizing:border-box;content:\"\";height:50px;left:50%;margin-left:-10px;margin-top:-10px;position:absolute;top:10%;width:50px}@media(min-width:768px){.no-message-center{margin-left:auto;width:calc(100% - 300px)}}\n"]
|
|
715
|
+
}]
|
|
716
|
+
}],
|
|
717
|
+
ctorParameters: () => [
|
|
718
|
+
{ type: i0.ElementRef },
|
|
719
|
+
{ type: i1$1.MailBoxService },
|
|
720
|
+
{ type: i1$1.ProfileService },
|
|
721
|
+
{ type: i1$1.WebsocketService },
|
|
722
|
+
{ type: i1$1.ScriptLoaderService },
|
|
723
|
+
{ type: i0.Injector },
|
|
724
|
+
{ type: i0.ChangeDetectorRef },
|
|
725
|
+
{ type: i2.ConfirmDialogService }
|
|
726
|
+
],
|
|
727
|
+
propDecorators: { messageInputRef: [{
|
|
728
|
+
type: ViewChild,
|
|
729
|
+
args: ["messageInput", { static: false }]
|
|
730
|
+
}] }
|
|
731
|
+
});
|
|
732
|
+
const routes = [{
|
|
733
|
+
path: "",
|
|
734
|
+
component: ChatBoxComponent,
|
|
735
|
+
data: { title: "Chat" }
|
|
736
|
+
}, {
|
|
737
|
+
path: ":memberId",
|
|
738
|
+
component: ChatBoxComponent,
|
|
739
|
+
data: { title: "Chat" }
|
|
740
|
+
}];
|
|
741
|
+
var MessageRoutingModule = class MessageRoutingModule {
|
|
742
|
+
static {
|
|
743
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
744
|
+
minVersion: "12.0.0",
|
|
745
|
+
version: "22.2.0",
|
|
746
|
+
ngImport: i0,
|
|
747
|
+
type: MessageRoutingModule,
|
|
748
|
+
deps: [],
|
|
749
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
static {
|
|
753
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
754
|
+
minVersion: "14.0.0",
|
|
755
|
+
version: "22.2.0",
|
|
756
|
+
ngImport: i0,
|
|
757
|
+
type: MessageRoutingModule,
|
|
758
|
+
imports: [i1.RouterModule],
|
|
759
|
+
exports: [RouterModule]
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
static {
|
|
763
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
764
|
+
minVersion: "12.0.0",
|
|
765
|
+
version: "22.2.0",
|
|
766
|
+
ngImport: i0,
|
|
767
|
+
type: MessageRoutingModule,
|
|
768
|
+
imports: [RouterModule.forChild(routes), RouterModule]
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
773
|
+
minVersion: "12.0.0",
|
|
774
|
+
version: "22.2.0",
|
|
775
|
+
ngImport: i0,
|
|
776
|
+
type: MessageRoutingModule,
|
|
777
|
+
decorators: [{
|
|
778
|
+
type: NgModule,
|
|
779
|
+
args: [{
|
|
780
|
+
imports: [RouterModule.forChild(routes)],
|
|
781
|
+
exports: [RouterModule]
|
|
782
|
+
}]
|
|
783
|
+
}]
|
|
784
|
+
});
|
|
785
|
+
var MessagingModule = class MessagingModule {
|
|
786
|
+
static {
|
|
787
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
788
|
+
minVersion: "12.0.0",
|
|
789
|
+
version: "22.2.0",
|
|
790
|
+
ngImport: i0,
|
|
791
|
+
type: MessagingModule,
|
|
792
|
+
deps: [],
|
|
793
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
static {
|
|
797
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
798
|
+
minVersion: "14.0.0",
|
|
799
|
+
version: "22.2.0",
|
|
800
|
+
ngImport: i0,
|
|
801
|
+
type: MessagingModule,
|
|
802
|
+
declarations: [ChatBoxComponent],
|
|
803
|
+
imports: [
|
|
804
|
+
CommonModule,
|
|
805
|
+
PipesModule,
|
|
806
|
+
FormsModule,
|
|
807
|
+
MessageRoutingModule,
|
|
808
|
+
ProgressSpinnerModule,
|
|
809
|
+
AutoCompleteModule,
|
|
810
|
+
PickerModule,
|
|
811
|
+
EmojiModule,
|
|
812
|
+
NgxFileDropModule,
|
|
813
|
+
InfiniteScrollModule,
|
|
814
|
+
ScrollingModule
|
|
815
|
+
],
|
|
816
|
+
exports: [RouterModule, ChatBoxComponent]
|
|
817
|
+
});
|
|
818
|
+
}
|
|
819
|
+
static {
|
|
820
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
821
|
+
minVersion: "12.0.0",
|
|
822
|
+
version: "22.2.0",
|
|
823
|
+
ngImport: i0,
|
|
824
|
+
type: MessagingModule,
|
|
825
|
+
imports: [
|
|
826
|
+
CommonModule,
|
|
827
|
+
PipesModule,
|
|
828
|
+
FormsModule,
|
|
829
|
+
MessageRoutingModule,
|
|
830
|
+
ProgressSpinnerModule,
|
|
831
|
+
AutoCompleteModule,
|
|
832
|
+
PickerModule,
|
|
833
|
+
EmojiModule,
|
|
834
|
+
NgxFileDropModule,
|
|
835
|
+
InfiniteScrollModule,
|
|
836
|
+
ScrollingModule,
|
|
837
|
+
RouterModule
|
|
838
|
+
]
|
|
839
|
+
});
|
|
840
|
+
}
|
|
841
|
+
};
|
|
842
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
843
|
+
minVersion: "12.0.0",
|
|
844
|
+
version: "22.2.0",
|
|
845
|
+
ngImport: i0,
|
|
846
|
+
type: MessagingModule,
|
|
847
|
+
decorators: [{
|
|
848
|
+
type: NgModule,
|
|
849
|
+
args: [{
|
|
850
|
+
imports: [
|
|
851
|
+
CommonModule,
|
|
852
|
+
PipesModule,
|
|
853
|
+
FormsModule,
|
|
854
|
+
MessageRoutingModule,
|
|
855
|
+
ProgressSpinnerModule,
|
|
856
|
+
AutoCompleteModule,
|
|
857
|
+
PickerModule,
|
|
858
|
+
EmojiModule,
|
|
859
|
+
NgxFileDropModule,
|
|
860
|
+
InfiniteScrollModule,
|
|
861
|
+
ScrollingModule
|
|
862
|
+
],
|
|
863
|
+
declarations: [ChatBoxComponent],
|
|
864
|
+
exports: [RouterModule, ChatBoxComponent]
|
|
865
|
+
}]
|
|
866
|
+
}]
|
|
867
|
+
});
|
|
642
868
|
export { ChatBoxComponent, MessagingModule };
|
|
643
|
-
|
|
869
|
+
|
|
870
|
+
//# sourceMappingURL=posiwise-messaging-module.mjs.map
|