@edvak99/voice-receptionist-widget 1.1.21 → 1.1.22
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.
- package/fesm2022/edvak99-voice-receptionist-widget-activities-page.component-dcDXT2KG.mjs +533 -0
- package/fesm2022/edvak99-voice-receptionist-widget-activities-page.component-dcDXT2KG.mjs.map +1 -0
- package/fesm2022/{edvak99-voice-receptionist-widget-analytics-page.component-CmImX5FN.mjs → edvak99-voice-receptionist-widget-analytics-page.component-B25yZJZz.mjs} +2 -2
- package/fesm2022/{edvak99-voice-receptionist-widget-analytics-page.component-CmImX5FN.mjs.map → edvak99-voice-receptionist-widget-analytics-page.component-B25yZJZz.mjs.map} +1 -1
- package/fesm2022/edvak99-voice-receptionist-widget-audit-page.component-Df-dtgR3.mjs +96 -0
- package/fesm2022/edvak99-voice-receptionist-widget-audit-page.component-Df-dtgR3.mjs.map +1 -0
- package/fesm2022/{edvak99-voice-receptionist-widget-call-history-detail-page.component-BT4clUO-.mjs → edvak99-voice-receptionist-widget-call-history-detail-page.component-BJGzgVxG.mjs} +21 -10
- package/fesm2022/edvak99-voice-receptionist-widget-call-history-detail-page.component-BJGzgVxG.mjs.map +1 -0
- package/fesm2022/edvak99-voice-receptionist-widget-call-history-page.component-CcwwO5SO.mjs +254 -0
- package/fesm2022/edvak99-voice-receptionist-widget-call-history-page.component-CcwwO5SO.mjs.map +1 -0
- package/fesm2022/{edvak99-voice-receptionist-widget-call-recording-player.component-4fL-zUWy.mjs → edvak99-voice-receptionist-widget-call-recording-player.component-BepxNLNQ.mjs} +2 -2
- package/fesm2022/{edvak99-voice-receptionist-widget-call-recording-player.component-4fL-zUWy.mjs.map → edvak99-voice-receptionist-widget-call-recording-player.component-BepxNLNQ.mjs.map} +1 -1
- package/fesm2022/{edvak99-voice-receptionist-widget-call-review.service-BhbCmB1S.mjs → edvak99-voice-receptionist-widget-call-review.service-nFqc30t3.mjs} +2 -2
- package/fesm2022/{edvak99-voice-receptionist-widget-call-review.service-BhbCmB1S.mjs.map → edvak99-voice-receptionist-widget-call-review.service-nFqc30t3.mjs.map} +1 -1
- package/fesm2022/edvak99-voice-receptionist-widget-dashboard-page.component-CMgOu0aw.mjs +311 -0
- package/fesm2022/edvak99-voice-receptionist-widget-dashboard-page.component-CMgOu0aw.mjs.map +1 -0
- package/fesm2022/{edvak99-voice-receptionist-widget-edvak99-voice-receptionist-widget-DDS7VdnD.mjs → edvak99-voice-receptionist-widget-edvak99-voice-receptionist-widget-CJ1L6QeE.mjs} +54 -25
- package/fesm2022/edvak99-voice-receptionist-widget-edvak99-voice-receptionist-widget-CJ1L6QeE.mjs.map +1 -0
- package/fesm2022/{edvak99-voice-receptionist-widget-live-calls-page.component-4LtgT4lS.mjs → edvak99-voice-receptionist-widget-live-calls-page.component-MnBMu8iA.mjs} +4 -4
- package/fesm2022/edvak99-voice-receptionist-widget-live-calls-page.component-MnBMu8iA.mjs.map +1 -0
- package/fesm2022/{edvak99-voice-receptionist-widget-live-monitor-page.component-B1lKfw-j.mjs → edvak99-voice-receptionist-widget-live-monitor-page.component-BzvMkbC4.mjs} +10 -7
- package/fesm2022/edvak99-voice-receptionist-widget-live-monitor-page.component-BzvMkbC4.mjs.map +1 -0
- package/fesm2022/edvak99-voice-receptionist-widget-outbound-purposes-page.component-Aws6TaaE.mjs +273 -0
- package/fesm2022/edvak99-voice-receptionist-widget-outbound-purposes-page.component-Aws6TaaE.mjs.map +1 -0
- package/fesm2022/{edvak99-voice-receptionist-widget-task-detail-drawer.component-aDTKTV79.mjs → edvak99-voice-receptionist-widget-task-detail-drawer.component-DVWdArqj.mjs} +14 -6
- package/fesm2022/edvak99-voice-receptionist-widget-task-detail-drawer.component-DVWdArqj.mjs.map +1 -0
- package/fesm2022/{edvak99-voice-receptionist-widget-tasks-page.component-Dj1nWx6V.mjs → edvak99-voice-receptionist-widget-tasks-page.component-CBDmGLol.mjs} +11 -7
- package/fesm2022/edvak99-voice-receptionist-widget-tasks-page.component-CBDmGLol.mjs.map +1 -0
- package/fesm2022/{edvak99-voice-receptionist-widget-wizard-page.component-CQttbEzW.mjs → edvak99-voice-receptionist-widget-wizard-page.component-C-hdBQIV.mjs} +2 -2
- package/fesm2022/{edvak99-voice-receptionist-widget-wizard-page.component-CQttbEzW.mjs.map → edvak99-voice-receptionist-widget-wizard-page.component-C-hdBQIV.mjs.map} +1 -1
- package/fesm2022/edvak99-voice-receptionist-widget.mjs +1 -1
- package/lib/components/call-tasks-panel/call-tasks-panel.component.d.ts +3 -0
- package/lib/components/patient-profile-drawer/patient-profile-drawer.component.d.ts +3 -0
- package/lib/components/task-detail-drawer/task-detail-drawer.component.d.ts +3 -0
- package/lib/pages/activities-page/activities-page.component.d.ts +5 -2
- package/lib/pages/audit-page/audit-page.component.d.ts +3 -0
- package/lib/pages/call-history-detail-page/call-history-detail-page.component.d.ts +2 -0
- package/lib/pages/call-history-page/call-history-page.component.d.ts +1 -0
- package/lib/pages/dashboard-page/dashboard-page.component.d.ts +4 -0
- package/lib/pages/live-monitor-page/live-monitor-page.component.d.ts +2 -0
- package/lib/pages/outbound-purposes-page/outbound-purposes-page.component.d.ts +3 -0
- package/lib/pages/settings-page/settings-page.component.d.ts +1 -0
- package/lib/pages/tasks-page/tasks-page.component.d.ts +2 -0
- package/lib/services/ai-receptionist-api.service.d.ts +1 -0
- package/package.json +1 -1
- package/src/assets/css/_tables.scss +12 -0
- package/styles/embed.scss +27 -0
- package/fesm2022/edvak99-voice-receptionist-widget-activities-page.component-CpXa1J9-.mjs +0 -510
- package/fesm2022/edvak99-voice-receptionist-widget-activities-page.component-CpXa1J9-.mjs.map +0 -1
- package/fesm2022/edvak99-voice-receptionist-widget-audit-page.component-DTAB2WTX.mjs +0 -78
- package/fesm2022/edvak99-voice-receptionist-widget-audit-page.component-DTAB2WTX.mjs.map +0 -1
- package/fesm2022/edvak99-voice-receptionist-widget-call-history-detail-page.component-BT4clUO-.mjs.map +0 -1
- package/fesm2022/edvak99-voice-receptionist-widget-call-history-page.component-BACON4uq.mjs +0 -247
- package/fesm2022/edvak99-voice-receptionist-widget-call-history-page.component-BACON4uq.mjs.map +0 -1
- package/fesm2022/edvak99-voice-receptionist-widget-dashboard-page.component-CxNYLBbg.mjs +0 -291
- package/fesm2022/edvak99-voice-receptionist-widget-dashboard-page.component-CxNYLBbg.mjs.map +0 -1
- package/fesm2022/edvak99-voice-receptionist-widget-edvak99-voice-receptionist-widget-DDS7VdnD.mjs.map +0 -1
- package/fesm2022/edvak99-voice-receptionist-widget-live-calls-page.component-4LtgT4lS.mjs.map +0 -1
- package/fesm2022/edvak99-voice-receptionist-widget-live-monitor-page.component-B1lKfw-j.mjs.map +0 -1
- package/fesm2022/edvak99-voice-receptionist-widget-outbound-purposes-page.component-BkIHblSu.mjs +0 -269
- package/fesm2022/edvak99-voice-receptionist-widget-outbound-purposes-page.component-BkIHblSu.mjs.map +0 -1
- package/fesm2022/edvak99-voice-receptionist-widget-task-detail-drawer.component-aDTKTV79.mjs.map +0 -1
- package/fesm2022/edvak99-voice-receptionist-widget-tasks-page.component-Dj1nWx6V.mjs.map +0 -1
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, signal, computed, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
4
|
+
import * as i1 from '@angular/forms';
|
|
5
|
+
import { FormsModule } from '@angular/forms';
|
|
6
|
+
import { A as AiReceptionistApiService, T as ToastService, n as DEFAULT_PAGE_SIZE, o as totalPages, t as triggerBlobDownload, h as historyResolution, d as historyResultChips, r as resultChipIcon, e as historyResolutionLabel, c as callerMetaLine, E as EdAvatarComponent, I as IconComponent, p as EdIconButtonComponent, f as EdButtonComponent, g as EdSkeletonComponent } from './edvak99-voice-receptionist-widget-edvak99-voice-receptionist-widget-CJ1L6QeE.mjs';
|
|
7
|
+
import { C as CallReviewService } from './edvak99-voice-receptionist-widget-call-review.service-nFqc30t3.mjs';
|
|
8
|
+
import { i as isNeedsReview } from './edvak99-voice-receptionist-widget-call-review.util-rWIPxDtQ.mjs';
|
|
9
|
+
import { S as SmartTooltipDirective } from './edvak99-voice-receptionist-widget-smart-tooltip.directive-ChEdIem3.mjs';
|
|
10
|
+
import { T as TABLE_SKELETON_ROWS } from './edvak99-voice-receptionist-widget-table-skeleton.constants-C1Dg9Z_2.mjs';
|
|
11
|
+
import { E as EdsSearchFieldComponent } from './edvak99-voice-receptionist-widget-eds-search-field.component-BDGCmkoP.mjs';
|
|
12
|
+
|
|
13
|
+
class CallHistoryPageComponent {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.api = inject(AiReceptionistApiService);
|
|
16
|
+
this.reviewService = inject(CallReviewService);
|
|
17
|
+
this.toast = inject(ToastService);
|
|
18
|
+
this.route = inject(ActivatedRoute);
|
|
19
|
+
this.router = inject(Router);
|
|
20
|
+
this.pageSize = DEFAULT_PAGE_SIZE;
|
|
21
|
+
this.rows = signal([]);
|
|
22
|
+
this.total = signal(0);
|
|
23
|
+
this.page = signal(1);
|
|
24
|
+
this.loading = signal(true);
|
|
25
|
+
this.skeletonRows = TABLE_SKELETON_ROWS;
|
|
26
|
+
this.reviewingId = signal(null);
|
|
27
|
+
this.search = signal('');
|
|
28
|
+
this.direction = signal('');
|
|
29
|
+
this.outcome = signal('');
|
|
30
|
+
this.location = signal('');
|
|
31
|
+
this.reviewTab = signal('all');
|
|
32
|
+
this.filtersOpen = signal(false);
|
|
33
|
+
this.exporting = signal(false);
|
|
34
|
+
this.reviewTabs = [
|
|
35
|
+
{ id: 'all', label: 'All' },
|
|
36
|
+
{ id: 'needs', label: 'Needs review' },
|
|
37
|
+
{ id: 'reviewed', label: 'Reviewed' },
|
|
38
|
+
];
|
|
39
|
+
this.totalPages = computed(() => totalPages(this.total(), DEFAULT_PAGE_SIZE));
|
|
40
|
+
this.tableRows = computed(() => this.rows().map((row) => this.toRow(row)));
|
|
41
|
+
}
|
|
42
|
+
toggleFilters(event) {
|
|
43
|
+
event?.stopPropagation();
|
|
44
|
+
this.filtersOpen.update((open) => !open);
|
|
45
|
+
}
|
|
46
|
+
closeFilters() {
|
|
47
|
+
this.filtersOpen.set(false);
|
|
48
|
+
}
|
|
49
|
+
onFiltersDocClick(event) {
|
|
50
|
+
const target = event.target;
|
|
51
|
+
if (!target?.closest('[data-history-filters]')) {
|
|
52
|
+
this.filtersOpen.set(false);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
ngOnInit() {
|
|
56
|
+
const reviewParam = this.route.snapshot.queryParamMap.get('review');
|
|
57
|
+
if (reviewParam === 'needs' || reviewParam === 'reviewed') {
|
|
58
|
+
this.reviewTab.set(reviewParam);
|
|
59
|
+
}
|
|
60
|
+
this.load();
|
|
61
|
+
}
|
|
62
|
+
load() {
|
|
63
|
+
this.loading.set(true);
|
|
64
|
+
const tab = this.reviewTab();
|
|
65
|
+
this.api
|
|
66
|
+
.getHistory({
|
|
67
|
+
q: this.search() || undefined,
|
|
68
|
+
dir: this.direction() || undefined,
|
|
69
|
+
outcome: this.outcome() || undefined,
|
|
70
|
+
location: this.location() || undefined,
|
|
71
|
+
review: tab === 'all' ? undefined : tab,
|
|
72
|
+
page: this.page(),
|
|
73
|
+
limit: DEFAULT_PAGE_SIZE,
|
|
74
|
+
})
|
|
75
|
+
.subscribe({
|
|
76
|
+
next: ({ items, total, page }) => {
|
|
77
|
+
this.rows.set(items);
|
|
78
|
+
this.total.set(total);
|
|
79
|
+
this.page.set(page);
|
|
80
|
+
this.loading.set(false);
|
|
81
|
+
},
|
|
82
|
+
error: () => this.loading.set(false),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
onSearchInput(value) {
|
|
86
|
+
this.search.set(value);
|
|
87
|
+
if (!value.trim()) {
|
|
88
|
+
this.page.set(1);
|
|
89
|
+
this.load();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
applyFilters() {
|
|
93
|
+
this.page.set(1);
|
|
94
|
+
this.load();
|
|
95
|
+
}
|
|
96
|
+
setReviewTab(tab) {
|
|
97
|
+
this.reviewTab.set(tab);
|
|
98
|
+
this.page.set(1);
|
|
99
|
+
void this.router.navigate([], {
|
|
100
|
+
relativeTo: this.route,
|
|
101
|
+
queryParams: tab === 'all' ? { review: null } : { review: tab },
|
|
102
|
+
queryParamsHandling: 'merge',
|
|
103
|
+
replaceUrl: true,
|
|
104
|
+
});
|
|
105
|
+
this.load();
|
|
106
|
+
}
|
|
107
|
+
tabBadgeCount(tab) {
|
|
108
|
+
if (tab !== 'needs' || this.reviewTab() !== 'needs')
|
|
109
|
+
return null;
|
|
110
|
+
const count = this.total();
|
|
111
|
+
return count > 0 ? count : null;
|
|
112
|
+
}
|
|
113
|
+
prevPage() {
|
|
114
|
+
if (this.page() <= 1)
|
|
115
|
+
return;
|
|
116
|
+
this.page.update((p) => p - 1);
|
|
117
|
+
this.load();
|
|
118
|
+
}
|
|
119
|
+
nextPage() {
|
|
120
|
+
if (this.page() >= this.totalPages())
|
|
121
|
+
return;
|
|
122
|
+
this.page.update((p) => p + 1);
|
|
123
|
+
this.load();
|
|
124
|
+
}
|
|
125
|
+
markReviewed(row, event) {
|
|
126
|
+
event.preventDefault();
|
|
127
|
+
event.stopPropagation();
|
|
128
|
+
if (!isNeedsReview(row.review) || this.reviewingId())
|
|
129
|
+
return;
|
|
130
|
+
this.reviewingId.set(row.id);
|
|
131
|
+
this.rows.update((list) => list.map((r) => (r.id === row.id ? { ...r, review: 'reviewed' } : r)));
|
|
132
|
+
this.reviewService.markReviewed(row.id).subscribe({
|
|
133
|
+
next: () => {
|
|
134
|
+
this.reviewingId.set(null);
|
|
135
|
+
this.toast.show('Call marked as reviewed', 'success');
|
|
136
|
+
if (this.reviewTab() === 'needs')
|
|
137
|
+
this.load();
|
|
138
|
+
},
|
|
139
|
+
error: () => {
|
|
140
|
+
this.reviewingId.set(null);
|
|
141
|
+
this.rows.update((list) => list.map((r) => (r.id === row.id ? { ...r, review: 'needs' } : r)));
|
|
142
|
+
this.toast.show('Failed to mark call as reviewed', 'error');
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
openCallDetail(id) {
|
|
147
|
+
void this.router.navigate(['../history', id], { relativeTo: this.route });
|
|
148
|
+
}
|
|
149
|
+
exportCsv() {
|
|
150
|
+
if (this.exporting())
|
|
151
|
+
return;
|
|
152
|
+
this.exporting.set(true);
|
|
153
|
+
const tab = this.reviewTab();
|
|
154
|
+
this.api
|
|
155
|
+
.exportHistoryCsv({
|
|
156
|
+
q: this.search() || undefined,
|
|
157
|
+
dir: this.direction() || undefined,
|
|
158
|
+
outcome: this.outcome() || undefined,
|
|
159
|
+
location: this.location() || undefined,
|
|
160
|
+
review: tab === 'all' ? undefined : tab,
|
|
161
|
+
})
|
|
162
|
+
.subscribe({
|
|
163
|
+
next: ({ blob, filename }) => {
|
|
164
|
+
triggerBlobDownload(blob, filename);
|
|
165
|
+
this.exporting.set(false);
|
|
166
|
+
this.toast.show('Export downloaded', 'success');
|
|
167
|
+
},
|
|
168
|
+
error: (err) => {
|
|
169
|
+
this.exporting.set(false);
|
|
170
|
+
this.toast.show(err.message ?? 'Failed to export CSV', 'error');
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
toRow(row) {
|
|
175
|
+
const resolution = historyResolution({
|
|
176
|
+
outcome: row.outcome,
|
|
177
|
+
resolution: row.resolution,
|
|
178
|
+
risk: row.risk,
|
|
179
|
+
});
|
|
180
|
+
const handledByStaff = row.handledBy === 'staff';
|
|
181
|
+
return {
|
|
182
|
+
id: row.id,
|
|
183
|
+
name: row.name?.trim() || 'Unknown Caller',
|
|
184
|
+
initials: row.initials || '?',
|
|
185
|
+
avatarTone: this.avatarTone(row),
|
|
186
|
+
metaLine: callerMetaLine({
|
|
187
|
+
dob: row.dob,
|
|
188
|
+
age: row.age,
|
|
189
|
+
gender: row.gender,
|
|
190
|
+
phone: row.phone,
|
|
191
|
+
name: row.name,
|
|
192
|
+
}),
|
|
193
|
+
timeLabel: row.started ? this.formatTime(row.started) : row.whenLabel || '—',
|
|
194
|
+
dateLabel: row.started ? this.formatDate(row.started) : '',
|
|
195
|
+
direction: row.direction,
|
|
196
|
+
directionIcon: row.direction === 'inbound' ? 'call_received' : 'call_made',
|
|
197
|
+
directionTitle: row.direction === 'inbound' ? 'Incoming call' : 'Outgoing call',
|
|
198
|
+
goals: this.goalLines(row.reason),
|
|
199
|
+
handledLabel: handledByStaff ? 'STAFF' : 'AI',
|
|
200
|
+
handledVariant: handledByStaff ? 'primary' : 'opened',
|
|
201
|
+
resolutionLabel: historyResolutionLabel(resolution),
|
|
202
|
+
resolutionVariant: resolution === 'resolved' ? 'success' : 'warning',
|
|
203
|
+
resultChips: historyResultChips(row.results, row.outcome).map((label) => ({
|
|
204
|
+
label,
|
|
205
|
+
icon: resultChipIcon(label),
|
|
206
|
+
})),
|
|
207
|
+
durationLabel: row.durationLabel ?? this.formatDuration(row.duration),
|
|
208
|
+
needsReview: isNeedsReview(row.review),
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
goalLines(reason) {
|
|
212
|
+
const raw = String(reason ?? '').trim();
|
|
213
|
+
if (!raw)
|
|
214
|
+
return [];
|
|
215
|
+
return raw
|
|
216
|
+
.split(/[\n;|/]+/)
|
|
217
|
+
.map((part) => part.trim())
|
|
218
|
+
.filter(Boolean);
|
|
219
|
+
}
|
|
220
|
+
avatarTone(row) {
|
|
221
|
+
if (!row.name?.trim() || /^unknown/i.test(row.name) || row.initials === '?')
|
|
222
|
+
return 'gray';
|
|
223
|
+
return 'brand';
|
|
224
|
+
}
|
|
225
|
+
formatTime(ts) {
|
|
226
|
+
return new Date(ts).toLocaleTimeString([], { hour: 'numeric', minute: '2-digit' });
|
|
227
|
+
}
|
|
228
|
+
formatDate(ts) {
|
|
229
|
+
return new Date(ts).toLocaleDateString([], { month: 'short', day: 'numeric', year: 'numeric' });
|
|
230
|
+
}
|
|
231
|
+
formatDuration(sec) {
|
|
232
|
+
const m = Math.floor(sec / 60);
|
|
233
|
+
const s = sec % 60;
|
|
234
|
+
return `${m}:${s.toString().padStart(2, '0')}`;
|
|
235
|
+
}
|
|
236
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CallHistoryPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
237
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: CallHistoryPageComponent, isStandalone: true, selector: "eds-call-history-page", host: { classAttribute: "block h-full min-h-0" }, ngImport: i0, template: "<div class=\"call-history-page flex min-h-0 flex-col overflow-hidden bg-lighter p-base\">\n <header class=\"relative z-10 mb-md flex shrink-0 items-start justify-between gap-base bg-lighter\">\n <div class=\"grid gap-2xs\">\n <h4>Call History</h4>\n <p class=\"fs-sm text-light\">\n Review past conversations and understand what happened during each call\n </p>\n </div>\n <div class=\"flex shrink-0 items-center gap-base\">\n <div class=\"relative w-60\">\n <eds-search-field\n inputClass=\"form-input w-full\"\n placeholder=\"Search here\"\n ariaLabel=\"Search call history\"\n [value]=\"search()\"\n (valueChange)=\"onSearchInput($event)\"\n (enter)=\"applyFilters()\"\n />\n <span class=\"pointer-events-none absolute inset-y-0 right-3 inline-flex items-center text-lighter\">\n <ed-icon name=\"search\" [size]=\"20\" color=\"currentColor\" />\n </span>\n </div>\n <div\n class=\"relative\"\n data-history-filters\n (document:click)=\"onFiltersDocClick($event)\"\n >\n <ed-icon-button\n name=\"filter_alt\"\n label=\"Filters\"\n size=\"md\"\n outline\n allowBubble\n [pressed]=\"filtersOpen()\"\n toggle\n (click$)=\"toggleFilters($event)\"\n />\n @if (filtersOpen()) {\n <div\n class=\"absolute right-0 top-[calc(100%+4px)] z-20 w-80 rounded-md border border-light bg-white shadow-md\"\n role=\"dialog\"\n aria-label=\"Filter Options\"\n (click)=\"$event.stopPropagation()\"\n >\n <header class=\"flex items-center justify-between border-b border-light px-base py-sm\">\n <h5 class=\"m-0\">Filter Options</h5>\n <ed-icon-button\n name=\"close\"\n size=\"sm\"\n label=\"Close filters\"\n (click$)=\"closeFilters()\"\n />\n </header>\n <section class=\"grid gap-sm p-base\">\n <div class=\"grid gap-2xs\">\n <label class=\"fs-sm font-semibold text-light\" for=\"call-history-direction\">Direction</label>\n <select\n id=\"call-history-direction\"\n class=\"form-select is-sm\"\n [ngModel]=\"direction()\"\n (ngModelChange)=\"direction.set($event)\"\n autocomplete=\"off\"\n aria-label=\"Direction\"\n >\n <option value=\"\">All directions</option>\n <option value=\"inbound\">Inbound</option>\n <option value=\"outbound\">Outbound</option>\n </select>\n </div>\n <div class=\"grid gap-2xs\">\n <label class=\"fs-sm font-semibold text-light\">Outcome</label>\n <eds-search-field\n type=\"text\"\n inputClass=\"form-input is-sm\"\n placeholder=\"Outcome\"\n ariaLabel=\"Outcome\"\n [value]=\"outcome()\"\n (valueChange)=\"outcome.set($event)\"\n (enter)=\"applyFilters(); closeFilters()\"\n />\n </div>\n <div class=\"grid gap-2xs\">\n <label class=\"fs-sm font-semibold text-light\">Location</label>\n <eds-search-field\n type=\"text\"\n inputClass=\"form-input is-sm\"\n placeholder=\"Location\"\n ariaLabel=\"Location\"\n [value]=\"location()\"\n (valueChange)=\"location.set($event)\"\n (enter)=\"applyFilters(); closeFilters()\"\n />\n </div>\n </section>\n <footer class=\"flex flex-row-reverse flex-wrap items-center gap-sm border-t border-light px-base py-sm\">\n <ed-button\n variant=\"primary\"\n fill\n size=\"sm\"\n (click$)=\"applyFilters(); closeFilters()\"\n >\n Apply\n </ed-button>\n <ed-button\n variant=\"secondary\"\n outline\n size=\"sm\"\n [disabled]=\"exporting()\"\n (click$)=\"exportCsv()\"\n >\n <ed-icon slot=\"prefix\" name=\"download\" [size]=\"16\" />\n Export CSV\n </ed-button>\n </footer>\n </div>\n }\n </div>\n </div>\n </header>\n\n <div class=\"call-history-page__table eds-table-scroll min-h-0 min-w-0 flex-1 rounded-md bg-white\">\n <table class=\"table-default eds-sticky-table eds-centered-table min-w-5xl w-full\" aria-label=\"Call history\">\n <thead>\n <tr>\n <th class=\"bg-light\">Time</th>\n <th class=\"bg-light\">Patient/Caller</th>\n <th class=\"bg-light text-center\">\n <span class=\"inline-flex items-center justify-center gap-2xs\">\n <ed-icon name=\"call_received\" [size]=\"12\" class=\"text-success\" color=\"currentColor\" />\n <span class=\"text-light\">/</span>\n <ed-icon name=\"call_made\" [size]=\"12\" class=\"text-primary\" color=\"currentColor\" />\n </span>\n </th>\n <th class=\"bg-light\">Goal</th>\n <th class=\"bg-light\">Handled By</th>\n <th class=\"bg-light\">Resolution</th>\n <th class=\"bg-light\">Result</th>\n <th class=\"bg-light\">Duration</th>\n </tr>\n </thead>\n @if (loading()) {\n <tbody aria-busy=\"true\">\n @for (_ of skeletonRows; track _) {\n <tr>\n <td>\n <div class=\"grid gap-2xs py-2xs\">\n <ed-skeleton class=\"h-3 w-16\"></ed-skeleton>\n <ed-skeleton class=\"h-3 w-20\"></ed-skeleton>\n </div>\n </td>\n <td>\n <div class=\"flex items-center gap-xs py-2xs\">\n <ed-skeleton class=\"h-8 w-8 !rounded-md\"></ed-skeleton>\n <div class=\"grid gap-2xs\">\n <ed-skeleton class=\"h-3 w-28\"></ed-skeleton>\n <ed-skeleton class=\"h-3 w-36\"></ed-skeleton>\n </div>\n </div>\n </td>\n <td class=\"text-center\">\n <div class=\"flex justify-center py-2xs\">\n <ed-skeleton class=\"h-5 w-5 !rounded\"></ed-skeleton>\n </div>\n </td>\n <td><ed-skeleton class=\"h-3 w-32\"></ed-skeleton></td>\n <td><ed-skeleton class=\"h-5 w-20 !rounded-full\"></ed-skeleton></td>\n <td><ed-skeleton class=\"h-5 w-24 !rounded-full\"></ed-skeleton></td>\n <td><ed-skeleton class=\"h-5 w-28 !rounded\"></ed-skeleton></td>\n <td><ed-skeleton class=\"h-3 w-12\"></ed-skeleton></td>\n </tr>\n }\n </tbody>\n } @else {\n <tbody>\n @for (row of tableRows(); track row.id; let i = $index) {\n <tr\n class=\"focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary\"\n role=\"button\"\n [attr.tabindex]=\"i === 0 ? 0 : -1\"\n [attr.aria-label]=\"'View call details for ' + row.name\"\n (click)=\"openCallDetail(row.id)\"\n (keyup.enter)=\"openCallDetail(row.id)\"\n >\n <td>\n <div class=\"grid gap-2xs whitespace-nowrap\">\n <span class=\"fs-xs font-medium text-dark\">{{ row.timeLabel }}</span>\n <span class=\"fs-xs text-light\">{{ row.dateLabel }}</span>\n </div>\n </td>\n\n <td>\n <div class=\"flex min-w-52 items-center gap-xs\">\n <ed-avatar\n shape=\"box\"\n size=\"base\"\n [initials]=\"row.initials\"\n [tone]=\"row.avatarTone\"\n />\n <div class=\"grid min-w-0 gap-2xs\">\n <div class=\"flex min-w-0 items-center gap-2xs\">\n <span\n class=\"inline-block min-w-0 max-w-56 truncate fs-sm font-semibold text-dark\"\n [smartTooltip]=\"row.name\"\n [tooltipOnlyWhenTruncated]=\"true\"\n >{{ row.name }}</span>\n <!-- <span class=\"inline-flex shrink-0 text-light\">\n <ed-icon name=\"TagSimple\" [size]=\"14\" color=\"currentColor\" />\n </span> -->\n </div>\n <span\n class=\"inline-block min-w-0 max-w-64 truncate fs-xs text-light\"\n [smartTooltip]=\"row.metaLine\"\n [tooltipOnlyWhenTruncated]=\"true\"\n >{{ row.metaLine }}</span>\n </div>\n </div>\n </td>\n\n <td class=\"text-center\">\n <span\n class=\"inline-flex h-5 w-5 items-center justify-center rounded\"\n [class.bg-success-50]=\"row.direction === 'inbound'\"\n [class.text-success]=\"row.direction === 'inbound'\"\n [class.bg-primary-50]=\"row.direction === 'outbound'\"\n [class.text-primary]=\"row.direction === 'outbound'\"\n [smartTooltip]=\"row.directionTitle\"\n [attr.aria-label]=\"row.directionTitle\"\n >\n <ed-icon [name]=\"row.directionIcon\" [size]=\"12\" color=\"currentColor\" />\n </span>\n </td>\n\n <td>\n <div class=\"grid gap-2xs\">\n @for (goal of row.goals; track goal) {\n <span\n class=\"inline-block min-w-0 max-w-56 truncate fs-sm font-medium text-dark\"\n [smartTooltip]=\"goal\"\n [tooltipOnlyWhenTruncated]=\"true\"\n >{{ goal }}</span>\n } @empty {\n <span class=\"fs-sm text-light\">\u2014</span>\n }\n </div>\n </td>\n\n <td>\n <ed-badge-2 [attr.variant]=\"row.handledVariant\" pill uppercase>\n {{ row.handledLabel }}\n </ed-badge-2>\n </td>\n\n <td>\n <ed-badge-2 [attr.variant]=\"row.resolutionVariant\" pill uppercase>\n {{ row.resolutionLabel }}\n </ed-badge-2>\n </td>\n\n <td>\n <div class=\"flex min-w-0 max-w-80 flex-wrap gap-2xs\">\n @for (chip of row.resultChips; track chip.label) {\n <span\n class=\"inline-flex h-5 max-w-48 min-w-0 items-center gap-2xs rounded bg-light px-2xs fs-xs font-medium text-dark\"\n >\n <ed-icon [name]=\"chip.icon\" [size]=\"12\" color=\"currentColor\" />\n <span\n class=\"min-w-0 truncate\"\n [smartTooltip]=\"chip.label\"\n [tooltipOnlyWhenTruncated]=\"true\"\n >{{ chip.label }}</span>\n </span>\n } @empty {\n <span class=\"fs-sm text-light\">\u2014</span>\n }\n </div>\n </td>\n\n <td class=\"whitespace-nowrap tabular-nums fs-sm font-medium\">\n {{ row.durationLabel }}\n </td>\n </tr>\n } @empty {\n <tr class=\"empty-row\">\n <td colspan=\"8\" class=\"py-lg text-center fs-sm text-light\">\n No calls match this filter.\n </td>\n </tr>\n }\n </tbody>\n }\n </table>\n </div>\n\n <footer class=\"mt-base flex shrink-0 items-center justify-between border-t border-light pt-sm hidden\">\n <span class=\"fs-sm text-light\">\n Page {{ page() }} of {{ totalPages() }} \u00B7 {{ total() }} total\n </span>\n <div class=\"flex gap-xs\">\n <ed-button\n variant=\"secondary\"\n outline\n size=\"sm\"\n [disabled]=\"page() <= 1\"\n (click$)=\"prevPage()\"\n >\n Previous\n </ed-button>\n <ed-button\n variant=\"secondary\"\n outline\n size=\"sm\"\n [disabled]=\"page() >= totalPages()\"\n (click$)=\"nextPage()\"\n >\n Next\n </ed-button>\n </div>\n </footer>\n</div>\n", styles: [":host{display:block;height:100%;min-height:0}.call-history-page{height:100%;min-height:24rem}.call-history-page__table{min-height:16rem}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: EdAvatarComponent, selector: "ed-avatar", inputs: ["initials", "tone", "shape", "size", "gradient"] }, { kind: "component", type: IconComponent, selector: "ed-icon", inputs: ["name", "size", "color", "cssClass", "decorative", "ariaHidden", "ariaLabel", "title", "desc", "focusable", "tabIndex"] }, { kind: "component", type: EdIconButtonComponent, selector: "ed-icon-button", inputs: ["label", "name", "size", "variant", "allowBubble", "ghost", "outline", "solid", "subtle", "shape", "type", "disabled", "loading", "toggle", "pressed", "id", "title", "nameAttr", "value", "autofocus", "tabIndex"], outputs: ["click", "focus", "blur", "click$", "focus$", "blur$"] }, { kind: "component", type: EdButtonComponent, selector: "ed-button", inputs: ["variant", "size", "disabled", "ghost", "outline", "subtle", "fill", "loading", "block", "elevated", "shape", "type", "href", "routerLink", "rel", "target", "download", "ariaLabel"], outputs: ["click$"] }, { kind: "component", type: EdsSearchFieldComponent, selector: "eds-search-field", inputs: ["value", "inputId", "type", "placeholder", "ariaLabel", "inputClass"], outputs: ["valueChange", "enter"] }, { kind: "directive", type: SmartTooltipDirective, selector: "[smartTooltip]", inputs: ["smartTooltip", "tooltipAllowHtml", "tooltipTemplate", "tooltipTemplateContext", "tooltipPlacement", "tooltipTrigger", "tooltipDelayShow", "tooltipDelayHide", "tooltipOffset", "tooltipMaxWidth", "tooltipZIndex", "tooltipClass", "tooltipDisabled", "tooltipArrow", "tooltipHoverIntentMs", "tooltipHoverIntentRadius", "tooltipId", "tooltipRole", "tooltipAnimEnterMs", "tooltipAnimExitMs", "tooltipAnimEasing", "tooltipHoverable", "tooltipHandoffMs", "tooltipOpen", "tooltipOnlyWhenTruncated"] }, { kind: "component", type: EdSkeletonComponent, selector: "ed-skeleton", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
238
|
+
}
|
|
239
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CallHistoryPageComponent, decorators: [{
|
|
240
|
+
type: Component,
|
|
241
|
+
args: [{ selector: 'eds-call-history-page', imports: [
|
|
242
|
+
FormsModule,
|
|
243
|
+
EdAvatarComponent,
|
|
244
|
+
IconComponent,
|
|
245
|
+
EdIconButtonComponent,
|
|
246
|
+
EdButtonComponent,
|
|
247
|
+
EdsSearchFieldComponent,
|
|
248
|
+
SmartTooltipDirective,
|
|
249
|
+
EdSkeletonComponent,
|
|
250
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, schemas: [CUSTOM_ELEMENTS_SCHEMA], host: { class: 'block h-full min-h-0' }, template: "<div class=\"call-history-page flex min-h-0 flex-col overflow-hidden bg-lighter p-base\">\n <header class=\"relative z-10 mb-md flex shrink-0 items-start justify-between gap-base bg-lighter\">\n <div class=\"grid gap-2xs\">\n <h4>Call History</h4>\n <p class=\"fs-sm text-light\">\n Review past conversations and understand what happened during each call\n </p>\n </div>\n <div class=\"flex shrink-0 items-center gap-base\">\n <div class=\"relative w-60\">\n <eds-search-field\n inputClass=\"form-input w-full\"\n placeholder=\"Search here\"\n ariaLabel=\"Search call history\"\n [value]=\"search()\"\n (valueChange)=\"onSearchInput($event)\"\n (enter)=\"applyFilters()\"\n />\n <span class=\"pointer-events-none absolute inset-y-0 right-3 inline-flex items-center text-lighter\">\n <ed-icon name=\"search\" [size]=\"20\" color=\"currentColor\" />\n </span>\n </div>\n <div\n class=\"relative\"\n data-history-filters\n (document:click)=\"onFiltersDocClick($event)\"\n >\n <ed-icon-button\n name=\"filter_alt\"\n label=\"Filters\"\n size=\"md\"\n outline\n allowBubble\n [pressed]=\"filtersOpen()\"\n toggle\n (click$)=\"toggleFilters($event)\"\n />\n @if (filtersOpen()) {\n <div\n class=\"absolute right-0 top-[calc(100%+4px)] z-20 w-80 rounded-md border border-light bg-white shadow-md\"\n role=\"dialog\"\n aria-label=\"Filter Options\"\n (click)=\"$event.stopPropagation()\"\n >\n <header class=\"flex items-center justify-between border-b border-light px-base py-sm\">\n <h5 class=\"m-0\">Filter Options</h5>\n <ed-icon-button\n name=\"close\"\n size=\"sm\"\n label=\"Close filters\"\n (click$)=\"closeFilters()\"\n />\n </header>\n <section class=\"grid gap-sm p-base\">\n <div class=\"grid gap-2xs\">\n <label class=\"fs-sm font-semibold text-light\" for=\"call-history-direction\">Direction</label>\n <select\n id=\"call-history-direction\"\n class=\"form-select is-sm\"\n [ngModel]=\"direction()\"\n (ngModelChange)=\"direction.set($event)\"\n autocomplete=\"off\"\n aria-label=\"Direction\"\n >\n <option value=\"\">All directions</option>\n <option value=\"inbound\">Inbound</option>\n <option value=\"outbound\">Outbound</option>\n </select>\n </div>\n <div class=\"grid gap-2xs\">\n <label class=\"fs-sm font-semibold text-light\">Outcome</label>\n <eds-search-field\n type=\"text\"\n inputClass=\"form-input is-sm\"\n placeholder=\"Outcome\"\n ariaLabel=\"Outcome\"\n [value]=\"outcome()\"\n (valueChange)=\"outcome.set($event)\"\n (enter)=\"applyFilters(); closeFilters()\"\n />\n </div>\n <div class=\"grid gap-2xs\">\n <label class=\"fs-sm font-semibold text-light\">Location</label>\n <eds-search-field\n type=\"text\"\n inputClass=\"form-input is-sm\"\n placeholder=\"Location\"\n ariaLabel=\"Location\"\n [value]=\"location()\"\n (valueChange)=\"location.set($event)\"\n (enter)=\"applyFilters(); closeFilters()\"\n />\n </div>\n </section>\n <footer class=\"flex flex-row-reverse flex-wrap items-center gap-sm border-t border-light px-base py-sm\">\n <ed-button\n variant=\"primary\"\n fill\n size=\"sm\"\n (click$)=\"applyFilters(); closeFilters()\"\n >\n Apply\n </ed-button>\n <ed-button\n variant=\"secondary\"\n outline\n size=\"sm\"\n [disabled]=\"exporting()\"\n (click$)=\"exportCsv()\"\n >\n <ed-icon slot=\"prefix\" name=\"download\" [size]=\"16\" />\n Export CSV\n </ed-button>\n </footer>\n </div>\n }\n </div>\n </div>\n </header>\n\n <div class=\"call-history-page__table eds-table-scroll min-h-0 min-w-0 flex-1 rounded-md bg-white\">\n <table class=\"table-default eds-sticky-table eds-centered-table min-w-5xl w-full\" aria-label=\"Call history\">\n <thead>\n <tr>\n <th class=\"bg-light\">Time</th>\n <th class=\"bg-light\">Patient/Caller</th>\n <th class=\"bg-light text-center\">\n <span class=\"inline-flex items-center justify-center gap-2xs\">\n <ed-icon name=\"call_received\" [size]=\"12\" class=\"text-success\" color=\"currentColor\" />\n <span class=\"text-light\">/</span>\n <ed-icon name=\"call_made\" [size]=\"12\" class=\"text-primary\" color=\"currentColor\" />\n </span>\n </th>\n <th class=\"bg-light\">Goal</th>\n <th class=\"bg-light\">Handled By</th>\n <th class=\"bg-light\">Resolution</th>\n <th class=\"bg-light\">Result</th>\n <th class=\"bg-light\">Duration</th>\n </tr>\n </thead>\n @if (loading()) {\n <tbody aria-busy=\"true\">\n @for (_ of skeletonRows; track _) {\n <tr>\n <td>\n <div class=\"grid gap-2xs py-2xs\">\n <ed-skeleton class=\"h-3 w-16\"></ed-skeleton>\n <ed-skeleton class=\"h-3 w-20\"></ed-skeleton>\n </div>\n </td>\n <td>\n <div class=\"flex items-center gap-xs py-2xs\">\n <ed-skeleton class=\"h-8 w-8 !rounded-md\"></ed-skeleton>\n <div class=\"grid gap-2xs\">\n <ed-skeleton class=\"h-3 w-28\"></ed-skeleton>\n <ed-skeleton class=\"h-3 w-36\"></ed-skeleton>\n </div>\n </div>\n </td>\n <td class=\"text-center\">\n <div class=\"flex justify-center py-2xs\">\n <ed-skeleton class=\"h-5 w-5 !rounded\"></ed-skeleton>\n </div>\n </td>\n <td><ed-skeleton class=\"h-3 w-32\"></ed-skeleton></td>\n <td><ed-skeleton class=\"h-5 w-20 !rounded-full\"></ed-skeleton></td>\n <td><ed-skeleton class=\"h-5 w-24 !rounded-full\"></ed-skeleton></td>\n <td><ed-skeleton class=\"h-5 w-28 !rounded\"></ed-skeleton></td>\n <td><ed-skeleton class=\"h-3 w-12\"></ed-skeleton></td>\n </tr>\n }\n </tbody>\n } @else {\n <tbody>\n @for (row of tableRows(); track row.id; let i = $index) {\n <tr\n class=\"focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary\"\n role=\"button\"\n [attr.tabindex]=\"i === 0 ? 0 : -1\"\n [attr.aria-label]=\"'View call details for ' + row.name\"\n (click)=\"openCallDetail(row.id)\"\n (keyup.enter)=\"openCallDetail(row.id)\"\n >\n <td>\n <div class=\"grid gap-2xs whitespace-nowrap\">\n <span class=\"fs-xs font-medium text-dark\">{{ row.timeLabel }}</span>\n <span class=\"fs-xs text-light\">{{ row.dateLabel }}</span>\n </div>\n </td>\n\n <td>\n <div class=\"flex min-w-52 items-center gap-xs\">\n <ed-avatar\n shape=\"box\"\n size=\"base\"\n [initials]=\"row.initials\"\n [tone]=\"row.avatarTone\"\n />\n <div class=\"grid min-w-0 gap-2xs\">\n <div class=\"flex min-w-0 items-center gap-2xs\">\n <span\n class=\"inline-block min-w-0 max-w-56 truncate fs-sm font-semibold text-dark\"\n [smartTooltip]=\"row.name\"\n [tooltipOnlyWhenTruncated]=\"true\"\n >{{ row.name }}</span>\n <!-- <span class=\"inline-flex shrink-0 text-light\">\n <ed-icon name=\"TagSimple\" [size]=\"14\" color=\"currentColor\" />\n </span> -->\n </div>\n <span\n class=\"inline-block min-w-0 max-w-64 truncate fs-xs text-light\"\n [smartTooltip]=\"row.metaLine\"\n [tooltipOnlyWhenTruncated]=\"true\"\n >{{ row.metaLine }}</span>\n </div>\n </div>\n </td>\n\n <td class=\"text-center\">\n <span\n class=\"inline-flex h-5 w-5 items-center justify-center rounded\"\n [class.bg-success-50]=\"row.direction === 'inbound'\"\n [class.text-success]=\"row.direction === 'inbound'\"\n [class.bg-primary-50]=\"row.direction === 'outbound'\"\n [class.text-primary]=\"row.direction === 'outbound'\"\n [smartTooltip]=\"row.directionTitle\"\n [attr.aria-label]=\"row.directionTitle\"\n >\n <ed-icon [name]=\"row.directionIcon\" [size]=\"12\" color=\"currentColor\" />\n </span>\n </td>\n\n <td>\n <div class=\"grid gap-2xs\">\n @for (goal of row.goals; track goal) {\n <span\n class=\"inline-block min-w-0 max-w-56 truncate fs-sm font-medium text-dark\"\n [smartTooltip]=\"goal\"\n [tooltipOnlyWhenTruncated]=\"true\"\n >{{ goal }}</span>\n } @empty {\n <span class=\"fs-sm text-light\">\u2014</span>\n }\n </div>\n </td>\n\n <td>\n <ed-badge-2 [attr.variant]=\"row.handledVariant\" pill uppercase>\n {{ row.handledLabel }}\n </ed-badge-2>\n </td>\n\n <td>\n <ed-badge-2 [attr.variant]=\"row.resolutionVariant\" pill uppercase>\n {{ row.resolutionLabel }}\n </ed-badge-2>\n </td>\n\n <td>\n <div class=\"flex min-w-0 max-w-80 flex-wrap gap-2xs\">\n @for (chip of row.resultChips; track chip.label) {\n <span\n class=\"inline-flex h-5 max-w-48 min-w-0 items-center gap-2xs rounded bg-light px-2xs fs-xs font-medium text-dark\"\n >\n <ed-icon [name]=\"chip.icon\" [size]=\"12\" color=\"currentColor\" />\n <span\n class=\"min-w-0 truncate\"\n [smartTooltip]=\"chip.label\"\n [tooltipOnlyWhenTruncated]=\"true\"\n >{{ chip.label }}</span>\n </span>\n } @empty {\n <span class=\"fs-sm text-light\">\u2014</span>\n }\n </div>\n </td>\n\n <td class=\"whitespace-nowrap tabular-nums fs-sm font-medium\">\n {{ row.durationLabel }}\n </td>\n </tr>\n } @empty {\n <tr class=\"empty-row\">\n <td colspan=\"8\" class=\"py-lg text-center fs-sm text-light\">\n No calls match this filter.\n </td>\n </tr>\n }\n </tbody>\n }\n </table>\n </div>\n\n <footer class=\"mt-base flex shrink-0 items-center justify-between border-t border-light pt-sm hidden\">\n <span class=\"fs-sm text-light\">\n Page {{ page() }} of {{ totalPages() }} \u00B7 {{ total() }} total\n </span>\n <div class=\"flex gap-xs\">\n <ed-button\n variant=\"secondary\"\n outline\n size=\"sm\"\n [disabled]=\"page() <= 1\"\n (click$)=\"prevPage()\"\n >\n Previous\n </ed-button>\n <ed-button\n variant=\"secondary\"\n outline\n size=\"sm\"\n [disabled]=\"page() >= totalPages()\"\n (click$)=\"nextPage()\"\n >\n Next\n </ed-button>\n </div>\n </footer>\n</div>\n", styles: [":host{display:block;height:100%;min-height:0}.call-history-page{height:100%;min-height:24rem}.call-history-page__table{min-height:16rem}\n"] }]
|
|
251
|
+
}] });
|
|
252
|
+
|
|
253
|
+
export { CallHistoryPageComponent };
|
|
254
|
+
//# sourceMappingURL=edvak99-voice-receptionist-widget-call-history-page.component-CcwwO5SO.mjs.map
|
package/fesm2022/edvak99-voice-receptionist-widget-call-history-page.component-CcwwO5SO.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edvak99-voice-receptionist-widget-call-history-page.component-CcwwO5SO.mjs","sources":["../../../src/lib/pages/call-history-page/call-history-page.component.ts","../../../src/lib/pages/call-history-page/call-history-page.component.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n CUSTOM_ELEMENTS_SCHEMA,\n inject,\n OnInit,\n signal,\n} from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { FormsModule } from '@angular/forms';\n\nimport { HistoryCall } from '../../models/ai-receptionist.types';\nimport { DEFAULT_PAGE_SIZE, totalPages as calcTotalPages } from '../../models/pagination';\nimport { AiReceptionistApiService } from '../../services/ai-receptionist-api.service';\nimport { CallReviewService } from '../../services/call-review.service';\nimport {\n callerMetaLine,\n historyResolution,\n historyResolutionLabel,\n historyResultChips,\n resultChipIcon,\n} from '../../utils/call-history-display.util';\nimport { isNeedsReview, ReviewFilterTab } from '../../utils/call-review.util';\nimport { EdButtonComponent } from '../../ui/ed-button.component';\nimport { EdSkeletonComponent } from '../../ui/ed-skeleton.component';\n\nimport { SmartTooltipDirective } from '../../shared/smart-tooltip.directive';\nimport { TABLE_SKELETON_ROWS } from '../../shared/table-skeleton.constants';\nimport { ToastService } from '../../shared/toast.service';\nimport { triggerBlobDownload } from '../../utils/csv-download.util';\nimport { EdAvatarComponent } from '../../ui/ed-avatar.component';\nimport { IconComponent } from '../../ui/ed-icon.component';\nimport { EdIconButtonComponent } from '../../ui/ed-icon-button.component';\nimport { EdsSearchFieldComponent } from '../../ui/eds-search-field.component';\n\ninterface HistoryRowVm {\n id: string;\n name: string;\n initials: string;\n avatarTone: 'gray' | 'brand';\n metaLine: string;\n timeLabel: string;\n dateLabel: string;\n direction: 'inbound' | 'outbound';\n directionIcon: string;\n directionTitle: string;\n goals: string[];\n handledLabel: string;\n handledVariant: 'opened' | 'primary';\n resolutionLabel: string;\n resolutionVariant: 'success' | 'warning';\n resultChips: { label: string; icon: string }[];\n durationLabel: string;\n needsReview: boolean;\n}\n\n@Component({\n selector: 'eds-call-history-page',\n imports: [\n FormsModule,\n EdAvatarComponent,\n IconComponent,\n EdIconButtonComponent,\n EdButtonComponent,\n EdsSearchFieldComponent,\n SmartTooltipDirective,\n EdSkeletonComponent,\n ],\n templateUrl: './call-history-page.component.html',\n styleUrl: './call-history-page.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n host: { class: 'block h-full min-h-0' },\n})\nexport class CallHistoryPageComponent implements OnInit {\n private readonly api = inject(AiReceptionistApiService);\n private readonly reviewService = inject(CallReviewService);\n private readonly toast = inject(ToastService);\n private readonly route = inject(ActivatedRoute);\n private readonly router = inject(Router);\n\n protected readonly pageSize = DEFAULT_PAGE_SIZE;\n protected readonly rows = signal<HistoryCall[]>([]);\n protected readonly total = signal(0);\n protected readonly page = signal(1);\n protected readonly loading = signal(true);\n protected readonly skeletonRows = TABLE_SKELETON_ROWS;\n protected readonly reviewingId = signal<string | null>(null);\n protected readonly search = signal('');\n protected readonly direction = signal('');\n protected readonly outcome = signal('');\n protected readonly location = signal('');\n protected readonly reviewTab = signal<ReviewFilterTab>('all');\n protected readonly filtersOpen = signal(false);\n protected readonly exporting = signal(false);\n\n protected toggleFilters(event?: Event): void {\n event?.stopPropagation();\n this.filtersOpen.update((open) => !open);\n }\n\n protected closeFilters(): void {\n this.filtersOpen.set(false);\n }\n\n protected onFiltersDocClick(event: MouseEvent): void {\n const target = event.target as HTMLElement | null;\n if (!target?.closest('[data-history-filters]')) {\n this.filtersOpen.set(false);\n }\n }\n\n protected readonly reviewTabs: { id: ReviewFilterTab; label: string }[] = [\n { id: 'all', label: 'All' },\n { id: 'needs', label: 'Needs review' },\n { id: 'reviewed', label: 'Reviewed' },\n ];\n\n protected readonly totalPages = computed(() => calcTotalPages(this.total(), DEFAULT_PAGE_SIZE));\n\n protected readonly tableRows = computed(() => this.rows().map((row) => this.toRow(row)));\n\n ngOnInit(): void {\n const reviewParam = this.route.snapshot.queryParamMap.get('review');\n if (reviewParam === 'needs' || reviewParam === 'reviewed') {\n this.reviewTab.set(reviewParam);\n }\n this.load();\n }\n\n protected load(): void {\n this.loading.set(true);\n const tab = this.reviewTab();\n this.api\n .getHistory({\n q: this.search() || undefined,\n dir: this.direction() || undefined,\n outcome: this.outcome() || undefined,\n location: this.location() || undefined,\n review: tab === 'all' ? undefined : tab,\n page: this.page(),\n limit: DEFAULT_PAGE_SIZE,\n })\n .subscribe({\n next: ({ items, total, page }) => {\n this.rows.set(items);\n this.total.set(total);\n this.page.set(page);\n this.loading.set(false);\n },\n error: () => this.loading.set(false),\n });\n }\n\n protected onSearchInput(value: string): void {\n this.search.set(value);\n if (!value.trim()) {\n this.page.set(1);\n this.load();\n }\n }\n\n protected applyFilters(): void {\n this.page.set(1);\n this.load();\n }\n\n protected setReviewTab(tab: ReviewFilterTab): void {\n this.reviewTab.set(tab);\n this.page.set(1);\n void this.router.navigate([], {\n relativeTo: this.route,\n queryParams: tab === 'all' ? { review: null } : { review: tab },\n queryParamsHandling: 'merge',\n replaceUrl: true,\n });\n this.load();\n }\n\n protected tabBadgeCount(tab: ReviewFilterTab): number | null {\n if (tab !== 'needs' || this.reviewTab() !== 'needs') return null;\n const count = this.total();\n return count > 0 ? count : null;\n }\n\n protected prevPage(): void {\n if (this.page() <= 1) return;\n this.page.update((p) => p - 1);\n this.load();\n }\n\n protected nextPage(): void {\n if (this.page() >= this.totalPages()) return;\n this.page.update((p) => p + 1);\n this.load();\n }\n\n protected markReviewed(row: HistoryCall, event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n if (!isNeedsReview(row.review) || this.reviewingId()) return;\n\n this.reviewingId.set(row.id);\n this.rows.update((list) =>\n list.map((r) => (r.id === row.id ? { ...r, review: 'reviewed' as const } : r)),\n );\n\n this.reviewService.markReviewed(row.id).subscribe({\n next: () => {\n this.reviewingId.set(null);\n this.toast.show('Call marked as reviewed', 'success');\n if (this.reviewTab() === 'needs') this.load();\n },\n error: () => {\n this.reviewingId.set(null);\n this.rows.update((list) =>\n list.map((r) => (r.id === row.id ? { ...r, review: 'needs' as const } : r)),\n );\n this.toast.show('Failed to mark call as reviewed', 'error');\n },\n });\n }\n\n protected openCallDetail(id: string): void {\n void this.router.navigate(['../history', id], { relativeTo: this.route });\n }\n\n protected exportCsv(): void {\n if (this.exporting()) return;\n this.exporting.set(true);\n const tab = this.reviewTab();\n this.api\n .exportHistoryCsv({\n q: this.search() || undefined,\n dir: this.direction() || undefined,\n outcome: this.outcome() || undefined,\n location: this.location() || undefined,\n review: tab === 'all' ? undefined : tab,\n })\n .subscribe({\n next: ({ blob, filename }) => {\n triggerBlobDownload(blob, filename);\n this.exporting.set(false);\n this.toast.show('Export downloaded', 'success');\n },\n error: (err: { message?: string }) => {\n this.exporting.set(false);\n this.toast.show(err.message ?? 'Failed to export CSV', 'error');\n },\n });\n }\n\n private toRow(row: HistoryCall): HistoryRowVm {\n const resolution = historyResolution({\n outcome: row.outcome,\n resolution: row.resolution,\n risk: row.risk,\n });\n const handledByStaff = row.handledBy === 'staff';\n\n return {\n id: row.id,\n name: row.name?.trim() || 'Unknown Caller',\n initials: row.initials || '?',\n avatarTone: this.avatarTone(row),\n metaLine: callerMetaLine({\n dob: row.dob,\n age: row.age,\n gender: row.gender,\n phone: row.phone,\n name: row.name,\n }),\n timeLabel: row.started ? this.formatTime(row.started) : row.whenLabel || '—',\n dateLabel: row.started ? this.formatDate(row.started) : '',\n direction: row.direction,\n directionIcon: row.direction === 'inbound' ? 'call_received' : 'call_made',\n directionTitle: row.direction === 'inbound' ? 'Incoming call' : 'Outgoing call',\n goals: this.goalLines(row.reason),\n handledLabel: handledByStaff ? 'STAFF' : 'AI',\n handledVariant: handledByStaff ? 'primary' : 'opened',\n resolutionLabel: historyResolutionLabel(resolution),\n resolutionVariant: resolution === 'resolved' ? 'success' : 'warning',\n resultChips: historyResultChips(row.results, row.outcome).map((label) => ({\n label,\n icon: resultChipIcon(label),\n })),\n durationLabel: row.durationLabel ?? this.formatDuration(row.duration),\n needsReview: isNeedsReview(row.review),\n };\n }\n\n private goalLines(reason: string | undefined): string[] {\n const raw = String(reason ?? '').trim();\n if (!raw) return [];\n return raw\n .split(/[\\n;|/]+/)\n .map((part) => part.trim())\n .filter(Boolean);\n }\n\n private avatarTone(row: HistoryCall): 'gray' | 'brand' {\n if (!row.name?.trim() || /^unknown/i.test(row.name) || row.initials === '?') return 'gray';\n return 'brand';\n }\n\n private formatTime(ts: number): string {\n return new Date(ts).toLocaleTimeString([], { hour: 'numeric', minute: '2-digit' });\n }\n\n private formatDate(ts: number): string {\n return new Date(ts).toLocaleDateString([], { month: 'short', day: 'numeric', year: 'numeric' });\n }\n\n private formatDuration(sec: number): string {\n const m = Math.floor(sec / 60);\n const s = sec % 60;\n return `${m}:${s.toString().padStart(2, '0')}`;\n }\n}\n","<div class=\"call-history-page flex min-h-0 flex-col overflow-hidden bg-lighter p-base\">\n <header class=\"relative z-10 mb-md flex shrink-0 items-start justify-between gap-base bg-lighter\">\n <div class=\"grid gap-2xs\">\n <h4>Call History</h4>\n <p class=\"fs-sm text-light\">\n Review past conversations and understand what happened during each call\n </p>\n </div>\n <div class=\"flex shrink-0 items-center gap-base\">\n <div class=\"relative w-60\">\n <eds-search-field\n inputClass=\"form-input w-full\"\n placeholder=\"Search here\"\n ariaLabel=\"Search call history\"\n [value]=\"search()\"\n (valueChange)=\"onSearchInput($event)\"\n (enter)=\"applyFilters()\"\n />\n <span class=\"pointer-events-none absolute inset-y-0 right-3 inline-flex items-center text-lighter\">\n <ed-icon name=\"search\" [size]=\"20\" color=\"currentColor\" />\n </span>\n </div>\n <div\n class=\"relative\"\n data-history-filters\n (document:click)=\"onFiltersDocClick($event)\"\n >\n <ed-icon-button\n name=\"filter_alt\"\n label=\"Filters\"\n size=\"md\"\n outline\n allowBubble\n [pressed]=\"filtersOpen()\"\n toggle\n (click$)=\"toggleFilters($event)\"\n />\n @if (filtersOpen()) {\n <div\n class=\"absolute right-0 top-[calc(100%+4px)] z-20 w-80 rounded-md border border-light bg-white shadow-md\"\n role=\"dialog\"\n aria-label=\"Filter Options\"\n (click)=\"$event.stopPropagation()\"\n >\n <header class=\"flex items-center justify-between border-b border-light px-base py-sm\">\n <h5 class=\"m-0\">Filter Options</h5>\n <ed-icon-button\n name=\"close\"\n size=\"sm\"\n label=\"Close filters\"\n (click$)=\"closeFilters()\"\n />\n </header>\n <section class=\"grid gap-sm p-base\">\n <div class=\"grid gap-2xs\">\n <label class=\"fs-sm font-semibold text-light\" for=\"call-history-direction\">Direction</label>\n <select\n id=\"call-history-direction\"\n class=\"form-select is-sm\"\n [ngModel]=\"direction()\"\n (ngModelChange)=\"direction.set($event)\"\n autocomplete=\"off\"\n aria-label=\"Direction\"\n >\n <option value=\"\">All directions</option>\n <option value=\"inbound\">Inbound</option>\n <option value=\"outbound\">Outbound</option>\n </select>\n </div>\n <div class=\"grid gap-2xs\">\n <label class=\"fs-sm font-semibold text-light\">Outcome</label>\n <eds-search-field\n type=\"text\"\n inputClass=\"form-input is-sm\"\n placeholder=\"Outcome\"\n ariaLabel=\"Outcome\"\n [value]=\"outcome()\"\n (valueChange)=\"outcome.set($event)\"\n (enter)=\"applyFilters(); closeFilters()\"\n />\n </div>\n <div class=\"grid gap-2xs\">\n <label class=\"fs-sm font-semibold text-light\">Location</label>\n <eds-search-field\n type=\"text\"\n inputClass=\"form-input is-sm\"\n placeholder=\"Location\"\n ariaLabel=\"Location\"\n [value]=\"location()\"\n (valueChange)=\"location.set($event)\"\n (enter)=\"applyFilters(); closeFilters()\"\n />\n </div>\n </section>\n <footer class=\"flex flex-row-reverse flex-wrap items-center gap-sm border-t border-light px-base py-sm\">\n <ed-button\n variant=\"primary\"\n fill\n size=\"sm\"\n (click$)=\"applyFilters(); closeFilters()\"\n >\n Apply\n </ed-button>\n <ed-button\n variant=\"secondary\"\n outline\n size=\"sm\"\n [disabled]=\"exporting()\"\n (click$)=\"exportCsv()\"\n >\n <ed-icon slot=\"prefix\" name=\"download\" [size]=\"16\" />\n Export CSV\n </ed-button>\n </footer>\n </div>\n }\n </div>\n </div>\n </header>\n\n <div class=\"call-history-page__table eds-table-scroll min-h-0 min-w-0 flex-1 rounded-md bg-white\">\n <table class=\"table-default eds-sticky-table eds-centered-table min-w-5xl w-full\" aria-label=\"Call history\">\n <thead>\n <tr>\n <th class=\"bg-light\">Time</th>\n <th class=\"bg-light\">Patient/Caller</th>\n <th class=\"bg-light text-center\">\n <span class=\"inline-flex items-center justify-center gap-2xs\">\n <ed-icon name=\"call_received\" [size]=\"12\" class=\"text-success\" color=\"currentColor\" />\n <span class=\"text-light\">/</span>\n <ed-icon name=\"call_made\" [size]=\"12\" class=\"text-primary\" color=\"currentColor\" />\n </span>\n </th>\n <th class=\"bg-light\">Goal</th>\n <th class=\"bg-light\">Handled By</th>\n <th class=\"bg-light\">Resolution</th>\n <th class=\"bg-light\">Result</th>\n <th class=\"bg-light\">Duration</th>\n </tr>\n </thead>\n @if (loading()) {\n <tbody aria-busy=\"true\">\n @for (_ of skeletonRows; track _) {\n <tr>\n <td>\n <div class=\"grid gap-2xs py-2xs\">\n <ed-skeleton class=\"h-3 w-16\"></ed-skeleton>\n <ed-skeleton class=\"h-3 w-20\"></ed-skeleton>\n </div>\n </td>\n <td>\n <div class=\"flex items-center gap-xs py-2xs\">\n <ed-skeleton class=\"h-8 w-8 !rounded-md\"></ed-skeleton>\n <div class=\"grid gap-2xs\">\n <ed-skeleton class=\"h-3 w-28\"></ed-skeleton>\n <ed-skeleton class=\"h-3 w-36\"></ed-skeleton>\n </div>\n </div>\n </td>\n <td class=\"text-center\">\n <div class=\"flex justify-center py-2xs\">\n <ed-skeleton class=\"h-5 w-5 !rounded\"></ed-skeleton>\n </div>\n </td>\n <td><ed-skeleton class=\"h-3 w-32\"></ed-skeleton></td>\n <td><ed-skeleton class=\"h-5 w-20 !rounded-full\"></ed-skeleton></td>\n <td><ed-skeleton class=\"h-5 w-24 !rounded-full\"></ed-skeleton></td>\n <td><ed-skeleton class=\"h-5 w-28 !rounded\"></ed-skeleton></td>\n <td><ed-skeleton class=\"h-3 w-12\"></ed-skeleton></td>\n </tr>\n }\n </tbody>\n } @else {\n <tbody>\n @for (row of tableRows(); track row.id; let i = $index) {\n <tr\n class=\"focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary\"\n role=\"button\"\n [attr.tabindex]=\"i === 0 ? 0 : -1\"\n [attr.aria-label]=\"'View call details for ' + row.name\"\n (click)=\"openCallDetail(row.id)\"\n (keyup.enter)=\"openCallDetail(row.id)\"\n >\n <td>\n <div class=\"grid gap-2xs whitespace-nowrap\">\n <span class=\"fs-xs font-medium text-dark\">{{ row.timeLabel }}</span>\n <span class=\"fs-xs text-light\">{{ row.dateLabel }}</span>\n </div>\n </td>\n\n <td>\n <div class=\"flex min-w-52 items-center gap-xs\">\n <ed-avatar\n shape=\"box\"\n size=\"base\"\n [initials]=\"row.initials\"\n [tone]=\"row.avatarTone\"\n />\n <div class=\"grid min-w-0 gap-2xs\">\n <div class=\"flex min-w-0 items-center gap-2xs\">\n <span\n class=\"inline-block min-w-0 max-w-56 truncate fs-sm font-semibold text-dark\"\n [smartTooltip]=\"row.name\"\n [tooltipOnlyWhenTruncated]=\"true\"\n >{{ row.name }}</span>\n <!-- <span class=\"inline-flex shrink-0 text-light\">\n <ed-icon name=\"TagSimple\" [size]=\"14\" color=\"currentColor\" />\n </span> -->\n </div>\n <span\n class=\"inline-block min-w-0 max-w-64 truncate fs-xs text-light\"\n [smartTooltip]=\"row.metaLine\"\n [tooltipOnlyWhenTruncated]=\"true\"\n >{{ row.metaLine }}</span>\n </div>\n </div>\n </td>\n\n <td class=\"text-center\">\n <span\n class=\"inline-flex h-5 w-5 items-center justify-center rounded\"\n [class.bg-success-50]=\"row.direction === 'inbound'\"\n [class.text-success]=\"row.direction === 'inbound'\"\n [class.bg-primary-50]=\"row.direction === 'outbound'\"\n [class.text-primary]=\"row.direction === 'outbound'\"\n [smartTooltip]=\"row.directionTitle\"\n [attr.aria-label]=\"row.directionTitle\"\n >\n <ed-icon [name]=\"row.directionIcon\" [size]=\"12\" color=\"currentColor\" />\n </span>\n </td>\n\n <td>\n <div class=\"grid gap-2xs\">\n @for (goal of row.goals; track goal) {\n <span\n class=\"inline-block min-w-0 max-w-56 truncate fs-sm font-medium text-dark\"\n [smartTooltip]=\"goal\"\n [tooltipOnlyWhenTruncated]=\"true\"\n >{{ goal }}</span>\n } @empty {\n <span class=\"fs-sm text-light\">—</span>\n }\n </div>\n </td>\n\n <td>\n <ed-badge-2 [attr.variant]=\"row.handledVariant\" pill uppercase>\n {{ row.handledLabel }}\n </ed-badge-2>\n </td>\n\n <td>\n <ed-badge-2 [attr.variant]=\"row.resolutionVariant\" pill uppercase>\n {{ row.resolutionLabel }}\n </ed-badge-2>\n </td>\n\n <td>\n <div class=\"flex min-w-0 max-w-80 flex-wrap gap-2xs\">\n @for (chip of row.resultChips; track chip.label) {\n <span\n class=\"inline-flex h-5 max-w-48 min-w-0 items-center gap-2xs rounded bg-light px-2xs fs-xs font-medium text-dark\"\n >\n <ed-icon [name]=\"chip.icon\" [size]=\"12\" color=\"currentColor\" />\n <span\n class=\"min-w-0 truncate\"\n [smartTooltip]=\"chip.label\"\n [tooltipOnlyWhenTruncated]=\"true\"\n >{{ chip.label }}</span>\n </span>\n } @empty {\n <span class=\"fs-sm text-light\">—</span>\n }\n </div>\n </td>\n\n <td class=\"whitespace-nowrap tabular-nums fs-sm font-medium\">\n {{ row.durationLabel }}\n </td>\n </tr>\n } @empty {\n <tr class=\"empty-row\">\n <td colspan=\"8\" class=\"py-lg text-center fs-sm text-light\">\n No calls match this filter.\n </td>\n </tr>\n }\n </tbody>\n }\n </table>\n </div>\n\n <footer class=\"mt-base flex shrink-0 items-center justify-between border-t border-light pt-sm hidden\">\n <span class=\"fs-sm text-light\">\n Page {{ page() }} of {{ totalPages() }} · {{ total() }} total\n </span>\n <div class=\"flex gap-xs\">\n <ed-button\n variant=\"secondary\"\n outline\n size=\"sm\"\n [disabled]=\"page() <= 1\"\n (click$)=\"prevPage()\"\n >\n Previous\n </ed-button>\n <ed-button\n variant=\"secondary\"\n outline\n size=\"sm\"\n [disabled]=\"page() >= totalPages()\"\n (click$)=\"nextPage()\"\n >\n Next\n </ed-button>\n </div>\n </footer>\n</div>\n"],"names":["calcTotalPages"],"mappings":";;;;;;;;;;;;MA2Ea,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,OAAA,EAAA,MAAA,EAAA,MAAA,EAAA,YAAA,EAAA,KAAA,EAAA,QAAA,EAAA,UAAA,EAAA,WAAA,CAAA,EAAA,OAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACjB,uBAAuB,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,EAAA,MAAA,EAAA,aAAA,EAAA,WAAA,EAAA,YAAA,CAAA,EAAA,OAAA,EAAA,CAAA,aAAA,EAAA,OAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACvB,qBAAqB,+iBACrB,mBAAmB,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAQV,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAlBpC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,uBAAuB,EAAA,OAAA,EACxB;wBACP,WAAW;wBACX,iBAAiB;wBACjB,aAAa;wBACb,qBAAqB;wBACrB,iBAAiB;wBACjB,uBAAuB;wBACvB,qBAAqB;wBACrB,mBAAmB;AACpB,qBAAA,EAAA,eAAA,EAGgB,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC,CAAC,sBAAsB,CAAC,EAAA,IAAA,EAC3B,EAAE,KAAK,EAAE,sBAAsB,EAAE,EAAA,QAAA,EAAA,g1ZAAA,EAAA,MAAA,EAAA,CAAA,4IAAA,CAAA,EAAA;;;;;"}
|
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { input, output, viewChild, inject, DestroyRef, signal, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { distinctUntilChanged, tap, switchMap, EMPTY, map, catchError } from 'rxjs';
|
|
5
|
-
import { A as AiReceptionistApiService, I as IconComponent, g as EdSkeletonComponent } from './edvak99-voice-receptionist-widget-edvak99-voice-receptionist-widget-
|
|
5
|
+
import { A as AiReceptionistApiService, I as IconComponent, g as EdSkeletonComponent } from './edvak99-voice-receptionist-widget-edvak99-voice-receptionist-widget-CJ1L6QeE.mjs';
|
|
6
6
|
|
|
7
7
|
class CallRecordingPlayerComponent {
|
|
8
8
|
constructor() {
|
|
@@ -107,4 +107,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
|
|
|
107
107
|
}], ctorParameters: () => [] });
|
|
108
108
|
|
|
109
109
|
export { CallRecordingPlayerComponent as C };
|
|
110
|
-
//# sourceMappingURL=edvak99-voice-receptionist-widget-call-recording-player.component-
|
|
110
|
+
//# sourceMappingURL=edvak99-voice-receptionist-widget-call-recording-player.component-BepxNLNQ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edvak99-voice-receptionist-widget-call-recording-player.component-4fL-zUWy.mjs","sources":["../../../src/lib/components/call-recording-player/call-recording-player.component.ts","../../../src/lib/components/call-recording-player/call-recording-player.component.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n inject,\n input,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\nimport { catchError, distinctUntilChanged, EMPTY, map, switchMap, tap } from 'rxjs';\n\nimport { EdSkeletonComponent } from '../../ui/ed-skeleton.component';\n\nimport { CallRecordingStatus } from '../../models/ai-receptionist.types';\nimport { AiReceptionistApiService } from '../../services/ai-receptionist-api.service';\nimport { IconComponent } from '../../ui/ed-icon.component';\n\ntype PlayerPhase = 'loading' | CallRecordingStatus | 'error';\n\n@Component({\n selector: 'eds-call-recording-player',\n imports: [IconComponent, EdSkeletonComponent],\n templateUrl: './call-recording-player.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CallRecordingPlayerComponent {\n readonly callId = input.required<string>();\n readonly currentTimeChange = output<number>();\n readonly durationChange = output<number>();\n\n private readonly audioRef = viewChild<ElementRef<HTMLAudioElement>>('audioEl');\n\n private readonly api = inject(AiReceptionistApiService);\n private readonly destroyRef = inject(DestroyRef);\n\n protected readonly phase = signal<PlayerPhase>('loading');\n protected readonly blobUrl = signal<string | null>(null);\n protected readonly durationSeconds = signal<number | null>(null);\n protected readonly message = signal<string | null>(null);\n\n /** Tracked outside signals so cleanup never reads blobUrl (avoids effect/subscription loops). */\n private objectUrl: string | null = null;\n\n constructor() {\n toObservable(this.callId)\n .pipe(\n distinctUntilChanged(),\n tap(() => this.revokeObjectUrl()),\n switchMap((id) => {\n if (!id) {\n this.resetUi();\n return EMPTY;\n }\n this.phase.set('loading');\n this.message.set(null);\n return this.api.getCallRecording(id).pipe(\n switchMap((meta) => {\n if (meta.status !== 'ready' || !meta.url) {\n this.phase.set(meta.status);\n this.message.set(meta.message ?? null);\n this.durationSeconds.set(meta.durationSeconds ?? null);\n return EMPTY;\n }\n this.durationSeconds.set(meta.durationSeconds ?? null);\n return this.api.getCallRecordingBlob(meta.url).pipe(\n map((blob) => blob),\n catchError(() => {\n this.phase.set('error');\n this.message.set('Could not load recording audio.');\n return EMPTY;\n }),\n );\n }),\n catchError(() => {\n this.phase.set('unavailable');\n this.message.set('Could not load recording metadata.');\n return EMPTY;\n }),\n );\n }),\n takeUntilDestroyed(),\n )\n .subscribe((blob) => {\n this.revokeObjectUrl();\n this.objectUrl = URL.createObjectURL(blob);\n this.blobUrl.set(this.objectUrl);\n this.phase.set('ready');\n this.message.set(null);\n const dur = this.durationSeconds();\n if (dur != null && dur > 0) {\n this.durationChange.emit(dur);\n }\n });\n\n this.destroyRef.onDestroy(() => this.revokeObjectUrl());\n }\n\n protected formatDuration(seconds: number): string {\n const m = Math.floor(seconds / 60);\n const s = seconds % 60;\n return `${m}:${s.toString().padStart(2, '0')}`;\n }\n\n protected onAudioError(): void {\n this.phase.set('error');\n this.message.set('Playback error — try reloading the page.');\n }\n\n protected onTimeUpdate(event: Event): void {\n const el = event.target as HTMLAudioElement;\n this.currentTimeChange.emit(el.currentTime);\n }\n\n protected onLoadedMetadata(event: Event): void {\n const el = event.target as HTMLAudioElement;\n if (Number.isFinite(el.duration) && el.duration > 0) {\n this.durationChange.emit(el.duration);\n }\n }\n\n /** Seek playback — used by synced transcript lines. */\n seekTo(seconds: number): void {\n const el = this.audioRef()?.nativeElement;\n if (!el) return;\n el.currentTime = Math.max(0, seconds);\n void el.play().catch(() => undefined);\n this.currentTimeChange.emit(el.currentTime);\n }\n\n private revokeObjectUrl(): void {\n if (this.objectUrl) {\n URL.revokeObjectURL(this.objectUrl);\n this.objectUrl = null;\n }\n this.blobUrl.set(null);\n }\n\n private resetUi(): void {\n this.phase.set('loading');\n this.durationSeconds.set(null);\n this.message.set(null);\n }\n}\n","<section class=\"flex flex-col gap-3 rounded-lg border border-base bg-lighter p-4\" aria-labelledby=\"call-recording-title\">\n <header class=\"flex items-center gap-2\">\n <ed-icon name=\"graph_new\" [size]=\"20\" />\n <h4 id=\"call-recording-title\" class=\"m-0 flex-1\">Call recording</h4>\n @if (durationSeconds(); as dur) {\n <span class=\"font-['IBM_Plex_Mono'] fs-sm text-light\">{{ formatDuration(dur) }}</span>\n }\n </header>\n\n @switch (phase()) {\n @case ('loading') {\n <div class=\"grid gap-2\" aria-busy=\"true\">\n <ed-skeleton class=\"h-10 w-full !rounded-md\"></ed-skeleton>\n <ed-skeleton class=\"h-3 w-24\"></ed-skeleton>\n </div>\n }\n @case ('ready') {\n @if (blobUrl(); as src) {\n <audio\n #audioEl\n class=\"h-10 w-full\"\n controls\n [src]=\"src\"\n (error)=\"onAudioError()\"\n (timeupdate)=\"onTimeUpdate($event)\"\n (loadedmetadata)=\"onLoadedMetadata($event)\"\n >\n Your browser does not support audio playback.\n </audio>\n }\n }\n @case ('pending') {\n <p class=\"fs-sm text-light m-0\">\n {{ message() ?? 'Recording is still processing…' }}\n </p>\n }\n @case ('unavailable') {\n <p class=\"fs-sm text-light m-0\">\n {{ message() ?? 'No recording available for this call.' }}\n </p>\n }\n @case ('failed') {\n <p class=\"fs-sm text-red-600 m-0\">\n {{ message() ?? 'Recording could not be retrieved.' }}\n </p>\n }\n @case ('error') {\n <p class=\"fs-sm text-red-600 m-0\">\n {{ message() ?? 'Playback error.' }}\n </p>\n }\n }\n</section>\n"],"names":[],"mappings":";;;;;;MA4Ba,4BAA4B,CAAA;AAkBvC,IAAA,WAAA,GAAA;AAjBS,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAU;QACjC,IAAA,CAAA,iBAAiB,GAAG,MAAM,EAAU;QACpC,IAAA,CAAA,cAAc,GAAG,MAAM,EAAU;AAEzB,QAAA,IAAA,CAAA,QAAQ,GAAG,SAAS,CAA+B,SAAS,CAAC;AAE7D,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,wBAAwB,CAAC;AACtC,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAE7B,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAc,SAAS,CAAC;AACtC,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAgB,IAAI,CAAC;AACrC,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAgB,IAAI,CAAC;AAC7C,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAgB,IAAI,CAAC;;QAGhD,IAAA,CAAA,SAAS,GAAkB,IAAI;AAGrC,QAAA,YAAY,CAAC,IAAI,CAAC,MAAM;aACrB,IAAI,CACH,oBAAoB,EAAE,EACtB,GAAG,CAAC,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC,EACjC,SAAS,CAAC,CAAC,EAAE,KAAI;YACf,IAAI,CAAC,EAAE,EAAE;gBACP,IAAI,CAA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A,CAAA;AAA5B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,4BAA4B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,2BAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,mBAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,UAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,SAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC5BzC,usDAqDA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,ED7Bc,aAAa,sLAAE,mBAAmB,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAInC,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBANxC,SAAS;+BACI,2BAA2B,EAAA,OAAA,EAC5B,CAAC,aAAa,EAAE,mBAAmB,CAAC,EAAA,eAAA,EAE5B,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,usDAAA,EAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"edvak99-voice-receptionist-widget-call-recording-player.component-BepxNLNQ.mjs","sources":["../../../src/lib/components/call-recording-player/call-recording-player.component.ts","../../../src/lib/components/call-recording-player/call-recording-player.component.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n inject,\n input,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\nimport { catchError, distinctUntilChanged, EMPTY, map, switchMap, tap } from 'rxjs';\n\nimport { EdSkeletonComponent } from '../../ui/ed-skeleton.component';\n\nimport { CallRecordingStatus } from '../../models/ai-receptionist.types';\nimport { AiReceptionistApiService } from '../../services/ai-receptionist-api.service';\nimport { IconComponent } from '../../ui/ed-icon.component';\n\ntype PlayerPhase = 'loading' | CallRecordingStatus | 'error';\n\n@Component({\n selector: 'eds-call-recording-player',\n imports: [IconComponent, EdSkeletonComponent],\n templateUrl: './call-recording-player.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CallRecordingPlayerComponent {\n readonly callId = input.required<string>();\n readonly currentTimeChange = output<number>();\n readonly durationChange = output<number>();\n\n private readonly audioRef = viewChild<ElementRef<HTMLAudioElement>>('audioEl');\n\n private readonly api = inject(AiReceptionistApiService);\n private readonly destroyRef = inject(DestroyRef);\n\n protected readonly phase = signal<PlayerPhase>('loading');\n protected readonly blobUrl = signal<string | null>(null);\n protected readonly durationSeconds = signal<number | null>(null);\n protected readonly message = signal<string | null>(null);\n\n /** Tracked outside signals so cleanup never reads blobUrl (avoids effect/subscription loops). */\n private objectUrl: string | null = null;\n\n constructor() {\n toObservable(this.callId)\n .pipe(\n distinctUntilChanged(),\n tap(() => this.revokeObjectUrl()),\n switchMap((id) => {\n if (!id) {\n this.resetUi();\n return EMPTY;\n }\n this.phase.set('loading');\n this.message.set(null);\n return this.api.getCallRecording(id).pipe(\n switchMap((meta) => {\n if (meta.status !== 'ready' || !meta.url) {\n this.phase.set(meta.status);\n this.message.set(meta.message ?? null);\n this.durationSeconds.set(meta.durationSeconds ?? null);\n return EMPTY;\n }\n this.durationSeconds.set(meta.durationSeconds ?? null);\n return this.api.getCallRecordingBlob(meta.url).pipe(\n map((blob) => blob),\n catchError(() => {\n this.phase.set('error');\n this.message.set('Could not load recording audio.');\n return EMPTY;\n }),\n );\n }),\n catchError(() => {\n this.phase.set('unavailable');\n this.message.set('Could not load recording metadata.');\n return EMPTY;\n }),\n );\n }),\n takeUntilDestroyed(),\n )\n .subscribe((blob) => {\n this.revokeObjectUrl();\n this.objectUrl = URL.createObjectURL(blob);\n this.blobUrl.set(this.objectUrl);\n this.phase.set('ready');\n this.message.set(null);\n const dur = this.durationSeconds();\n if (dur != null && dur > 0) {\n this.durationChange.emit(dur);\n }\n });\n\n this.destroyRef.onDestroy(() => this.revokeObjectUrl());\n }\n\n protected formatDuration(seconds: number): string {\n const m = Math.floor(seconds / 60);\n const s = seconds % 60;\n return `${m}:${s.toString().padStart(2, '0')}`;\n }\n\n protected onAudioError(): void {\n this.phase.set('error');\n this.message.set('Playback error — try reloading the page.');\n }\n\n protected onTimeUpdate(event: Event): void {\n const el = event.target as HTMLAudioElement;\n this.currentTimeChange.emit(el.currentTime);\n }\n\n protected onLoadedMetadata(event: Event): void {\n const el = event.target as HTMLAudioElement;\n if (Number.isFinite(el.duration) && el.duration > 0) {\n this.durationChange.emit(el.duration);\n }\n }\n\n /** Seek playback — used by synced transcript lines. */\n seekTo(seconds: number): void {\n const el = this.audioRef()?.nativeElement;\n if (!el) return;\n el.currentTime = Math.max(0, seconds);\n void el.play().catch(() => undefined);\n this.currentTimeChange.emit(el.currentTime);\n }\n\n private revokeObjectUrl(): void {\n if (this.objectUrl) {\n URL.revokeObjectURL(this.objectUrl);\n this.objectUrl = null;\n }\n this.blobUrl.set(null);\n }\n\n private resetUi(): void {\n this.phase.set('loading');\n this.durationSeconds.set(null);\n this.message.set(null);\n }\n}\n","<section class=\"flex flex-col gap-3 rounded-lg border border-base bg-lighter p-4\" aria-labelledby=\"call-recording-title\">\n <header class=\"flex items-center gap-2\">\n <ed-icon name=\"graph_new\" [size]=\"20\" />\n <h4 id=\"call-recording-title\" class=\"m-0 flex-1\">Call recording</h4>\n @if (durationSeconds(); as dur) {\n <span class=\"font-['IBM_Plex_Mono'] fs-sm text-light\">{{ formatDuration(dur) }}</span>\n }\n </header>\n\n @switch (phase()) {\n @case ('loading') {\n <div class=\"grid gap-2\" aria-busy=\"true\">\n <ed-skeleton class=\"h-10 w-full !rounded-md\"></ed-skeleton>\n <ed-skeleton class=\"h-3 w-24\"></ed-skeleton>\n </div>\n }\n @case ('ready') {\n @if (blobUrl(); as src) {\n <audio\n #audioEl\n class=\"h-10 w-full\"\n controls\n [src]=\"src\"\n (error)=\"onAudioError()\"\n (timeupdate)=\"onTimeUpdate($event)\"\n (loadedmetadata)=\"onLoadedMetadata($event)\"\n >\n Your browser does not support audio playback.\n </audio>\n }\n }\n @case ('pending') {\n <p class=\"fs-sm text-light m-0\">\n {{ message() ?? 'Recording is still processing…' }}\n </p>\n }\n @case ('unavailable') {\n <p class=\"fs-sm text-light m-0\">\n {{ message() ?? 'No recording available for this call.' }}\n </p>\n }\n @case ('failed') {\n <p class=\"fs-sm text-red-600 m-0\">\n {{ message() ?? 'Recording could not be retrieved.' }}\n </p>\n }\n @case ('error') {\n <p class=\"fs-sm text-red-600 m-0\">\n {{ message() ?? 'Playback error.' }}\n </p>\n }\n }\n</section>\n"],"names":[],"mappings":";;;;;;MA4Ba,4BAA4B,CAAA;AAkBvC,IAAA,WAAA,GAAA;AAjBS,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAU;QACjC,IAAA,CAAA,iBAAiB,GAAG,MAAM,EAAU;QACpC,IAAA,CAAA,cAAc,GAAG,MAAM,EAAU;AAEzB,QAAA,IAAA,CAAA,QAAQ,GAAG,SAAS,CAA+B,SAAS,CAAC;AAE7D,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,wBAAwB,CAAC;AACtC,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAE7B,QAAA,IAAA,CAAA,KAAK,GAAG,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AA,aAAA,EAAA,MAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAInC,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBANxC,SAAS;+BACI,2BAA2B,EAAA,OAAA,EAC5B,CAAC,aAAa,EAAE,mBAAmB,CAAC,EAAA,eAAA,EAE5B,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,usDAAA,EAAA;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, signal, Injectable } from '@angular/core';
|
|
3
3
|
import { tap, map } from 'rxjs';
|
|
4
|
-
import { A as AiReceptionistApiService } from './edvak99-voice-receptionist-widget-edvak99-voice-receptionist-widget-
|
|
4
|
+
import { A as AiReceptionistApiService } from './edvak99-voice-receptionist-widget-edvak99-voice-receptionist-widget-CJ1L6QeE.mjs';
|
|
5
5
|
|
|
6
6
|
class CallReviewService {
|
|
7
7
|
constructor() {
|
|
@@ -26,4 +26,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
|
|
|
26
26
|
}] });
|
|
27
27
|
|
|
28
28
|
export { CallReviewService as C };
|
|
29
|
-
//# sourceMappingURL=edvak99-voice-receptionist-widget-call-review.service-
|
|
29
|
+
//# sourceMappingURL=edvak99-voice-receptionist-widget-call-review.service-nFqc30t3.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edvak99-voice-receptionist-widget-call-review.service-
|
|
1
|
+
{"version":3,"file":"edvak99-voice-receptionist-widget-call-review.service-nFqc30t3.mjs","sources":["../../../src/lib/services/call-review.service.ts"],"sourcesContent":["import { Injectable, inject, signal } from '@angular/core';\nimport { Observable, map, tap } from 'rxjs';\n\nimport { CallReviewStatus } from '../utils/call-review.util';\nimport { AiReceptionistApiService } from './ai-receptionist-api.service';\n\n@Injectable({ providedIn: 'root' })\nexport class CallReviewService {\n private readonly api = inject(AiReceptionistApiService);\n\n /** Cached from dashboard summary; decremented optimistically on review. */\n readonly needsReviewCount = signal<number | null>(null);\n\n setNeedsReviewCount(count: number): void {\n this.needsReviewCount.set(count);\n }\n\n markReviewed(callId: string): Observable<CallReviewStatus> {\n return this.api.postReview(callId).pipe(\n tap(() => {\n this.needsReviewCount.update((c) => (c != null && c > 0 ? c - 1 : c));\n }),\n map(() => 'reviewed'),\n );\n }\n}\n"],"names":[],"mappings":";;;;;MAOa,iBAAiB,CAAA;AAD9B,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,wBAAwB,CAAC;;AAG9C,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAgB,IAAI,CAAC;AAcxD,IAAA;AAZC,IAAA,mBAAmB,CAAC,KAAa,EAAA;AAC/B,QAAA,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC;IAClC;AAEA,IAAA,YAAY,CAAC,MAAc,EAAA;AACzB,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,CACrC,GAAG,CAAC,MAAK;AACP,YAAA,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QACvE,CAAC,CAAC,EACF,GAAG,CAAC,MAAM,UAAU,CAAC,CACtB;IACH;+GAjBW,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAjB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,cADJ,MAAM,EAAA,CAAA,CAAA;;4FACnB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAD7B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|