@aggdirect/coolmap 2.5.4 → 2.6.0

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.
Files changed (57) hide show
  1. package/esm2022/lib/component/add-route/add-route.component.mjs +348 -0
  2. package/esm2022/lib/component/job-code/job-code.component.mjs +191 -0
  3. package/esm2022/lib/component/map/map.component.mjs +39 -0
  4. package/esm2022/lib/component/nav/layout/add-route-nav/add-route-nav.component.mjs +152 -0
  5. package/esm2022/lib/component/nav/layout/job-code-nav/job-code-nav.component.mjs +119 -0
  6. package/esm2022/lib/component/nav/nav.component.mjs +54 -0
  7. package/esm2022/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.mjs +77 -0
  8. package/esm2022/lib/component/route-jobcode-list/route-jobcode-list.component.mjs +318 -0
  9. package/esm2022/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.mjs +19 -0
  10. package/esm2022/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.mjs +37 -0
  11. package/esm2022/lib/component/shared/dialog/dialog.component.mjs +31 -0
  12. package/esm2022/lib/component/shared/estimation-display/estimation-display.component.mjs +18 -0
  13. package/esm2022/lib/component/shared/job-route-list/job-route-list.component.mjs +79 -0
  14. package/esm2022/lib/component/shared/jobcode-overview/jobcode-overview.component.mjs +24 -0
  15. package/esm2022/lib/component/shared/jobcode-status/jobcode-status.component.mjs +15 -0
  16. package/esm2022/lib/component/shared/route-info-card/route-info-card.component.mjs +57 -0
  17. package/esm2022/lib/coolmap.module.mjs +182 -0
  18. package/fesm2022/aggdirect-coolmap.mjs +1639 -0
  19. package/fesm2022/aggdirect-coolmap.mjs.map +1 -0
  20. package/lib/component/add-route/add-route.component.d.ts +1 -1
  21. package/lib/component/job-code/job-code.component.d.ts +1 -1
  22. package/lib/component/nav/layout/add-route-nav/add-route-nav.component.d.ts +1 -1
  23. package/lib/component/nav/layout/job-code-nav/job-code-nav.component.d.ts +1 -1
  24. package/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.d.ts +1 -1
  25. package/lib/component/route-jobcode-list/route-jobcode-list.component.d.ts +1 -1
  26. package/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.d.ts +1 -1
  27. package/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.d.ts +1 -1
  28. package/lib/component/shared/estimation-display/estimation-display.component.d.ts +1 -1
  29. package/lib/component/shared/job-route-list/job-route-list.component.d.ts +1 -1
  30. package/lib/component/shared/jobcode-overview/jobcode-overview.component.d.ts +1 -1
  31. package/lib/component/shared/jobcode-status/jobcode-status.component.d.ts +1 -1
  32. package/lib/component/shared/route-info-card/route-info-card.component.d.ts +1 -1
  33. package/lib/coolmap.module.d.ts +3 -4
  34. package/package.json +9 -14
  35. package/esm2020/lib/component/add-route/add-route.component.mjs +0 -335
  36. package/esm2020/lib/component/job-code/job-code.component.mjs +0 -181
  37. package/esm2020/lib/component/map/map.component.mjs +0 -37
  38. package/esm2020/lib/component/nav/layout/add-route-nav/add-route-nav.component.mjs +0 -146
  39. package/esm2020/lib/component/nav/layout/job-code-nav/job-code-nav.component.mjs +0 -114
  40. package/esm2020/lib/component/nav/nav.component.mjs +0 -52
  41. package/esm2020/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.mjs +0 -72
  42. package/esm2020/lib/component/route-jobcode-list/route-jobcode-list.component.mjs +0 -316
  43. package/esm2020/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.mjs +0 -19
  44. package/esm2020/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.mjs +0 -33
  45. package/esm2020/lib/component/shared/dialog/dialog.component.mjs +0 -29
  46. package/esm2020/lib/component/shared/estimation-display/estimation-display.component.mjs +0 -19
  47. package/esm2020/lib/component/shared/job-route-list/job-route-list.component.mjs +0 -71
  48. package/esm2020/lib/component/shared/jobcode-overview/jobcode-overview.component.mjs +0 -24
  49. package/esm2020/lib/component/shared/jobcode-status/jobcode-status.component.mjs +0 -14
  50. package/esm2020/lib/component/shared/route-info-card/route-info-card.component.mjs +0 -57
  51. package/esm2020/lib/coolmap.module.mjs +0 -185
  52. package/fesm2015/aggdirect-coolmap.mjs +0 -1619
  53. package/fesm2015/aggdirect-coolmap.mjs.map +0 -1
  54. package/fesm2020/aggdirect-coolmap.mjs +0 -1580
  55. package/fesm2020/aggdirect-coolmap.mjs.map +0 -1
  56. /package/{esm2020 → esm2022}/aggdirect-coolmap.mjs +0 -0
  57. /package/{esm2020 → esm2022}/public-api.mjs +0 -0
