1import { EhrVideoPlayerComponent } from "./chunk-WZGF7UZ5.js"; 2import { DragAndDropDirective } from "./chunk-3CC3O7Q4.js"; 3import { DateLocalizedPipe } from "./chunk-J4JV2KN3.js"; 4import { Editor, MenuComponent, NgxEditorComponent } from "./chunk-HMG6THTW.js"; 5import { StorageUrlPipe } from "./chunk-22BUR7P4.js"; 6import { AttachmentService } from "./chunk-ICBWSMPO.js"; 7import { MAT_DIALOG_DATA, MatDialogRef } from "./chunk-X5MWQ6KI.js"; 8import { fadeInOutAnimation } from "./chunk-BGXYW3E3.js"; 9import { MatSelect } from "./chunk-7EAOBTD7.js"; 10import { MatOption } from "./chunk-2SDCWOQR.js"; 11import { MatTooltipModule } from "./chunk-UMGWWLGK.js"; 12import { MatTooltip } from "./chunk-R6Y7W643.js"; 13import { MatIcon } from "./chunk-BFO5WUGI.js"; 14import { DefaultValueAccessor, FormArray, FormBuilder, FormControl, FormControlDirective, FormControlName, FormGroup, FormGroupDirective, MatError, MatFormField, MatInput, MatLabel, NgControlStatus, NgControlStatusGroup, Validators, ɵNgNoValidate } from "./chunk-CULTIHLT.js"; 15import { MatButton, MatButtonModule, SpinnerService } from "./chunk-L27SLIL4.js"; 16import { AuthenticationService, Firestore, Timestamp, collection2 as collection, collectionSnapshots, doc, endBefore, getCountFromServer, getDocs2 as getDocs, limit2 as limit, limitToLast, orderBy, query2 as query, startAfter, where2 as where, writeBatch } from "./chunk-2TSZT3SZ.js"; 17import { AsyncPipe, CommonModule } from "./chunk-HE5ARQDU.js"; 18import { Component, Inject, Injectable, NgModule, __async, __spreadProps, __spreadValues, from, map, setClassMetadata, switchMap, take, ɵsetClassDebugInfo, ɵɵadvance, ɵɵclassProp, ɵɵconditional, ɵɵconditionalCreate, ɵɵdefineComponent, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdirectiveInject, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵgetCurrentView, ɵɵi18n, ɵɵinject, ɵɵlistener, ɵɵnextContext, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵproperty, ɵɵreference, ɵɵrepeater, ɵɵrepeaterCreate, ɵɵrepeaterTrackByIdentity, ɵɵresetView, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeUrl, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1 } from "./chunk-ZGC4HH7K.js"; 19
20// src/app/_dialogs/contact-moment-dialog/contact-moment-dialog.component.ts 21function ContactMomentDialogComponent_For_39_Case_1_Conditional_0_Template(rf, ctx) { 22 if (rf & 1) { 23 ɵɵelement(0, "ehr-video-player", 30); 24 ɵɵpipe(1, "storageUrl"); 25 ɵɵpipe(2, "async"); 26 } 27 if (rf & 2) { 28 const attachment_r1 = ɵɵnextContext(2).$implicit; 29 ɵɵproperty("matTooltip", attachment_r1.name)("videoUrl", ɵɵpipeBind1(2, 4, ɵɵpipeBind1(1, 2, attachment_r1.storagePath))); 30 } 31} 32function ContactMomentDialogComponent_For_39_Case_1_Template(rf, ctx) { 33 if (rf & 1) { 34 ɵɵconditionalCreate(0, ContactMomentDialogComponent_For_39_Case_1_Conditional_0_Template, 3, 6, "ehr-video-player", 30); 35 } 36 if (rf & 2) { 37 const attachment_r1 = ɵɵnextContext().$implicit; 38 ɵɵconditional(attachment_r1.storagePath ? 0 : -1); 39 } 40} 41function ContactMomentDialogComponent_For_39_Case_2_Template(rf, ctx) { 42 if (rf & 1) { 43 ɵɵelementStart(0, "div", 29)(1, "div", 31); 44 ɵɵelement(2, "div", 32); 45 ɵɵelementEnd(); 46 ɵɵelementStart(3, "div", 33); 47 ɵɵtext(4); 48 ɵɵelementEnd()(); 49 } 50 if (rf & 2) { 51 const attachment_r1 = ɵɵnextContext().$implicit; 52 ɵɵproperty("matTooltip", attachment_r1.name); 53 ɵɵadvance(4); 54 ɵɵtextInterpolate1(" ", attachment_r1.name, " "); 55 } 56} 57function ContactMomentDialogComponent_For_39_Case_3_Conditional_2_Template(rf, ctx) { 58 if (rf & 1) { 59 ɵɵelement(0, "img", 34); 60 ɵɵpipe(1, "storageUrl"); 61 ɵɵpipe(2, "async"); 62 } 63 if (rf & 2) { 64 const attachment_r1 = ɵɵnextContext(2).$implicit; 65 ɵɵproperty("src", ɵɵpipeBind1(2, 4, ɵɵpipeBind1(1, 2, attachment_r1.storagePath)), ɵɵsanitizeUrl)("alt", attachment_r1.name); 66 } 67} 68function ContactMomentDialogComponent_For_39_Case_3_Template(rf, ctx) { 69 if (rf & 1) { 70 ɵɵelementStart(0, "div", 29)(1, "div", 31); 71 ɵɵconditionalCreate(2, ContactMomentDialogComponent_For_39_Case_3_Conditional_2_Template, 3, 6, "img", 34); 72 ɵɵelementEnd(); 73 ɵɵelementStart(3, "div", 33); 74 ɵɵtext(4); 75 ɵɵelementEnd()(); 76 } 77 if (rf & 2) { 78 const attachment_r1 = ɵɵnextContext().$implicit; 79 ɵɵproperty("matTooltip", attachment_r1.name); 80 ɵɵadvance(2); 81 ɵɵconditional(attachment_r1.storagePath ? 2 : -1); 82 ɵɵadvance(2); 83 ɵɵtextInterpolate1(" ", attachment_r1.name, " "); 84 } 85} 86function ContactMomentDialogComponent_For_39_Template(rf, ctx) { 87 if (rf & 1) { 88 ɵɵelementStart(0, "div", 23); 89 ɵɵconditionalCreate(1, ContactMomentDialogComponent_For_39_Case_1_Template, 1, 1)(2, ContactMomentDialogComponent_For_39_Case_2_Template, 5, 2, "div", 29)(3, ContactMomentDialogComponent_For_39_Case_3_Template, 5, 3, "div", 29); 90 ɵɵelementEnd(); 91 } 92 if (rf & 2) { 93 let tmp_11_0; 94 const attachment_r1 = ctx.$implicit; 95 ɵɵadvance(); 96 ɵɵconditional((tmp_11_0 = attachment_r1.type) === "video" ? 1 : tmp_11_0 === "pdf" ? 2 : 3); 97 } 98} 99var ContactMomentDialogComponent = class _ContactMomentDialogComponent { 100 constructor(matDialogRef, data) { 101 this.matDialogRef = matDialogRef; 102 this.data = data; 103 this.contactMoment = data?.contactMoment; 104 this.createdBy = this.getEmployeeName(data.contactMoment.ownerId); 105 } 106 getStatus(category) { 107 switch (category) { 108 case "Note": 109 return "Opmerking"; 110 // Represents a note contact moment 111 case "Email": 112 return "E-mailadres"; 113 // Represents an email contact moment 114 case "Phone": 115 return "Telefoon"; 116 // Represents a phone contact moment 117 case "Meeting": 118 return "Gesprek"; 119 // Represents a meeting contact moment 120 case "Milestone": 121 return "Mijlpaal"; 122 // Represents a milestone contact moment 123 case "Direct Message": 124 return "Direct bericht"; 125 // Represents a direct message contact moment 126 case "Other": 127 return "Overige"; 128 // Represents an undefined or other contact moment 129 default: 130 return category; 131 } 132 } 133 parseInnerHTML(content) { 134 let counter = 0; 135 let replacedContent = content.replace(/--/g, match => { 136 const suffix = String.fromCharCode(97 + counter) + "."; 137 counter++; 138 return `</br>` + suffix + " "; 139 }); 140 replacedContent = replacedContent.replace(/\*\*/g, "<br/></br>"); 141 return replacedContent; 142 } 143 getEmployeeName(employeeId) { 144 const options = this.data.owners; 145 if (Array.isArray(options) && employeeId) { 146 const employee = options.find(employee2 => employee2.id === employeeId); 147 if (!employee) return ""; 148 return [employee.firstName, employee.middleName, employee.lastName].filter(
148Boolean).join(" "); 149 } 150 return ""; 151 } 152 onCloseDialog() { 153 this.matDialogRef.close(); 154 } 155 static { 156 this.ɵfac = function ContactMomentDialogComponent_Factory(__ngFactoryType__) { 157 return new (__ngFactoryType__ || _ContactMomentDialogComponent)(ɵɵdirectiveInject(MatDialogRef), ɵɵdirectiveInject(MAT_DIALOG_DATA)); 158 }; 159 } 160 static { 161 this.ɵcmp = /* @__PURE__ */ɵɵdefineComponent({ 162 type: _ContactMomentDialogComponent, 163 selectors: [["ehr-contact-moment-dialog"]], 164 standalone: false, 165 decls: 49, 166 vars: 20, 167 consts: () => { 168 let i18n_0; 169 if (false) { 170 const MSG_EXTERNAL_contact_moment$$SRC_APP__DIALOGS_CONTACT_MOMENT_DIALOG_CONTACT_MOMENT_DIALOG_COMPONENT_TS_0 = goog.getMsg(" Contact moment "); 171 i18n_0 = MSG_EXTERNAL_contact_moment$$SRC_APP__DIALOGS_CONTACT_MOMENT_DIALOG_CONTACT_MOMENT_DIALOG_COMPONENT_TS_0; 172 } else { 173 i18n_0 = "Contactmomenten"; 174 } 175 let i18n_1; 176 if (false) { 177 const MSG_EXTERNAL_subject$$SRC_APP__DIALOGS_CONTACT_MOMENT_DIALOG_CONTACT_MOMENT_DIALOG_COMPONENT_TS_1 = goog.getMsg(" Subject "); 178 i18n_1 = MSG_EXTERNAL_subject$$SRC_APP__DIALOGS_CONTACT_MOMENT_DIALOG_CONTACT_MOMENT_DIALOG_COMPONENT_TS_1; 179 } else { 180 i18n_1 = "Onderwerp"; 181 } 182 let i18n_2; 183 if (false) { 184 const MSG_EXTERNAL_category$$SRC_APP__DIALOGS_CONTACT_MOMENT_DIALOG_CONTACT_MOMENT_DIALOG_COMPONENT_TS_2 = goog.getMsg(" Category "); 185 i18n_2 = MSG_EXTERNAL_category$$SRC_APP__DIALOGS_CONTACT_MOMENT_DIALOG_CONTACT_MOMENT_DIALOG_COMPONENT_TS_2; 186 } else { 187 i18n_2 = "Categorie"; 188 } 189 let i18n_3; 190 if (false) { 191 const MSG_EXTERNAL_created_by_label$$SRC_APP__DIALOGS_CONTACT_MOMENT_DIALOG_CONTACT_MOMENT_DIALOG_COMPONENT_TS_3 = goog.getMsg(" Created by "); 192 i18n_3 = MSG_EXTERNAL_created_by_label$$SRC_APP__DIALOGS_CONTACT_MOMENT_DIALOG_CONTACT_MOMENT_DIALOG_COMPONENT_TS_3; 193 } else { 194 i18n_3 = "Gemaakt door"; 195 } 196 let i18n_4; 197 if (false) { 198 const MSG_EXTERNAL_created$$SRC_APP__DIALOGS_CONTACT_MOMENT_DIALOG_CONTACT_MOMENT_DIALOG_COMPONENT_TS_4 = goog.getMsg(" Created "); 199 i18n_4 = MSG_EXTERNAL_created$$SRC_APP__DIALOGS_CONTACT_MOMENT_DIALOG_CONTACT_MOMENT_DIALOG_COMPONENT_TS_4; 200 } else { 201 i18n_4 = "Gemaakt"; 202 } 203 let i18n_5; 204 if (false) { 205 const MSG_EXTERNAL_attachments$$SRC_APP__DIALOGS_CONTACT_MOMENT_DIALOG_CONTACT_MOMENT_DIALOG_COMPONENT_TS_5 = goog.getMsg(" Attachments "); 206 i18n_5 = MSG_EXTERNAL_attachments$$SRC_APP__DIALOGS_CONTACT_MOMENT_DIALOG_CONTACT_MOMENT_DIALOG_COMPONENT_TS_5; 207 } else { 208 i18n_5 = "Bijlagen"; 209 } 210 let i18n_6; 211 if (false) { 212 const MSG_EXTERNAL_content$$SRC_APP__DIALOGS_CONTACT_MOMENT_DIALOG_CONTACT_MOMENT_DIALOG_COMPONENT_TS_6 = goog.getMsg(" Content "); 213 i18n_6 = MSG_EXTERNAL_content$$SRC_APP__DIALOGS_CONTACT_MOMENT_DIALOG_CONTACT_MOMENT_DIALOG_COMPONENT_TS_6; 214 } else { 215 i18n_6 = "Inhoud"; 216 } 217 let i18n_7; 218 if (false) { 219 const MSG_EXTERNAL_close$$SRC_APP__DIALOGS_CONTACT_MOMENT_DIALOG_CONTACT_MOMENT_DIALOG_COMPONENT_TS_7 = goog.getMsg(" Close "); 220 i18n_7 = MSG_EXTERNAL_close$$SRC_APP__DIALOGS_CONTACT_MOMENT_DIALOG_CONTACT_MOMENT_DIALOG_COMPONENT_TS_7; 221 } else { 222 i18n_7 = "Sluit"; 223 } 224 return [i18n_0, i18n_1, i18n_2, i18n_3, i18n_4, i18n_5, i18n_6, i18n_7, [1, "ehr-dialog"], [1, "ehr-dialog-header"], [1, "ehr-dialog-header-title"], [1, "ehr-dialog-body"], [1, "flex-column-start-start", "flex-column-gap-2rem"], [1, "ehr-card-container-2-col"], [1, "ehr-card"], [1, "full-width", "flex-row-space-between-start"], [1, "ehr-card-dialog-container", "half-width"], [1, "ehr-card-label"], [1, "ehr-card-value"], [1, "full-width", "flex-column-start-start", "flex-column-gap-16px"], [1, "ehr-title"], [1, "full-width", "flex-row-start-center"], [1, "ehr-gallery"], [1, "ehr-gallery-item"], [1, "ehr-card-container-1-col"], [1, "ehr-card-dialog-container"], [1, "ehr-card-editor-value", "ehr-innerHTML", 3, "innerHTML"], [1, "ehr-dialog-footer"], ["mat-raised-button", "", "type", "button", 1, "ehr-cancel-button", 3, "click"], [1, "ehr-single-file", 3, "matTooltip"], [3, "matTooltip", "videoUrl"], [1, "ehr-gallery-img"], [1, "ehr-pdf-img"], [1, "ehr-name"], [3, "src", "alt"]]; 225 }, 226 template: function ContactMomentDialogComponent_Template(rf, ctx) { 227 if (rf & 1) { 228 ɵɵelementStart(0, "div", 8)(1, "div", 9)(2, "h6", 10); 229 ɵɵi18n(3, 0); 230 ɵɵelementEnd()(); 231 ɵɵelementStart(4, "div", 11)(5, "div", 12)(6, "div", 13)(7, "div", 14)(8, "div", 15)(9, "div", 16)(10, "div", 17); 232 ɵɵi18n(11, 1); 233 ɵɵelementEnd(); 234 ɵɵelementStart(12, "p", 18); 235 ɵɵtext(13); 236 ɵɵelementEnd()(); 237 ɵɵelementStart(14, "div", 16)(15, "div", 17); 238 ɵɵi18n(16, 2); 239 ɵɵelementEnd(); 240 ɵɵelementStart(17, "div")(18, "div"); 241 ɵɵtext(19); 242 ɵɵelementEnd()()()(); 243 ɵɵelementStart(20, "div", 15)(21, "div", 16)(22, "div", 17); 244 ɵɵi18n(23, 3); 245 ɵɵelementEnd(); 246 ɵɵelementStart(24, "p", 18); 247 ɵɵtext(25); 248 ɵɵelementEnd()(); 249 ɵɵelementStart(26, "div", 16)(27, "div", 17); 250 ɵɵi18n(28, 4); 251 ɵɵelementEnd(); 252 ɵɵelementStart(29, "p", 18); 253 ɵɵtext(30); 254 ɵɵpipe(31, "dateLocalized"); 255 ɵɵelementEnd()()()(); 256 ɵɵelementStart(32, "div", 14)(33, "div", 19)(34, "div", 20); 257 ɵɵi18n(35, 5); 258 ɵɵelementEnd(); 259 ɵɵelementStart(36, "div", 21)(37, "div", 22); 260 ɵɵrepeaterCreate(38, ContactMomentDialogComponent_For_39_Template, 4, 1, "div", 23, ɵɵrepeaterTrackByIdentity); 261 ɵɵelementEnd()()()()(); 262 ɵɵelementStart(40, "div", 24)(41, "div", 14)(42, "div", 25)(43, "div", 17); 263 ɵɵi18n(44, 6); 264 ɵɵelementEnd(); 265 ɵɵelement(45, "div", 26); 266 ɵɵelementEnd()()()()(); 267 ɵɵelementStart(46, "div", 27)(47, "button", 28); 268 ɵɵlistener("click", function ContactMomentDialogComponent_Template_button_click_47_listener() { 269 return ctx.onCloseDialog(); 270 }); 271 ɵɵi18n(48, 7); 272 ɵɵelementEnd()()(); 273 } 274 if (rf & 2) { 275 ɵɵadvance(13); 276 ɵɵtextInterpolate1(" ", ctx.contactMoment == null ? null : ctx.contactMoment.title, " "); 277 ɵɵadvance(5); 278 ɵɵclassProp("ehr-badge-gray", ctx.contactMoment.category === "Note")("ehr-badge-red", ctx.contactMoment.category === "Other")("ehr-badge", ctx.contactMoment.category === "Direct Message")("ehr-badge-info", ctx.contactMoment.category === "Email")("ehr-badge-orange", ctx.contactMoment.category === "Phone")("ehr-badge-green", ctx.contactMoment.category === "Meeting"); 279 ɵɵadvance(); 280 ɵɵtextInterpolate1(" ", ctx.getStatus(ctx.contactMoment.category), " "); 281 ɵɵadvance(6); 282 ɵɵtextInterpolate1(" ", ctx.createdBy, " "); 283 ɵɵadvance(5); 284 ɵɵtextInterpolate1(" ", ɵɵpipeBind2(31, 17, ctx.contactMoment.createdAt, "dd MMMM yyyy"), " "); 285 ɵɵadvance(8); 286 ɵɵrepeater(ctx.contactMoment == null ? null : ctx.contactMoment.attachments); 287 ɵɵadvance(7); 288 ɵɵproperty("innerHTML", ctx.parseInnerHTML(ctx.contactMoment.content), ɵɵsanitizeHtml); 289 } 290 }, 291 dependencies: [MatButton, EhrVideoPlayerComponent, MatTooltip, AsyncPipe, StorageUrlPipe, DateLocalizedPipe], 292 styles: ["\n@media screen and (min-width: 768px) {\n .ehr-card-container-2-col[_ngcontent-%COMP%] .ehr-card[_ngcontent-%COMP%] {\n width: calc(50% - 5rem);\n min-height: 10rem;\n }\n}\n/*# sourceMappingURL=contact-moment-dialog.component.css.map */"] 293 }); 294 } 295}; 296(() => { 297 (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ContactMomentDialogComponent, [{ 298 type: Component, 299 args: [{ 300 selector: "ehr-contact-moment-dialog", 301 standalone: false, 302 template: `<div class="ehr-dialog">\r 303 <div class="ehr-dialog-header">\r 304 <h6 class="ehr-dialog-header-title"\r 305 i18n="@@contact-moment">\r 306 Contact moment\r 307 </h6>\r 308 </div>\r 309\r 310 <div class="ehr-dialog-body">\r 311 <div class="flex-column-start-start flex-column-gap-2rem">\r 312 <div class="ehr-card-container-2-col">\r 313 <div class="ehr-card">\r 314 <div class="full-width flex-row-space-between-start">\r 315 <div class="ehr-card-dialog-container half-width">\r 316 <div class="ehr-card-label"\r 317 i18n="@@subject">\r 318 Subject\r 319 </div>\r 320\r 321 <p class="ehr-card-value">\r 322 {{ contactMoment?.title }}\r 323 </p>\r 324 </div>\r 325\r 326 <div class="ehr-card-dialog-container half-width">\r 327 <div class="ehr-card-label"\r 328 i18n="@@category">\r 329 Category\r 330 </div>\r 331\r 332 <div>\r 333 <div [class.ehr-badge-gray]="contactMoment.category === 'Note'"\r 334 [class.ehr-badge-red]="contactMoment.category === 'Other'"\r 335 [class.ehr-badge]="contactMoment.category === 'Direct Message'"\r 336 [class.ehr-badge-info]="contactMoment.category === 'Email'"\r 337 [class.ehr-badge-orange]="contactMoment.category === 'Phone'"\r 338 [class.ehr-badge-green]="contactMoment.category === 'Meeting'">\r 339 {{ getStatus(contactMoment.category) }}\r 340 </div>\r 341 </div>\r 342 </div>\r 343 </div>\r 344\r 345 <div class="full-width flex-row-space-between-start">\r 346 <div class="ehr-card-dialog-container half-width">\r 347 <div class="ehr-card-label"\r 348 i18n="@@created-by-label">\r 349 Created by\r 350 </div>\r 351\r 352 <p class="ehr-card-value">\r 353 {{ createdBy }}\r 354 </p>\r 355 </div>\r 356\r 357 <div class="ehr-card-dialog-container half-width">\r 358 <div class="ehr-card-label"\r 359 i18n="@@created">\r 360 Created\r 361 </div>\r 362\r 363 <p class="ehr-card-value">\r 364 {{ contactMoment.createdAt | dateLocalized: 'dd MMMM yyyy' }}\r 365 </p>\r 366 </div>\r 367 </div>\r 368 </div>\r 369\r 370 <div class="ehr-card">\r 371 <div class="full-width flex-column-start-start flex-column-gap-16px">\r 372 <div class="ehr-title"\r 373 i18n="@@attachments">\r 374 Attachments\r 375 </div>\r 376\r 377 <div class="full-width flex-row-start-center">\r 378 <div class="ehr-gallery">\r 379 @for (attachment of contactMoment?.attachments; let i = $index; track attachment) {\r 380 <div class="ehr-gallery-item">\r 381 @switch (attachment.type) {\r 382 @case ('video') {\r 383 @if (attachment.storagePath) {\r 384 <ehr-video-player [matTooltip]="attachment.name"\r 385 [videoUrl]="attachment.storagePath | storageUrl | async"></ehr-video-player>\r 386 }\r 387 }\r 388 @case ('pdf') {\r 389 <div class="ehr-single-file"\r 390 [matTooltip]="attachment.name">\r 391 <div class="ehr-gallery-img">\r 392 <div class="ehr-pdf-img"></div>\r 393 </div>\r 394 <div class="ehr-name">\r 395 {{ attachment.name }}\r 396 </div>\r 397 </div>\r 398 }\r 399 @default {\r 400 <div [matTooltip]="attachment.name"\r 401 class="ehr-single-file">\r 402 <div class="ehr-gallery-img">\r 403 @if (attachment.storagePath) {\r 404 <img [src]="attachment.storagePath | storageUrl | async" [alt]="attachment.name"/>\r 405 }\r 406 </div>\r 407 <div class="ehr-name">\r 408 {{ attachment.name }}\r 409 </div>\r 410 </div>\r 411 }\r 412 }\r 413 </div>\r 414 }\r 415 </div>\r 416 </div>\r 417 </div>\r 418 </div>\r 419 </div>\r 420\r 421 <div class="ehr-card-container-1-col">\r 422 <div class="ehr-card">\r 423 <div class="ehr-card-dialog-container">\r 424 <div class="ehr-card-label"\r 425 i18n="@@content">\r 426 Content\r 427 </div>\r 428\r 429 <div class="ehr-card-editor-value ehr-innerHTML" [innerHTML]="parseInnerHTML(contactMoment.content)"></div>\r 430 </div>\r 431 </div>\r 432 </div>\r 433 </div>\r 434 </div>\r 435\r 436 <div class="ehr-dialog-footer">\r 437 <button mat-raised-button\r 438 class="ehr-cancel-button"\r 439 (click)="onCloseDialog()"\r 440 i18n="@@close"\r 441 type="button">\r 442 Close\r 443 </button>\r 444 </div>\r 445</div>\r 446`, 447 styles: ["/* src/app/_dialogs/contact-moment-dialog/contact-moment-dialog.component.scss */\n@media screen and (min-width: 768px) {\n .ehr-card-container-2-col .ehr-card {\n width: calc(50% - 5rem);\n min-height: 10rem;\n }\n}\n/*# sourceMappingURL=contact-moment-dialog.component.css.map */\n"] 448 }] 449 }], () => [{ 450 type: MatDialogRef 451 }, { 452 type: void 0, 453 decorators: [{ 454 type: Inject, 455 args: [MAT_DIALOG_DATA] 456 }] 457 }], null); 458})(); 459(() => { 460 (typeof ngDevMode === "undefined" || ngDevMode) && ɵsetClassDebugInfo(ContactMomentDialogComponent, { 461 className: "ContactMomentDialogComponent", 462 filePath: "src/app/_dialogs/contact-moment-dialog/contact-moment-dialog.component.ts", 463 lineNumber: 12 464 }); 465})(); 466
467// src/app/_dialogs/contact-moment-dialog/contact-moment-dialog.module.ts 468var ContactMomentDialogModule = class _ContactMomentDialogModule { 469 static { 470 this.ɵfac = function ContactMomentDialogModule_Factory(__ngFactoryType__) { 471 return new (__ngFactoryType__ || _ContactMomentDialogModule)(); 472 }; 473 } 474 static { 475 this.ɵmod = /* @__PURE__ */ɵɵdefineNgModule({ 476 type: _ContactMomentDialogModule 477 }); 478 } 479 static { 480 this.ɵinj = /* @__PURE__ */ɵɵdefineInjector({ 481 imports: [CommonModule, MatButtonModule, MatTooltipModule] 482 }); 483 } 484}; 485(() => { 486 (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ContactMomentDialogModule, [{ 487 type: NgModule, 488 args: [{ 489 declarations: [ContactMomentDialogComponent], 490 imports: [CommonModule, MatButtonModule, EhrVideoPlayerComponent, MatTooltipModule, StorageUrlPipe, DateLocalizedPipe], 491 exports: [ContactMomentDialogComponent] 492 }] 493 }], null, null); 494})(); 495
496// src/app/_services/contact-moment.service.ts 497var ContactMomentService = class _ContactMomentService { 498 constructor(firestore, attachmentService, authService) { 499 this.firestore = firestore; 500 this.attachmentService = attachmentService; 501 this.authService = authService; 502 } 503 createContactMoment(contactMoment, newFiles) { 504 return this.authService.getCurrentSession$().pipe(take(1), switchMap(session => { 505 const orgId = session.orgId; 506 const employeeId = session.employeeId; 507 const body = __spreadProps(__spreadValues({}, contactMoment), { 508 ownerId: employeeId, 509 lastUpdatedAt: Timestamp.now(), 510 createdAt: Timestamp.now() 511 }); 512 if (!newFiles?.length) { 513 return from(this.commitContactMoment(orgId, body)); 514 } 515 const uploads = newFiles.map(attachment => { 516 return this.attachmentService.uploadFileCreateAttachment(attachment, attachment.file); 517 }); 518 return from(Promise.all(uploads)).pipe(switchMap(results => { 519 body.attachments = results.map(r => r.persistAttachment); 520 return this.commitContactMoment(orgId, body); 521 })); 522 })); 523 } 524 commitContactMoment(orgId, body) { 525 return __async(this, null, function* () { 526 const batch = writeBatch(this.firestore); 527 const docRef = doc(collection(this.firestore, "organizations", orgId, "contactMoments")); 528 batch.set(docRef, body); 529 yield batch.commit(); 530 }); 531 } 532 getContactMomentsById(documentId, widget = false) { 533 return this.authService.getCurrentSession$().pipe(take(1), switchMap(session => { 534 const colRef = collection(this.firestore, "organizations", session.orgId, "contactMoments"); 535 let q = query(colRef, where("documentIds", "array-contains", documentId)); 536 if (widget) { 537 q = query(colRef, where("documentIds", "array-contains", documentId), limit(5)); 538 } 539 return collectionSnapshots(q); 540 }), map(colSnapshot => colSnapshot.map(doc2 => { 541 const data = doc2.data(); 542 return __spreadProps(__spreadValues({}, data), { 543 id: doc2.id, 544 exists: doc2.exists() 545 }); 546 }))); 547 } 548 getContactMomentCountByDocId(documentId, manager) { 549 return this.authService.getCurrentSession$().pipe(take(1), switchMap(session => { 550 const colRef = collection(this.firestore, "organizations", session.orgId, "contactMoments"); 551 let q = query(colRef, where("documentIds", "array-contains", documentId)); 552 if (manager) { 553 q = query(q, where("ownerId", "==", manager)); 554 } 555 return getCountFromServer(q); 556 }), map(snapshot => snapshot.data().count)); 557 } 558 getContactMomentsByDocIdFirstPage(documentId, perPage, orderByField, sortDirection, manager) { 559 return this.authService.getCurrentSession$().pipe(take(1), switchMap(session => { 560 const colRef = collection(this.firestore, "organizations", session.orgId, "contactMoments"); 561 let q = query(colRef, where("documentIds", "array-contains", documentId), orderBy(orderByField, sortDirection), limit(perPage)); 562 if (manager) { 563 q = query(q, where("ownerId", "==", manager)); 564 } 565 return getDocs(q); 566 }), map(snapshot => { 567 const result = snapshot.docs.map(doc2 => { 568 return __spreadProps(__spreadValues({}, doc2.data()), { 569 id: doc2.id, 570 exists: doc2.exists() 571 }); 572 }); 573 return { 574 result, 575 lastVisible: snapshot.docs[snapshot.docs.length - 1], 576 firstVisible: snapshot.docs[0] 577 }; 578 })); 579 } 580 getContactMomentsByDocIdNextPage(documentId, fieldValue, perPage, orderByField = "startDateFormat", sortDirection = "desc", manager) { 581 return this.authService.getCurrentSession$().pipe(take(1), switchMap(session => { 582 const colRef = collection(this.firestore, "organizations", session.orgId, "contactMoments"); 583 let q = query(colRef, where("documentIds", "array-contains", documentId), orderBy(orderByField, sortDirection), startAfter(fieldValue), limit(perPage)); 584 if (manager) { 585 q = query(q, where("ownerId", "==", manager)); 586 } 587 return getDocs(q); 588 }), map(snapshot => { 589 const result = snapshot.docs.map(doc2 => { 590 return __spreadProps(__spreadValues({}, doc2.data()), { 591 id: doc2.id, 592 exists: doc2.exists() 593 }); 594 }); 595 return { 596 result, 597 lastVisible: snapshot.docs[snapshot.docs.length - 1], 598 firstVisible: snapshot.docs[0] 599 }; 600 })); 601 } 602 getContactMomentsByDocIdPrevPage(documentId, fieldValue, perPage, orderByField = "startDateFormat", sortDirection = "desc", manager) { 603 return this.authService.getCurrentSession$().pipe(take(1), switchMap(session => { 604 const colRef = collection(this.firestore, "organizations", session.orgId, "contactMoments"); 605 let q = query(colRef, where("documentIds", "array-contains", documentId), orderBy(orderByField, sortDirection), endBefore(fieldValue), limitToLast(perPage)); 606 if (manager) { 607 q = query(q, where("ownerId", "==", manager)); 608 } 609 return getDocs(q); 610 }), map(snapshot => { 611 const result = snapshot.docs.map(doc2 => { 612 return __spreadProps(__spreadValues({}, doc2.data()), { 613 id: doc2.id, 614 exists: doc2.exists() 615 }); 616 }); 617 return { 618 result, 619 lastVisible: snapshot.docs[snapshot.docs.length - 1], 620 firstVisible: snapshot.docs[0] 621 }; 622 })); 623 } 624 static { 625 this.ɵfac = function ContactMomentService_Factory(__ngFactoryType__) { 626 return new (__ngFactoryType__ || _ContactMomentService)(ɵɵinject(Firestore), ɵɵinject(AttachmentService), ɵɵinject(AuthenticationService)); 627 }; 628 } 629 static { 630 this.ɵprov = /* @__PURE__ */ɵɵdefineInjectable({ 631 token: _ContactMomentService, 632 factory: _ContactMomentService.ɵfac, 633 providedIn: "root" 634 }); 635 } 636}; 637(() => { 638 (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ContactMomentService, [{ 639 type: Injectable, 640 args: [{ 641 providedIn: "root" 642 }] 643 }], () => [{ 644 type: Firestore 645 }, { 646 type: AttachmentService 647 }, { 648 type: AuthenticationService 649 }], null); 650})(); 651
652// src/app/_dialogs/add-contact-moment-dialog/add-contact-moment-dialog.component.ts 653function AddContactMomentDialogComponent_Conditional_12_Template(rf, ctx) { 654 if (rf & 1) { 655 ɵɵelementStart(0, "mat-error"); 656 ɵɵi18n(1, 8); 657 ɵɵelementEnd(); 658 } 659} 660function AddContactMomentDialogComponent_For_19_Template(rf, ctx) { 661 if (rf & 1) { 662 ɵɵelementStart(0, "mat-option", 24); 663 ɵɵtext(1); 664 ɵɵelementEnd(); 665 } 666 if (rf & 2) { 667 const category_r3 = ctx.$implicit; 668 const ctx_r3 = ɵɵnextContext(); 669 ɵɵproperty("value", category_r3); 670 ɵɵadvance(); 671 ɵɵtextInterpolate(ctx_r3.getCategory(category_r3)); 672 } 673} 674function AddContactMomentDialogComponent_Conditional_25_Template(rf, ctx) { 675 if (rf & 1) { 676 ɵɵelementStart(0, "mat-error", 30); 677 ɵɵi18n(1, 9); 678 ɵɵelementEnd(); 679 } 680} 681function AddContactMomentDialogComponent_Conditional_28_Conditional_3_For_3_Conditional_3_Template(rf, ctx) { 682 if (rf & 1) { 683 ɵɵelementStart(0, "div", 44)(1, "div", 47)(2, "mat-icon"); 684 ɵɵtext(3, "upload"); 685 ɵɵelementEnd()()(); 686 } 687 if (rf & 2) { 688 const file_r8 = ɵɵnextContext().$implicit; 689 ɵɵproperty("matTooltip", file_r8.name); 690 } 691} 692function AddContactMomentDialogComponent_Conditional_28_Conditional_3_For_3_Conditional_4_Template(rf, ctx) { 693 if (rf & 1) { 694 ɵɵelementStart(0, "div", 44)(1, "div", 48); 695 ɵɵelement(2, "img", 49); 696 ɵɵelementEnd()(); 697 } 698 if (rf & 2) { 699 const ctx_r8 = ɵɵnextContext(); 700 const file_r8 = ctx_r8.$implicit; 701 const ɵ$index_73_r7 = ctx_r8.$index; 702 const ctx_r3 = ɵɵnextContext(3); 703 ɵɵproperty("matTooltip", file_r8.name); 704 ɵɵadvance(2); 705 ɵɵproperty("src", ctx_r3.newFilePreviews[ɵ$index_73_r7], ɵɵsanitizeUrl)("alt", file_r8.name); 706 } 707} 708function AddContactMomentDialogComponent_Conditional_28_Conditional_3_For_3_Template(rf, ctx) { 709 if (rf & 1) { 710 const _r6 = ɵɵgetCurrentView(); 711 ɵɵelementStart(0, "div", 42)(1, "mat-icon", 43); 712 ɵɵlistener("click", function AddContactMomentDialogComponent_Conditional_28_Conditional_3_For_3_Template_mat_icon_click_1_listener() { 713 const ɵ$index_73_r7 = ɵɵrestoreView(_r6).$index; 714 const ctx_r3 = ɵɵnextContext(3); 715 return ɵɵresetView(ctx_r3.deleteNewFile(ɵ$index_73_r7)); 716 }); 717 ɵɵtext(2, " close "); 718 ɵɵelementEnd(); 719 ɵɵconditionalCreate(3, AddContactMomentDialogComponent_Conditional_28_Conditional_3_For_3_Conditional_3_Template, 4, 1, "div", 44); 720 ɵɵconditionalCreate(4, AddContactMomentDialogComponent_Conditional_28_Conditional_3_For_3_Conditional_4_Template, 3, 3, "div", 44); 721 ɵɵelementStart(5, "div", 45)(6, "mat-form-field", 21)(7, "mat-label"); 722 ɵɵi18n(8, 14); 723 ɵɵelementEnd(); 724 ɵɵelement(9, "input", 46); 725 ɵɵelementEnd()()(); 726 } 727 if (rf & 2) { 728 const file_r8 = ctx.$implicit; 729 const ɵ$index_73_r7 = ctx.$index; 730 const ctx_r3 = ɵɵnextContext(3); 731 ɵɵadvance(); 732 ɵɵproperty("inline", true); 733 ɵɵadvance(2); 734 ɵɵconditional(file_r8.type === "application/pdf" || file_r8.type.startsWith("application/") ? 3 : -1); 735 ɵɵadvance(); 736 ɵɵconditional(!(file_r8.type === "application/pdf" || file_r8.type.startsWith("application/")) ? 4 : -1); 737 ɵɵadvance(5); 738 ɵɵproperty("formControl", ctx_r3.getAttachmentFormControl(ɵ$index_73_r7)); 739 } 740} 741function AddContactMomentDialogComponent_Conditional_28_Conditional_3_Template(rf, ctx) { 742 if (rf & 1) { 743 ɵɵelementStart(0, "div", 36)(1, "div", 41); 744 ɵɵrepeaterCreate(2, AddContactMomentDialogComponent_Conditional_28_Conditional_3_For_3_Template, 10, 4, "div", 42, ɵɵrepeaterTrackByIdentity); 745 ɵɵelementEnd()(); 746 } 747 if (rf & 2) { 748 const ctx_r3 = ɵɵnextContext(2); 749 ɵɵadvance(2); 750 ɵɵrepeater(ctx_r3.newFiles); 751 } 752} 753function AddContactMomentDialogComponent_Conditional_28_Template(rf, ctx) { 754 if (rf & 1) { 755 const _r5 = ɵɵgetCurrentView(); 756 ɵɵelementStart(0, "button", 31); 757 ɵɵlistener("click", function AddContactMomentDialogComponent_Conditional_28_Template_button_click_0_listener() { 758 ɵɵrestoreView(_r5); 759 const ctx_r3 = ɵɵnextContext();
760 return ɵɵresetView(ctx_r3.onHideAttachments()); 761 }); 762 ɵɵi18n(1, 10); 763 ɵɵelementEnd(); 764 ɵɵelementStart(2, "div", 35); 765 ɵɵconditionalCreate(3, AddContactMomentDialogComponent_Conditional_28_Conditional_3_Template, 4, 0, "div", 36); 766 ɵɵelementStart(4, "div", 37); 767 ɵɵlistener("fileDropped", function AddContactMomentDialogComponent_Conditional_28_Template_div_fileDropped_4_listener($event) { 768 ɵɵrestoreView(_r5); 769 const ctx_r3 = ɵɵnextContext(); 770 return ɵɵresetView(ctx_r3.onFileChange($event)); 771 }); 772 ɵɵelementStart(5, "div")(6, "input", 38, 1); 773 ɵɵlistener("change", function AddContactMomentDialogComponent_Conditional_28_Template_input_change_6_listener($event) { 774 ɵɵrestoreView(_r5); 775 const ctx_r3 = ɵɵnextContext(); 776 return ɵɵresetView(ctx_r3.onFileSelected($event)); 777 }); 778 ɵɵelementEnd(); 779 ɵɵelement(8, "img", 39); 780 ɵɵelementStart(9, "p"); 781 ɵɵi18n(10, 11); 782 ɵɵelementEnd(); 783 ɵɵelementStart(11, "p"); 784 ɵɵi18n(12, 12); 785 ɵɵelementEnd(); 786 ɵɵelementStart(13, "button", 40); 787 ɵɵlistener("click", function AddContactMomentDialogComponent_Conditional_28_Template_button_click_13_listener() { 788 ɵɵrestoreView(_r5); 789 const fileInput_r10 = ɵɵreference(7); 790 return ɵɵresetView(fileInput_r10.click()); 791 }); 792 ɵɵi18n(14, 13); 793 ɵɵelementEnd()()()(); 794 } 795 if (rf & 2) { 796 const ctx_r3 = ɵɵnextContext(); 797 ɵɵadvance(3); 798 ɵɵconditional(ctx_r3.newFiles.length > 0 ? 3 : -1); 799 ɵɵadvance(); 800 ɵɵclassProp("disabled", ctx_r3.newFiles.length >= 4 || ctx_r3.loading); 801 ɵɵproperty("@fadeInOut", true); 802 ɵɵadvance(2); 803 ɵɵproperty("disabled", ctx_r3.loading || ctx_r3.newFiles.length >= 4); 804 ɵɵadvance(7); 805 ɵɵproperty("disabled", ctx_r3.loading || ctx_r3.newFiles.length >= 4); 806 } 807} 808var AddContactMomentDialogComponent = class _AddContactMomentDialogComponent { 809 static { 810 this.MAX_ATTACHMENTS = 4; 811 } 812 static { 813 this.MAX_ATTACHMENT_BYTES = 20 * 1024 * 1024; 814 } 815 static { 816 this.ALLOWED_ATTACHMENT_TYPES = /* @__PURE__ */new Set(["image/png", "image/jpeg", "image/webp", "application/pdf"]); 817 } 818 constructor(matDialogRef, contactMomentService, fb, spinnerService, data) { 819 this.matDialogRef = matDialogRef; 820 this.contactMomentService = contactMomentService; 821 this.fb = fb; 822 this.spinnerService = spinnerService; 823 this.data = data; 824 this.contactMomentForm = new FormGroup({ 825 title: new FormControl("", Validators.required), 826 content: new FormControl("", Validators.required), 827 category: new FormControl("Note", Validators.required), 828 attachments: new FormArray([]) 829 // one row per new file 830 }); 831 this.editor = new Editor(); 832 this.toolbar = [["bold"], ["underline", "strike"], [], ["ordered_list", "bullet_list"], [{ 833 heading: ["h1", "h2", "h3", "h4", "h5", "h6"] 834 }], [], [], ["align_left", "align_center", "align_right", "align_justify"]]; 835 this.categories = ["Note", "Email", "Phone", "Meeting", "Direct Message", "Other"]; 836 this.showAttachments = false; 837 this.loading = false; 838 this.newFiles = []; 839 this.newFilePreviews = []; 840 } 841 get attachmentsArray() { 842 return this.contactMomentForm.get("attachments"); 843 } 844 onSubmit(form) { 845 if (!form.valid) return; 846 this.loading = true; 847 const documentIds = [this.data.parentId]; 848 if (this.data.childId) documentIds.push(this.data.childId); 849 const attachmentsPreview = this.buildAttachmentsPreview(); 850 const body = { 851 content: form.value.content, 852 ownerId: "", 853 documentIds, 854 title: form.value.title, 855 attachments: [], 856 category: form.value.category, 857 lastUpdatedAt: Timestamp.now(), 858 createdAt: Timestamp.now() 859 }; 860 this.contactMomentService.createContactMoment(body, attachmentsPreview).pipe(take(1)).subscribe({ 861 next: () => { 862 this.spinnerService.stopSpinnerWithSuccess("Contactmoment is succesvol aangemaakt"); 863 this.loading = false; 864 this.onCloseDialog(true); 865 }, 866 error: err => { 867 this.spinnerService.stopSpinnerWithError(err?.message); 868 this.loading = false;
869 } 870 }); 871 } 872 onFileSelected(event) { 873 return __async(this, null, function* () { 874 const target = event.target; 875 if (target.files?.length) { 876 yield this.onFileChange(target.files); 877 target.value = ""; 878 } 879 }); 880 } 881 onFileChange(fileList) { 882 return __async(this, null, function* () { 883 const files = Array.from(fileList || []); 884 if (!files.length) return; 885 const availableSlots = _AddContactMomentDialogComponent.MAX_ATTACHMENTS - this.newFiles.length; 886 const accepted = files.slice(0, Math.max(0, availableSlots)); 887 for (const file of accepted) { 888 if (file.size >= _AddContactMomentDialogComponent.MAX_ATTACHMENT_BYTES) { 889 this.spinnerService.stopSpinnerWithError("Bijlagen moeten kleiner zijn dan 20 MB"); 890 continue; 891 } 892 if (!_AddContactMomentDialogComponent.ALLOWED_ATTACHMENT_TYPES.has(file.type)) { 893 this.spinnerService.stopSpinnerWithError("Dit bestandstype wordt niet ondersteund"); 894 continue; 895 } 896 this.newFiles.push(file); 897 this.newFilePreviews.push(URL.createObjectURL(file)); 898 this.attachmentsArray.push(this.fb.group({ 899 description: new FormControl(""), 900 type: new FormControl(this.getFileType(file), Validators.required), 901 name: new FormControl(file.name, Validators.required) 902 })); 903 } 904 }); 905 } 906 deleteNewFile(index) { 907 const url = this.newFilePreviews[index]; 908 if (url) { 909 try { 910 URL.revokeObjectURL(url); 911 } catch (e) {} 912 } 913 this.newFilePreviews.splice(index, 1); 914 this.newFiles.splice(index, 1); 915 this.attachmentsArray.removeAt(index); 916 } 917 getAttachmentFormControl(index) { 918 return this.attachmentsArray.at(index).get("description"); 919 } 920 onShowAttachments() { 921 this.showAttachments = true; 922 } 923 onHideAttachments() { 924 this.showAttachments = false; 925 } 926 onCloseDialog(refresh = false) { 927 this.matDialogRef.close(refresh); 928 } 929 buildAttachmentsPreview() { 930 return this.newFiles.map((file, i) => { 931 const row = this.attachmentsArray.at(i); 932 const description = row.get("description")?.value ?? ""; 933 const type = row.get("type")?.value ?? this.getFileType(file); 934 return { 935 context: this.data.context, 936 storagePath: "", 937 // placeholder 938 subjectEmployeeId: this.data.employeeId, 939 uploadedById: "", 940 description, 941 documentIds: [this.data.parentId], 942 uploadedAt: Timestamp.now(), 943 name: file.name, 944 type, 945 file 946 }; 947 }); 948 } 949 getCategory(category) { 950 switch (category) { 951 case "Note": 952 return "Opmerking"; 953 case "Email": 954 return "E-mailadres"; 955 case "Phone": 956 return "Telefoon"; 957 case "Meeting": 958 return "Gesprek"; 959 case "Direct Message": 960 return "Direct bericht"; 961 case "Other": 962 return "Overige"; 963 default: 964 return category; 965 } 966 } 967 getFileType(file) { 968 if (file.type === "application/pdf") return "pdf"; 969 return "image"; 970 } 971 ngOnDestroy() { 972 this.editor.destroy(); 973 for (const url of this.newFilePreviews) { 974 try { 975 URL.revokeObjectURL(url); 976 } catch (e) {} 977 } 978 } 979 static { 980 this.ɵfac = function AddContactMomentDialogComponent_Factory(__ngFactoryType__) { 981 return new (__ngFactoryType__ || _AddContactMomentDialogComponent)(ɵɵdirectiveInject(MatDialogRef), ɵɵdirectiveInject(ContactMomentService), ɵɵdirectiveInject(FormBuilder), ɵɵdirectiveInject(SpinnerService), ɵɵdirectiveInject(MAT_DIALOG_DATA)); 982 }; 983 } 984 static { 985 this.ɵcmp = /* @__PURE__ */ɵɵdefineComponent({ 986 type: _AddContactMomentDialogComponent, 987 selectors: [["ehr-add-contact-moment-dialog"]], 988 standalone: false, 989 decls: 34, 990 vars: 16, 991 consts: () => { 992 let i18n_0; 993 if (false) { 994 const MSG_EXTERNAL_665870996015497421$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_0 = goog.getMsg("Content..."); 995 i18n_0 = MSG_EXTERNAL_665870996015497421$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_0; 996 } else { 997 i18n_0 = "Inhoud..."; 998 } 999 let i18n_1; 1000 if (false) { 1001 const MSG_EXTERNAL_add_contact_moment$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_1 = goog.getMsg("Add contact moment"); 1002 i18n_1 = MSG_EXTERNAL_add_contact_moment$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_1; 1003 } else { 1004 i18n_1 = "Contactmoment toevoegen"; 1005 } 1006 let i18n_2; 1007 if (false) { 1008 const MSG_EXTERNAL_title$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_2 = goog.getMsg("Title"); 1009 i18n_2 = MSG_EXTERNAL_title$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_2; 1010 } else { 1011 i18n_2 = "Titel"; 1012 } 1013 let i18n_3; 1014 if (false) { 1015 const MSG_EXTERNAL_category$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_3 = goog.getMsg("Category"); 1016 i18n_3 = MSG_EXTERNAL_category$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_3; 1017 } else { 1018 i18n_3 = "Categorie"; 1019 } 1020 let i18n_4; 1021 if (false) { 1022 const MSG_EXTERNAL_add_attachments$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_4 = goog.getMsg(" Add Attachments "); 1023 i18n_4 = MSG_EXTERNAL_add_attachments$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_4; 1024 } else { 1025 i18n_4 = "Bijlagen toevoegen"; 1026 } 1027 let i18n_5; 1028 if (false) { 1029 const MSG_EXTERNAL_cancel$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_5 = goog.getMsg(" Cancel "); 1030 i18n_5 = MSG_EXTERNAL_cancel$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_5; 1031 } else { 1032 i18n_5 = "Annuleren"; 1033 } 1034 let i18n_6; 1035 if (false) { 1036 const MSG_EXTERNAL_submit$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_6 = goog.getMsg(" Submit "); 1037 i18n_6 = MSG_EXTERNAL_submit$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_6; 1038 } else { 1039 i18n_6 = "Opslaan"; 1040 } 1041 let i18n_7; 1042 if (false) { 1043 const MSG_EXTERNAL_title_required_error$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_7 = goog.getMsg("Title is required"); 1044 i18n_7 = MSG_EXTERNAL_title_required_error$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_7; 1045 } else { 1046 i18n_7 = "Titel is vereist"; 1047 } 1048 let i18n_8; 1049 if (false) { 1050 const MSG_EXTERNAL_content_required$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_8 = goog.getMsg("Content is required"); 1051 i18n_8 = MSG_EXTERNAL_content_required$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_8; 1052 } else { 1053 i18n_8 = "Dit veld is verplicht"; 1054 } 1055 let i18n_9; 1056 if (false) { 1057 const MSG_EXTERNAL_hide_attachments$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_9 = goog.getMsg(" Hide attachments "); 1058 i18n_9 = MSG_EXTERNAL_hide_attachments$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_9; 1059 } else { 1060 i18n_9 = "Bijlagen verbergen"; 1061 } 1062 let i18n_10; 1063 if (false) { 1064 const MSG_EXTERNAL_drag_drop_file_here$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_10 = goog.getMsg("Drag and drop file here"); 1065 i18n_10 = MSG_EXTERNAL_drag_drop_file_here$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_10; 1066 } else { 1067 i18n_10 = "Sleep het bestand hierheen"; 1068 } 1069 let i18n_11; 1070 if (false) { 1071 const MSG_EXTERNAL_or$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_11 = goog.getMsg("or"); 1072 i18n_11 = MSG_EXTERNAL_or$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_11; 1073 } else { 1074 i18n_11 = "of"; 1075 } 1076 let i18n_12; 1077 if (false) { 1078 const MSG_EXTERNAL_browse_for_file$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_12 = goog.getMsg(" Browse for file "); 1079 i18n_12 = MSG_EXTERNAL_browse_for_file$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_12; 1080 } else { 1081 i18n_12 = "Bestand kiezen"; 1082 } 1083 let i18n_13; 1084 if (false) {
1085 const MSG_EXTERNAL_description$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_13 = goog.getMsg("Description"); 1086 i18n_13 = MSG_EXTERNAL_description$$SRC_APP__DIALOGS_ADD_CONTACT_MOMENT_DIALOG_ADD_CONTACT_MOMENT_DIALOG_COMPONENT_TS_13; 1087 } else { 1088 i18n_13 = "Beschrijving"; 1089 } 1090 return [["form", "ngForm"], ["fileInput", ""], i18n_1, i18n_2, i18n_3, i18n_4, i18n_5, i18n_6, i18n_7, i18n_8, i18n_9, i18n_10, i18n_11, i18n_12, i18n_13, [1, "ehr-dialog", 3, "ngSubmit", "formGroup"], [1, "ehr-dialog-header"], [1, "ehr-dialog-header-title"], [1, "ehr-dialog-body"], [1, "full-width", "flex-row-space-between-start"], [1, "ehr-form-field-wrapper", "ehr-form-field-wrapper--2-cols"], ["floatLabel", "always", "appearance", "outline", 1, "ehr-input", "ehr-form-field"], ["matInput", "", "formControlName", "title"], ["formControlName", "category"], [3, "value"], [1, "ehr-form-field-wrapper", "margin-top-1"], [1, "ehr-textarea-field", "ehr-form-field"], [1, "NgxEditor__Wrapper"], [3, "editor", "toolbar"], ["formControlName", "content", "placeholder", i18n_0, 3, "outputFormat", "editor", "disabled"], [1, "ehr-error-editor"], ["mat-button", "", "type", "button", 1, "ehr-link-button", 3, "click"], [1, "ehr-dialog-footer"], ["mat-raised-button", "", "type", "button", 1, "ehr-cancel-button", 3, "click", "disabled"], ["mat-raised-button", "", "color", "primary", "type", "submit", 1, "ehr-submit-button", 3, "disabled"], [1, "ehr-drag-and-drop-box-mini"], [1, "full-width", "flex-row-start-center"], ["ehr-DnD", "", 1, "ehr-drag-and-drop-container", 3, "fileDropped"], ["type", "file", "id", "fileDropRef", "accept", ".png,.jpg,.jpeg,.webp,.pdf,image/png,image/jpeg,image/webp,application/pdf", 3, "change", "disabled"], ["src", "assets/_icons/upload.svg", 1, "ehr-upload-img"], ["type", "button", "mat-button", "", 1, "ehr-primary-button", 3, "click", "disabled"], [1, "ehr-gallery"], [1, "ehr-gallery-item"], [1, "ehr-delete-file-button", 3, "click", "inline"], [1, "ehr-single-file", 3, "matTooltip"], [1, "ehr-form-field-wrapper"], ["matInput", "", 3, "formControl"], [1, "ehr-file-icon"], [1, "ehr-gallery-img"], [3, "src", "alt"]]; 1091 }, 1092 template: function AddContactMomentDialogComponent_Template(rf, ctx) { 1093 if (rf & 1) { 1094 const _r1 = ɵɵgetCurrentView(); 1095 ɵɵelementStart(0, "form", 15, 0); 1096 ɵɵlistener("ngSubmit", function AddContactMomentDialogComponent_Template_form_ngSubmit_0_listener() { 1097 ɵɵrestoreView(_r1); 1098 const form_r2 = ɵɵreference(1); 1099 return ɵɵresetView(ctx.onSubmit(form_r2)); 1100 }); 1101 ɵɵelementStart(2, "div", 16)(3, "h6", 17); 1102 ɵɵi18n(4, 2); 1103 ɵɵelementEnd()(); 1104 ɵɵelementStart(5, "div", 18)(6, "div", 19)(7, "div", 20)(8, "mat-form-field", 21)(9, "mat-label"); 1105 ɵɵi18n(10, 3); 1106 ɵɵelementEnd(); 1107 ɵɵelement(11, "input", 22); 1108 ɵɵconditionalCreate(12, AddContactMomentDialogComponent_Conditional_12_Template, 2, 0, "mat-error"); 1109 ɵɵelementEnd()(); 1110 ɵɵelementStart(13, "div", 20)(14, "mat-form-field", 21)(15, "mat-label"); 1111 ɵɵi18n(16, 4); 1112 ɵɵelementEnd(); 1113 ɵɵelementStart(17, "mat-select", 23); 1114 ɵɵrepeaterCreate(18, AddContactMomentDialogComponent_For_19_Template, 2, 2, "mat-option", 24, ɵɵrepeaterTrackByIdentity); 1115 ɵɵelementEnd()()()(); 1116 ɵɵelementStart(20, "div", 25)(21, "div", 26)(22, "div", 27); 1117 ɵɵelement(23, "ngx-editor-menu", 28)(24, "ngx-editor", 29); 1118 ɵɵelementEnd(); 1119 ɵɵconditionalCreate(25, AddContactMomentDialogComponent_Conditional_25_Template, 2, 0, "mat-error", 30); 1120 ɵɵelementEnd()(); 1121 ɵɵelementStart(26, "button", 31); 1122 ɵɵlistener("click", function AddContactMomentDialogComponent_Template_button_click_26_listener() { 1123 return ctx.onShowAttachments(); 1124 }); 1125 ɵɵi18n(27, 5); 1126 ɵɵelementEnd(); 1127 ɵɵconditionalCreate(28, AddContactMomentDialogComponent_Conditional_28_Template, 15, 6); 1128 ɵɵelementEnd(); 1129 ɵɵelementStart(29, "div", 32)(30, "button", 33); 1130 ɵɵlistener("click", function AddContactMomentDialogComponent_Template_button_click_30_listener() { 1131 return ctx.onCloseDialog(); 1132 }); 1133 ɵɵi18n(31, 6); 1134 ɵɵelementEnd(); 1135 ɵɵelementStart(32, "button", 34); 1136 ɵɵi18n(33, 7); 1137 ɵɵelementEnd()()(); 1138 } 1139 if (rf & 2) { 1140 let tmp_3_0; 1141 let tmp_5_0; 1142 let tmp_11_0; 1143 const form_r2 = ɵɵreference(1); 1144 ɵɵproperty("@fadeInOut", true)("formGroup", ctx.contactMomentForm); 1145 ɵɵadvance(12); 1146 ɵɵconditional(((tmp_3_0 = ctx.contactMomentForm.get("title")) == null ? null : tmp_3_0.hasError("required")) ? 12 : -1); 1147 ɵɵadvance(6); 1148 ɵɵrepeater(ctx.categories); 1149 ɵɵadvance(3); 1150 ɵɵclassProp("ehr-invalid-editor", (form_r2.submitted || ((tmp_5_0 = ctx.contactMomentForm.get("content")) == null ? null : tmp_5_0.touched)) && ((tmp_5_0 = ctx.contactMomentForm.get("content")) == null ? null : tmp_5_0.hasError("required"))); 1151 ɵɵadvance(2); 1152 ɵɵproperty("editor", ctx.editor)("toolbar", ctx.toolbar); 1153 ɵɵadvance(); 1154 ɵɵproperty("outputFormat", "html")("editor", ctx.editor)("disabled", false); 1155 ɵɵadvance(); 1156 ɵɵconditional((form_r2.submitted || ((tmp_11_0 = ctx.contactMomentForm.get("content")) == null ? null : tmp_11_0.touched)) && ((tmp_11_0 = ctx.contactMomentForm.get("content")) == null ? null : tmp_11_0.hasError("required")) ? 25 : -1); 1157 ɵɵadvance(3); 1158 ɵɵconditional(ctx.showAttachments ? 28 : -1); 1159 ɵɵadvance(2); 1160 ɵɵproperty("disabled", ctx.loading); 1161 ɵɵadvance(2); 1162 ɵɵclassProp("spinner", ctx.loading); 1163 ɵɵproperty("disabled", ctx.loading); 1164 } 1165 }, 1166 dependencies: [MatButton, MatInput, MatFormField, MatLabel, MatError, MatOption, MatSelect, ɵNgNoValidate, DefaultValueAccessor, NgControlStatus, NgControlStatusGroup, FormControlDirective, FormGroupDirective, FormControlName, DragAndDropDirective, MatIcon, MatTooltip, NgxEditorComponent, MenuComponent], 1167 encapsulation: 2, 1168 data: { 1169 animation: [fadeInOutAnimation] 1170 } 1171 }); 1172 } 1173}; 1174(() => { 1175 (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(AddContactMomentDialogComponent, [{ 1176 type: Component, 1177 args: [{ 1178 selector: "ehr-add-contact-moment-dialog", 1179 animations: [fadeInOutAnimation], 1180 standalone: false, 1181 template: `<form [@fadeInOut]="true"\r 1182 [formGroup]="contactMomentForm"\r 1183 #form="ngForm"\r 1184 (ngSubmit)="onSubmit(form)"\r 1185 class="ehr-dialog">\r 1186\r 1187 <div class="ehr-dialog-header">\r 1188 <h6 class="ehr-dialog-header-title" i18n="@@add-contact-moment">Add contact moment</h6>\r 1189 </div>\r 1190\r 1191 <div class="ehr-dialog-body">\r 1192 <div class="full-width flex-row-space-between-start">\r 1193 <div class="ehr-form-field-wrapper ehr-form-field-wrapper--2-cols">\r 1194 <mat-form-field floatLabel="always" appearance="outline" class="ehr-input ehr-form-field">\r 1195 <mat-label i18n="@@title">Title</mat-label>\r 1196 <input matInput formControlName="title"/>\r 1197\r 1198 @if (contactMomentForm.get('title')?.hasError('required')) {\r 1199 <mat-error i18n="@@title-required-error">Title is required</mat-error>\r 1200 }\r 1201 </mat-form-field>\r 1202 </div>\r 1203\r 1204 <div class="ehr-form-field-wrapper ehr-form-field-wrapper--2-cols">\r 1205 <mat-form-field floatLabel="always" appearance="outline" class="ehr-input ehr-form-field">\r 1206 <mat-label i18n="@@category">Category</mat-label>\r 1207 <mat-select formControlName="category">\r 1208 @for (category of categories; track category) {\r 1209 <mat-option [value]="category">{{ getCategory(category) }}</mat-option>\r 1210 }\r 1211 </mat-select>\r 1212 </mat-form-field>\r 1213 </div>\r 1214 </div>\r 1215\r 1216 <div class="ehr-form-field-wrapper margin-top-1">\r 1217 <div class="ehr-textarea-field ehr-form-field"\r 1218 [class.ehr-invalid-editor]="(form.submitted || contactMomentForm.get('content')?.touched) && contactMomentForm.get('content')?.hasError('required')">\r 1219 <div class="NgxEditor__Wrapper">\r 1220 <ngx-editor-menu [editor]="editor" [toolbar]="toolbar"></ngx-editor-menu>\r 1221 <ngx-editor\r 1222 [outputFormat]="'html'"\r 1223 [editor]="editor"\r 1224 [disabled]="false"\r 1225 formControlName="content"\r 1226 i18n-placeholder\r 1227 placeholder="Content...">\r 1228 </ngx-editor>\r 1229 </div>\r 1230\r 1231 @if ((form.submitted || contactMomentForm.get('content')?.touched) && contactMomentForm.get('content')?.hasError('required')) {\r 1232 <mat-error class="ehr-error-editor" i18n="@@content-required">Content is required</mat-error>\r 1233 }\r 1234 </div>\r 1235 </div>\r 1236\r 1237 <button mat-button type="button" class="ehr-link-button" (click)="onShowAttachments()" i18n="@@add-attachments">\r 1238 Add Attachments\r 1239 </button>\r 1240\r 1241 @if (showAttachments) {\r 1242 <button mat-button type="button" class="ehr-link-button" (click)="onHideAttachments()" i18n="@@hide-attachments">\r 1243 Hide attachments\r 1244 </button>\r 1245\r 1246 <div class="ehr-drag-and-drop-box-mini">\r 1247 @if (newFiles.length > 0) {\r 1248 <div class="full-width flex-row-start-center">\r 1249 <div class="ehr-gallery">\r 1250 @for (file of newFiles; let i = $index; track file) {\r 1251 <div class="ehr-gallery-item">\r 1252 <mat-icon\r 1253 (click)="deleteNewFile(i)"\r 1254 [inline]="true"\r 1255 class="ehr-delete-file-button">\r 1256 close\r 1257 </mat-icon>\r 1258\r 1259 @if (file.type === 'application/pdf' || file.type.startsWith('application/')) {\r 1260 <div class="ehr-single-file" [matTooltip]="file.name">\r 1261 <div class="ehr-file-icon">\r 1262 <mat-icon>upload</mat-icon>\r 1263 </div>\r 1264 </div>\r 1265 }\r 1266\r 1267 @if (!(file.type === 'application/pdf' || file.type.startsWith('application/'))) {\r 1268 <div class="ehr-single-file" [matTooltip]="file.name">\r 1269 <div class="ehr-gallery-img">\r 1270 <img [src]="newFilePreviews[i]" [alt]="file.name"/>\r 1271 </div>\r 1272 </div>\r 1273 }\r 1274\r 1275 <div class="ehr-form-field-wrapper">\r 1276 <mat-form-field floatLabel="always" appearance="outline" class="ehr-input ehr-form-field">\r 1277 <mat-label i18n="@@description">Description</mat-label>\r 1278 <input matInput [formControl]="getAttachmentFormControl(i)"/>\r 1279 </mat-form-field>\r 1280 </div>\r 1281 </div>\r 1282 }\r 1283 </div>\r 1284 </div>\r 1285 }\r 1286\r 1287 <div class="ehr-drag-and-drop-container"\r 1288 [@fadeInOut]="true"\r 1289 [class.disabled]="newFiles.length >= 4 || loading"\r 1290 ehr-DnD\r 1291 (fileDropped)="onFileChange($event)">\r 1292\r 1293 <div>\r 1294 <input type="file"\r 1295 id="fileDropRef"\r 1296 #fileInput\r 1297 (change)="onFileSelected($event)"\r 1298 accept=".png,.jpg,.jpeg,.webp,.pdf,image/png,image/jpeg,image/webp,application/pdf"\r 1299 [disabled]="loading || newFiles.length >= 4"/>\r 1300\r 1301 <img class="ehr-upload-img" src="assets/_icons/upload.svg"/>\r 1302 <p i18n="@@drag-drop-file-here">Drag and drop file here</p>\r 1303 <p i18n="@@or">or</p>\r 1304\r 1305 <button class="ehr-primary-button"\r 1306 type="button"\r 1307 [disabled]="loading || newFiles.length >= 4"\r 1308 (click)="fileInput.click()"\r 1309 mat-button\r 1310 i18n="@@browse-for-file">\r 1311 Browse for file\r 1312 </button>\r 1313 </div>\r 1314 </div>\r 1315 </div>\r 1316 }\r 1317 </div>\r 1318\r 1319 <div class="ehr-dialog-footer">\r 1320 <button mat-raised-button\r 1321 class="ehr-cancel-button"\r 1322 [disabled]="loading"\r 1323 (click)="onCloseDialog()"\r 1324 type="button"\r 1325 i18n="@@cancel">\r 1326 Cancel\r 1327 </button>\r 1328\r 1329 <button mat-raised-button\r 1330 [disabled]="loading"\r 1331 class="ehr-submit-button"\r 1332 [class.spinner]="loading"\r 1333 color="primary"\r 1334 type="submit"\r 1335 i18n="@@submit">\r 1336 Submit\r 1337 </button>\r 1338 </div>\r 1339</form>\r 1340` 1341 }] 1342 }], () => [{ 1343 type: MatDialogRef 1344 }, { 1345 type: ContactMomentService 1346 }, { 1347 type: FormBuilder 1348 }, { 1349 type: SpinnerService 1350 }, { 1351 type: void 0, 1352 decorators: [{ 1353 type: Inject, 1354 args: [MAT_DIALOG_DATA] 1355 }] 1356 }], null); 1357})(); 1358(() => { 1359 (typeof ngDevMode === "undefined" || ngDevMode) && ɵsetClassDebugInfo(AddContactMomentDialogComponent, { 1360 className: "AddContactMomentDialogComponent", 1361 filePath: "src/app/_dialogs/add-contact-moment-dialog/add-contact-moment-dialog.component.ts", 1362 lineNumber: 26 1363 }); 1364})();
1365export { ContactMomentDialogComponent, ContactMomentService, AddContactMomentDialogComponent, ContactMomentDialogModule }; 1366/**i18n:55a58011b6fcf12b70aba021cbe233ce2fe179902ce3502a5c6547ccaba0ed7f*/ 1367//# sourceMappingURL=chunk-GCAPU6VN.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.