@@ -0,0 +1,1639 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, ViewChild, EventEmitter, Output, Input, Inject, NgModule } from '@angular/core';
3
+ import { Subject, takeUntil, startWith, map, distinctUntilChanged, debounceTime, fromEvent } from 'rxjs';
4
+ import * as i1 from '@aggdirect/coolmap-services';
5
+ import { DriversmsCardKey, DriverSmsCardEnum, JobCodeOverviewData, JobCodeOverviewEnum, EstinationData, EstinationEnum } from '@aggdirect/coolmap-services';
6
+ import * as i2 from '@angular/common';
7
+ import { CommonModule } from '@angular/common';
8
+ import * as i3 from '@angular/material/progress-bar';
9
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
10
+ import * as i3$1 from '@angular/material/tooltip';
11
+ import { MatTooltipModule } from '@angular/material/tooltip';
12
+ import * as i10 from '@angular/material/button';
13
+ import { MatButtonModule } from '@angular/material/button';
14
+ import { MatSidenavModule } from '@angular/material/sidenav';
15
+ import { MatSnackBarModule } from '@angular/material/snack-bar';
16
+ import * as i3$3 from '@angular/cdk/drag-drop';
17
+ import { DragDropModule } from '@angular/cdk/drag-drop';
18
+ import * as i3$2 from '@angular/forms';
19
+ import { Validators, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
20
+ import * as i4 from '@angular/material/input';
21
+ import { MatInputModule } from '@angular/material/input';
22
+ import * as i8$1 from '@angular/material/select';
23
+ import { MatSelectModule } from '@angular/material/select';
24
+ import * as i7 from '@angular/material/icon';
25
+ import { MatIconModule } from '@angular/material/icon';
26
+ import * as i8 from '@angular/material/autocomplete';
27
+ import { MatAutocompleteModule } from '@angular/material/autocomplete';
28
+ import * as i5 from '@angular/material/form-field';
29
+ import { MatFormFieldModule } from '@angular/material/form-field';
30
+ import * as i7$1 from '@angular/material/progress-spinner';
31
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
32
+ import * as i9 from '@angular/material/chips';
33
+ import { MatChipsModule } from '@angular/material/chips';
34
+ import * as i1$1 from '@angular/material/dialog';
35
+ import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
36
+ import * as i6 from '@angular/material/core';
37
+ import { MatNativeDateModule, MatPseudoCheckboxModule } from '@angular/material/core';
38
+ import { SelectionModel } from '@angular/cdk/collections';
39
+ import * as i10$1 from '@angular/material/datepicker';
40
+ import { MatDatepickerModule } from '@angular/material/datepicker';
41
+
42
+ class MapComponent {
43
+ coolmapService;
44
+ mapDiv;
45
+ enableProgress = true;
46
+ destroyer$ = new Subject();
47
+ constructor(coolmapService) {
48
+ this.coolmapService = coolmapService;
49
+ }
50
+ ngAfterViewInit() {
51
+ this.coolmapService.reintiatecoolmap.pipe(takeUntil(this.destroyer$)).subscribe((res) => {
52
+ this.enableProgress = true;
53
+ if (res) {
54
+ this.coolmapService.initiateMapForAddRoute(this.mapDiv.nativeElement).then((res) => {
55
+ this.enableProgress = false;
56
+ });
57
+ }
58
+ });
59
+ }
60
+ ngOnDestroy() {
61
+ this.destroyer$.next(true);
62
+ this.destroyer$.unsubscribe();
63
+ }
64
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: MapComponent, deps: [{ token: i1.CoolmapService }], target: i0.ɵɵFactoryTarget.Component });
65
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: MapComponent, selector: "app-map", viewQueries: [{ propertyName: "mapDiv", first: true, predicate: ["map"], descendants: true, static: true }], ngImport: i0, template: "<div>\n <mat-progress-bar *ngIf=\"enableProgress\" mode=\"indeterminate\"></mat-progress-bar>\n <div #map class=\"coolmap\" style=\"height: 100vh;\"></div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }] });
66
+ }
67
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: MapComponent, decorators: [{
68
+ type: Component,
69
+ args: [{ selector: 'app-map', template: "<div>\n <mat-progress-bar *ngIf=\"enableProgress\" mode=\"indeterminate\"></mat-progress-bar>\n <div #map class=\"coolmap\" style=\"height: 100vh;\"></div>\n</div>\n" }]
70
+ }], ctorParameters: () => [{ type: i1.CoolmapService }], propDecorators: { mapDiv: [{
71
+ type: ViewChild,
72
+ args: ['map', { static: true }]
73
+ }] } });
74
+
75
+ class NavComponent {
76
+ utils;
77
+ coolMap;
78
+ drawer = new EventEmitter();
79
+ changeNav = new EventEmitter();
80
+ navValue = 'Jobcode';
81
+ isnavChange = true;
82
+ paddinForJobCode = { top: 0, bottom: 250, left: 500, right: 400 };
83
+ paddinForViewRoute = { top: 0, bottom: 400, left: 400, right: 0 };
84
+ destroyer$ = new Subject();
85
+ constructor(utils, coolMap) {
86
+ this.utils = utils;
87
+ this.coolMap = coolMap;
88
+ this.utils.navChangeObserve.pipe(takeUntil(this.destroyer$)).subscribe(res => { this.isnavChange = res; });
89
+ this.coolMap.setPadding(this.paddinForJobCode);
90
+ }
91
+ openDrawer() { this.drawer.emit(true); }
92
+ chnageNav(name) {
93
+ if (this.isnavChange) {
94
+ this.changeNav.emit(name);
95
+ this.navValue = name;
96
+ this.coolMap.clearBound();
97
+ if (name === 'Addroute') {
98
+ this.coolMap.setPadding(this.paddinForViewRoute);
99
+ }
100
+ else {
101
+ this.coolMap.setPadding(this.paddinForJobCode);
102
+ }
103
+ this.utils.clearOptions();
104
+ }
105
+ }
106
+ ngOnDestroy() {
107
+ this.destroyer$.next(true);
108
+ this.destroyer$.unsubscribe();
109
+ }
110
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NavComponent, deps: [{ token: i1.UtilsService }, { token: i1.CoolmapService }], target: i0.ɵɵFactoryTarget.Component });
111
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: NavComponent, selector: "app-nav", outputs: { drawer: "drawer", changeNav: "changeNav" }, ngImport: i0, template: "<div class=\"nav\">\n <button (click)=\"openDrawer()\" class=\"toggle\">\n <img src=\"assets/images/toggle.svg\" alt=\"\" />\n </button>\n\n <ul class=\"m-100\">\n <li [ngClass]=\"{'active': navValue === 'Jobcode'}\">\n <a mat-raised-button #tooltip=\"matTooltip\" matTooltip=\"Job Code\" aria-label=\"Job-code\" (click)=\"chnageNav('Jobcode')\">\n <img src=\"assets/images/job-code.svg\" alt=\"\" />\n </a>\n </li>\n\n <li [ngClass]=\"{'active': navValue === 'Addroute', 'disabled': !isnavChange }\">\n <a mat-raised-button #tooltip=\"matTooltip\" matTooltip=\"View Route\" aria-label=\"View-route\" (click)=\"chnageNav('Addroute')\">\n <img src=\"assets/images/route.svg\" alt=\"\" />\n </a>\n </li>\n </ul>\n</div>\n", styles: [".nav{background:#e8e8e8;height:100vh;padding:15px 0;display:flex;align-items:center;flex-direction:column}.nav button{background:white;border-radius:15px;padding:5px 6px}.nav button img{width:28px}.nav ul{display:flex;flex-direction:column;align-items:center}.nav ul li{margin:10px 0;padding:0 5px;border-right:2px solid #e8e8e8}.nav ul li:hover{border-right:2px solid #326ad3;padding:0 5px}.nav ul li.disabled a{pointer-events:none;opacity:.5}.nav ul li.disabled:hover{border-right:2px solid #e8e8e8}.nav ul li a{padding:6px 0;display:block;border-radius:15px;min-width:42px;box-shadow:none;line-height:30px}.nav ul li a img{width:27px}.nav ul li a:hover{background:white}.nav ul li a:hover img{filter:invert(.2) sepia(1) saturate(8) hue-rotate(180deg)}.nav ul li.active{border-right:2px solid #326ad3}.nav ul li.active a{background:white}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: i10.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]", exportAs: ["matButton", "matAnchor"] }] });
112
+ }
113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NavComponent, decorators: [{
114
+ type: Component,
115
+ args: [{ selector: 'app-nav', template: "<div class=\"nav\">\n <button (click)=\"openDrawer()\" class=\"toggle\">\n <img src=\"assets/images/toggle.svg\" alt=\"\" />\n </button>\n\n <ul class=\"m-100\">\n <li [ngClass]=\"{'active': navValue === 'Jobcode'}\">\n <a mat-raised-button #tooltip=\"matTooltip\" matTooltip=\"Job Code\" aria-label=\"Job-code\" (click)=\"chnageNav('Jobcode')\">\n <img src=\"assets/images/job-code.svg\" alt=\"\" />\n </a>\n </li>\n\n <li [ngClass]=\"{'active': navValue === 'Addroute', 'disabled': !isnavChange }\">\n <a mat-raised-button #tooltip=\"matTooltip\" matTooltip=\"View Route\" aria-label=\"View-route\" (click)=\"chnageNav('Addroute')\">\n <img src=\"assets/images/route.svg\" alt=\"\" />\n </a>\n </li>\n </ul>\n</div>\n", styles: [".nav{background:#e8e8e8;height:100vh;padding:15px 0;display:flex;align-items:center;flex-direction:column}.nav button{background:white;border-radius:15px;padding:5px 6px}.nav button img{width:28px}.nav ul{display:flex;flex-direction:column;align-items:center}.nav ul li{margin:10px 0;padding:0 5px;border-right:2px solid #e8e8e8}.nav ul li:hover{border-right:2px solid #326ad3;padding:0 5px}.nav ul li.disabled a{pointer-events:none;opacity:.5}.nav ul li.disabled:hover{border-right:2px solid #e8e8e8}.nav ul li a{padding:6px 0;display:block;border-radius:15px;min-width:42px;box-shadow:none;line-height:30px}.nav ul li a img{width:27px}.nav ul li a:hover{background:white}.nav ul li a:hover img{filter:invert(.2) sepia(1) saturate(8) hue-rotate(180deg)}.nav ul li.active{border-right:2px solid #326ad3}.nav ul li.active a{background:white}\n"] }]
116
+ }], ctorParameters: () => [{ type: i1.UtilsService }, { type: i1.CoolmapService }], propDecorators: { drawer: [{
117
+ type: Output
118
+ }], changeNav: [{
119
+ type: Output
120
+ }] } });
121
+
122
+ class SmsCardDetailsOverviewComponent {
123
+ jobValue;
124
+ label = DriversmsCardKey;
125
+ overViewEnum = DriverSmsCardEnum;
126
+ constructor() { }
127
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: SmsCardDetailsOverviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
128
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: SmsCardDetailsOverviewComponent, selector: "app-sms-card-details-overview", inputs: { jobValue: "jobValue" }, ngImport: i0, template: "<ng-container *ngFor=\"let item of label\">\n <span>\n <label>{{overViewEnum[item]}}</label>\n <ng-container *ngIf=\"item !== 'values'\">{{jobValue[item] ? jobValue[item] : 'N/A'}}</ng-container>\n <ng-container *ngIf=\"item === 'values'\">{{jobValue[item]['Done'] + jobValue[item]['Ongoing'] + jobValue[item]['Open']}}</ng-container>\n </span>\n</ng-container>\n", styles: ["span{display:flex;margin-bottom:12px;font-size:.8rem;align-items:center}span label{font-weight:600;width:37%}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
129
+ }
130
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: SmsCardDetailsOverviewComponent, decorators: [{
131
+ type: Component,
132
+ args: [{ selector: 'app-sms-card-details-overview', template: "<ng-container *ngFor=\"let item of label\">\n <span>\n <label>{{overViewEnum[item]}}</label>\n <ng-container *ngIf=\"item !== 'values'\">{{jobValue[item] ? jobValue[item] : 'N/A'}}</ng-container>\n <ng-container *ngIf=\"item === 'values'\">{{jobValue[item]['Done'] + jobValue[item]['Ongoing'] + jobValue[item]['Open']}}</ng-container>\n </span>\n</ng-container>\n", styles: ["span{display:flex;margin-bottom:12px;font-size:.8rem;align-items:center}span label{font-weight:600;width:37%}\n"] }]
133
+ }], ctorParameters: () => [], propDecorators: { jobValue: [{
134
+ type: Input
135
+ }] } });
136
+
137
+ class RouteJobCodeListComponent {
138
+ coolMap;
139
+ utils;
140
+ loader = true;
141
+ type = '';
142
+ data = [];
143
+ currentNav = '';
144
+ emitroute = new EventEmitter();
145
+ showAllRoute = new EventEmitter();
146
+ preventMouseout = false;
147
+ filterList = this.data;
148
+ searchTerm;
149
+ isDriverList = false;
150
+ selectedRoute = new SelectionModel(true, []);
151
+ driverList;
152
+ preventListSelect = false;
153
+ clearJobDetailsFromList = new EventEmitter();
154
+ preventDetailsClose = false;
155
+ messageLoader = false;
156
+ driverMessage = new FormControl('', [Validators.maxLength(256)]);
157
+ clearListSeletion;
158
+ isSmsList = false;
159
+ constructor(coolMap, utils) {
160
+ this.coolMap = coolMap;
161
+ this.utils = utils;
162
+ this.driverList = [];
163
+ }
164
+ ngOnInit() {
165
+ this.utils.getpreVentJobdetailclose.subscribe(res => { this.preventDetailsClose = res; });
166
+ this.utils.removeMapEntityUtility.subscribe((res) => { this.passRoute(res); });
167
+ }
168
+ passRoute(job) {
169
+ this.data.forEach((each) => { if (each['route_id'] !== job['route_id']) {
170
+ each['isActive'] = false;
171
+ }
172
+ else {
173
+ each['isActive'] = true;
174
+ } });
175
+ if (this.type == 'addroute')
176
+ this.filterList.forEach(ele => this.coolMap.filterRoute(ele['route_id'], 'none'));
177
+ }
178
+ selectRoute(route) {
179
+ if (!this.preventListSelect) {
180
+ this.preventListSelect = true;
181
+ this.selectedRoute.toggle(route);
182
+ this.clearJobDetailsFromList.emit(true);
183
+ this.utils.preVentJobdetailclose.next(false);
184
+ this.filterList.forEach(ele => this.coolMap.filterRoute(ele['job_id'], 'none'));
185
+ this.clearList();
186
+ this.selectedRoute.selected.forEach((ele, index) => {
187
+ this.coolMap.filterRoute(ele['job_id'], 'visible', ((this.selectedRoute.selected.length - 1) === index)).then(() => {
188
+ this.preventListSelect = false;
189
+ });
190
+ });
191
+ if (!this.selectedRoute.selected.length) {
192
+ this.preventListSelect = false;
193
+ this.data.forEach(ele => this.coolMap.filterRoute(ele['job_id'], 'visible'));
194
+ }
195
+ ;
196
+ }
197
+ }
198
+ checkroutes(route) {
199
+ const selectedRoute = this.selectedRoute.selected;
200
+ this.filterList = this.filterList.map(ele => { ele['isSelected'] = false; return ele; });
201
+ if (selectedRoute.length > 0) {
202
+ selectedRoute.forEach(ele => {
203
+ if (route['order_number'] === ele['order_number']) {
204
+ ele['isSelected'] = true;
205
+ }
206
+ });
207
+ }
208
+ return route;
209
+ }
210
+ ngOnChanges(changes) {
211
+ setTimeout(() => {
212
+ if (this.currentNav === 'Addroute' && (this.data.length < this.filterList.length)) {
213
+ const index = this.filterList.findIndex(ele => ele.isActive);
214
+ if (index > 0)
215
+ this.filterList[index].isActive = false;
216
+ this.data.forEach((ele, indexForData) => {
217
+ const id = (ele['job_id'] ? ele['job_id'] : ele['route_id']);
218
+ this.coolMap.plotRoute(ele, id, this.type, false, (indexForData === (this.data.length - 1))).then((res) => {
219
+ });
220
+ });
221
+ }
222
+ }, 500);
223
+ if (changes['data'] && changes['data']['currentValue']) {
224
+ this.filterList = changes['data']['currentValue'];
225
+ if (this.searchTerm) {
226
+ if (this.searchTerm.length > 0) {
227
+ this.data = this.utils.getSearchResults(changes['data']['currentValue'], this.searchTerm);
228
+ this.filterList = this.data;
229
+ }
230
+ else {
231
+ this.filterList = changes['data']['currentValue'];
232
+ }
233
+ }
234
+ if (this.type === 'jobcode') {
235
+ this.loader = true;
236
+ this.clearList();
237
+ if (this.filterList.length === 0)
238
+ this.loader = false;
239
+ }
240
+ if (this.type !== 'jobcode') {
241
+ if (changes['data']['previousValue'] && this.currentNav === 'addForm') {
242
+ const activeRoute = changes['data']['previousValue'].find((ele) => ele.isActive);
243
+ if (activeRoute) {
244
+ this.filterList.map((item) => {
245
+ if (item.route_id === activeRoute.route_id) {
246
+ item.isActive = true;
247
+ }
248
+ });
249
+ }
250
+ }
251
+ }
252
+ if (changes['data']['previousValue'] && this.currentNav !== 'addForm') {
253
+ this.coolMap.removeJobFromMap(changes['data']['previousValue']);
254
+ this.selectedRoute.clear();
255
+ }
256
+ ;
257
+ if (this.currentNav !== 'addForm') {
258
+ changes['data']['currentValue'].forEach((ele, indexForData) => {
259
+ const id = (ele['job_id'] ? ele['job_id'] : ele['route_id']);
260
+ if (this.type === 'jobcode')
261
+ ele.materialLabel = ele.material;
262
+ this.coolMap.plotRoute(ele, id, this.type, false, (indexForData === (this.data.length - 1))).then((res) => {
263
+ if (indexForData === (this.data.length - 1)) {
264
+ this.loader = false;
265
+ this.utils.preventnavChange.next(true);
266
+ }
267
+ });
268
+ });
269
+ }
270
+ }
271
+ if (changes['searchTerm']) {
272
+ if (this.filterList) {
273
+ this.data = this.filterList;
274
+ this.clearList();
275
+ if (changes['searchTerm']['currentValue'].length > 0) {
276
+ this.coolMap.removeRouteAndMarker(1);
277
+ this.data = this.utils.getSearchResults(this.data, changes['searchTerm']['currentValue']);
278
+ }
279
+ else {
280
+ this.data = this.filterList;
281
+ }
282
+ setTimeout(() => {
283
+ this.coolMap.clearBoundWithCordinates();
284
+ if (this.currentNav !== 'addForm' && !this.selectedRoute['selected'].length) {
285
+ this.coolMap.removeRouteAndMarker(1);
286
+ this.toggleFilterRoute(this.filterList);
287
+ }
288
+ }, 500);
289
+ if (this.currentNav !== 'addForm' && this.selectedRoute['selected'].length) {
290
+ if (this.data && this.data.length > 0) {
291
+ this.clearList();
292
+ this.clearJobDetailsFromList.emit(true);
293
+ this.coolMap.removeJobFromMap(this.selectedRoute.selected);
294
+ setTimeout(() => {
295
+ this.data.forEach((ele, indexForData) => {
296
+ this.coolMap.plotRoute(ele, ele['job_id'], this.type, false, (indexForData === (this.data.length - 1))).then(() => {
297
+ if (indexForData === (this.data.length - 1)) {
298
+ this.loader = false;
299
+ this.utils.preventnavChange.next(true);
300
+ }
301
+ if (this.selectedRoute['selected'].length && this.selectedRoute['selected'][0]['job_id'] === ele['job_id']) {
302
+ this.selectedRoute.clear();
303
+ }
304
+ });
305
+ });
306
+ }, 500);
307
+ }
308
+ }
309
+ }
310
+ }
311
+ }
312
+ showRoute() {
313
+ this.utils.preventnavChange.next(false);
314
+ this.loader = true;
315
+ this.clearList();
316
+ this.showAllRoute.emit(true);
317
+ if (this.filterList && this.filterList.length > 0) {
318
+ this.coolMap.removeJobFromMap(this.selectedRoute.selected);
319
+ setTimeout(() => {
320
+ this.filterList.forEach((ele, indexForData) => {
321
+ this.coolMap.plotRoute(ele, ele['job_id'], this.type, false, (indexForData === this.filterList.length - 1)).then(() => {
322
+ if (indexForData === this.filterList.length - 1) {
323
+ this.loader = false;
324
+ this.utils.preventnavChange.next(true);
325
+ }
326
+ if (this.selectedRoute['selected'].length && this.selectedRoute['selected'][0]['job_id'] === ele['job_id']) {
327
+ this.selectedRoute.clear();
328
+ }
329
+ });
330
+ });
331
+ }, 500);
332
+ }
333
+ }
334
+ toggleDrivermenu(event) {
335
+ const mouseevntType = event.mouseevntType;
336
+ let route = event.route;
337
+ const isHoverOut = event.isHoverOut;
338
+ if (typeof (mouseevntType) === 'string') {
339
+ if (this.preventMouseout) {
340
+ this.isDriverList = !this.isDriverList;
341
+ }
342
+ ;
343
+ this.preventMouseout = true;
344
+ }
345
+ if (typeof (mouseevntType) === 'boolean' && !mouseevntType && !this.preventMouseout) {
346
+ this.isDriverList = mouseevntType;
347
+ }
348
+ ;
349
+ if (typeof (mouseevntType) === 'boolean' && mouseevntType && !this.preventMouseout) {
350
+ this.isDriverList = mouseevntType;
351
+ }
352
+ ;
353
+ if (this.preventMouseout && !this.isDriverList)
354
+ this.preventMouseout = false;
355
+ if (isHoverOut) {
356
+ if (this.preventMouseout) {
357
+ route = this.utils.getdictValue('driver-details');
358
+ this.driverList = route;
359
+ }
360
+ if (!this.preventMouseout) {
361
+ this.driverList = route;
362
+ }
363
+ }
364
+ else {
365
+ this.driverList = route;
366
+ }
367
+ }
368
+ visiblesection(value) { if (this.type === value) {
369
+ return true;
370
+ }
371
+ else
372
+ return false; }
373
+ toggleFilterRoute(filterList) {
374
+ filterList.forEach((ele) => {
375
+ const filterItem = (this.type === 'jobcode') ? 'job_id' : 'route_id';
376
+ const index = this.data.findIndex((ele1) => { return (ele1[`${filterItem}`] === ele[`${filterItem}`]); });
377
+ const id = (ele['job_id'] ? ele['job_id'] : ele['route_id']);
378
+ if (id && index < 0)
379
+ this.coolMap.filterRoute(id, 'none');
380
+ if (id && index >= 0) {
381
+ this.data[index].isActive = false;
382
+ this.coolMap.filterRoute(id, 'visible');
383
+ this.coolMap.extendBound(ele['path'], (index === (this.data.length - 1)));
384
+ }
385
+ ;
386
+ });
387
+ }
388
+ clearList() {
389
+ this.isDriverList = false;
390
+ this.driverList = null;
391
+ this.preventMouseout = false;
392
+ this.isSmsList = false;
393
+ }
394
+ sendMessage() {
395
+ this.messageLoader = true;
396
+ if (this.driverMessage.valid) {
397
+ const data = {
398
+ order_number: this.driverList['order_number'],
399
+ date: this.driverList['date'],
400
+ message: this.driverMessage.value,
401
+ };
402
+ this.utils.postdata('jobs_report_chat', data).subscribe((res) => {
403
+ if (res['data']['status'] === 'Success.') {
404
+ this.messageLoader = false;
405
+ this.driverMessage.reset();
406
+ this.utils.openSnackBar('Message Sent', 'success');
407
+ }
408
+ else {
409
+ this.messageLoader = false;
410
+ this.utils.openSnackBar('Message not sent', 'error');
411
+ }
412
+ }, err => { if (err) {
413
+ this.messageLoader = false;
414
+ } });
415
+ }
416
+ }
417
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RouteJobCodeListComponent, deps: [{ token: i1.CoolmapService }, { token: i1.UtilsService }], target: i0.ɵɵFactoryTarget.Component });
418
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: RouteJobCodeListComponent, selector: "app-route-jobcode-list", inputs: { loader: "loader", type: "type", data: "data", currentNav: "currentNav", searchTerm: "searchTerm", clearListSeletion: "clearListSeletion" }, outputs: { emitroute: "emitroute", showAllRoute: "showAllRoute", clearJobDetailsFromList: "clearJobDetailsFromList" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"scrollprt addroutelist\" [class.viewroute]=\"visiblesection('addroute')\"\n [class.jobList]=\"visiblesection('jobcode')\">\n <button (click)=\"showRoute()\" [disabled]=\"loader\" *ngIf=\"selectedRoute.selected.length\" class=\"show_routebtn\">Show all\n route</button>\n\n <!-- // TODO: Replace perfect scrollbar -->\n <!-- <perfect-scrollbar [class.jobscroll]=\"visiblesection('jobcode')\">\n <mat-spinner *ngIf=\"loader\"></mat-spinner>\n <ul *ngIf=\"!loader && data.length > 0\">\n <li [class.active]=\"route['isActive'] && visiblesection('addroute')\" *ngFor=\"let route of data\">\n <app-job-code-list-card *ngIf=\"visiblesection('jobcode')\" (toggleDrivermenu)=\"toggleDrivermenu($event)\"\n (routeSeletion)=\"selectRoute($event)\" [preventCloseDetails]=\"preventDetailsClose\" [emitJobdetails]=\"{emitroute, clearJobDetailsFromList}\" [route]=\"checkroutes(route)\"></app-job-code-list-card>\n <app-view-route-list-card [emitrouteevent]=\"emitroute\" *ngIf=\"visiblesection('addroute')\"\n [route]=\"route\"></app-view-route-list-card>\n </li>\n </ul>\n <p *ngIf=\"!loader && data.length === 0\">{{visiblesection('addroute') ? 'No Route found' : 'No Job code found.'}}</p>\n </perfect-scrollbar> -->\n</div>\n\n<div class=\"driver_list\" *ngIf=\"isDriverList\">\n <div class=\"driver_headingprt\">\n <h2>Driver List</h2>\n <button *ngIf=\"driverList.driver_list?.length > 0\" (click)=\"isSmsList = true\">SMS</button>\n <div class=\"closebtn\" (click)=\"isDriverList = false; preventMouseout = false; isSmsList = false\">\n <mat-icon>clear</mat-icon>\n </div>\n </div>\n <ul class=\"driverList\" *ngIf=\"driverList && driverList.driver_list\">\n <li *ngFor=\"let driver of driverList?.driver_list\">\n <img src=\"assets/images/driver_icon.png\" [alt]=\"driver['driver_name']\" />\n <div class=\"driver_detail\">\n <b>{{driver['driver_name']}}</b> <span>{{driver['trucking_company']}}</span>\n <div class=\"cont_del\">\n <small>Driver contact: <b>{{driver['driver_phone'] ? driver['driver_phone'] : 'N/A'}}</b></small>\n <small>Company contact: <b>{{driver['trucking_company_phone'] ? driver['trucking_company_phone'] : 'N/A'}}</b></small>\n </div>\n </div>\n </li>\n <p *ngIf=\"driverList.driver_list?.length === 0\" style=\"font-weight:700; text-align:center;\">\n No Driver found\n </p>\n </ul>\n <div class=\"smslist\" *ngIf=\"isSmsList\">\n <div class=\"heading\">\n <h2>SMS All Drivers</h2>\n <div class=\"closebtn\" (click)=\"isSmsList = false\">\n <mat-icon>clear</mat-icon>\n </div>\n </div>\n <div class=\"detailprt\">\n <app-sms-card-details-overview [jobValue]=\"driverList\"></app-sms-card-details-overview>\n <div class=\"form_input\">\n <mat-form-field class=\"example-full-width\">\n <textarea matInput placeholder=\"Text here...\" autocomplete=\"nope\" column=\"10\"\n [formControl]=\"driverMessage\"></textarea>\n <mat-hint>{{driverMessage.value?.length}} / 256</mat-hint>\n </mat-form-field>\n <button *ngIf=\"!messageLoader\" [disabled]=\"!driverMessage.value || driverMessage.invalid\" (click)=\"sendMessage()\">\n Send SMS\n </button>\n </div>\n </div>\n <div class=\"loader\">\n <mat-spinner *ngIf=\"messageLoader\"></mat-spinner>\n </div>\n </div>\n</div>\n", styles: [".driver_iconprt{position:absolute;right:10px;top:12px;z-index:9999}.driver_iconprt img{width:25px;height:25px}.driver_list{background:white;position:fixed;width:300px;top:10px;left:360px;border-top-left-radius:20px;border-top-right-radius:20px}.driver_list .driver_headingprt{display:flex;justify-content:space-between;align-items:center;padding:0 15px}.driver_list .driver_headingprt button{background:none;border:1px solid #ccc;border-radius:10px;padding:5px 20px}.driver_list .driver_headingprt button:hover{background:#326ad3;color:#fff}.driver_list h2{font-size:20px}.driver_list .driverList{height:300px;overflow:auto}.driver_list .driverList li{display:flex;padding:10px;align-items:flex-start;cursor:pointer;border-bottom:1px solid white;background:#eee}.driver_list .driverList li img{width:35px;height:35px;border-radius:100%;margin-right:10px}.driver_list .driverList li .driver_detail{width:calc(100% - 45px);display:flex;flex-direction:column;justify-content:flex-start}.driver_list .driverList li .driver_detail b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:135px;font-size:.9rem}.driver_list .driverList li .driver_detail span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px;font-size:.8rem}.driver_list:after{height:10px;background:white;border-bottom-right-radius:20px;border-bottom-left-radius:20px;content:\"\";position:absolute;bottom:-9px;width:100%}.smslist{background:white;position:absolute;width:480px;top:0;left:105%;border-radius:20px;padding-bottom:20px}.smslist .heading{display:flex;justify-content:space-between;align-items:center;padding:0 15px}.smslist .detailprt{padding:0 15px}.smslist .detailprt span{display:flex;margin-bottom:12px;font-size:.8rem;align-items:center}.smslist .detailprt span label{font-weight:600;width:37%}.smslist .detailprt .form_input{display:flex;flex-direction:column;font-size:.8rem}.smslist .detailprt .form_input button{background:#326ad3;padding:10px 18px;color:#fff;font-size:.8125rem;border-radius:30px;display:flex;align-self:flex-end}.closebtn{box-shadow:0 0 5px #0000001c;border-radius:100%;width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer;background:#f5f5f5}.show_routebtn{font-size:.9rem;margin-bottom:20px;padding:6px 11px;position:absolute;top:8px;right:10px;background-color:transparent;color:#3f51b5;border:1px solid #3f51b5;border-radius:10px;box-shadow:none}.show_routebtn:hover{background-color:#3f51b5;color:#fff}.cont_del{margin-top:10px}.cont_del small{display:block}.jobList ul{margin:0 15px 0 10px;width:100%}.jobList ul li{position:relative;background:#fbfbfb;padding:10px;border-radius:15px;margin-bottom:5px;border:1px solid #fbfbfb;border-left:3px solid #fbfbfb;cursor:pointer;height:inherit}@media (min-width: 2500px){.jobList ul li{height:7.65vh}}@media (min-width: 3300px){.jobList ul li{height:5.61vh}}.viewroute ul{margin:0 15px;width:100%}.viewroute ul li{position:relative;background:#fbfbfb;padding:7px 10px;border-radius:15px;margin-bottom:5px;border:1px solid #fbfbfb;border-left:3px solid #fbfbfb;cursor:pointer;height:16.4vh}@media (min-width: 1600px){.viewroute ul li{height:12.4vh}}.viewroute ul li.active{border:1px solid #39c471;border-left:3px solid #39c471}.loader{position:absolute;height:100%;top:0;left:0;width:100%;display:flex;align-items:center;justify-content:center;pointer-events:none}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i7$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: SmsCardDetailsOverviewComponent, selector: "app-sms-card-details-overview", inputs: ["jobValue"] }] });
419
+ }
420
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RouteJobCodeListComponent, decorators: [{
421
+ type: Component,
422
+ args: [{ selector: 'app-route-jobcode-list', template: "<div class=\"scrollprt addroutelist\" [class.viewroute]=\"visiblesection('addroute')\"\n [class.jobList]=\"visiblesection('jobcode')\">\n <button (click)=\"showRoute()\" [disabled]=\"loader\" *ngIf=\"selectedRoute.selected.length\" class=\"show_routebtn\">Show all\n route</button>\n\n <!-- // TODO: Replace perfect scrollbar -->\n <!-- <perfect-scrollbar [class.jobscroll]=\"visiblesection('jobcode')\">\n <mat-spinner *ngIf=\"loader\"></mat-spinner>\n <ul *ngIf=\"!loader && data.length > 0\">\n <li [class.active]=\"route['isActive'] && visiblesection('addroute')\" *ngFor=\"let route of data\">\n <app-job-code-list-card *ngIf=\"visiblesection('jobcode')\" (toggleDrivermenu)=\"toggleDrivermenu($event)\"\n (routeSeletion)=\"selectRoute($event)\" [preventCloseDetails]=\"preventDetailsClose\" [emitJobdetails]=\"{emitroute, clearJobDetailsFromList}\" [route]=\"checkroutes(route)\"></app-job-code-list-card>\n <app-view-route-list-card [emitrouteevent]=\"emitroute\" *ngIf=\"visiblesection('addroute')\"\n [route]=\"route\"></app-view-route-list-card>\n </li>\n </ul>\n <p *ngIf=\"!loader && data.length === 0\">{{visiblesection('addroute') ? 'No Route found' : 'No Job code found.'}}</p>\n </perfect-scrollbar> -->\n</div>\n\n<div class=\"driver_list\" *ngIf=\"isDriverList\">\n <div class=\"driver_headingprt\">\n <h2>Driver List</h2>\n <button *ngIf=\"driverList.driver_list?.length > 0\" (click)=\"isSmsList = true\">SMS</button>\n <div class=\"closebtn\" (click)=\"isDriverList = false; preventMouseout = false; isSmsList = false\">\n <mat-icon>clear</mat-icon>\n </div>\n </div>\n <ul class=\"driverList\" *ngIf=\"driverList && driverList.driver_list\">\n <li *ngFor=\"let driver of driverList?.driver_list\">\n <img src=\"assets/images/driver_icon.png\" [alt]=\"driver['driver_name']\" />\n <div class=\"driver_detail\">\n <b>{{driver['driver_name']}}</b> <span>{{driver['trucking_company']}}</span>\n <div class=\"cont_del\">\n <small>Driver contact: <b>{{driver['driver_phone'] ? driver['driver_phone'] : 'N/A'}}</b></small>\n <small>Company contact: <b>{{driver['trucking_company_phone'] ? driver['trucking_company_phone'] : 'N/A'}}</b></small>\n </div>\n </div>\n </li>\n <p *ngIf=\"driverList.driver_list?.length === 0\" style=\"font-weight:700; text-align:center;\">\n No Driver found\n </p>\n </ul>\n <div class=\"smslist\" *ngIf=\"isSmsList\">\n <div class=\"heading\">\n <h2>SMS All Drivers</h2>\n <div class=\"closebtn\" (click)=\"isSmsList = false\">\n <mat-icon>clear</mat-icon>\n </div>\n </div>\n <div class=\"detailprt\">\n <app-sms-card-details-overview [jobValue]=\"driverList\"></app-sms-card-details-overview>\n <div class=\"form_input\">\n <mat-form-field class=\"example-full-width\">\n <textarea matInput placeholder=\"Text here...\" autocomplete=\"nope\" column=\"10\"\n [formControl]=\"driverMessage\"></textarea>\n <mat-hint>{{driverMessage.value?.length}} / 256</mat-hint>\n </mat-form-field>\n <button *ngIf=\"!messageLoader\" [disabled]=\"!driverMessage.value || driverMessage.invalid\" (click)=\"sendMessage()\">\n Send SMS\n </button>\n </div>\n </div>\n <div class=\"loader\">\n <mat-spinner *ngIf=\"messageLoader\"></mat-spinner>\n </div>\n </div>\n</div>\n", styles: [".driver_iconprt{position:absolute;right:10px;top:12px;z-index:9999}.driver_iconprt img{width:25px;height:25px}.driver_list{background:white;position:fixed;width:300px;top:10px;left:360px;border-top-left-radius:20px;border-top-right-radius:20px}.driver_list .driver_headingprt{display:flex;justify-content:space-between;align-items:center;padding:0 15px}.driver_list .driver_headingprt button{background:none;border:1px solid #ccc;border-radius:10px;padding:5px 20px}.driver_list .driver_headingprt button:hover{background:#326ad3;color:#fff}.driver_list h2{font-size:20px}.driver_list .driverList{height:300px;overflow:auto}.driver_list .driverList li{display:flex;padding:10px;align-items:flex-start;cursor:pointer;border-bottom:1px solid white;background:#eee}.driver_list .driverList li img{width:35px;height:35px;border-radius:100%;margin-right:10px}.driver_list .driverList li .driver_detail{width:calc(100% - 45px);display:flex;flex-direction:column;justify-content:flex-start}.driver_list .driverList li .driver_detail b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:135px;font-size:.9rem}.driver_list .driverList li .driver_detail span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px;font-size:.8rem}.driver_list:after{height:10px;background:white;border-bottom-right-radius:20px;border-bottom-left-radius:20px;content:\"\";position:absolute;bottom:-9px;width:100%}.smslist{background:white;position:absolute;width:480px;top:0;left:105%;border-radius:20px;padding-bottom:20px}.smslist .heading{display:flex;justify-content:space-between;align-items:center;padding:0 15px}.smslist .detailprt{padding:0 15px}.smslist .detailprt span{display:flex;margin-bottom:12px;font-size:.8rem;align-items:center}.smslist .detailprt span label{font-weight:600;width:37%}.smslist .detailprt .form_input{display:flex;flex-direction:column;font-size:.8rem}.smslist .detailprt .form_input button{background:#326ad3;padding:10px 18px;color:#fff;font-size:.8125rem;border-radius:30px;display:flex;align-self:flex-end}.closebtn{box-shadow:0 0 5px #0000001c;border-radius:100%;width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer;background:#f5f5f5}.show_routebtn{font-size:.9rem;margin-bottom:20px;padding:6px 11px;position:absolute;top:8px;right:10px;background-color:transparent;color:#3f51b5;border:1px solid #3f51b5;border-radius:10px;box-shadow:none}.show_routebtn:hover{background-color:#3f51b5;color:#fff}.cont_del{margin-top:10px}.cont_del small{display:block}.jobList ul{margin:0 15px 0 10px;width:100%}.jobList ul li{position:relative;background:#fbfbfb;padding:10px;border-radius:15px;margin-bottom:5px;border:1px solid #fbfbfb;border-left:3px solid #fbfbfb;cursor:pointer;height:inherit}@media (min-width: 2500px){.jobList ul li{height:7.65vh}}@media (min-width: 3300px){.jobList ul li{height:5.61vh}}.viewroute ul{margin:0 15px;width:100%}.viewroute ul li{position:relative;background:#fbfbfb;padding:7px 10px;border-radius:15px;margin-bottom:5px;border:1px solid #fbfbfb;border-left:3px solid #fbfbfb;cursor:pointer;height:16.4vh}@media (min-width: 1600px){.viewroute ul li{height:12.4vh}}.viewroute ul li.active{border:1px solid #39c471;border-left:3px solid #39c471}.loader{position:absolute;height:100%;top:0;left:0;width:100%;display:flex;align-items:center;justify-content:center;pointer-events:none}\n"] }]
423
+ }], ctorParameters: () => [{ type: i1.CoolmapService }, { type: i1.UtilsService }], propDecorators: { loader: [{
424
+ type: Input
425
+ }], type: [{
426
+ type: Input
427
+ }], data: [{
428
+ type: Input
429
+ }], currentNav: [{
430
+ type: Input
431
+ }], emitroute: [{
432
+ type: Output
433
+ }], showAllRoute: [{
434
+ type: Output
435
+ }], searchTerm: [{
436
+ type: Input
437
+ }], clearJobDetailsFromList: [{
438
+ type: Output
439
+ }], clearListSeletion: [{
440
+ type: Input
441
+ }] } });
442
+
443
+ class AddRouteNavComponent {
444
+ utils;
445
+ config;
446
+ filterForm = new FormGroup({ search: new FormControl() });
447
+ filteredOptions;
448
+ filters = [];
449
+ loaderVal = false;
450
+ routes = [];
451
+ changeNav = new EventEmitter();
452
+ navValue = '';
453
+ addemit = new EventEmitter();
454
+ updateRouteList = false;
455
+ customerRepoDetails;
456
+ destroyer$ = new Subject();
457
+ preventListUpdate = false;
458
+ unitList;
459
+ materialsList;
460
+ constructor(utils, config) {
461
+ this.utils = utils;
462
+ this.config = config;
463
+ this.filteredOptions = this.filterForm.get('search')?.valueChanges.pipe(startWith(''), map(value => this.utils.filter(value, this.filters)));
464
+ }
465
+ showAddForm() { this.changeNav.emit('addForm'); this.addemit.emit(''); }
466
+ filterSearch(e) {
467
+ this.changeNav.emit({ type: 'Addroute' });
468
+ this.preventListUpdate = true;
469
+ this.filterForm.controls.search.setValue(null);
470
+ this.filters = [{ name: e.source.value.label, type: e.source.value.type, value: e.source.value }];
471
+ }
472
+ removeFromFilter(filter) {
473
+ this.changeNav.emit({ type: 'Addroute' });
474
+ const index = this.filters.indexOf(filter);
475
+ if (index >= 0) {
476
+ this.filters = [];
477
+ }
478
+ }
479
+ ngAfterViewInit() {
480
+ this.checkAndCallRouteList();
481
+ }
482
+ ngOnChanges(changes) {
483
+ if (changes['updateRouteList'] && changes['updateRouteList']['currentValue'])
484
+ this.checkAndCallRouteList();
485
+ if (changes['navValue'] && (changes['navValue']['previousValue'] === 'addForm') && !this.preventListUpdate)
486
+ this.checkAndCallRouteList();
487
+ }
488
+ getRoute(event) { if (event['type'] === 'editroute') {
489
+ this.addemit.emit(event);
490
+ } }
491
+ checkAndCallRouteList() {
492
+ if (this.config.repository === 'customer') {
493
+ this.utils.fetchUnitsList().then((res) => {
494
+ this.unitList = res;
495
+ this.utils.fetchMaterialsListForCustomer().then((res) => {
496
+ this.materialsList = res;
497
+ this.getRouteListForCustomer();
498
+ });
499
+ });
500
+ }
501
+ else {
502
+ this.getRouteListForCoolMap();
503
+ }
504
+ }
505
+ getUnitName(data) {
506
+ let unitName = '';
507
+ this.unitList.map((res) => {
508
+ if (res.id === data.unit_id) {
509
+ unitName = res.type;
510
+ }
511
+ });
512
+ return unitName;
513
+ }
514
+ getMaterialName(data) {
515
+ let materialName = '';
516
+ this.materialsList.map((res) => {
517
+ if (res.sub_material_id === data.materials_id) {
518
+ materialName = res.label;
519
+ }
520
+ });
521
+ return materialName;
522
+ }
523
+ getRouteListForCoolMap() {
524
+ this.utils.getData('routes/all').pipe(takeUntil(this.destroyer$)).subscribe((res) => {
525
+ if (res) {
526
+ this.filters = [];
527
+ this.routes = res['data'];
528
+ this.preventListUpdate = false;
529
+ this.utils.clearOptions();
530
+ this.routes.forEach((ele) => { this.utils.makeOptions(ele); });
531
+ }
532
+ });
533
+ }
534
+ getRouteListForCustomer() {
535
+ const dataset = {
536
+ customer_id: this.customerRepoDetails.customer.id
537
+ };
538
+ this.utils.postdata('routes/all', dataset).pipe(takeUntil(this.destroyer$)).subscribe((res) => {
539
+ if (res) {
540
+ this.filters = [];
541
+ this.routes = res['data'];
542
+ this.preventListUpdate = false;
543
+ this.utils.clearOptions();
544
+ this.routes.map((ele) => {
545
+ ele.unit = this.getUnitName(ele);
546
+ ele.materialLabel = this.getMaterialName(ele);
547
+ ele.material = this.getMaterialName(ele).split('|')[0].trim();
548
+ this.utils.makeOptions(ele);
549
+ });
550
+ }
551
+ });
552
+ }
553
+ resetSearch() { this.changeNav.emit('Addroute'); }
554
+ ngOnDestroy() {
555
+ this.destroyer$.next(true);
556
+ this.destroyer$.unsubscribe();
557
+ }
558
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AddRouteNavComponent, deps: [{ token: i1.UtilsService }, { token: 'memberData' }], target: i0.ɵɵFactoryTarget.Component });
559
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: AddRouteNavComponent, selector: "app-add-route-nav", inputs: { navValue: "navValue", updateRouteList: "updateRouteList", customerRepoDetails: "customerRepoDetails" }, outputs: { changeNav: "changeNav", addemit: "addemit" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"nav_body\">\n <div class=\"logo\">\n <img src=\"assets/images/logo.png\" alt=\"logo\" />\n </div>\n <div class=\"heading m-20\">\n <h1>View Route</h1>\n <button mat-raised-button color=\"primary\" (click)=\"showAddForm()\">\n <mat-icon>add_circle_outline</mat-icon> Add route\n </button>\n </div>\n\n <div class=\"search-panel\">\n <div class=\"w-100\">\n <form [formGroup]=\"filterForm\">\n <mat-form-field class=\"full-width\" [class.disabled]=\"loaderVal\">\n <input matInput [matChipInputFor]=\"chipList\" formControlName=\"search\" [matAutocomplete]=\"auto\"\n [disabled]=\"loaderVal\" placeholder=\"Search\">\n <mat-icon matSuffix *ngIf=\"!utils.conveySearchIcon(filterForm.value.search)\">search</mat-icon>\n <button mat-button matSuffix mat-icon-button aria-label=\"Clear\" *ngIf=\"utils.conveySearchIcon(filterForm.value.search)\"\n (click)=\"filterForm.reset()\">\n <mat-icon>close</mat-icon>\n </button>\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\" class=\"whole_width\">\n <mat-option *ngFor=\"let option of filteredOptions | async\" (onSelectionChange)=\"filterSearch($event)\"\n [value]=\"option\">\n {{option.type | titlecase }}: {{option['label']}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n </form>\n <div class=\"chip-list\">\n <!-- // TODO: Get this to work. -->\n <mat-chip-listbox #chipList aria-label=\"Filter selection\">\n <mat-chip-option *ngFor=\"let filter of filters\" (removed)=\"removeFromFilter(filter)\">\n {{filter.type | titlecase }}: {{filter.name}}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-option>\n </mat-chip-listbox>\n </div>\n </div>\n </div>\n <app-route-jobcode-list [type]=\"'addroute'\" [currentNav]=\"navValue\" [searchTerm]=\"filters\" [data]=\"routes\" [loader]=\"loaderVal\" (emitroute)=\"getRoute($event)\"></app-route-jobcode-list>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i8.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i8.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "directive", type: i9.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "component", type: i9.MatChipListbox, selector: "mat-chip-listbox", inputs: ["tabIndex", "multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i9.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["color", "disabled", "disableRipple", "tabIndex", "selectable", "selected"], outputs: ["selectionChange"] }, { kind: "directive", type: i9.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i10.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i10.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: RouteJobCodeListComponent, selector: "app-route-jobcode-list", inputs: ["loader", "type", "data", "currentNav", "searchTerm", "clearListSeletion"], outputs: ["emitroute", "showAllRoute", "clearJobDetailsFromList"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TitleCasePipe, name: "titlecase" }] });
560
+ }
561
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AddRouteNavComponent, decorators: [{
562
+ type: Component,
563
+ args: [{ selector: 'app-add-route-nav', template: "<div class=\"nav_body\">\n <div class=\"logo\">\n <img src=\"assets/images/logo.png\" alt=\"logo\" />\n </div>\n <div class=\"heading m-20\">\n <h1>View Route</h1>\n <button mat-raised-button color=\"primary\" (click)=\"showAddForm()\">\n <mat-icon>add_circle_outline</mat-icon> Add route\n </button>\n </div>\n\n <div class=\"search-panel\">\n <div class=\"w-100\">\n <form [formGroup]=\"filterForm\">\n <mat-form-field class=\"full-width\" [class.disabled]=\"loaderVal\">\n <input matInput [matChipInputFor]=\"chipList\" formControlName=\"search\" [matAutocomplete]=\"auto\"\n [disabled]=\"loaderVal\" placeholder=\"Search\">\n <mat-icon matSuffix *ngIf=\"!utils.conveySearchIcon(filterForm.value.search)\">search</mat-icon>\n <button mat-button matSuffix mat-icon-button aria-label=\"Clear\" *ngIf=\"utils.conveySearchIcon(filterForm.value.search)\"\n (click)=\"filterForm.reset()\">\n <mat-icon>close</mat-icon>\n </button>\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\" class=\"whole_width\">\n <mat-option *ngFor=\"let option of filteredOptions | async\" (onSelectionChange)=\"filterSearch($event)\"\n [value]=\"option\">\n {{option.type | titlecase }}: {{option['label']}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n </form>\n <div class=\"chip-list\">\n <!-- // TODO: Get this to work. -->\n <mat-chip-listbox #chipList aria-label=\"Filter selection\">\n <mat-chip-option *ngFor=\"let filter of filters\" (removed)=\"removeFromFilter(filter)\">\n {{filter.type | titlecase }}: {{filter.name}}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-option>\n </mat-chip-listbox>\n </div>\n </div>\n </div>\n <app-route-jobcode-list [type]=\"'addroute'\" [currentNav]=\"navValue\" [searchTerm]=\"filters\" [data]=\"routes\" [loader]=\"loaderVal\" (emitroute)=\"getRoute($event)\"></app-route-jobcode-list>\n</div>\n" }]
564
+ }], ctorParameters: () => [{ type: i1.UtilsService }, { type: i1.CoolmapConfigModel, decorators: [{
565
+ type: Inject,
566
+ args: ['memberData']
567
+ }] }], propDecorators: { changeNav: [{
568
+ type: Output
569
+ }], navValue: [{
570
+ type: Input
571
+ }], addemit: [{
572
+ type: Output
573
+ }], updateRouteList: [{
574
+ type: Input
575
+ }], customerRepoDetails: [{
576
+ type: Input
577
+ }] } });
578
+
579
+ class JobCodeNavComponent {
580
+ utils;
581
+ config;
582
+ filterForm = new FormGroup({ search: new FormControl() });
583
+ listData = [];
584
+ loaderVal = false;
585
+ dateValue = new Date();
586
+ jobemit = new EventEmitter();
587
+ value = '';
588
+ filteredOptions;
589
+ filters = [];
590
+ clearJobDetails = new EventEmitter();
591
+ destroyer$ = new Subject();
592
+ customerRepoDetails;
593
+ selectedDate;
594
+ constructor(utils, config) {
595
+ this.utils = utils;
596
+ this.config = config;
597
+ this.selectedDate = this.utils.getDateFormat(new Date());
598
+ utils.navChangeObserve.pipe(takeUntil(this.destroyer$)).subscribe(res => {
599
+ if (res) {
600
+ this.loaderVal = false;
601
+ }
602
+ else
603
+ this.loaderVal = true;
604
+ });
605
+ }
606
+ ngOnChanges(changes) {
607
+ if (changes['customerRepoDetails'] && changes['customerRepoDetails']['currentValue']) {
608
+ this.loadData(this.selectedDate);
609
+ this.filters = [];
610
+ this.utils.clearViewRouteforJobCode.next(true);
611
+ }
612
+ }
613
+ loadData(value) {
614
+ this.selectedDate = value;
615
+ this.filteredOptions = this.filterForm.get('search')?.valueChanges.pipe(startWith(''), map(value => this.utils.filter(value, this.filters)));
616
+ this.utils.preventnavChange.next(false);
617
+ this.loaderVal = true;
618
+ let dataSet;
619
+ if (this.config.repository === 'customer') {
620
+ dataSet = {
621
+ date: value,
622
+ customer_id: this.customerRepoDetails.customer.id,
623
+ project_id: this.customerRepoDetails.projectId,
624
+ };
625
+ }
626
+ else {
627
+ dataSet = { date: value };
628
+ }
629
+ this.utils.postdata('jobs_report_v2', dataSet).pipe(takeUntil(this.destroyer$)).subscribe((res) => {
630
+ if (typeof res['data'] !== 'string') {
631
+ if (res['data'].length > 0)
632
+ this.listData = res['data'].map((ele) => { ele['date'] = value; return ele; });
633
+ this.listData.forEach((ele) => { this.utils.makeOptions(ele); });
634
+ }
635
+ else
636
+ this.listData = [];
637
+ this.clearJobDetails.emit(true);
638
+ this.utils.clearViewRouteforJobCode.next(true);
639
+ this.filters = [];
640
+ if (typeof res['data'] === 'string')
641
+ this.utils.preventnavChange.next(true);
642
+ }, (err) => { if (err)
643
+ this.utils.preventnavChange.next(true); });
644
+ }
645
+ getRoute(job) { if (job['type'] === 'jobcode') {
646
+ this.jobemit.emit(job);
647
+ } }
648
+ getDate(ev) { this.loadData(this.utils.getDateFormat(ev.value)); }
649
+ filterSearch(e) {
650
+ this.filterForm.controls.search.setValue(null);
651
+ this.filterForm.controls.search.updateValueAndValidity();
652
+ this.filters = [{ name: e.source.value.label, type: e.source.value.type, value: e.source.value }];
653
+ }
654
+ removeFromFilter(filter) {
655
+ const index = this.filters.indexOf(filter);
656
+ if (index >= 0) {
657
+ this.filters = [];
658
+ }
659
+ }
660
+ ngOnDestroy() {
661
+ this.destroyer$.next(true);
662
+ this.destroyer$.unsubscribe();
663
+ }
664
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: JobCodeNavComponent, deps: [{ token: i1.UtilsService }, { token: 'memberData' }], target: i0.ɵɵFactoryTarget.Component });
665
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: JobCodeNavComponent, selector: "app-job-code-nav", inputs: { customerRepoDetails: "customerRepoDetails" }, outputs: { jobemit: "jobemit", clearJobDetails: "clearJobDetails" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"nav_body\">\n <div class=\"search-panel\">\n <div class=\"datepicker\">\n <mat-form-field>\n <mat-label>Choose a date</mat-label>\n <input readonly matInput (click)=\"picker.open()\" [disabled]=\"loaderVal\" [(ngModel)]=\"dateValue\" [matDatepicker]=\"picker\" (dateChange)=\"getDate($event)\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n </mat-form-field>\n </div>\n <div class=\"search\">\n <form [formGroup]=\"filterForm\">\n <mat-form-field class=\"full-width\" [class.disabled]=\"loaderVal\">\n <input matInput [matChipInputFor]=\"chipList\" formControlName=\"search\" [matAutocomplete]=\"auto\"\n [disabled]=\"loaderVal\" placeholder=\"Search\">\n <mat-icon matSuffix *ngIf=\"!utils.conveySearchIcon(filterForm.value.search)\">search</mat-icon>\n <button mat-button matSuffix mat-icon-button aria-label=\"Clear\" *ngIf=\"utils.conveySearchIcon(filterForm.value.search)\" (click)=\"filterForm.reset()\">\n <mat-icon>close</mat-icon>\n </button>\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\" class=\"whole_width\">\n <mat-option *ngFor=\"let option of filteredOptions | async\" (onSelectionChange)=\"filterSearch($event)\"\n [value]=\"option\">\n {{option.type | titlecase }}: {{option['label']}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n </form>\n\n </div>\n\n <div class=\"chip-list\">\n <mat-chip-listbox #chipList aria-label=\"Filter selection\">\n <mat-chip-option *ngFor=\"let filter of filters\" (removed)=\"removeFromFilter(filter)\">\n {{filter.type | titlecase }}: {{filter.name}}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-option>\n </mat-chip-listbox>\n </div>\n </div>\n <app-route-jobcode-list [type]=\"'jobcode'\" [searchTerm]=\"filters\" [data]=\"listData\" [loader]=\"loaderVal\" (clearJobDetailsFromList)=\"clearJobDetails.emit(true)\" (showAllRoute)=\"filters = []; clearJobDetails.emit(true)\" (emitroute)=\"getRoute($event)\"></app-route-jobcode-list>\n</div>\n", styles: [".search-panel .datepicker,.search-panel .search{width:47%}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i8.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i8.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "directive", type: i9.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "component", type: i9.MatChipListbox, selector: "mat-chip-listbox", inputs: ["tabIndex", "multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i9.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["color", "disabled", "disableRipple", "tabIndex", "selectable", "selected"], outputs: ["selectionChange"] }, { kind: "directive", type: i9.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i10$1.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i10$1.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i10$1.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i10.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i10.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: RouteJobCodeListComponent, selector: "app-route-jobcode-list", inputs: ["loader", "type", "data", "currentNav", "searchTerm", "clearListSeletion"], outputs: ["emitroute", "showAllRoute", "clearJobDetailsFromList"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TitleCasePipe, name: "titlecase" }] });
666
+ }
667
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: JobCodeNavComponent, decorators: [{
668
+ type: Component,
669
+ args: [{ selector: 'app-job-code-nav', template: "<div class=\"nav_body\">\n <div class=\"search-panel\">\n <div class=\"datepicker\">\n <mat-form-field>\n <mat-label>Choose a date</mat-label>\n <input readonly matInput (click)=\"picker.open()\" [disabled]=\"loaderVal\" [(ngModel)]=\"dateValue\" [matDatepicker]=\"picker\" (dateChange)=\"getDate($event)\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n </mat-form-field>\n </div>\n <div class=\"search\">\n <form [formGroup]=\"filterForm\">\n <mat-form-field class=\"full-width\" [class.disabled]=\"loaderVal\">\n <input matInput [matChipInputFor]=\"chipList\" formControlName=\"search\" [matAutocomplete]=\"auto\"\n [disabled]=\"loaderVal\" placeholder=\"Search\">\n <mat-icon matSuffix *ngIf=\"!utils.conveySearchIcon(filterForm.value.search)\">search</mat-icon>\n <button mat-button matSuffix mat-icon-button aria-label=\"Clear\" *ngIf=\"utils.conveySearchIcon(filterForm.value.search)\" (click)=\"filterForm.reset()\">\n <mat-icon>close</mat-icon>\n </button>\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\" class=\"whole_width\">\n <mat-option *ngFor=\"let option of filteredOptions | async\" (onSelectionChange)=\"filterSearch($event)\"\n [value]=\"option\">\n {{option.type | titlecase }}: {{option['label']}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n </form>\n\n </div>\n\n <div class=\"chip-list\">\n <mat-chip-listbox #chipList aria-label=\"Filter selection\">\n <mat-chip-option *ngFor=\"let filter of filters\" (removed)=\"removeFromFilter(filter)\">\n {{filter.type | titlecase }}: {{filter.name}}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-option>\n </mat-chip-listbox>\n </div>\n </div>\n <app-route-jobcode-list [type]=\"'jobcode'\" [searchTerm]=\"filters\" [data]=\"listData\" [loader]=\"loaderVal\" (clearJobDetailsFromList)=\"clearJobDetails.emit(true)\" (showAllRoute)=\"filters = []; clearJobDetails.emit(true)\" (emitroute)=\"getRoute($event)\"></app-route-jobcode-list>\n</div>\n", styles: [".search-panel .datepicker,.search-panel .search{width:47%}\n"] }]
670
+ }], ctorParameters: () => [{ type: i1.UtilsService }, { type: i1.CoolmapConfigModel, decorators: [{
671
+ type: Inject,
672
+ args: ['memberData']
673
+ }] }], propDecorators: { jobemit: [{
674
+ type: Output
675
+ }], clearJobDetails: [{
676
+ type: Output
677
+ }], customerRepoDetails: [{
678
+ type: Input
679
+ }] } });
680
+
681
+ class ViewRouteListCardComponent {
682
+ utils;
683
+ config;
684
+ route;
685
+ emitrouteevent;
686
+ constructor(utils, config) {
687
+ this.utils = utils;
688
+ this.config = config;
689
+ }
690
+ detailsDict(event, route) {
691
+ if (event === 'click')
692
+ this.utils.setdictValue('route-detailsv2', JSON.stringify(route));
693
+ route['type'] = 'editroute';
694
+ route['prevent'] = true;
695
+ this.emitrouteevent.emit(route);
696
+ this.utils.routeDetailsUtility.next({ event, route });
697
+ }
698
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ViewRouteListCardComponent, deps: [{ token: i1.UtilsService }, { token: 'memberData' }], target: i0.ɵɵFactoryTarget.Component });
699
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: ViewRouteListCardComponent, selector: "app-view-route-list-card", inputs: { route: "route", emitrouteevent: "emitrouteevent" }, ngImport: i0, template: "<div class=\"routebox\">\n <span>\n <mat-icon>directions</mat-icon>\n <h2 [ngClass]=\"{'routeheading': route['route_name']}\">\n {{route['route_name']}}\n </h2>\n </span>\n <h3><ng-container *ngIf=\"config?.repository === 'coolmap'\">{{route['customer_name']}} | </ng-container>{{config.repository === 'coolmap' ? route['material'] : route['materialLabel']}}</h3>\n\n <div class=\"pickdropprt\">\n <div class=\"pickprt\">\n <b>\n <h4>{{route['pickup_location']}}</h4>\n </b>\n </div>\n <div class=\"dropprt\">\n <b>\n <h4>{{route['delivery_location']}}</h4>\n </b>\n </div>\n </div>\n <div class=\"infoicon\" (click)=\"detailsDict('click', route)\" (mouseover)=\"detailsDict(true, route)\"\n (mouseleave)=\"detailsDict(false, route)\">\n <img src=\"assets/images/info_icon.png\" [alt]=\"\" />\n </div>\n <div class=\"status routestatus\" [ngClass]=\"route['unit']\">{{route['unit']}}</div>\n</div>\n\n", styles: [".routebox span{display:flex;align-items:center}.routebox span h2{margin-left:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px;margin-bottom:5px;margin-top:5px;font-size:.95rem}.routebox h3{font-size:.85rem;color:#767676;font-weight:400;margin-top:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:325px;margin-bottom:10px}.routebox .pickdropprt{font-size:.8125rem}.routebox .pickdropprt .pickprt{position:relative;display:flex;align-items:center;padding-bottom:6px}.routebox .pickdropprt .pickprt span{padding-left:0;padding-right:20px;display:block}.routebox .pickdropprt .pickprt b{position:relative;font-weight:400}.routebox .pickdropprt .pickprt b:after{background:black;width:1px;height:100%;left:3px;content:\"\";position:absolute;top:10px}.routebox .pickdropprt .pickprt h4{position:relative;padding-left:15px;margin:0;line-height:18px;font-weight:400;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;max-width:215px}@media (min-width: 1600px){.routebox .pickdropprt .pickprt h4{max-width:265px}}.routebox .pickdropprt .pickprt h4:before{background:black;top:4px;left:0;position:absolute;content:\"\";width:7px;height:7px;border-radius:100%}.routebox .pickdropprt .dropprt{position:relative;padding-bottom:10px;display:flex;align-items:center}.routebox .pickdropprt .dropprt span{padding-left:0;padding-right:20px;display:block}.routebox .pickdropprt .dropprt b{position:relative;font-weight:400}.routebox .pickdropprt .dropprt b:after{background:black;width:1px;height:12px;left:3px;content:\"\";position:absolute;top:-7px}.routebox .pickdropprt .dropprt h4{position:relative;padding-left:15px;margin:0;line-height:18px;font-weight:400;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;max-width:215px}.routebox .pickdropprt .dropprt h4:before{background:black;top:4px;left:0;position:absolute;content:\"\";width:7px;height:7px;border-radius:100%}.routebox .infoicon{position:absolute;right:10px;bottom:10px}.routebox .infoicon img{width:20px;height:20px}.routebox .status{position:absolute;border-radius:30px;top:12px;right:40px;font-size:0;color:#fff;text-transform:capitalize;font-weight:500;padding:3px 10px}.routebox .status.routestatus{right:10px;width:20px;height:20px;text-align:center;line-height:20px;padding:0 0 0 1px}.routebox .status.routestatus:first-letter{font-size:.8rem}@media (min-width: 1600px){.routebox .status.routestatus{padding:0;line-height:22px}}.routebox .status.Ton{background:#ff7272}.routebox .status.Load{background:#a3c52e}.routebox .status.Hourly{background:#ae23d1}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
700
+ }
701
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ViewRouteListCardComponent, decorators: [{
702
+ type: Component,
703
+ args: [{ selector: 'app-view-route-list-card', template: "<div class=\"routebox\">\n <span>\n <mat-icon>directions</mat-icon>\n <h2 [ngClass]=\"{'routeheading': route['route_name']}\">\n {{route['route_name']}}\n </h2>\n </span>\n <h3><ng-container *ngIf=\"config?.repository === 'coolmap'\">{{route['customer_name']}} | </ng-container>{{config.repository === 'coolmap' ? route['material'] : route['materialLabel']}}</h3>\n\n <div class=\"pickdropprt\">\n <div class=\"pickprt\">\n <b>\n <h4>{{route['pickup_location']}}</h4>\n </b>\n </div>\n <div class=\"dropprt\">\n <b>\n <h4>{{route['delivery_location']}}</h4>\n </b>\n </div>\n </div>\n <div class=\"infoicon\" (click)=\"detailsDict('click', route)\" (mouseover)=\"detailsDict(true, route)\"\n (mouseleave)=\"detailsDict(false, route)\">\n <img src=\"assets/images/info_icon.png\" [alt]=\"\" />\n </div>\n <div class=\"status routestatus\" [ngClass]=\"route['unit']\">{{route['unit']}}</div>\n</div>\n\n", styles: [".routebox span{display:flex;align-items:center}.routebox span h2{margin-left:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px;margin-bottom:5px;margin-top:5px;font-size:.95rem}.routebox h3{font-size:.85rem;color:#767676;font-weight:400;margin-top:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:325px;margin-bottom:10px}.routebox .pickdropprt{font-size:.8125rem}.routebox .pickdropprt .pickprt{position:relative;display:flex;align-items:center;padding-bottom:6px}.routebox .pickdropprt .pickprt span{padding-left:0;padding-right:20px;display:block}.routebox .pickdropprt .pickprt b{position:relative;font-weight:400}.routebox .pickdropprt .pickprt b:after{background:black;width:1px;height:100%;left:3px;content:\"\";position:absolute;top:10px}.routebox .pickdropprt .pickprt h4{position:relative;padding-left:15px;margin:0;line-height:18px;font-weight:400;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;max-width:215px}@media (min-width: 1600px){.routebox .pickdropprt .pickprt h4{max-width:265px}}.routebox .pickdropprt .pickprt h4:before{background:black;top:4px;left:0;position:absolute;content:\"\";width:7px;height:7px;border-radius:100%}.routebox .pickdropprt .dropprt{position:relative;padding-bottom:10px;display:flex;align-items:center}.routebox .pickdropprt .dropprt span{padding-left:0;padding-right:20px;display:block}.routebox .pickdropprt .dropprt b{position:relative;font-weight:400}.routebox .pickdropprt .dropprt b:after{background:black;width:1px;height:12px;left:3px;content:\"\";position:absolute;top:-7px}.routebox .pickdropprt .dropprt h4{position:relative;padding-left:15px;margin:0;line-height:18px;font-weight:400;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;max-width:215px}.routebox .pickdropprt .dropprt h4:before{background:black;top:4px;left:0;position:absolute;content:\"\";width:7px;height:7px;border-radius:100%}.routebox .infoicon{position:absolute;right:10px;bottom:10px}.routebox .infoicon img{width:20px;height:20px}.routebox .status{position:absolute;border-radius:30px;top:12px;right:40px;font-size:0;color:#fff;text-transform:capitalize;font-weight:500;padding:3px 10px}.routebox .status.routestatus{right:10px;width:20px;height:20px;text-align:center;line-height:20px;padding:0 0 0 1px}.routebox .status.routestatus:first-letter{font-size:.8rem}@media (min-width: 1600px){.routebox .status.routestatus{padding:0;line-height:22px}}.routebox .status.Ton{background:#ff7272}.routebox .status.Load{background:#a3c52e}.routebox .status.Hourly{background:#ae23d1}\n"] }]
704
+ }], ctorParameters: () => [{ type: i1.UtilsService }, { type: i1.CoolmapConfigModel, decorators: [{
705
+ type: Inject,
706
+ args: ['memberData']
707
+ }] }], propDecorators: { route: [{
708
+ type: Input
709
+ }], emitrouteevent: [{
710
+ type: Input
711
+ }] } });
712
+
713
+ class JobCodeListCardComponent {
714
+ utils;
715
+ config;
716
+ route;
717
+ routeSeletion = new EventEmitter();
718
+ toggleDrivermenu = new EventEmitter();
719
+ emitJobdetails;
720
+ preventCloseDetails;
721
+ constructor(utils, config) {
722
+ this.utils = utils;
723
+ this.config = config;
724
+ }
725
+ selectRoute(route) { this.routeSeletion.emit(route); }
726
+ toggleDriverlist(mouseevntType, route, isHoverOut) {
727
+ const data = { mouseevntType, route, isHoverOut };
728
+ this.toggleDrivermenu.emit(data);
729
+ if (mouseevntType === 'click')
730
+ this.utils.setdictValue('driver-details', JSON.stringify(this.route));
731
+ }
732
+ toggleJobCodeDetails(mouseEventType, route) {
733
+ if (mouseEventType) {
734
+ route['type'] = 'jobcode';
735
+ this.emitJobdetails.emitroute.emit(route);
736
+ }
737
+ else if (!mouseEventType && this.preventCloseDetails) {
738
+ route = this.utils.getdictValue('route-details');
739
+ route['type'] = 'jobcode';
740
+ this.emitJobdetails.emitroute.emit(route);
741
+ }
742
+ else if (!mouseEventType && !this.preventCloseDetails)
743
+ this.emitJobdetails.clearJobDetailsFromList.emit(true);
744
+ }
745
+ calculateStatusPercentage(type, route) {
746
+ const total = route['Done'] + route['Ongoing'] + route['Open'];
747
+ if (type === 'done') {
748
+ return Math.round((100 * route['Done']) / total);
749
+ }
750
+ else if (type === 'ongoing') {
751
+ return Math.round((100 * route['Ongoing']) / total);
752
+ }
753
+ else if (type === 'open') {
754
+ return Math.round((100 * route['Open']) / total);
755
+ }
756
+ else {
757
+ return null;
758
+ }
759
+ }
760
+ setRouteItem() {
761
+ this.utils.preVentJobdetailclose.next(true);
762
+ this.utils.setdictValue('route-details', JSON.stringify(this.route));
763
+ }
764
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: JobCodeListCardComponent, deps: [{ token: i1.UtilsService }, { token: 'memberData' }], target: i0.ɵɵFactoryTarget.Component });
765
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: JobCodeListCardComponent, selector: "app-job-code-list-card", inputs: { route: "route", emitJobdetails: "emitJobdetails", preventCloseDetails: "preventCloseDetails" }, outputs: { routeSeletion: "routeSeletion", toggleDrivermenu: "toggleDrivermenu" }, ngImport: i0, template: "<div class=\"innerbox\">\n <div class=\"inputarea\">\n <input type=\"checkbox\" name=\"selectroute\" [checked]=\"route['isSelected']\" (change)=\"$event ? selectRoute(route) : null\" />\n <label>&nbsp;</label>\n <div class=\"border\"></div>\n </div>\n <div class=\"job_intro\">\n <div class=\"heading\">\n <h2>\n {{route['order_number'] ? route['order_number'] : ''}}\n </h2>\n |\n <span>\n {{route['customer_name']}}\n </span>\n |\n <span>\n {{route['project']}}\n </span>\n </div>\n <div class=\"destinationprt\">\n <span style=\"padding-left: 0;\">\n {{route['pickup_location']}}\n </span>\n <b>></b>\n <span>\n {{route['delivery_location']}}\n </span>\n </div>\n <div class=\"mat_cat\">\n <span>\n {{route['material']}}\n </span>\n </div>\n\n <div class=\"statusbar\">\n <div class=\"status_percent\">\n <span class=\"done\" [style]=\"'width:'+calculateStatusPercentage('done',route['values'])+'%'\"></span>\n <span class=\"ongoing\" [style]=\"'width:'+calculateStatusPercentage('ongoing', route['values'])+'%'\"> </span>\n <span class=\"open\" [style]=\"'width:'+calculateStatusPercentage('open', route['values'])+'%'\"> </span>\n </div>\n </div>\n </div>\n <div class=\"statusarea\">\n <div class=\"statusunit\" [ngClass]=\"route['unit']\">{{route['unit']}}</div>\n <div class=\"driver_icon\" *ngIf=\"config.repository !== 'customer'\" (mouseover)=\"toggleDriverlist(true, route)\" (mouseout)=\"toggleDriverlist(false, route, true)\"\n mat-raised-button #tooltip=\"matTooltip\" matTooltip=\"Click on icon to show the driver list\" matTooltipPosition=\"above\"\n (click)=\"toggleDriverlist('click', route)\">\n <img src=\"assets/images/driver_icon.png\" [alt]=\"\" />\n </div>\n <div class=\"infoicon\" (click)=\"setRouteItem()\" (mouseover)=\"toggleJobCodeDetails(true, route)\"\n (mouseout)=\"toggleJobCodeDetails(false, route)\">\n <img src=\"assets/images/info_icon.png\" [alt]=\"\" />\n </div>\n </div>\n</div>\n", styles: [".innerbox{display:flex;justify-content:space-between}.innerbox .inputarea{display:flex;align-items:center;width:6%}.innerbox .inputarea input[type=checkbox]{width:100%;height:100%;margin-right:10px;opacity:0;position:absolute;left:0;margin-left:0;top:0;z-index:3;cursor:pointer}.innerbox .inputarea label{width:100%;position:relative;z-index:2;font-size:12px;color:#878787;height:100%;position:absolute;top:0;left:0}.innerbox .inputarea .border{position:absolute;width:100%;height:100%;left:0;right:0;top:-1px;border-radius:15px}.innerbox .inputarea input:checked~.border{border-left:3px solid #39c471;border-right:1px solid #39c471;border-top:1px solid #39c471;border-bottom:1px solid #39c471}.innerbox .inputarea h2{margin-left:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:214px;padding-left:16px;margin-bottom:5px;margin-top:0}.innerbox .job_intro{width:80%}.innerbox .job_intro .heading{display:flex;font-size:.8rem}.innerbox .job_intro .heading h2{margin:0 4px 0 0;font-size:.8rem}.innerbox .job_intro .heading span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100px;padding:0 3px;display:block}.innerbox .job_intro .destinationprt{display:flex;margin-top:10px;font-size:.8rem}.innerbox .job_intro .destinationprt span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:132px;padding:0 5px;display:block}.innerbox .job_intro .mat_cat{margin-top:10px;font-size:.8rem}.innerbox .job_intro .statusbar{width:100%;position:relative;height:5px;margin-top:10px}.innerbox .job_intro .statusbar .status_percent{position:absolute;left:0;display:flex;width:100%;height:100%}.innerbox .job_intro .statusbar .status_percent span{display:block}.innerbox .job_intro .statusbar .status_percent .done{background:#008000}.innerbox .job_intro .statusbar .status_percent .ongoing{background:#ffcc00}.innerbox .job_intro .statusbar .status_percent .open{background:#bfbfbf}.innerbox .statusarea{display:flex;flex-direction:column;align-items:center;width:10%}.innerbox .statusarea .statusunit{border-radius:30px;font-size:0;color:#fff;text-transform:capitalize;font-weight:500;width:20px;height:20px;text-align:center;line-height:20px}.innerbox .statusarea .statusunit:first-letter{font-size:.8rem}.innerbox .statusarea .statusunit.routestatus{right:10px}.innerbox .statusarea .statusunit.Ton{background:#39c471}.innerbox .statusarea .statusunit.Load{background:#326ad3}.innerbox .statusarea .statusunit.Hourly{background:#ffad56}.innerbox .statusarea .driver_icon,.innerbox .statusarea .infoicon{z-index:9999}.innerbox .statusarea .driver_icon img,.innerbox .statusarea .infoicon img{width:20px;height:20px}.innerbox .statusarea .driver_icon{margin:5px 0}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] });
766
+ }
767
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: JobCodeListCardComponent, decorators: [{
768
+ type: Component,
769
+ args: [{ selector: 'app-job-code-list-card', template: "<div class=\"innerbox\">\n <div class=\"inputarea\">\n <input type=\"checkbox\" name=\"selectroute\" [checked]=\"route['isSelected']\" (change)=\"$event ? selectRoute(route) : null\" />\n <label>&nbsp;</label>\n <div class=\"border\"></div>\n </div>\n <div class=\"job_intro\">\n <div class=\"heading\">\n <h2>\n {{route['order_number'] ? route['order_number'] : ''}}\n </h2>\n |\n <span>\n {{route['customer_name']}}\n </span>\n |\n <span>\n {{route['project']}}\n </span>\n </div>\n <div class=\"destinationprt\">\n <span style=\"padding-left: 0;\">\n {{route['pickup_location']}}\n </span>\n <b>></b>\n <span>\n {{route['delivery_location']}}\n </span>\n </div>\n <div class=\"mat_cat\">\n <span>\n {{route['material']}}\n </span>\n </div>\n\n <div class=\"statusbar\">\n <div class=\"status_percent\">\n <span class=\"done\" [style]=\"'width:'+calculateStatusPercentage('done',route['values'])+'%'\"></span>\n <span class=\"ongoing\" [style]=\"'width:'+calculateStatusPercentage('ongoing', route['values'])+'%'\"> </span>\n <span class=\"open\" [style]=\"'width:'+calculateStatusPercentage('open', route['values'])+'%'\"> </span>\n </div>\n </div>\n </div>\n <div class=\"statusarea\">\n <div class=\"statusunit\" [ngClass]=\"route['unit']\">{{route['unit']}}</div>\n <div class=\"driver_icon\" *ngIf=\"config.repository !== 'customer'\" (mouseover)=\"toggleDriverlist(true, route)\" (mouseout)=\"toggleDriverlist(false, route, true)\"\n mat-raised-button #tooltip=\"matTooltip\" matTooltip=\"Click on icon to show the driver list\" matTooltipPosition=\"above\"\n (click)=\"toggleDriverlist('click', route)\">\n <img src=\"assets/images/driver_icon.png\" [alt]=\"\" />\n </div>\n <div class=\"infoicon\" (click)=\"setRouteItem()\" (mouseover)=\"toggleJobCodeDetails(true, route)\"\n (mouseout)=\"toggleJobCodeDetails(false, route)\">\n <img src=\"assets/images/info_icon.png\" [alt]=\"\" />\n </div>\n </div>\n</div>\n", styles: [".innerbox{display:flex;justify-content:space-between}.innerbox .inputarea{display:flex;align-items:center;width:6%}.innerbox .inputarea input[type=checkbox]{width:100%;height:100%;margin-right:10px;opacity:0;position:absolute;left:0;margin-left:0;top:0;z-index:3;cursor:pointer}.innerbox .inputarea label{width:100%;position:relative;z-index:2;font-size:12px;color:#878787;height:100%;position:absolute;top:0;left:0}.innerbox .inputarea .border{position:absolute;width:100%;height:100%;left:0;right:0;top:-1px;border-radius:15px}.innerbox .inputarea input:checked~.border{border-left:3px solid #39c471;border-right:1px solid #39c471;border-top:1px solid #39c471;border-bottom:1px solid #39c471}.innerbox .inputarea h2{margin-left:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:214px;padding-left:16px;margin-bottom:5px;margin-top:0}.innerbox .job_intro{width:80%}.innerbox .job_intro .heading{display:flex;font-size:.8rem}.innerbox .job_intro .heading h2{margin:0 4px 0 0;font-size:.8rem}.innerbox .job_intro .heading span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100px;padding:0 3px;display:block}.innerbox .job_intro .destinationprt{display:flex;margin-top:10px;font-size:.8rem}.innerbox .job_intro .destinationprt span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:132px;padding:0 5px;display:block}.innerbox .job_intro .mat_cat{margin-top:10px;font-size:.8rem}.innerbox .job_intro .statusbar{width:100%;position:relative;height:5px;margin-top:10px}.innerbox .job_intro .statusbar .status_percent{position:absolute;left:0;display:flex;width:100%;height:100%}.innerbox .job_intro .statusbar .status_percent span{display:block}.innerbox .job_intro .statusbar .status_percent .done{background:#008000}.innerbox .job_intro .statusbar .status_percent .ongoing{background:#ffcc00}.innerbox .job_intro .statusbar .status_percent .open{background:#bfbfbf}.innerbox .statusarea{display:flex;flex-direction:column;align-items:center;width:10%}.innerbox .statusarea .statusunit{border-radius:30px;font-size:0;color:#fff;text-transform:capitalize;font-weight:500;width:20px;height:20px;text-align:center;line-height:20px}.innerbox .statusarea .statusunit:first-letter{font-size:.8rem}.innerbox .statusarea .statusunit.routestatus{right:10px}.innerbox .statusarea .statusunit.Ton{background:#39c471}.innerbox .statusarea .statusunit.Load{background:#326ad3}.innerbox .statusarea .statusunit.Hourly{background:#ffad56}.innerbox .statusarea .driver_icon,.innerbox .statusarea .infoicon{z-index:9999}.innerbox .statusarea .driver_icon img,.innerbox .statusarea .infoicon img{width:20px;height:20px}.innerbox .statusarea .driver_icon{margin:5px 0}\n"] }]
770
+ }], ctorParameters: () => [{ type: i1.UtilsService }, { type: i1.CoolmapConfigModel, decorators: [{
771
+ type: Inject,
772
+ args: ['memberData']
773
+ }] }], propDecorators: { route: [{
774
+ type: Input
775
+ }], routeSeletion: [{
776
+ type: Output
777
+ }], toggleDrivermenu: [{
778
+ type: Output
779
+ }], emitJobdetails: [{
780
+ type: Input
781
+ }], preventCloseDetails: [{
782
+ type: Input
783
+ }] } });
784
+
785
+ class JobRouteListComponent {
786
+ utils;
787
+ coolMap;
788
+ changeNav = new EventEmitter();
789
+ filteredOptions;
790
+ preventListUpdate;
791
+ filterForm = new FormGroup({ search: new FormControl() });
792
+ filters;
793
+ routes;
794
+ selectedRoute;
795
+ changeRoutes = new EventEmitter();
796
+ changeSelectedRoute = new EventEmitter();
797
+ masterRoutes;
798
+ constructor(utils, coolMap) {
799
+ this.utils = utils;
800
+ this.coolMap = coolMap;
801
+ this.filters = [];
802
+ this.filteredOptions = this.filterForm.get('search')?.valueChanges.pipe(startWith(''), map(value => this.utils.filter(value, this.filters)));
803
+ }
804
+ filterSearch(e) {
805
+ this.changeNav.emit({ type: 'Addroute' });
806
+ this.preventListUpdate = true;
807
+ this.filterForm.controls.search.setValue(null);
808
+ this.filters = [{ name: e.source.value.label, type: e.source.value.type, value: e.source.value }];
809
+ const filteredRoutes = this.utils.getSearchResults(this.masterRoutes, [{ name: e.source.value.label, type: e.source.value.type, value: e.source.value }]);
810
+ this.changeRoutes.emit(filteredRoutes);
811
+ this.selectedRoute.selected.forEach((item) => {
812
+ const routeData = filteredRoutes.find(x => x.route_id === item.route_id);
813
+ if (!routeData) {
814
+ this.selectedRoute.toggle(item);
815
+ this.changeSelectedRoute.emit(this.selectedRoute);
816
+ this.coolMap.removeRouteAndMarker(item['route_id']).then((res) => {
817
+ this.coolMap.extendReBound();
818
+ });
819
+ }
820
+ });
821
+ }
822
+ removeFromFilter(filter) {
823
+ this.changeNav.emit({ type: 'Addroute' });
824
+ const index = this.filters.indexOf(filter);
825
+ if (index >= 0) {
826
+ this.filters = [];
827
+ this.changeRoutes.emit(this.masterRoutes);
828
+ }
829
+ }
830
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: JobRouteListComponent, deps: [{ token: i1.UtilsService }, { token: i1.CoolmapService }], target: i0.ɵɵFactoryTarget.Component });
831
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: JobRouteListComponent, selector: "app-job-route-list", inputs: { routes: "routes", selectedRoute: "selectedRoute", masterRoutes: "masterRoutes" }, outputs: { changeNav: "changeNav", changeRoutes: "changeRoutes", changeSelectedRoute: "changeSelectedRoute" }, ngImport: i0, template: "<div class=\"searchprt\">\n <form [formGroup]=\"filterForm\">\n <mat-form-field class=\"full-width\">\n <input matInput [matChipInputFor]=\"chipList\" formControlName=\"search\" [matAutocomplete]=\"auto\" placeholder=\"Search\">\n <mat-icon matSuffix *ngIf=\"!utils.conveySearchIcon(filterForm.value.search)\">search</mat-icon>\n <button mat-button matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"filterForm.reset()\" *ngIf=\"utils.conveySearchIcon(filterForm.value.search)\">\n <mat-icon>close</mat-icon>\n </button>\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of filteredOptions | async\" (onSelectionChange)=\"filterSearch($event)\"\n [value]=\"option\">\n {{option.type | titlecase }}: {{option['label']}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n</form>\n</div>\n<div class=\"chip-list\">\n <mat-chip-listbox #chipList aria-label=\"Filter selection\">\n <mat-chip-option *ngFor=\"let filter of filters\" (removed)=\"removeFromFilter(filter)\">\n {{filter.type | titlecase }}: {{filter.name}}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-option >\n </mat-chip-listbox>\n</div>\n", styles: [".searchprt{padding-right:20px}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i8.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i8.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "directive", type: i9.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "component", type: i9.MatChipListbox, selector: "mat-chip-listbox", inputs: ["tabIndex", "multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i9.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["color", "disabled", "disableRipple", "tabIndex", "selectable", "selected"], outputs: ["selectionChange"] }, { kind: "directive", type: i9.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i10.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i10.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TitleCasePipe, name: "titlecase" }] });
832
+ }
833
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: JobRouteListComponent, decorators: [{
834
+ type: Component,
835
+ args: [{ selector: 'app-job-route-list', template: "<div class=\"searchprt\">\n <form [formGroup]=\"filterForm\">\n <mat-form-field class=\"full-width\">\n <input matInput [matChipInputFor]=\"chipList\" formControlName=\"search\" [matAutocomplete]=\"auto\" placeholder=\"Search\">\n <mat-icon matSuffix *ngIf=\"!utils.conveySearchIcon(filterForm.value.search)\">search</mat-icon>\n <button mat-button matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"filterForm.reset()\" *ngIf=\"utils.conveySearchIcon(filterForm.value.search)\">\n <mat-icon>close</mat-icon>\n </button>\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of filteredOptions | async\" (onSelectionChange)=\"filterSearch($event)\"\n [value]=\"option\">\n {{option.type | titlecase }}: {{option['label']}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n</form>\n</div>\n<div class=\"chip-list\">\n <mat-chip-listbox #chipList aria-label=\"Filter selection\">\n <mat-chip-option *ngFor=\"let filter of filters\" (removed)=\"removeFromFilter(filter)\">\n {{filter.type | titlecase }}: {{filter.name}}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-option >\n </mat-chip-listbox>\n</div>\n", styles: [".searchprt{padding-right:20px}\n"] }]
836
+ }], ctorParameters: () => [{ type: i1.UtilsService }, { type: i1.CoolmapService }], propDecorators: { changeNav: [{
837
+ type: Output
838
+ }], routes: [{
839
+ type: Input
840
+ }], selectedRoute: [{
841
+ type: Input
842
+ }], changeRoutes: [{
843
+ type: Output
844
+ }], changeSelectedRoute: [{
845
+ type: Output
846
+ }], masterRoutes: [{
847
+ type: Input
848
+ }] } });
849
+
850
+ class JobcodeStatusComponent {
851
+ jobValue;
852
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: JobcodeStatusComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
853
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: JobcodeStatusComponent, selector: "app-jobcode-status", inputs: { jobValue: "jobValue" }, ngImport: i0, template: "<div class=\"statusprt\" *ngIf=\"jobValue['values']\">\n <span class=\"done\"> Done - {{jobValue['values']['Done']}} </span>\n <span class=\"ongoing\"> Ongoing - {{jobValue['values']['Ongoing']}} </span>\n <span class=\"open\"> Open - {{jobValue['values']['Open']}} </span>\n</div>\n", styles: [".statusprt span{padding:5px 10px;font-size:.9rem;margin-left:0;margin-right:5px}.statusprt span.done{border:2px solid #0b843c;color:#0b843c}.statusprt span.done:hover{background:#0b843c;color:#fff}.statusprt span.ongoing{border:2px solid #eecb27;color:#eecb27}.statusprt span.ongoing:hover{background:#eecb27;color:#fff}.statusprt span.open{border:2px solid #12afcb;color:#12afcb}.statusprt span.open:hover{background:#12afcb;color:#fff}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
854
+ }
855
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: JobcodeStatusComponent, decorators: [{
856
+ type: Component,
857
+ args: [{ selector: 'app-jobcode-status', template: "<div class=\"statusprt\" *ngIf=\"jobValue['values']\">\n <span class=\"done\"> Done - {{jobValue['values']['Done']}} </span>\n <span class=\"ongoing\"> Ongoing - {{jobValue['values']['Ongoing']}} </span>\n <span class=\"open\"> Open - {{jobValue['values']['Open']}} </span>\n</div>\n", styles: [".statusprt span{padding:5px 10px;font-size:.9rem;margin-left:0;margin-right:5px}.statusprt span.done{border:2px solid #0b843c;color:#0b843c}.statusprt span.done:hover{background:#0b843c;color:#fff}.statusprt span.ongoing{border:2px solid #eecb27;color:#eecb27}.statusprt span.ongoing:hover{background:#eecb27;color:#fff}.statusprt span.open{border:2px solid #12afcb;color:#12afcb}.statusprt span.open:hover{background:#12afcb;color:#fff}\n"] }]
858
+ }], propDecorators: { jobValue: [{
859
+ type: Input
860
+ }] } });
861
+
862
+ class JobcodeOverviewComponent {
863
+ jobValue;
864
+ label = JobCodeOverviewData;
865
+ overViewEnum = JobCodeOverviewEnum;
866
+ constructor() { }
867
+ makeValueObject(item) {
868
+ let obj;
869
+ obj = { label: this.overViewEnum[item], value: this.jobValue[item] };
870
+ return obj;
871
+ }
872
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: JobcodeOverviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
873
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: JobcodeOverviewComponent, selector: "app-jobcode-overview", inputs: { jobValue: "jobValue" }, ngImport: i0, template: "<div class=\"detail_view m-20\">\n <div class=\"destination\">\n <div class=\"duration\">\n <p class=\"pickprt\"><b>{{makeValueObject('pickup_location')['label']}}:</b> {{makeValueObject('pickup_location')['value']}}</p>\n <p class=\"dropprt\"><b>{{makeValueObject('delivery_location')['label']}}:</b> {{makeValueObject('delivery_location')['value']}}</p>\n </div>\n <ng-container *ngFor=\"let item of label\">\n <span *ngIf=\"item !== 'pickup_location' && item !== 'delivery_location'\" (mousedown)=\"$event.stopPropagation()\"><b>{{makeValueObject(item)['label']}}:</b> {{makeValueObject(item)['value']}}</span>\n </ng-container>\n </div>\n\n", styles: [".detail_view .destination .duration{padding:10px}.detail_view .destination span{padding:5px 0}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
874
+ }
875
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: JobcodeOverviewComponent, decorators: [{
876
+ type: Component,
877
+ args: [{ selector: 'app-jobcode-overview', template: "<div class=\"detail_view m-20\">\n <div class=\"destination\">\n <div class=\"duration\">\n <p class=\"pickprt\"><b>{{makeValueObject('pickup_location')['label']}}:</b> {{makeValueObject('pickup_location')['value']}}</p>\n <p class=\"dropprt\"><b>{{makeValueObject('delivery_location')['label']}}:</b> {{makeValueObject('delivery_location')['value']}}</p>\n </div>\n <ng-container *ngFor=\"let item of label\">\n <span *ngIf=\"item !== 'pickup_location' && item !== 'delivery_location'\" (mousedown)=\"$event.stopPropagation()\"><b>{{makeValueObject(item)['label']}}:</b> {{makeValueObject(item)['value']}}</span>\n </ng-container>\n </div>\n\n", styles: [".detail_view .destination .duration{padding:10px}.detail_view .destination span{padding:5px 0}\n"] }]
878
+ }], ctorParameters: () => [], propDecorators: { jobValue: [{
879
+ type: Input
880
+ }] } });
881
+
882
+ const CardKeysValue = ['route_name', 'customer_name', 'material', 'unit',
883
+ 'estimated_distance', 'estimated_time', 'trucker_pay_estimate', 'customer_price_estimate', 'note', 'pickup_location', 'delivery_location'];
884
+ var CardElements;
885
+ (function (CardElements) {
886
+ CardElements["route_name"] = "Name";
887
+ CardElements["customer_name"] = "Customer";
888
+ CardElements["material"] = "Material";
889
+ CardElements["unit"] = "Type";
890
+ CardElements["estimated_distance"] = "Distance";
891
+ CardElements["estimated_time"] = "Travel Time";
892
+ CardElements["trucker_pay_estimate"] = "Trucker Pay Estimate";
893
+ CardElements["customer_price_estimate"] = "Customer Price Estimate";
894
+ CardElements["note"] = "Notes";
895
+ CardElements["pickup_location"] = "Pickup";
896
+ CardElements["delivery_location"] = "Delivery";
897
+ })(CardElements || (CardElements = {}));
898
+ class RouteInfoCardComponent {
899
+ popupData;
900
+ propData;
901
+ cardKeysElement = CardKeysValue;
902
+ ngAfterViewInit() {
903
+ if (this.propData['repository'] === 'customer')
904
+ this.cardKeysElement = this.cardKeysElement.filter(ele => ele !== 'trucker_pay_estimate');
905
+ }
906
+ createLabel(itemName) {
907
+ let obj;
908
+ if (this.propData['repository'] === 'coolmap') {
909
+ obj = { label: CardElements[itemName], value: this.popupData[itemName] };
910
+ }
911
+ if (this.propData['repository'] === 'customer') {
912
+ if (itemName === 'material') {
913
+ obj = { label: CardElements[itemName], value: this.popupData['materialLabel'] };
914
+ }
915
+ else {
916
+ obj = { label: CardElements[itemName], value: this.popupData[itemName] };
917
+ }
918
+ }
919
+ if (itemName === 'trucker_pay_estimate' || itemName === 'customer_price_estimate') {
920
+ obj['value'] = obj['value'] ? '$' + obj['value'] : '';
921
+ }
922
+ return obj;
923
+ }
924
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RouteInfoCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
925
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: RouteInfoCardComponent, selector: "lib-route-info-card", inputs: { popupData: "popupData", propData: "propData" }, ngImport: i0, template: "<div [class]=\"propData['className']\">\n <div class=\"destination\">\n <div class=\"duration\">\n <p class=\"pickprt\"><b>Pickup:</b>{{createLabel('pickup_location')['value']}}</p>\n <p class=\"dropprt\"><b>Delivery:</b>{{createLabel('delivery_location')['value']}}</p>\n </div>\n <ng-container *ngFor=\"let item of cardKeysElement\">\n <span *ngIf=\"item !== 'pickup_location' && item !== 'delivery_location'\" [class.notes]=\"item === 'note'\"><b>{{createLabel(item)['label']}}:</b> {{createLabel(item)['value']}}</span>\n </ng-container>\n </div>\n</div>\n", styles: [".routeCard span{padding:5px 0}.routeCard span.notes{max-height:200px;overflow:auto;white-space:pre-wrap;word-break:break-all}.routeCard .duration{padding:10px}.listRoutecard .duration{background:#444343;border:1px solid #918e8e;padding:10px;color:#fff}.listRoutecard .duration b{color:#fff}.listRoutecard .pickprt:before,.listRoutecard .dropprt:before{background:#fff}.listRoutecard .pickprt b:before,.listRoutecard .dropprt b:before{background:#fff}.listRoutecard span{line-height:20px;color:#fff;padding:3px 0}.listRoutecard span b{color:#fff}.listRoutecard span.notes{max-height:200px;overflow:auto;white-space:pre-wrap;word-break:break-all}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
926
+ }
927
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RouteInfoCardComponent, decorators: [{
928
+ type: Component,
929
+ args: [{ selector: 'lib-route-info-card', template: "<div [class]=\"propData['className']\">\n <div class=\"destination\">\n <div class=\"duration\">\n <p class=\"pickprt\"><b>Pickup:</b>{{createLabel('pickup_location')['value']}}</p>\n <p class=\"dropprt\"><b>Delivery:</b>{{createLabel('delivery_location')['value']}}</p>\n </div>\n <ng-container *ngFor=\"let item of cardKeysElement\">\n <span *ngIf=\"item !== 'pickup_location' && item !== 'delivery_location'\" [class.notes]=\"item === 'note'\"><b>{{createLabel(item)['label']}}:</b> {{createLabel(item)['value']}}</span>\n </ng-container>\n </div>\n</div>\n", styles: [".routeCard span{padding:5px 0}.routeCard span.notes{max-height:200px;overflow:auto;white-space:pre-wrap;word-break:break-all}.routeCard .duration{padding:10px}.listRoutecard .duration{background:#444343;border:1px solid #918e8e;padding:10px;color:#fff}.listRoutecard .duration b{color:#fff}.listRoutecard .pickprt:before,.listRoutecard .dropprt:before{background:#fff}.listRoutecard .pickprt b:before,.listRoutecard .dropprt b:before{background:#fff}.listRoutecard span{line-height:20px;color:#fff;padding:3px 0}.listRoutecard span b{color:#fff}.listRoutecard span.notes{max-height:200px;overflow:auto;white-space:pre-wrap;word-break:break-all}\n"] }]
930
+ }], propDecorators: { popupData: [{
931
+ type: Input
932
+ }], propData: [{
933
+ type: Input
934
+ }] } });
935
+
936
+ class JobCodeComponent {
937
+ utils;
938
+ coolMap;
939
+ config;
940
+ jobdetail;
941
+ customerRepoDetails;
942
+ isVisible = false;
943
+ routes = [];
944
+ selectedRoute = new SelectionModel(true, []);
945
+ clearJobDetails = new EventEmitter();
946
+ openShareRoute = new EventEmitter();
947
+ isOverlapRouteSection = false;
948
+ destroyer$ = new Subject();
949
+ detailsCardEnable;
950
+ preventMouseout = false;
951
+ routeCardDetail;
952
+ preventListUpdate;
953
+ masterRoutes;
954
+ unitList;
955
+ materialsList;
956
+ constructor(utils, coolMap, config) {
957
+ this.utils = utils;
958
+ this.coolMap = coolMap;
959
+ this.config = config;
960
+ this.utils.clearViewRouteforJobCodeObserve.pipe(takeUntil(this.destroyer$)).subscribe(res => {
961
+ if (res)
962
+ this.coolMap.removeJobFromMap(this.selectedRoute.selected);
963
+ this.selectedRoute.clear();
964
+ });
965
+ }
966
+ ngOnInit() { this.checkAndCallRouteList(); }
967
+ checkAndCallRouteList() {
968
+ this.utils.clearOptions();
969
+ if (this.config.repository === 'customer') {
970
+ this.utils.fetchUnitsList().then((res) => {
971
+ this.unitList = res;
972
+ this.utils.fetchMaterialsListForCustomer().then((res) => {
973
+ this.materialsList = res;
974
+ this.getRouteListForCustomer();
975
+ });
976
+ });
977
+ }
978
+ else {
979
+ this.getRouteListForCoolMap();
980
+ }
981
+ }
982
+ getUnitName(data) {
983
+ let unitName = '';
984
+ this.unitList.map((res) => {
985
+ if (res.id === data.unit_id) {
986
+ unitName = res.type;
987
+ }
988
+ });
989
+ return unitName;
990
+ }
991
+ getMaterialName(data) {
992
+ let materialName = '';
993
+ this.materialsList.map((res) => {
994
+ if (res.sub_material_id === data.materials_id) {
995
+ materialName = res.label;
996
+ }
997
+ });
998
+ return materialName;
999
+ }
1000
+ getRouteListForCoolMap() {
1001
+ this.utils.getData('routes/all').pipe(takeUntil(this.destroyer$)).subscribe((res) => {
1002
+ if (res) {
1003
+ this.routes = res.data;
1004
+ this.masterRoutes = res.data;
1005
+ this.preventListUpdate = false;
1006
+ this.routes.forEach((ele) => { this.utils.makeOptions(ele); });
1007
+ }
1008
+ });
1009
+ }
1010
+ getRouteListForCustomer() {
1011
+ const dataset = {
1012
+ customer_id: this.customerRepoDetails.customer.id
1013
+ };
1014
+ this.utils.postdata('routes/all', dataset).pipe(takeUntil(this.destroyer$)).subscribe((res) => {
1015
+ if (res) {
1016
+ this.routes = res.data;
1017
+ this.preventListUpdate = false;
1018
+ this.routes.map((ele) => {
1019
+ ele.unit = this.getUnitName(ele);
1020
+ ele.materialLabel = this.getMaterialName(ele);
1021
+ ele.material = this.getMaterialName(ele).split('|')[0].trim();
1022
+ this.utils.makeOptions(ele);
1023
+ });
1024
+ this.masterRoutes = this.routes;
1025
+ }
1026
+ });
1027
+ }
1028
+ toggleSidemenu() {
1029
+ this.isVisible = !this.isVisible;
1030
+ this.detailsCardEnable = false;
1031
+ this.preventMouseout = false;
1032
+ }
1033
+ clearJob() { this.clearJobDetails.emit(true); this.utils.preVentJobdetailclose.next(false); }
1034
+ selectRoute(event) {
1035
+ const i = this.selectedRoute.selected.findIndex(ele => ele['order_number'] === event['order_number']);
1036
+ this.selectedRoute.toggle(event);
1037
+ if (!this.selectedRoute.isSelected(event) && event['route_id']) {
1038
+ this.coolMap.removeRouteAndMarker(event['route_id']).then((res) => {
1039
+ this.coolMap.extendReBound();
1040
+ });
1041
+ }
1042
+ else {
1043
+ this.coolMap.plotRoute(event, event['route_id'], 'jobrouteList', false, true);
1044
+ }
1045
+ }
1046
+ masterToggle() {
1047
+ if (this.routes.length === this.selectedRoute.selected.length) {
1048
+ this.selectedRoute.clear();
1049
+ this.routes.forEach(row => {
1050
+ this.coolMap.removeRouteAndMarker(row['route_id']).then((res) => { this.coolMap.extendReBound(); });
1051
+ });
1052
+ }
1053
+ else {
1054
+ this.routes.forEach(row => {
1055
+ this.selectedRoute.select(row);
1056
+ this.coolMap.plotRoute(row, row['route_id'], 'jobrouteList', false, true);
1057
+ });
1058
+ }
1059
+ }
1060
+ togglerouteDetails(eventType, route, mouseOut) {
1061
+ if (typeof (eventType) === 'string') {
1062
+ this.preventMouseout = true;
1063
+ this.utils.setdictValue('route-details', JSON.stringify(route));
1064
+ }
1065
+ if (typeof (eventType) === 'boolean' && eventType && !this.preventMouseout) {
1066
+ this.detailsCardEnable = eventType;
1067
+ }
1068
+ ;
1069
+ if (typeof (eventType) === 'boolean' && !eventType && !this.preventMouseout) {
1070
+ this.detailsCardEnable = eventType;
1071
+ }
1072
+ ;
1073
+ if (this.preventMouseout && !this.detailsCardEnable)
1074
+ this.preventMouseout = false;
1075
+ if (mouseOut) {
1076
+ if (this.preventMouseout) {
1077
+ route = this.utils.getdictValue('route-details');
1078
+ this.routeCardDetail = route;
1079
+ }
1080
+ if (!this.preventMouseout) {
1081
+ this.routeCardDetail = route;
1082
+ }
1083
+ }
1084
+ else {
1085
+ this.routeCardDetail = route;
1086
+ }
1087
+ this.routeCardDetail['created_at'] = this.utils.getDateFormat(new Date(this.routeCardDetail['created_at']), '/');
1088
+ }
1089
+ openShareRouteModal(data) {
1090
+ this.openShareRoute.emit(data);
1091
+ }
1092
+ ngOnDestroy() {
1093
+ this.destroyer$.next(true);
1094
+ this.destroyer$.unsubscribe();
1095
+ }
1096
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: JobCodeComponent, deps: [{ token: i1.UtilsService }, { token: i1.CoolmapService }, { token: 'memberData' }], target: i0.ɵɵFactoryTarget.Component });
1097
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: JobCodeComponent, selector: "app-job-code", inputs: { jobdetail: "jobdetail", customerRepoDetails: "customerRepoDetails" }, outputs: { clearJobDetails: "clearJobDetails", openShareRoute: "openShareRoute" }, ngImport: i0, template: "<div class=\"jobcode_detailprt\" (click)=\"isOverlapRouteSection = false\" *ngIf=\"jobdetail\" [ngClass]=\"{'overlap': !isOverlapRouteSection}\" cdkDrag>\n <span class=\"close\"><mat-icon (click)=\"clearJob()\">clear</mat-icon></span>\n <div class=\"job_details_area\">\n <div class=\"detailnameprt\">\n <app-jobcode-status [jobValue]=\"jobdetail\"></app-jobcode-status>\n </div>\n <app-jobcode-overview [jobValue]=\"jobdetail\"></app-jobcode-overview>\n </div>\n</div>\n\n<div class=\"route_listprt\" (click)=\"isOverlapRouteSection = true\" [ngClass]=\"{ 'show': isVisible, 'overlap': isOverlapRouteSection}\">\n <div class=\"listing_toggle\" (click)=\"toggleSidemenu()\">\n <img src=\"assets/images/route.svg\" alt=\"\" />\n </div>\n\n <div class=\"listing_box\">\n <div class=\"closebtn\" (click)=\"toggleSidemenu()\">\n <mat-icon>clear</mat-icon>\n </div>\n\n <div class=\"btnprt\">\n <h2> List of Routes </h2>\n <button (click)=\"masterToggle()\">{{routes && routes.length > 0 && routes.length === selectedRoute.selected.length ? 'Uncheck' : 'Check'}} All</button>\n </div>\n\n <app-job-route-list [routes]=\"routes\" [masterRoutes]=\"masterRoutes\" [selectedRoute]=\"selectedRoute\" (changeRoutes)=\"routes = $event\" (changeSelectedRoute)=\"selectedRoute = $event\"></app-job-route-list>\n\n <!-- // TODO: Find another scrollbar -->\n <!-- <perfect-scrollbar>\n <ul *ngIf=\"routes['length'] > 0\">\n <li *ngFor=\"let list of routes\">\n <div class=\"iconprt\">\n <span>\n <input type=\"checkbox\" [checked]=\"selectedRoute.isSelected(list)\"\n (change)=\"$event ? selectRoute(list) : null\" /><label>&nbsp;</label>\n <div class=\"border\"></div>\n </span>\n <div class=\"statusunit\" [ngClass]=\"list['unit']\">{{list['unit']}}</div>\n <div class=\"infoicon\">\n <img (mouseenter)=\"togglerouteDetails(true, list)\" (mouseout)=\"togglerouteDetails(false, list, true)\"\n (click)=\"togglerouteDetails('click', list)\" src=\"assets/images/info_icon.png\" [alt]=\"\" />\n </div>\n <div class=\"infoicon\" *ngIf=\"config.repository === 'customer'\">\n <img src=\"assets/images/share_icon.png\" (click)=\"openShareRouteModal(list)\" [alt]=\"\" />\n </div>\n </div>\n <div class=\"pickprtbox\">\n <h2> {{list['route_name']}} </h2>\n <h3><ng-container *ngIf=\"config?.repository === 'coolmap'\">{{list['customer_name']}} | </ng-container>{{config.repository === 'coolmap' ? list['material'] : list['materialLabel']}}</h3>\n <div class=\"pickdropprt\">\n <div class=\"pickprt\">\n <b>\n <h4>{{list['pickup_location']}}</h4>\n </b>\n </div>\n <div class=\"dropprt\">\n <b>\n <h4>{{list['delivery_location']}}</h4>\n </b>\n </div>\n </div>\n </div>\n </li>\n </ul>\n <p style=\"color: #fff;\" *ngIf=\"routes.length === 0\">No Route found</p>\n </perfect-scrollbar> -->\n </div>\n\n <div class=\"route_detail\" *ngIf=\"detailsCardEnable\">\n <div class=\"closebtnroutedetail\" (click)=\"detailsCardEnable = false; preventMouseout = false\">\n <mat-icon>clear</mat-icon>\n </div>\n <lib-route-info-card [propData]=\"{className: 'listRoutecard', repository: config['repository']}\" [popupData]=\"routeCardDetail\"></lib-route-info-card>\n <div class=\"createTxt\">\n <small>\n Created by {{routeCardDetail?.created_by_name}} on {{routeCardDetail?.created_at}}\n </small>\n </div>\n </div>\n</div>\n", styles: [".jobcode_detailprt{position:absolute;left:300px;bottom:10px;background:white;padding:15px 20px;border-radius:20px;max-width:350px;z-index:999;box-shadow:0 0 5px #0000001a}.jobcode_detailprt .close{box-shadow:0 0 5px #0000001c;border-radius:100%;width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer;background:#fff;position:absolute;top:-11px;left:-11px}@keyframes autoslide{to{transform:translate(calc(90vw - 100%))}0%{transform:translate(0)}}.route_listprt .listing_toggle{background:white;border-radius:15px;padding:5px;position:absolute;right:10px;top:20px;cursor:pointer}.route_listprt .listing_toggle img{width:28px}.route_listprt .listing_box{background:#282828;height:100vh;position:fixed;right:0;top:0;z-index:1111;box-shadow:-3px 0 5px #ffffff14;transition:.5s;-webkit-transition:.5s;-moz-transition:.5s;width:0;border-radius:40px 0 0;opacity:0}.route_listprt .listing_box .closebtn{display:none}.route_listprt .listing_box ul{padding:0 20px 0 0}.route_listprt .listing_box ul li{background:#4a4a4a;padding:10px 15px;border-radius:15px;display:flex;margin-bottom:10px;position:relative;height:inherit}@media (min-width: 1600px){.route_listprt .listing_box ul li{padding:6px 15px;margin-bottom:5px}}.route_listprt .listing_box ul li .iconprt{display:flex;flex-direction:column}.route_listprt .listing_box ul li .iconprt span{display:flex;align-items:center;margin-bottom:32px}.route_listprt .listing_box ul li .iconprt span input[type=checkbox]{width:100%;height:100%;margin-right:10px;opacity:0;position:absolute;left:0;margin-left:0;top:0;z-index:3;cursor:pointer}.route_listprt .listing_box ul li .iconprt span label{width:100%;position:relative;z-index:2;font-size:12px;color:#878787;height:100%;position:absolute;top:0;left:0}.route_listprt .listing_box ul li .iconprt span .border{position:absolute;width:100%;height:100%;left:0;right:0;top:0;border-radius:15px}.route_listprt .listing_box ul li .iconprt span input:checked~.border{border-left:1px solid white;border-right:1px solid white;border-top:1px solid white;border-bottom:1px solid white}.route_listprt .listing_box ul li .iconprt span h2{margin-left:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px;padding-left:16px;font-size:.9rem;margin-bottom:0;font-weight:400;margin-top:0}.route_listprt .listing_box ul li .iconprt .statusunit{border-radius:30px;font-size:0;color:#fff;text-transform:capitalize;font-weight:500;width:20px;height:20px;text-align:center;line-height:20px;margin-bottom:7px}.route_listprt .listing_box ul li .iconprt .statusunit:first-letter{font-size:.8rem}.route_listprt .listing_box ul li .iconprt .statusunit.Ton{background:#ff7272}.route_listprt .listing_box ul li .iconprt .statusunit.Load{background:#a3c52e}.route_listprt .listing_box ul li .iconprt .statusunit.Hourly{background:#ae23d1}@media (min-width: 1600px){.route_listprt .listing_box ul li .iconprt .statusunit{line-height:21px}}.route_listprt .listing_box ul li .iconprt .infoicon{z-index:5;cursor:pointer}.route_listprt .listing_box ul li .iconprt .infoicon img{width:20px;height:20px}.route_listprt .listing_box ul li .pickprtbox{margin-left:10px}.route_listprt .listing_box ul li .pickprtbox h2{font-size:.9rem;margin:3px 0 5px;white-space:nowrap;text-overflow:ellipsis;max-width:195px;overflow:hidden}.route_listprt .listing_box ul li h3{font-size:.8rem;color:#979797;font-weight:600;margin-top:0;white-space:nowrap;text-overflow:ellipsis;max-width:195px;overflow:hidden;margin-bottom:5px}.route_listprt .listing_box ul li .pickdropprt{font-size:.75rem}.route_listprt .listing_box ul li .pickdropprt .pickprt{position:relative;display:flex;align-items:center;padding-bottom:10px}.route_listprt .listing_box ul li .pickdropprt .pickprt span{padding-left:0;padding-right:20px;display:block}.route_listprt .listing_box ul li .pickdropprt .pickprt b{position:relative}.route_listprt .listing_box ul li .pickdropprt .pickprt b:after{background:#bcbcbc;width:1px;height:100%;left:3px;content:\"\";position:absolute;top:10px}.route_listprt .listing_box ul li .pickdropprt .pickprt h4{position:relative;padding-left:15px;margin:0;line-height:18px;color:#bcbcbc;font-weight:400;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.route_listprt .listing_box ul li .pickdropprt .pickprt h4:before{background:#bcbcbc;top:4px;left:0;position:absolute;content:\"\";width:7px;height:7px;border-radius:100%}.route_listprt .listing_box ul li .pickdropprt .dropprt{position:relative;padding-bottom:10px;display:flex;align-items:center}.route_listprt .listing_box ul li .pickdropprt .dropprt span{padding-left:0;padding-right:20px;display:block}.route_listprt .listing_box ul li .pickdropprt .dropprt b{position:relative}.route_listprt .listing_box ul li .pickdropprt .dropprt b:after{background:#bcbcbc;width:1px;height:12px;left:3px;content:\"\";position:absolute;top:-7px}.route_listprt .listing_box ul li .pickdropprt .dropprt h4{position:relative;padding-left:15px;margin:0;line-height:18px;color:#bcbcbc;font-weight:400;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.route_listprt .listing_box ul li .pickdropprt .dropprt h4:before{background:#bcbcbc;top:4px;left:0;position:absolute;content:\"\";width:7px;height:7px;border-radius:100%}.route_listprt.show .listing_box{width:300px;max-width:300px;flex:0 0 350px;transition:.5s;-webkit-transition:.5s;-moz-transition:.5s;padding:40px 0 40px 20px;opacity:1}.route_listprt.show .listing_box h2{color:#fff;white-space:nowrap}.route_listprt.show .listing_box .closebtn{position:absolute;left:-33px;top:50px;background:#282828;color:#fff;padding:8px;border-top-left-radius:15px;border-bottom-left-radius:15px;cursor:pointer;box-shadow:-4px 2px 5px #ffffff14;display:block}.btnprt{display:flex;justify-content:space-between;align-items:center;padding-right:20px}.btnprt h2{margin:0}.btnprt button{font-size:15px;padding:8px 20px;background-color:#326ad3;color:#fff;border:none;border-radius:10px;box-shadow:none;outline:none}.hidden{display:none}.route_detail{background:#282828;position:absolute;width:260px;top:50%;transform:translateY(-50%);right:310px;border-radius:20px;padding:10px;box-shadow:0 0 5px #ffffff36}.createTxt small{color:#fff;font-size:.7rem}.closebtnroutedetail{box-shadow:0 0 5px #0000001c;border-radius:100%;width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer;background:#f5f5f5;position:absolute;top:-7px;left:-11px}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$3.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: JobRouteListComponent, selector: "app-job-route-list", inputs: ["routes", "selectedRoute", "masterRoutes"], outputs: ["changeNav", "changeRoutes", "changeSelectedRoute"] }, { kind: "component", type: JobcodeStatusComponent, selector: "app-jobcode-status", inputs: ["jobValue"] }, { kind: "component", type: JobcodeOverviewComponent, selector: "app-jobcode-overview", inputs: ["jobValue"] }, { kind: "component", type: RouteInfoCardComponent, selector: "lib-route-info-card", inputs: ["popupData", "propData"] }] });
1098
+ }
1099
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: JobCodeComponent, decorators: [{
1100
+ type: Component,
1101
+ args: [{ selector: 'app-job-code', template: "<div class=\"jobcode_detailprt\" (click)=\"isOverlapRouteSection = false\" *ngIf=\"jobdetail\" [ngClass]=\"{'overlap': !isOverlapRouteSection}\" cdkDrag>\n <span class=\"close\"><mat-icon (click)=\"clearJob()\">clear</mat-icon></span>\n <div class=\"job_details_area\">\n <div class=\"detailnameprt\">\n <app-jobcode-status [jobValue]=\"jobdetail\"></app-jobcode-status>\n </div>\n <app-jobcode-overview [jobValue]=\"jobdetail\"></app-jobcode-overview>\n </div>\n</div>\n\n<div class=\"route_listprt\" (click)=\"isOverlapRouteSection = true\" [ngClass]=\"{ 'show': isVisible, 'overlap': isOverlapRouteSection}\">\n <div class=\"listing_toggle\" (click)=\"toggleSidemenu()\">\n <img src=\"assets/images/route.svg\" alt=\"\" />\n </div>\n\n <div class=\"listing_box\">\n <div class=\"closebtn\" (click)=\"toggleSidemenu()\">\n <mat-icon>clear</mat-icon>\n </div>\n\n <div class=\"btnprt\">\n <h2> List of Routes </h2>\n <button (click)=\"masterToggle()\">{{routes && routes.length > 0 && routes.length === selectedRoute.selected.length ? 'Uncheck' : 'Check'}} All</button>\n </div>\n\n <app-job-route-list [routes]=\"routes\" [masterRoutes]=\"masterRoutes\" [selectedRoute]=\"selectedRoute\" (changeRoutes)=\"routes = $event\" (changeSelectedRoute)=\"selectedRoute = $event\"></app-job-route-list>\n\n <!-- // TODO: Find another scrollbar -->\n <!-- <perfect-scrollbar>\n <ul *ngIf=\"routes['length'] > 0\">\n <li *ngFor=\"let list of routes\">\n <div class=\"iconprt\">\n <span>\n <input type=\"checkbox\" [checked]=\"selectedRoute.isSelected(list)\"\n (change)=\"$event ? selectRoute(list) : null\" /><label>&nbsp;</label>\n <div class=\"border\"></div>\n </span>\n <div class=\"statusunit\" [ngClass]=\"list['unit']\">{{list['unit']}}</div>\n <div class=\"infoicon\">\n <img (mouseenter)=\"togglerouteDetails(true, list)\" (mouseout)=\"togglerouteDetails(false, list, true)\"\n (click)=\"togglerouteDetails('click', list)\" src=\"assets/images/info_icon.png\" [alt]=\"\" />\n </div>\n <div class=\"infoicon\" *ngIf=\"config.repository === 'customer'\">\n <img src=\"assets/images/share_icon.png\" (click)=\"openShareRouteModal(list)\" [alt]=\"\" />\n </div>\n </div>\n <div class=\"pickprtbox\">\n <h2> {{list['route_name']}} </h2>\n <h3><ng-container *ngIf=\"config?.repository === 'coolmap'\">{{list['customer_name']}} | </ng-container>{{config.repository === 'coolmap' ? list['material'] : list['materialLabel']}}</h3>\n <div class=\"pickdropprt\">\n <div class=\"pickprt\">\n <b>\n <h4>{{list['pickup_location']}}</h4>\n </b>\n </div>\n <div class=\"dropprt\">\n <b>\n <h4>{{list['delivery_location']}}</h4>\n </b>\n </div>\n </div>\n </div>\n </li>\n </ul>\n <p style=\"color: #fff;\" *ngIf=\"routes.length === 0\">No Route found</p>\n </perfect-scrollbar> -->\n </div>\n\n <div class=\"route_detail\" *ngIf=\"detailsCardEnable\">\n <div class=\"closebtnroutedetail\" (click)=\"detailsCardEnable = false; preventMouseout = false\">\n <mat-icon>clear</mat-icon>\n </div>\n <lib-route-info-card [propData]=\"{className: 'listRoutecard', repository: config['repository']}\" [popupData]=\"routeCardDetail\"></lib-route-info-card>\n <div class=\"createTxt\">\n <small>\n Created by {{routeCardDetail?.created_by_name}} on {{routeCardDetail?.created_at}}\n </small>\n </div>\n </div>\n</div>\n", styles: [".jobcode_detailprt{position:absolute;left:300px;bottom:10px;background:white;padding:15px 20px;border-radius:20px;max-width:350px;z-index:999;box-shadow:0 0 5px #0000001a}.jobcode_detailprt .close{box-shadow:0 0 5px #0000001c;border-radius:100%;width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer;background:#fff;position:absolute;top:-11px;left:-11px}@keyframes autoslide{to{transform:translate(calc(90vw - 100%))}0%{transform:translate(0)}}.route_listprt .listing_toggle{background:white;border-radius:15px;padding:5px;position:absolute;right:10px;top:20px;cursor:pointer}.route_listprt .listing_toggle img{width:28px}.route_listprt .listing_box{background:#282828;height:100vh;position:fixed;right:0;top:0;z-index:1111;box-shadow:-3px 0 5px #ffffff14;transition:.5s;-webkit-transition:.5s;-moz-transition:.5s;width:0;border-radius:40px 0 0;opacity:0}.route_listprt .listing_box .closebtn{display:none}.route_listprt .listing_box ul{padding:0 20px 0 0}.route_listprt .listing_box ul li{background:#4a4a4a;padding:10px 15px;border-radius:15px;display:flex;margin-bottom:10px;position:relative;height:inherit}@media (min-width: 1600px){.route_listprt .listing_box ul li{padding:6px 15px;margin-bottom:5px}}.route_listprt .listing_box ul li .iconprt{display:flex;flex-direction:column}.route_listprt .listing_box ul li .iconprt span{display:flex;align-items:center;margin-bottom:32px}.route_listprt .listing_box ul li .iconprt span input[type=checkbox]{width:100%;height:100%;margin-right:10px;opacity:0;position:absolute;left:0;margin-left:0;top:0;z-index:3;cursor:pointer}.route_listprt .listing_box ul li .iconprt span label{width:100%;position:relative;z-index:2;font-size:12px;color:#878787;height:100%;position:absolute;top:0;left:0}.route_listprt .listing_box ul li .iconprt span .border{position:absolute;width:100%;height:100%;left:0;right:0;top:0;border-radius:15px}.route_listprt .listing_box ul li .iconprt span input:checked~.border{border-left:1px solid white;border-right:1px solid white;border-top:1px solid white;border-bottom:1px solid white}.route_listprt .listing_box ul li .iconprt span h2{margin-left:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px;padding-left:16px;font-size:.9rem;margin-bottom:0;font-weight:400;margin-top:0}.route_listprt .listing_box ul li .iconprt .statusunit{border-radius:30px;font-size:0;color:#fff;text-transform:capitalize;font-weight:500;width:20px;height:20px;text-align:center;line-height:20px;margin-bottom:7px}.route_listprt .listing_box ul li .iconprt .statusunit:first-letter{font-size:.8rem}.route_listprt .listing_box ul li .iconprt .statusunit.Ton{background:#ff7272}.route_listprt .listing_box ul li .iconprt .statusunit.Load{background:#a3c52e}.route_listprt .listing_box ul li .iconprt .statusunit.Hourly{background:#ae23d1}@media (min-width: 1600px){.route_listprt .listing_box ul li .iconprt .statusunit{line-height:21px}}.route_listprt .listing_box ul li .iconprt .infoicon{z-index:5;cursor:pointer}.route_listprt .listing_box ul li .iconprt .infoicon img{width:20px;height:20px}.route_listprt .listing_box ul li .pickprtbox{margin-left:10px}.route_listprt .listing_box ul li .pickprtbox h2{font-size:.9rem;margin:3px 0 5px;white-space:nowrap;text-overflow:ellipsis;max-width:195px;overflow:hidden}.route_listprt .listing_box ul li h3{font-size:.8rem;color:#979797;font-weight:600;margin-top:0;white-space:nowrap;text-overflow:ellipsis;max-width:195px;overflow:hidden;margin-bottom:5px}.route_listprt .listing_box ul li .pickdropprt{font-size:.75rem}.route_listprt .listing_box ul li .pickdropprt .pickprt{position:relative;display:flex;align-items:center;padding-bottom:10px}.route_listprt .listing_box ul li .pickdropprt .pickprt span{padding-left:0;padding-right:20px;display:block}.route_listprt .listing_box ul li .pickdropprt .pickprt b{position:relative}.route_listprt .listing_box ul li .pickdropprt .pickprt b:after{background:#bcbcbc;width:1px;height:100%;left:3px;content:\"\";position:absolute;top:10px}.route_listprt .listing_box ul li .pickdropprt .pickprt h4{position:relative;padding-left:15px;margin:0;line-height:18px;color:#bcbcbc;font-weight:400;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.route_listprt .listing_box ul li .pickdropprt .pickprt h4:before{background:#bcbcbc;top:4px;left:0;position:absolute;content:\"\";width:7px;height:7px;border-radius:100%}.route_listprt .listing_box ul li .pickdropprt .dropprt{position:relative;padding-bottom:10px;display:flex;align-items:center}.route_listprt .listing_box ul li .pickdropprt .dropprt span{padding-left:0;padding-right:20px;display:block}.route_listprt .listing_box ul li .pickdropprt .dropprt b{position:relative}.route_listprt .listing_box ul li .pickdropprt .dropprt b:after{background:#bcbcbc;width:1px;height:12px;left:3px;content:\"\";position:absolute;top:-7px}.route_listprt .listing_box ul li .pickdropprt .dropprt h4{position:relative;padding-left:15px;margin:0;line-height:18px;color:#bcbcbc;font-weight:400;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.route_listprt .listing_box ul li .pickdropprt .dropprt h4:before{background:#bcbcbc;top:4px;left:0;position:absolute;content:\"\";width:7px;height:7px;border-radius:100%}.route_listprt.show .listing_box{width:300px;max-width:300px;flex:0 0 350px;transition:.5s;-webkit-transition:.5s;-moz-transition:.5s;padding:40px 0 40px 20px;opacity:1}.route_listprt.show .listing_box h2{color:#fff;white-space:nowrap}.route_listprt.show .listing_box .closebtn{position:absolute;left:-33px;top:50px;background:#282828;color:#fff;padding:8px;border-top-left-radius:15px;border-bottom-left-radius:15px;cursor:pointer;box-shadow:-4px 2px 5px #ffffff14;display:block}.btnprt{display:flex;justify-content:space-between;align-items:center;padding-right:20px}.btnprt h2{margin:0}.btnprt button{font-size:15px;padding:8px 20px;background-color:#326ad3;color:#fff;border:none;border-radius:10px;box-shadow:none;outline:none}.hidden{display:none}.route_detail{background:#282828;position:absolute;width:260px;top:50%;transform:translateY(-50%);right:310px;border-radius:20px;padding:10px;box-shadow:0 0 5px #ffffff36}.createTxt small{color:#fff;font-size:.7rem}.closebtnroutedetail{box-shadow:0 0 5px #0000001c;border-radius:100%;width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer;background:#f5f5f5;position:absolute;top:-7px;left:-11px}\n"] }]
1102
+ }], ctorParameters: () => [{ type: i1.UtilsService }, { type: i1.CoolmapService }, { type: i1.CoolmapConfigModel, decorators: [{
1103
+ type: Inject,
1104
+ args: ['memberData']
1105
+ }] }], propDecorators: { jobdetail: [{
1106
+ type: Input
1107
+ }], customerRepoDetails: [{
1108
+ type: Input
1109
+ }], clearJobDetails: [{
1110
+ type: Output
1111
+ }], openShareRoute: [{
1112
+ type: Output
1113
+ }] } });
1114
+
1115
+ class DialogComponent {
1116
+ dialogRef;
1117
+ data;
1118
+ body = 'Are you sure you want to delete?';
1119
+ positive = 'Delete';
1120
+ negative = 'Cancel';
1121
+ constructor(dialogRef, data) {
1122
+ this.dialogRef = dialogRef;
1123
+ this.data = data;
1124
+ ['body', 'positive', 'negative'].map(elem => {
1125
+ if (this.data[elem] !== undefined) {
1126
+ this[elem] = this.data[elem];
1127
+ }
1128
+ });
1129
+ }
1130
+ onClose(result) { this.dialogRef.close(result); }
1131
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: DialogComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
1132
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: DialogComponent, selector: "app-dialog", ngImport: i0, template: "<div class=\"dialogbox\">\n <h2>{{body}}</h2>\n <div class=\"twobtnprt\">\n <button class=\"delbtn\" (click)=\"onClose(true)\">{{positive}}</button>\n <button class=\"closebtn\" (click)=\"onClose(false)\">{{negative}}</button>\n </div>\n</div>\n", styles: [".dialogbox{display:flex;flex-direction:column}.dialogbox h2{font-size:1.5rem}.dialogbox .twobtnprt{display:flex;justify-content:center;margin-top:10px}.closebtn{background:black;color:#fff;border-radius:30px;padding:10px 18px;margin:0 10px;font-size:1rem}.delbtn{background:red;color:#fff;border-radius:30px;padding:10px 18px;margin:0 10px;font-size:1rem}\n"] });
1133
+ }
1134
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: DialogComponent, decorators: [{
1135
+ type: Component,
1136
+ args: [{ selector: 'app-dialog', template: "<div class=\"dialogbox\">\n <h2>{{body}}</h2>\n <div class=\"twobtnprt\">\n <button class=\"delbtn\" (click)=\"onClose(true)\">{{positive}}</button>\n <button class=\"closebtn\" (click)=\"onClose(false)\">{{negative}}</button>\n </div>\n</div>\n", styles: [".dialogbox{display:flex;flex-direction:column}.dialogbox h2{font-size:1.5rem}.dialogbox .twobtnprt{display:flex;justify-content:center;margin-top:10px}.closebtn{background:black;color:#fff;border-radius:30px;padding:10px 18px;margin:0 10px;font-size:1rem}.delbtn{background:red;color:#fff;border-radius:30px;padding:10px 18px;margin:0 10px;font-size:1rem}\n"] }]
1137
+ }], ctorParameters: () => [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
1138
+ type: Inject,
1139
+ args: [MAT_DIALOG_DATA]
1140
+ }] }] });
1141
+
1142
+ class EstimationDisplayComponent {
1143
+ value;
1144
+ label = EstinationData;
1145
+ Estinationlabel = EstinationEnum;
1146
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: EstimationDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1147
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: EstimationDisplayComponent, selector: "app-estimation-display", inputs: { value: "value" }, ngImport: i0, template: "<div class=\"d-flex\">\n <ng-container *ngFor=\"let item of label\">\n <span *ngIf=\"value[item]\" class=\"estimate\" (mousedown)=\"$event.stopPropagation()\">\n Estimation of {{Estinationlabel[item]}} - <b>{{value[item]}}</b>\n </span>\n </ng-container>\n</div>\n", styles: [".estimate{margin-right:20px;font-size:.7rem}@media (min-width: 1600px){.estimate{font-size:.95rem}}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1148
+ }
1149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: EstimationDisplayComponent, decorators: [{
1150
+ type: Component,
1151
+ args: [{ selector: 'app-estimation-display', template: "<div class=\"d-flex\">\n <ng-container *ngFor=\"let item of label\">\n <span *ngIf=\"value[item]\" class=\"estimate\" (mousedown)=\"$event.stopPropagation()\">\n Estimation of {{Estinationlabel[item]}} - <b>{{value[item]}}</b>\n </span>\n </ng-container>\n</div>\n", styles: [".estimate{margin-right:20px;font-size:.7rem}@media (min-width: 1600px){.estimate{font-size:.95rem}}\n"] }]
1152
+ }], propDecorators: { value: [{
1153
+ type: Input
1154
+ }] } });
1155
+
1156
+ class AddRouteComponent {
1157
+ coolMapService;
1158
+ utils;
1159
+ dialog;
1160
+ config;
1161
+ filterPickup;
1162
+ filterDelivery;
1163
+ changeNav = new EventEmitter();
1164
+ updateRouteList = new EventEmitter();
1165
+ pickupOptions = [];
1166
+ deliveryOptions = [];
1167
+ requestParmsForRouteDetails = { pickup_lat_lng: '', delivery_lat_lng: '' };
1168
+ customersList = [];
1169
+ unitsList = [];
1170
+ materialsList = [];
1171
+ addRouteForm;
1172
+ routeData;
1173
+ customerRepoDetails;
1174
+ routeId;
1175
+ preventSave = false;
1176
+ preventInitialSave = false;
1177
+ customersList$;
1178
+ routeDetails;
1179
+ destroyer$ = new Subject();
1180
+ popupDetails;
1181
+ enablePopUp = false;
1182
+ prevantPopupClose = false;
1183
+ enableForm = false;
1184
+ constructor(coolMapService, utils, dialog, config) {
1185
+ this.coolMapService = coolMapService;
1186
+ this.utils = utils;
1187
+ this.dialog = dialog;
1188
+ this.config = config;
1189
+ if (this.config.repository === 'customer') {
1190
+ this.utils.fetchMaterialsListForCustomer().then((res) => {
1191
+ this.materialsList = res;
1192
+ });
1193
+ }
1194
+ else {
1195
+ this.utils.fetchMaterialsList().then((res) => {
1196
+ this.materialsList = res;
1197
+ });
1198
+ }
1199
+ this.utils.fetchUnitsList().then((res) => {
1200
+ this.unitsList = res;
1201
+ });
1202
+ this.formInit();
1203
+ this.utils.getrouteDetailsUtility.subscribe(res => {
1204
+ if (res) {
1205
+ if (res['event'] !== 'click' && !this.prevantPopupClose) {
1206
+ this.enablePopUp = res['event'];
1207
+ }
1208
+ else if (this.enablePopUp && !this.prevantPopupClose) {
1209
+ this.prevantPopupClose = true;
1210
+ }
1211
+ if (res['event'] !== 'click' && !res['event'] && this.prevantPopupClose) {
1212
+ this.popupDetails = this.utils.getdictValue('route-detailsv2');
1213
+ }
1214
+ else {
1215
+ this.popupDetails = res['route'];
1216
+ }
1217
+ if (this.enablePopUp)
1218
+ this.popupDetails['created_at'] = this.utils.getDateFormat(new Date(this.popupDetails['created_at']), '/');
1219
+ }
1220
+ });
1221
+ }
1222
+ filterCustomerList() {
1223
+ this.customersList$ = this.addRouteForm.controls['customer_name'].valueChanges.pipe(startWith(''), map(value => this._filter(value || '')));
1224
+ }
1225
+ _filter(value) {
1226
+ const filterValue = value.toLowerCase();
1227
+ return this.customersList.filter((option) => option['customer_name'].toLowerCase().includes(filterValue));
1228
+ }
1229
+ ngOnChanges(changes) {
1230
+ if (changes['routeData'] && !changes['routeData']['currentValue'])
1231
+ this.inIt(null);
1232
+ }
1233
+ openDialog() {
1234
+ const dialogRef = this.dialog.open(DialogComponent, {
1235
+ data: { body: 'Are you sure you want to delete this route?' },
1236
+ });
1237
+ dialogRef.afterClosed().subscribe(res => { if (res) {
1238
+ this.deleteRoute();
1239
+ } });
1240
+ }
1241
+ editEvent() {
1242
+ this.prevantPopupClose = false;
1243
+ this.enableForm = true;
1244
+ this.enablePopUp = false;
1245
+ this.popupDetails['prevent'] = false;
1246
+ this.utils.removeMapEntity.next(this.popupDetails);
1247
+ this.inIt(this.popupDetails);
1248
+ }
1249
+ inIt(changes) {
1250
+ if (changes) {
1251
+ if (!changes['prevent']) {
1252
+ this.preventSave = false;
1253
+ this.formControlValue();
1254
+ this.patchFormValue(changes).then(() => {
1255
+ this.checkAndFetchRouteInformation(true);
1256
+ });
1257
+ }
1258
+ }
1259
+ if (!changes) {
1260
+ this.enableForm = true;
1261
+ this.preventSave = true;
1262
+ this.patchFormValue().then(() => {
1263
+ this.checkAndFetchRouteInformation();
1264
+ });
1265
+ }
1266
+ }
1267
+ ngOnInit() {
1268
+ this.formControlValue();
1269
+ if (this.config.repository === 'customer') {
1270
+ this.addRouteForm.patchValue({
1271
+ customer_id: this.customerRepoDetails.customer.id,
1272
+ customer_name: this.customerRepoDetails.customer.name,
1273
+ });
1274
+ }
1275
+ else {
1276
+ this.utils.fetchCustomersList().then((res) => {
1277
+ this.customersList = res;
1278
+ this.filterCustomerList();
1279
+ this.addRouteForm.controls['customer_name'].enable();
1280
+ });
1281
+ }
1282
+ }
1283
+ ngAfterViewInit() {
1284
+ fromEvent(this.filterPickup.nativeElement, 'keyup').pipe(distinctUntilChanged(), debounceTime(150)).pipe(takeUntil(this.destroyer$)).subscribe(() => {
1285
+ this.utils.fetchAutoCompleteLocations(this.filterPickup.nativeElement.value).pipe(takeUntil(this.destroyer$)).subscribe((res) => {
1286
+ this.pickupOptions = res.features;
1287
+ });
1288
+ });
1289
+ fromEvent(this.filterDelivery.nativeElement, 'keyup').pipe(distinctUntilChanged(), debounceTime(150)).pipe(takeUntil(this.destroyer$)).subscribe(() => {
1290
+ this.utils.fetchAutoCompleteLocations(this.filterDelivery.nativeElement.value).pipe(takeUntil(this.destroyer$)).subscribe((res) => {
1291
+ this.deliveryOptions = res.features;
1292
+ });
1293
+ });
1294
+ }
1295
+ formControlValue() {
1296
+ this.addRouteForm.controls['pickup_location']?.valueChanges.pipe(takeUntil(this.destroyer$)).subscribe((res) => {
1297
+ if (this.addRouteForm.value.pickup_location && res !== this.addRouteForm.value.pickup_location) {
1298
+ this.addRouteForm.patchValue({ pickup_lat_lng: '' });
1299
+ this.addRouteForm.controls['pickup_lat_lng'].markAsTouched();
1300
+ }
1301
+ });
1302
+ this.addRouteForm.controls['delivery_location']?.valueChanges.pipe(takeUntil(this.destroyer$)).subscribe((res) => {
1303
+ if (this.addRouteForm.value.delivery_location && res !== this.addRouteForm.value.delivery_location) {
1304
+ this.addRouteForm.patchValue({ delivery_lat_lng: '' });
1305
+ this.addRouteForm.controls['delivery_lat_lng'].markAsTouched();
1306
+ }
1307
+ });
1308
+ }
1309
+ formInit() {
1310
+ this.addRouteForm = new FormGroup({
1311
+ route_name: new FormControl('', [Validators.required]),
1312
+ customer_name: new FormControl({ value: '', disabled: true }, [Validators.required]),
1313
+ customer_id: new FormControl(''),
1314
+ materials_id: new FormControl('', [Validators.required]),
1315
+ unit_id: new FormControl('', [Validators.required]),
1316
+ path: new FormControl('', [Validators.required]),
1317
+ pickup_location: new FormControl('', [Validators.required]),
1318
+ pickup_lat_lng: new FormControl('', [Validators.required]),
1319
+ delivery_location: new FormControl('', [Validators.required]),
1320
+ delivery_lat_lng: new FormControl('', [Validators.required]),
1321
+ estimated_distance: new FormControl('', [Validators.required]),
1322
+ estimated_time: new FormControl('', [Validators.required]),
1323
+ note: new FormControl('', [Validators.maxLength(2048)]),
1324
+ trucker_pay_estimate: new FormControl(null),
1325
+ customer_price_estimate: new FormControl(null),
1326
+ });
1327
+ }
1328
+ async patchFormValue(data) {
1329
+ this.addRouteForm.reset();
1330
+ this.addRouteForm.patchValue(data);
1331
+ if (this.config.repository === 'customer') {
1332
+ this.addRouteForm.patchValue({
1333
+ customer_id: this.customerRepoDetails.customer.id,
1334
+ customer_name: this.customerRepoDetails.customer.name,
1335
+ });
1336
+ }
1337
+ this.routeId = data?.route_id;
1338
+ this.routeDetails = data ? { pickup_location: data.pickup_location, delivery_location: data.delivery_location } : null;
1339
+ this.addRouteForm.valueChanges.pipe(takeUntil(this.destroyer$)).subscribe(res => {
1340
+ if (res) {
1341
+ if (this.preventInitialSave)
1342
+ this.preventInitialSave = false;
1343
+ }
1344
+ });
1345
+ this.filterCustomerList();
1346
+ await true;
1347
+ }
1348
+ selectedLongLat(type, event) {
1349
+ if (type === 'pickup') {
1350
+ this.addRouteForm.patchValue({
1351
+ pickup_lat_lng: (event.geometry.coordinates[1] + ',' + event.geometry.coordinates[0]).toString()
1352
+ });
1353
+ this.coolMapService.clearBoundWithCordinates();
1354
+ }
1355
+ else if (type === 'delivery') {
1356
+ this.addRouteForm.patchValue({
1357
+ delivery_lat_lng: (event.geometry.coordinates[1] + ',' + event.geometry.coordinates[0]).toString()
1358
+ });
1359
+ }
1360
+ this.checkAndFetchRouteInformation();
1361
+ }
1362
+ checkAndFetchRouteInformation(isinitial) {
1363
+ if (this.addRouteForm.value?.delivery_lat_lng?.length > 0 && this.addRouteForm.value?.pickup_lat_lng?.length > 0 && this.addRouteForm.value.unit_id) {
1364
+ let unit = this.unitsList.find((x) => x.id === this.addRouteForm.value.unit_id);
1365
+ const param = {
1366
+ delivery_lat_lng: this.addRouteForm.value.delivery_lat_lng,
1367
+ pickup_lat_lng: this.addRouteForm.value.pickup_lat_lng,
1368
+ unit: unit?.type
1369
+ };
1370
+ this.utils.postdata('calculate/routes/estimation', param).pipe(takeUntil(this.destroyer$)).subscribe((res) => {
1371
+ if (res && res['path']) {
1372
+ this.addRouteForm.patchValue({
1373
+ estimated_distance: res['dist'],
1374
+ estimated_time: res['time'],
1375
+ path: res['path'],
1376
+ trucker_pay_estimate: res['trucker_haul_cost'],
1377
+ customer_price_estimate: (+(+res['trucker_haul_cost'] / 0.80).toFixed(2))
1378
+ });
1379
+ let path = res['path'].split(';');
1380
+ path = path.map((ele) => { return ele = this.formateLatLong(ele); });
1381
+ res['path'] = path;
1382
+ const element = {
1383
+ type: 'FeatureCollection',
1384
+ features: [{ type: 'Feature', properties: {}, geometry: { type: 'LineString', coordinates: res['path'] } }]
1385
+ };
1386
+ this.coolMapService.removeRouteAndMarker(1).then(() => {
1387
+ const unit = this.unitsList.find((x) => x.id === this.addRouteForm.value.unit_id);
1388
+ const materialDetails = this.materialsList.find((x) => x.sub_material_id === this.addRouteForm.value.materials_id);
1389
+ this.coolMapService.loadMapProperty(element, 1, unit?.type, {
1390
+ pickup_location: this.addRouteForm.get('pickup_location')?.value,
1391
+ delivery_location: this.addRouteForm.get('delivery_location')?.value,
1392
+ route_name: this.addRouteForm.get('route_name')?.value,
1393
+ materialLabel: materialDetails?.label,
1394
+ unit: unit?.type
1395
+ }).then((res) => { this.preventSave = true; });
1396
+ });
1397
+ }
1398
+ else {
1399
+ this.coolMapService.removeRouteAndMarker(1);
1400
+ this.utils.openSnackBar(res['status'], 'error');
1401
+ }
1402
+ if (this.routeId && isinitial)
1403
+ this.preventInitialSave = true;
1404
+ });
1405
+ }
1406
+ else {
1407
+ this.coolMapService.removeRouteAndMarker(1);
1408
+ }
1409
+ }
1410
+ formateLatLong(latlong) { return latlong ? latlong.split(',').map(x => +x).reverse() : null; }
1411
+ saveRoute() {
1412
+ if (this.addRouteForm.valid) {
1413
+ this.preventSave = false;
1414
+ const data = this.addRouteForm.getRawValue();
1415
+ const url = this.routeId ? this.utils.postdata('update/routes', data) : this.utils.postdata('add/routes', data);
1416
+ if (this.routeId)
1417
+ data['id'] = this.routeId;
1418
+ url.pipe(takeUntil(this.destroyer$)).subscribe((res) => {
1419
+ if (res.success) {
1420
+ this.updateRouteList.emit(true);
1421
+ this.utils.openSnackBar(res.message, 'success');
1422
+ this.preventInitialSave = true;
1423
+ this.preventSave = true;
1424
+ if (!this.routeId)
1425
+ this.changeNav.next('Addroute');
1426
+ }
1427
+ else {
1428
+ this.utils.openSnackBar(res.message, 'error');
1429
+ this.preventSave = true;
1430
+ }
1431
+ }, (err) => { if (err) {
1432
+ this.preventSave = true;
1433
+ } });
1434
+ }
1435
+ else {
1436
+ this.addRouteForm.markAllAsTouched();
1437
+ }
1438
+ }
1439
+ deleteRoute() {
1440
+ this.preventSave = false;
1441
+ this.utils.postdata('delete/routes', { uuid: this.routeId }).subscribe(res => {
1442
+ if (res['data']['success']) {
1443
+ this.utils.openSnackBar(res['data']['message'], 'success');
1444
+ this.updateRouteList.emit(true);
1445
+ this.changeNav.next('Addroute');
1446
+ this.preventInitialSave = true;
1447
+ this.preventSave = true;
1448
+ }
1449
+ else {
1450
+ this.utils.openSnackBar('Somthing went wrong', 'error');
1451
+ this.preventSave = true;
1452
+ }
1453
+ }, (err) => { this.preventSave = true; });
1454
+ }
1455
+ ngOnDestroy() {
1456
+ this.destroyer$.next(true);
1457
+ this.destroyer$.unsubscribe();
1458
+ }
1459
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AddRouteComponent, deps: [{ token: i1.CoolmapService }, { token: i1.UtilsService }, { token: i1$1.MatDialog }, { token: 'memberData' }], target: i0.ɵɵFactoryTarget.Component });
1460
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: AddRouteComponent, selector: "app-add-route", inputs: { routeData: "routeData", customerRepoDetails: "customerRepoDetails" }, outputs: { changeNav: "changeNav", updateRouteList: "updateRouteList" }, viewQueries: [{ propertyName: "filterPickup", first: true, predicate: ["filterPickup"], descendants: true }, { propertyName: "filterDelivery", first: true, predicate: ["filterDelivery"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"addroutebox\">\n <div class=\"routedetailbox\" *ngIf=\"enablePopUp\">\n <div class=\"closebtnroutedetail\">\n <mat-icon (click)=\"prevantPopupClose = false; enablePopUp = false;\">clear</mat-icon>\n </div>\n <lib-route-info-card [propData]=\"{className: 'routeCard', repository: config['repository']}\" [popupData]=\"popupDetails\"></lib-route-info-card>\n <div class=\"createTxt\">\n <small>\n Created by {{popupDetails['created_by_name']}} on {{popupDetails['created_at']}}\n </small>\n <button class=\"editbtn\" (click)=\"editEvent()\">Edit</button>\n </div>\n </div>\n <div class=\"add_add_route_box\" cdkDrag [style.visibility]=\"!enableForm ? 'hidden' : 'visible'\">\n <div class=\"topheadingprt\">\n <h2> {{routeId? 'EDIT' : 'ADD'}} ROUTE </h2>\n <div class=\"buttonprt\">\n <button *ngIf=\"routeId\" class=\"delbtn\" (click)=\"openDialog()\">Delete</button>\n <button mat-raised-button type=\"submit\" class=\"closebtn\" (click)=\"changeNav.next('Addroute')\">Close</button>\n </div>\n </div>\n <form [formGroup]=\"addRouteForm\">\n <div class=\"route_form_area\">\n <div class=\"col-6\">\n <mat-form-field>\n <mat-label>Route Name</mat-label>\n <input matInput formControlName=\"route_name\" autocomplete=\"nope\" (mousedown)=\"$event.stopPropagation()\">\n <mat-error *ngIf=\"addRouteForm.controls['route_name'].hasError('required')\">\n Route Name is required\n </mat-error>\n </mat-form-field>\n </div>\n <div class=\"col-6\">\n <mat-form-field>\n <input type=\"text\" placeholder=\"Customer Name\" matInput formControlName=\"customer_name\" [matAutocomplete]=\"auto\" (mousedown)=\"$event.stopPropagation()\">\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let customer of customersList$ | async\" [value]=\"customer['customer_name']\">\n {{customer['customer_name']}}\n </mat-option>\n </mat-autocomplete>\n <mat-error *ngIf=\"addRouteForm.controls['customer_name'].hasError('required')\">\n Customer name is required.\n </mat-error>\n </mat-form-field>\n </div>\n <div class=\"col-6\">\n <mat-form-field>\n <mat-label>Pickup</mat-label>\n <input type=\"text\" placeholder=\"Search...\" matInput #filterPickup [matAutocomplete]=\"pickupAutocomplete\"\n formControlName=\"pickup_location\" (mousedown)=\"$event.stopPropagation()\">\n\n <mat-autocomplete #pickupAutocomplete=\"matAutocomplete\">\n <mat-option (click)=\"selectedLongLat('pickup', option)\" *ngFor=\"let option of pickupOptions\"\n [value]=\"option?.place_name\">\n {{option?.place_name}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n <mat-error *ngIf=\"addRouteForm.controls['pickup_lat_lng'].touched && addRouteForm.controls['pickup_lat_lng'].hasError('required')\">\n Please select pickup location from the list.\n </mat-error>\n </div>\n <div class=\"col-6\">\n <mat-form-field>\n <mat-label>Delivery</mat-label>\n <input type=\"text\" placeholder=\"Search...\" matInput #filterDelivery [matAutocomplete]=\"deliveryAutocomplete\"\n formControlName=\"delivery_location\" (mousedown)=\"$event.stopPropagation()\">\n <mat-autocomplete #deliveryAutocomplete=\"matAutocomplete\">\n <mat-option (click)=\"selectedLongLat('delivery', option)\" *ngFor=\"let option of deliveryOptions\"\n [value]=\"option?.place_name\">\n {{option?.place_name}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n <mat-error *ngIf=\"addRouteForm.controls['delivery_lat_lng'].touched && addRouteForm.controls['delivery_lat_lng'].hasError('required')\">\n Please select delivery location from the list.\n </mat-error>\n </div>\n <div class=\"col-6\">\n <mat-form-field>\n <mat-label>Notes</mat-label>\n <textarea style=\"height: 18px; resize: none;\" matInput name=\"\" id=\"\" cols=\"30\" rows=\"10\" formControlName=\"note\" autocomplete=\"nope\" (mousedown)=\"$event.stopPropagation()\"></textarea>\n <mat-error *ngIf=\"addRouteForm.controls['note'].hasError('maxlength')\">\n Notes should be within 2048 characters.\n </mat-error>\n </mat-form-field>\n </div>\n\n <div class=\"col-6 d-flex\">\n <div class=\"inputbox m-0\">\n <mat-form-field>\n <mat-label>Unit type</mat-label>\n <mat-select formControlName=\"unit_id\" (selectionChange)=\"checkAndFetchRouteInformation()\" (mousedown)=\"$event.stopPropagation()\">\n <mat-option *ngFor=\"let unit of unitsList\" [value]=\"unit?.id\"> {{unit?.type}} </mat-option>\n </mat-select>\n <mat-error *ngIf=\"addRouteForm.controls['unit_id'].hasError('required')\">\n Unit is required\n </mat-error>\n </mat-form-field>\n </div>\n\n <div class=\"inputbox m-0\">\n <mat-form-field>\n <mat-label>Material</mat-label>\n <mat-select formControlName=\"materials_id\" (mousedown)=\"$event.stopPropagation()\">\n <mat-option *ngFor=\"let material of materialsList\" [value]=\"config.repository === 'coolmap' ? material?.material_id : material?.sub_material_id\"> {{config.repository === 'coolmap' ? material?.material : material?.label}}\n </mat-option>\n </mat-select>\n <mat-error *ngIf=\"addRouteForm.controls['materials_id'].hasError('required')\">\n Material is required\n </mat-error>\n </mat-form-field>\n </div>\n </div>\n <div class=\"col-6\">\n <app-estimation-display *ngIf=\"addRouteForm?.value?.pickup_lat_lng && addRouteForm?.value?.delivery_lat_lng\" [value]=\"addRouteForm['value']\"></app-estimation-display>\n </div>\n <div class=\"col-6\" *ngIf=\"addRouteForm['value']['trucker_pay_estimate'] && addRouteForm['value']['customer_price_estimate']\">\n <span *ngIf=\"config['repository'] !== 'customer'\" class=\"estimate\" (mousedown)=\"$event.stopPropagation()\">\n Trucker Pay Estimate - <b>{{'$'+ addRouteForm['value']['trucker_pay_estimate']}}</b>\n </span>\n <span class=\"estimate\" (mousedown)=\"$event.stopPropagation()\">\n Customer Price Estimate - <b>{{'$'+ addRouteForm['value']['customer_price_estimate']}}</b>\n </span>\n </div>\n <button mat-raised-button type=\"submit\" (click)=\"saveRoute()\" *ngIf=\"preventSave\"\n [disabled]=\"addRouteForm.invalid && preventSave || preventInitialSave\">{{routeId? 'Update' : 'Save'}}\n </button>\n <div class=\"loader\">\n <mat-spinner *ngIf=\"!preventSave\"></mat-spinner>\n </div>\n </div>\n </form>\n </div>\n</div>\n", styles: [".addroutebox{width:calc(100% - 315px);position:absolute;left:300px;bottom:10px;z-index:999;display:flex;justify-content:space-between;align-items:flex-start}.addroutebox .routedetailbox{max-width:300px;padding:10px;background-color:#fff;border-radius:20px;margin-right:20px}@media (min-width: 1600px){.addroutebox .routedetailbox{max-width:280px}}.addroutebox .editbtn{background:#326ad3;padding:10px 25px;color:#fff;font-size:.8125rem;border-radius:30px;float:right}.add_add_route_box{background:white;padding:10px 20px;border-radius:20px;box-shadow:2px 4px 4px 2px #00000024;height:370px;width:100%;position:relative;cursor:move}.add_add_route_box .route_form_area{display:flex;flex-wrap:wrap;justify-content:space-between}.add_add_route_box .route_form_area .col-6{width:48%;margin-top:15px;justify-content:space-between}.add_add_route_box .route_form_area .col-6 .inputbox{width:47%}.add_add_route_box .route_form_area .col-6 span{font-size:.875rem}.add_add_route_box .route_form_area button{background:#326ad3;padding:0 18px;color:#fff;font-size:.8125rem;border-radius:30px;position:absolute;right:18px;top:20px;height:35px}.closebtn{background:black;color:#fff;border-radius:30px;padding:0 18px;margin-left:10px;height:35px}.delbtn{background:red;color:#fff;border-radius:30px;padding:10px 18px}.add_route_listingpart .listing_toggle{background:white;border-radius:15px;padding:8px 10px;position:absolute;right:10px;top:30px;cursor:pointer}.listing_box{background:#282828;height:100vh;position:fixed;right:0;top:0;z-index:1111;box-shadow:-3px 0 5px #ffffff14;transition:.5s;-webkit-transition:.5s;-moz-transition:.5s;width:0;border-radius:40px 0 0 40px;opacity:0}.listing_box .closebtn{display:none}.show .listing_box{width:250px;max-width:250px;flex:0 0 250px;transition:.5s;-webkit-transition:.5s;-moz-transition:.5s;padding:40px 0 40px 20px;opacity:1}@media (min-width: 1600px){.show .listing_box{width:320px;max-width:320px;flex:0 0 320px}}.show .listing_box h2{color:#fff;white-space:nowrap}.show .listing_box ul{padding:0 20px 0 0}.show .listing_box ul li{background:#4a4a4a;padding:15px;border-radius:15px;display:flex;margin-bottom:15px}.show .listing_box ul li .companayIcon{width:40px;height:40px;border-radius:10px;background:white;margin-right:10px;display:flex;justify-content:center;align-items:center}.show .listing_box ul li .company_cont{width:calc(100% - 50px)}.show .listing_box ul li .company_cont h3{color:#fff;font-size:15px;font-weight:400;margin:0;text-overflow:ellipsis;max-width:129px;-webkit-box-orient:vertical;white-space:nowrap;overflow:hidden}@media (min-width: 1600px){.show .listing_box ul li .company_cont h3{max-width:170px}}.show .listing_box ul li .company_cont p{color:#bcbcbc;font-size:12px;margin:5px 0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:16px}.show .closebtn{position:absolute;left:-33px;top:50px;background:#282828;color:#fff;padding:8px;border-top-left-radius:15px;border-bottom-left-radius:15px;cursor:pointer;box-shadow:-4px 2px 5px #ffffff14;display:block}.loader{position:absolute;width:95%;height:100%;display:flex;justify-content:center;align-items:center;pointer-events:none}.buttonprt{margin-right:83px}.closebtnroutedetail{box-shadow:0 0 5px #0000001c;border-radius:100%;width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer;background:#fff;position:absolute;top:-11px;left:-11px}.routenotes{max-height:170px;overflow:auto}.estimate{margin-right:20px;font-size:.7rem}@media (min-width: 1600px){.estimate{font-size:.95rem}}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$3.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: i8$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "aria-describedby", "panelClass", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i8.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i8.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: i7$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i10.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: EstimationDisplayComponent, selector: "app-estimation-display", inputs: ["value"] }, { kind: "component", type: RouteInfoCardComponent, selector: "lib-route-info-card", inputs: ["popupData", "propData"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }] });
1461
+ }
1462
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AddRouteComponent, decorators: [{
1463
+ type: Component,
1464
+ args: [{ selector: 'app-add-route', template: "<div class=\"addroutebox\">\n <div class=\"routedetailbox\" *ngIf=\"enablePopUp\">\n <div class=\"closebtnroutedetail\">\n <mat-icon (click)=\"prevantPopupClose = false; enablePopUp = false;\">clear</mat-icon>\n </div>\n <lib-route-info-card [propData]=\"{className: 'routeCard', repository: config['repository']}\" [popupData]=\"popupDetails\"></lib-route-info-card>\n <div class=\"createTxt\">\n <small>\n Created by {{popupDetails['created_by_name']}} on {{popupDetails['created_at']}}\n </small>\n <button class=\"editbtn\" (click)=\"editEvent()\">Edit</button>\n </div>\n </div>\n <div class=\"add_add_route_box\" cdkDrag [style.visibility]=\"!enableForm ? 'hidden' : 'visible'\">\n <div class=\"topheadingprt\">\n <h2> {{routeId? 'EDIT' : 'ADD'}} ROUTE </h2>\n <div class=\"buttonprt\">\n <button *ngIf=\"routeId\" class=\"delbtn\" (click)=\"openDialog()\">Delete</button>\n <button mat-raised-button type=\"submit\" class=\"closebtn\" (click)=\"changeNav.next('Addroute')\">Close</button>\n </div>\n </div>\n <form [formGroup]=\"addRouteForm\">\n <div class=\"route_form_area\">\n <div class=\"col-6\">\n <mat-form-field>\n <mat-label>Route Name</mat-label>\n <input matInput formControlName=\"route_name\" autocomplete=\"nope\" (mousedown)=\"$event.stopPropagation()\">\n <mat-error *ngIf=\"addRouteForm.controls['route_name'].hasError('required')\">\n Route Name is required\n </mat-error>\n </mat-form-field>\n </div>\n <div class=\"col-6\">\n <mat-form-field>\n <input type=\"text\" placeholder=\"Customer Name\" matInput formControlName=\"customer_name\" [matAutocomplete]=\"auto\" (mousedown)=\"$event.stopPropagation()\">\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let customer of customersList$ | async\" [value]=\"customer['customer_name']\">\n {{customer['customer_name']}}\n </mat-option>\n </mat-autocomplete>\n <mat-error *ngIf=\"addRouteForm.controls['customer_name'].hasError('required')\">\n Customer name is required.\n </mat-error>\n </mat-form-field>\n </div>\n <div class=\"col-6\">\n <mat-form-field>\n <mat-label>Pickup</mat-label>\n <input type=\"text\" placeholder=\"Search...\" matInput #filterPickup [matAutocomplete]=\"pickupAutocomplete\"\n formControlName=\"pickup_location\" (mousedown)=\"$event.stopPropagation()\">\n\n <mat-autocomplete #pickupAutocomplete=\"matAutocomplete\">\n <mat-option (click)=\"selectedLongLat('pickup', option)\" *ngFor=\"let option of pickupOptions\"\n [value]=\"option?.place_name\">\n {{option?.place_name}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n <mat-error *ngIf=\"addRouteForm.controls['pickup_lat_lng'].touched && addRouteForm.controls['pickup_lat_lng'].hasError('required')\">\n Please select pickup location from the list.\n </mat-error>\n </div>\n <div class=\"col-6\">\n <mat-form-field>\n <mat-label>Delivery</mat-label>\n <input type=\"text\" placeholder=\"Search...\" matInput #filterDelivery [matAutocomplete]=\"deliveryAutocomplete\"\n formControlName=\"delivery_location\" (mousedown)=\"$event.stopPropagation()\">\n <mat-autocomplete #deliveryAutocomplete=\"matAutocomplete\">\n <mat-option (click)=\"selectedLongLat('delivery', option)\" *ngFor=\"let option of deliveryOptions\"\n [value]=\"option?.place_name\">\n {{option?.place_name}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n <mat-error *ngIf=\"addRouteForm.controls['delivery_lat_lng'].touched && addRouteForm.controls['delivery_lat_lng'].hasError('required')\">\n Please select delivery location from the list.\n </mat-error>\n </div>\n <div class=\"col-6\">\n <mat-form-field>\n <mat-label>Notes</mat-label>\n <textarea style=\"height: 18px; resize: none;\" matInput name=\"\" id=\"\" cols=\"30\" rows=\"10\" formControlName=\"note\" autocomplete=\"nope\" (mousedown)=\"$event.stopPropagation()\"></textarea>\n <mat-error *ngIf=\"addRouteForm.controls['note'].hasError('maxlength')\">\n Notes should be within 2048 characters.\n </mat-error>\n </mat-form-field>\n </div>\n\n <div class=\"col-6 d-flex\">\n <div class=\"inputbox m-0\">\n <mat-form-field>\n <mat-label>Unit type</mat-label>\n <mat-select formControlName=\"unit_id\" (selectionChange)=\"checkAndFetchRouteInformation()\" (mousedown)=\"$event.stopPropagation()\">\n <mat-option *ngFor=\"let unit of unitsList\" [value]=\"unit?.id\"> {{unit?.type}} </mat-option>\n </mat-select>\n <mat-error *ngIf=\"addRouteForm.controls['unit_id'].hasError('required')\">\n Unit is required\n </mat-error>\n </mat-form-field>\n </div>\n\n <div class=\"inputbox m-0\">\n <mat-form-field>\n <mat-label>Material</mat-label>\n <mat-select formControlName=\"materials_id\" (mousedown)=\"$event.stopPropagation()\">\n <mat-option *ngFor=\"let material of materialsList\" [value]=\"config.repository === 'coolmap' ? material?.material_id : material?.sub_material_id\"> {{config.repository === 'coolmap' ? material?.material : material?.label}}\n </mat-option>\n </mat-select>\n <mat-error *ngIf=\"addRouteForm.controls['materials_id'].hasError('required')\">\n Material is required\n </mat-error>\n </mat-form-field>\n </div>\n </div>\n <div class=\"col-6\">\n <app-estimation-display *ngIf=\"addRouteForm?.value?.pickup_lat_lng && addRouteForm?.value?.delivery_lat_lng\" [value]=\"addRouteForm['value']\"></app-estimation-display>\n </div>\n <div class=\"col-6\" *ngIf=\"addRouteForm['value']['trucker_pay_estimate'] && addRouteForm['value']['customer_price_estimate']\">\n <span *ngIf=\"config['repository'] !== 'customer'\" class=\"estimate\" (mousedown)=\"$event.stopPropagation()\">\n Trucker Pay Estimate - <b>{{'$'+ addRouteForm['value']['trucker_pay_estimate']}}</b>\n </span>\n <span class=\"estimate\" (mousedown)=\"$event.stopPropagation()\">\n Customer Price Estimate - <b>{{'$'+ addRouteForm['value']['customer_price_estimate']}}</b>\n </span>\n </div>\n <button mat-raised-button type=\"submit\" (click)=\"saveRoute()\" *ngIf=\"preventSave\"\n [disabled]=\"addRouteForm.invalid && preventSave || preventInitialSave\">{{routeId? 'Update' : 'Save'}}\n </button>\n <div class=\"loader\">\n <mat-spinner *ngIf=\"!preventSave\"></mat-spinner>\n </div>\n </div>\n </form>\n </div>\n</div>\n", styles: [".addroutebox{width:calc(100% - 315px);position:absolute;left:300px;bottom:10px;z-index:999;display:flex;justify-content:space-between;align-items:flex-start}.addroutebox .routedetailbox{max-width:300px;padding:10px;background-color:#fff;border-radius:20px;margin-right:20px}@media (min-width: 1600px){.addroutebox .routedetailbox{max-width:280px}}.addroutebox .editbtn{background:#326ad3;padding:10px 25px;color:#fff;font-size:.8125rem;border-radius:30px;float:right}.add_add_route_box{background:white;padding:10px 20px;border-radius:20px;box-shadow:2px 4px 4px 2px #00000024;height:370px;width:100%;position:relative;cursor:move}.add_add_route_box .route_form_area{display:flex;flex-wrap:wrap;justify-content:space-between}.add_add_route_box .route_form_area .col-6{width:48%;margin-top:15px;justify-content:space-between}.add_add_route_box .route_form_area .col-6 .inputbox{width:47%}.add_add_route_box .route_form_area .col-6 span{font-size:.875rem}.add_add_route_box .route_form_area button{background:#326ad3;padding:0 18px;color:#fff;font-size:.8125rem;border-radius:30px;position:absolute;right:18px;top:20px;height:35px}.closebtn{background:black;color:#fff;border-radius:30px;padding:0 18px;margin-left:10px;height:35px}.delbtn{background:red;color:#fff;border-radius:30px;padding:10px 18px}.add_route_listingpart .listing_toggle{background:white;border-radius:15px;padding:8px 10px;position:absolute;right:10px;top:30px;cursor:pointer}.listing_box{background:#282828;height:100vh;position:fixed;right:0;top:0;z-index:1111;box-shadow:-3px 0 5px #ffffff14;transition:.5s;-webkit-transition:.5s;-moz-transition:.5s;width:0;border-radius:40px 0 0 40px;opacity:0}.listing_box .closebtn{display:none}.show .listing_box{width:250px;max-width:250px;flex:0 0 250px;transition:.5s;-webkit-transition:.5s;-moz-transition:.5s;padding:40px 0 40px 20px;opacity:1}@media (min-width: 1600px){.show .listing_box{width:320px;max-width:320px;flex:0 0 320px}}.show .listing_box h2{color:#fff;white-space:nowrap}.show .listing_box ul{padding:0 20px 0 0}.show .listing_box ul li{background:#4a4a4a;padding:15px;border-radius:15px;display:flex;margin-bottom:15px}.show .listing_box ul li .companayIcon{width:40px;height:40px;border-radius:10px;background:white;margin-right:10px;display:flex;justify-content:center;align-items:center}.show .listing_box ul li .company_cont{width:calc(100% - 50px)}.show .listing_box ul li .company_cont h3{color:#fff;font-size:15px;font-weight:400;margin:0;text-overflow:ellipsis;max-width:129px;-webkit-box-orient:vertical;white-space:nowrap;overflow:hidden}@media (min-width: 1600px){.show .listing_box ul li .company_cont h3{max-width:170px}}.show .listing_box ul li .company_cont p{color:#bcbcbc;font-size:12px;margin:5px 0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:16px}.show .closebtn{position:absolute;left:-33px;top:50px;background:#282828;color:#fff;padding:8px;border-top-left-radius:15px;border-bottom-left-radius:15px;cursor:pointer;box-shadow:-4px 2px 5px #ffffff14;display:block}.loader{position:absolute;width:95%;height:100%;display:flex;justify-content:center;align-items:center;pointer-events:none}.buttonprt{margin-right:83px}.closebtnroutedetail{box-shadow:0 0 5px #0000001c;border-radius:100%;width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer;background:#fff;position:absolute;top:-11px;left:-11px}.routenotes{max-height:170px;overflow:auto}.estimate{margin-right:20px;font-size:.7rem}@media (min-width: 1600px){.estimate{font-size:.95rem}}\n"] }]
1465
+ }], ctorParameters: () => [{ type: i1.CoolmapService }, { type: i1.UtilsService }, { type: i1$1.MatDialog }, { type: i1.CoolmapConfigModel, decorators: [{
1466
+ type: Inject,
1467
+ args: ['memberData']
1468
+ }] }], propDecorators: { filterPickup: [{
1469
+ type: ViewChild,
1470
+ args: ['filterPickup']
1471
+ }], filterDelivery: [{
1472
+ type: ViewChild,
1473
+ args: ['filterDelivery']
1474
+ }], changeNav: [{
1475
+ type: Output
1476
+ }], updateRouteList: [{
1477
+ type: Output
1478
+ }], routeData: [{
1479
+ type: Input
1480
+ }], customerRepoDetails: [{
1481
+ type: Input
1482
+ }] } });
1483
+
1484
+ class CoolmapModule {
1485
+ static forRoot(memberData) {
1486
+ return {
1487
+ ngModule: CoolmapModule,
1488
+ providers: [{ provide: 'memberData', useValue: memberData }]
1489
+ };
1490
+ }
1491
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: CoolmapModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1492
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: CoolmapModule, declarations: [MapComponent,
1493
+ NavComponent,
1494
+ AddRouteNavComponent,
1495
+ JobCodeNavComponent,
1496
+ RouteJobCodeListComponent,
1497
+ ViewRouteListCardComponent,
1498
+ SmsCardDetailsOverviewComponent,
1499
+ JobCodeListCardComponent,
1500
+ JobCodeComponent,
1501
+ JobRouteListComponent,
1502
+ JobcodeStatusComponent,
1503
+ JobcodeOverviewComponent,
1504
+ DialogComponent,
1505
+ AddRouteComponent,
1506
+ EstimationDisplayComponent,
1507
+ RouteInfoCardComponent], imports: [CommonModule,
1508
+ MatSnackBarModule,
1509
+ MatSidenavModule,
1510
+ DragDropModule,
1511
+ FormsModule,
1512
+ MatInputModule,
1513
+ MatSelectModule,
1514
+ MatIconModule,
1515
+ ReactiveFormsModule,
1516
+ MatAutocompleteModule,
1517
+ MatFormFieldModule,
1518
+ MatProgressSpinnerModule,
1519
+ MatChipsModule,
1520
+ MatDialogModule,
1521
+ MatTooltipModule,
1522
+ MatDatepickerModule,
1523
+ MatNativeDateModule,
1524
+ MatPseudoCheckboxModule,
1525
+ MatButtonModule,
1526
+ MatProgressBarModule], exports: [MapComponent,
1527
+ NavComponent,
1528
+ AddRouteNavComponent,
1529
+ JobCodeNavComponent,
1530
+ RouteJobCodeListComponent,
1531
+ ViewRouteListCardComponent,
1532
+ SmsCardDetailsOverviewComponent,
1533
+ JobCodeListCardComponent,
1534
+ JobCodeComponent,
1535
+ JobRouteListComponent,
1536
+ JobcodeStatusComponent,
1537
+ JobcodeOverviewComponent,
1538
+ DialogComponent,
1539
+ AddRouteComponent] });
1540
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: CoolmapModule, imports: [CommonModule,
1541
+ MatSnackBarModule,
1542
+ MatSidenavModule,
1543
+ DragDropModule,
1544
+ FormsModule,
1545
+ MatInputModule,
1546
+ MatSelectModule,
1547
+ MatIconModule,
1548
+ ReactiveFormsModule,
1549
+ MatAutocompleteModule,
1550
+ MatFormFieldModule,
1551
+ MatProgressSpinnerModule,
1552
+ MatChipsModule,
1553
+ MatDialogModule,
1554
+ MatTooltipModule,
1555
+ MatDatepickerModule,
1556
+ MatNativeDateModule,
1557
+ MatPseudoCheckboxModule,
1558
+ MatButtonModule,
1559
+ MatProgressBarModule] });
1560
+ }
1561
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: CoolmapModule, decorators: [{
1562
+ type: NgModule,
1563
+ args: [{
1564
+ declarations: [
1565
+ MapComponent,
1566
+ NavComponent,
1567
+ AddRouteNavComponent,
1568
+ JobCodeNavComponent,
1569
+ RouteJobCodeListComponent,
1570
+ ViewRouteListCardComponent,
1571
+ SmsCardDetailsOverviewComponent,
1572
+ JobCodeListCardComponent,
1573
+ JobCodeComponent,
1574
+ JobRouteListComponent,
1575
+ JobcodeStatusComponent,
1576
+ JobcodeOverviewComponent,
1577
+ DialogComponent,
1578
+ AddRouteComponent,
1579
+ EstimationDisplayComponent,
1580
+ RouteInfoCardComponent
1581
+ ],
1582
+ imports: [
1583
+ CommonModule,
1584
+ MatSnackBarModule,
1585
+ MatSidenavModule,
1586
+ DragDropModule,
1587
+ FormsModule,
1588
+ MatInputModule,
1589
+ MatSelectModule,
1590
+ MatIconModule,
1591
+ ReactiveFormsModule,
1592
+ MatAutocompleteModule,
1593
+ MatFormFieldModule,
1594
+ MatProgressSpinnerModule,
1595
+ MatChipsModule,
1596
+ MatDialogModule,
1597
+ MatTooltipModule,
1598
+ MatDatepickerModule,
1599
+ MatNativeDateModule,
1600
+ MatPseudoCheckboxModule,
1601
+ MatButtonModule,
1602
+ MatProgressBarModule,
1603
+ ],
1604
+ exports: [
1605
+ MapComponent,
1606
+ NavComponent,
1607
+ AddRouteNavComponent,
1608
+ JobCodeNavComponent,
1609
+ RouteJobCodeListComponent,
1610
+ ViewRouteListCardComponent,
1611
+ SmsCardDetailsOverviewComponent,
1612
+ JobCodeListCardComponent,
1613
+ JobCodeComponent,
1614
+ JobRouteListComponent,
1615
+ JobcodeStatusComponent,
1616
+ JobcodeOverviewComponent,
1617
+ DialogComponent,
1618
+ AddRouteComponent
1619
+ ],
1620
+ // TODO: entryComponents is no longer supported. Find out if this breaks something
1621
+ // entryComponents: [
1622
+ // DialogComponent,
1623
+ // JobCodeComponent,
1624
+ // AddRouteComponent
1625
+ // ],
1626
+ providers: []
1627
+ }]
1628
+ }] });
1629
+
1630
+ /*
1631
+ * Public API Surface of coolmap
1632
+ */
1633
+
1634
+ /**
1635
+ * Generated bundle index. Do not edit.
1636
+ */
1637
+
1638
+ export { AddRouteComponent, AddRouteNavComponent, CoolmapModule, DialogComponent, JobCodeComponent, JobCodeListCardComponent, JobCodeNavComponent, JobRouteListComponent, JobcodeOverviewComponent, JobcodeStatusComponent, MapComponent, NavComponent, RouteJobCodeListComponent, SmsCardDetailsOverviewComponent, ViewRouteListCardComponent };
1639
+ //# sourceMappingURL=aggdirect-coolmap.mjs.map