kwikid-agent-dashboard 0.0.0-watch

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 (34) hide show
  1. package/README.md +0 -0
  2. package/esm2015/kwikid-agent-dashboard.js +5 -0
  3. package/esm2015/lib/components/add-customer/add-customer.component.js +66 -0
  4. package/esm2015/lib/components/customer-list/customer-list.component.js +121 -0
  5. package/esm2015/lib/components/customer-tile/customer-tile.component.js +107 -0
  6. package/esm2015/lib/components/menu/menu.component.js +34 -0
  7. package/esm2015/lib/kwikid-agent-dashboard.component.js +166 -0
  8. package/esm2015/lib/kwikid-agent-dashboard.module.js +87 -0
  9. package/esm2015/lib/services/agent.service.js +47 -0
  10. package/esm2015/lib/services/customer.service.js +20 -0
  11. package/esm2015/lib/services/info-window.service.js +183 -0
  12. package/esm2015/lib/services/map.service.js +175 -0
  13. package/esm2015/lib/shared/interfaces/customer.js +2 -0
  14. package/esm2015/lib/svgs/kyc-pending/kyc-pending.component.js +18 -0
  15. package/esm2015/lib/svgs/kyc-success/kyc-success.component.js +18 -0
  16. package/esm2015/public_api.js +5 -0
  17. package/fesm2015/kwikid-agent-dashboard.js +995 -0
  18. package/fesm2015/kwikid-agent-dashboard.js.map +1 -0
  19. package/kwikid-agent-dashboard.d.ts +5 -0
  20. package/lib/components/add-customer/add-customer.component.d.ts +16 -0
  21. package/lib/components/customer-list/customer-list.component.d.ts +76 -0
  22. package/lib/components/customer-tile/customer-tile.component.d.ts +67 -0
  23. package/lib/components/menu/menu.component.d.ts +18 -0
  24. package/lib/kwikid-agent-dashboard.component.d.ts +110 -0
  25. package/lib/kwikid-agent-dashboard.module.d.ts +20 -0
  26. package/lib/services/agent.service.d.ts +18 -0
  27. package/lib/services/customer.service.d.ts +9 -0
  28. package/lib/services/info-window.service.d.ts +98 -0
  29. package/lib/services/map.service.d.ts +27 -0
  30. package/lib/shared/interfaces/customer.d.ts +16 -0
  31. package/lib/svgs/kyc-pending/kyc-pending.component.d.ts +8 -0
  32. package/lib/svgs/kyc-success/kyc-success.component.d.ts +8 -0
  33. package/package.json +46 -0
  34. package/public_api.d.ts +2 -0
@@ -0,0 +1,995 @@
1
+ import { __awaiter } from 'tslib';
2
+ import * as i0 from '@angular/core';
3
+ import { Injectable, EventEmitter, Component, Output, Input, ViewChild, NgModule } from '@angular/core';
4
+ import * as i5 from 'kwikui';
5
+ import { KwikUIButtonModule, KwikUIButtonIconModule, KwikUIInputModule, KwikUIInputDateModule, KwikUISelectComboboxModule, KwikUITableModule, KwikUITablePaginationModule } from 'kwikui';
6
+ import * as i5$1 from '@angular/forms';
7
+ import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
8
+ import { TuiDay, TuiActiveZoneModule } from '@taiga-ui/cdk';
9
+ import * as i6 from '@angular/common';
10
+ import { CommonModule } from '@angular/common';
11
+ import { HttpClientModule } from '@angular/common/http';
12
+ import { RouterTestingModule } from '@angular/router/testing';
13
+ import { TuiSidebarModule } from '@taiga-ui/addon-mobile';
14
+
15
+ class AgentService {
16
+ constructor() {
17
+ this.agentConfig = {};
18
+ this.showMenu = false;
19
+ this.showMapview = true;
20
+ this.addTask = false;
21
+ }
22
+ getAgentConfig() {
23
+ return this.agentConfig;
24
+ }
25
+ setAgentConfig(agentConfig) {
26
+ this.agentConfig = agentConfig;
27
+ }
28
+ setMapview(value) {
29
+ this.showMapview = value;
30
+ }
31
+ getAddTask() {
32
+ return this.addTask;
33
+ }
34
+ setAddTask(value) {
35
+ this.addTask = value;
36
+ this.setMenu(false);
37
+ }
38
+ toggleMapview() {
39
+ this.showMapview = !this.showMapview;
40
+ }
41
+ getMenu() {
42
+ return this.showMenu;
43
+ }
44
+ setMenu(value) {
45
+ this.showMenu = value;
46
+ }
47
+ toggleMenu() {
48
+ this.showMenu = !this.showMenu;
49
+ }
50
+ }
51
+ /** @nocollapse */ AgentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
52
+ /** @nocollapse */ AgentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentService, providedIn: 'root' });
53
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentService, decorators: [{
54
+ type: Injectable,
55
+ args: [{
56
+ providedIn: 'root'
57
+ }]
58
+ }] });
59
+
60
+ class MapService {
61
+ constructor(agentService) {
62
+ this.agentService = agentService;
63
+ this.allCustomersMarkers = [];
64
+ }
65
+ getMyPosition() {
66
+ return this.myPosition;
67
+ }
68
+ getMap() {
69
+ return this.map;
70
+ }
71
+ setMap(map) {
72
+ this.map = map;
73
+ }
74
+ getMarkers() {
75
+ return this.allCustomersMarkers;
76
+ }
77
+ setMarkers(markers) {
78
+ this.allCustomersMarkers = markers;
79
+ }
80
+ initMap(mapElement) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ this.myPosition = yield this.getPosition().then((pos) => {
83
+ return {
84
+ lat: pos.lat,
85
+ lng: pos.lng
86
+ };
87
+ });
88
+ this.map = new google.maps.Map(mapElement.nativeElement, {
89
+ zoom: 10,
90
+ center: this.myPosition,
91
+ streetViewControl: false,
92
+ mapTypeControl: false,
93
+ fullscreenControl: false,
94
+ zoomControl: false,
95
+ });
96
+ });
97
+ }
98
+ plotMarkers(customers) {
99
+ return __awaiter(this, void 0, void 0, function* () {
100
+ let path = [];
101
+ const marker = new google.maps.Marker({
102
+ position: this.myPosition,
103
+ map: this.map,
104
+ animation: google.maps.Animation.DROP
105
+ });
106
+ let origin = marker.getPosition();
107
+ customers.map((customer) => {
108
+ path.push({
109
+ location: this.getLatLng(customer.extras.loc),
110
+ stopover: true
111
+ });
112
+ });
113
+ customers = yield this.calcRoute(customers, origin, path);
114
+ customers.map((customer, index) => {
115
+ const marker = new google.maps.Marker({
116
+ position: this.getLatLng(customer.extras.loc),
117
+ map: this.map,
118
+ animation: google.maps.Animation.DROP,
119
+ label: {
120
+ text: String(index + 1),
121
+ color: '#FFF'
122
+ }
123
+ });
124
+ this.allCustomersMarkers.push(marker);
125
+ });
126
+ return customers;
127
+ });
128
+ }
129
+ calcRoute(customers, origin, waypoints) {
130
+ return __awaiter(this, void 0, void 0, function* () {
131
+ let directionsService = new google.maps.DirectionsService();
132
+ let directionsRenderer = new google.maps.DirectionsRenderer({
133
+ suppressMarkers: true
134
+ });
135
+ const destination = new google.maps.LatLng(19.0996079, 72.9144412);
136
+ directionsRenderer.setMap(this.map);
137
+ let request = {
138
+ origin: origin,
139
+ destination: destination,
140
+ waypoints: waypoints,
141
+ optimizeWaypoints: true,
142
+ travelMode: 'DRIVING'
143
+ };
144
+ let sortList = this.sortList;
145
+ let customersData = customers;
146
+ yield directionsService.route(request, function (result, status) {
147
+ if (status == 'OK') {
148
+ directionsRenderer.setDirections(result);
149
+ customersData = sortList(result.routes[0].waypoint_order, customersData);
150
+ }
151
+ });
152
+ this.allCustomersDirections = directionsRenderer;
153
+ return customersData;
154
+ });
155
+ }
156
+ getPosition() {
157
+ return new Promise((resolve, reject) => {
158
+ navigator.geolocation.watchPosition((resp) => {
159
+ resolve({
160
+ lng: resp.coords.longitude,
161
+ lat: resp.coords.latitude
162
+ });
163
+ }, (err) => {
164
+ reject(err);
165
+ });
166
+ });
167
+ }
168
+ getLatLng(data) {
169
+ return new google.maps.LatLng(data[0], data[1]);
170
+ }
171
+ sortList(order, customersData) {
172
+ let c = [];
173
+ for (let i = 0; i < customersData.length; i++) {
174
+ let customer = customersData[order[i]];
175
+ c.push(customer);
176
+ }
177
+ return c;
178
+ }
179
+ plotHistoryCustomer(customer) {
180
+ if (this.historyCustomerMarker)
181
+ this.setMarkersMap(null, null);
182
+ this.agentService.toggleMenu();
183
+ const marker = new google.maps.Marker({
184
+ position: this.getLatLng(customer.loc),
185
+ map: this.map,
186
+ animation: google.maps.Animation.DROP,
187
+ label: {
188
+ text: 'C',
189
+ color: '#FFF'
190
+ }
191
+ });
192
+ this.historyCustomerMarker = marker;
193
+ let directionsService = new google.maps.DirectionsService();
194
+ let directionsRenderer = new google.maps.DirectionsRenderer({
195
+ suppressMarkers: true
196
+ });
197
+ directionsRenderer.setMap(this.map);
198
+ let request = {
199
+ origin: this.myPosition,
200
+ destination: marker.getPosition(),
201
+ optimizeWaypoints: true,
202
+ travelMode: 'DRIVING'
203
+ };
204
+ directionsService.route(request, function (result, status) {
205
+ if (status == 'OK') {
206
+ directionsRenderer.setDirections(result);
207
+ }
208
+ });
209
+ this.historyCustomerDirections = directionsRenderer;
210
+ this.setMarkersMap(null, this.map);
211
+ return marker;
212
+ }
213
+ setMarkersMap(all, history) {
214
+ this.allCustomersMarkers.map((marker) => {
215
+ marker.setMap(all);
216
+ });
217
+ this.allCustomersDirections.setMap(all);
218
+ this.historyCustomerMarker.setMap(history);
219
+ this.historyCustomerDirections.setMap(history);
220
+ }
221
+ }
222
+ /** @nocollapse */ MapService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapService, deps: [{ token: AgentService }], target: i0.ɵɵFactoryTarget.Injectable });
223
+ /** @nocollapse */ MapService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapService, providedIn: 'root' });
224
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapService, decorators: [{
225
+ type: Injectable,
226
+ args: [{
227
+ providedIn: 'root'
228
+ }]
229
+ }], ctorParameters: function () { return [{ type: AgentService }]; } });
230
+
231
+ class CustomerService {
232
+ constructor() { }
233
+ getCustomers() {
234
+ return this.customersData;
235
+ }
236
+ setCustomers(customers) {
237
+ this.customersData = customers;
238
+ }
239
+ }
240
+ /** @nocollapse */ CustomerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
241
+ /** @nocollapse */ CustomerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerService, providedIn: 'root' });
242
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerService, decorators: [{
243
+ type: Injectable,
244
+ args: [{
245
+ providedIn: 'root'
246
+ }]
247
+ }], ctorParameters: function () { return []; } });
248
+
249
+ class MenuComponent {
250
+ /**
251
+ * @description
252
+ *
253
+ * @constructor
254
+ */
255
+ constructor(agentService) {
256
+ this.agentService = agentService;
257
+ this.nextStep = new EventEmitter();
258
+ }
259
+ ngOnInit() { }
260
+ goToNextStep(e) {
261
+ this.nextStep.emit(e);
262
+ }
263
+ refresh() {
264
+ window.location.reload();
265
+ }
266
+ }
267
+ /** @nocollapse */ MenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MenuComponent, deps: [{ token: AgentService }], target: i0.ɵɵFactoryTarget.Component });
268
+ /** @nocollapse */ MenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: MenuComponent, selector: "menu", outputs: { nextStep: "nextStep" }, ngImport: i0, template: "<div class=\"menu-container\">\r\n <div class=\"menu-option\">\r\n <div class=\"agent-name\">Agent Name</div>\r\n <div class=\"agent-id\">1234-5678-9012</div>\r\n </div>\r\n <hr />\r\n <div class=\"menu-option\" (click)=\"agentService.toggleMapview()\">\r\n {{ agentService.showMapview ? 'Hide Maps' : 'Show Maps' }}\r\n </div>\r\n <div class=\"menu-option\" (click)=\"agentService.setAddTask(true)\">\r\n Add Task\r\n </div>\r\n <div class=\"menu-option\" (click)=\"refresh()\">Refresh</div>\r\n <hr />\r\n <div class=\"menu-option\" (onClick)=\"goToNextStep('logout')\">Logout</div>\r\n</div>\r\n", styles: [".menu-container{position:absolute;top:8%;right:0;background-color:#fafafa;width:-moz-fit-content;width:fit-content;border-radius:1rem;z-index:1001;box-shadow:0 4px 8px #0000001a;transition:\"0.15s linear 0s\"}.t-wrapper{padding:1.25rem!important}.agent-name{font-size:.9rem;font-weight:600}.agent-id{font-size:.7rem}.menu-option{padding:.25rem 1.5rem;display:flex;flex-direction:column;align-items:center;justify-content:center}hr{border:none!important;background-color:#ddd}\n"] });
269
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MenuComponent, decorators: [{
270
+ type: Component,
271
+ args: [{
272
+ selector: 'menu',
273
+ templateUrl: './menu.component.html',
274
+ styleUrls: ['./menu.component.css']
275
+ }]
276
+ }], ctorParameters: function () { return [{ type: AgentService }]; }, propDecorators: { nextStep: [{
277
+ type: Output
278
+ }] } });
279
+
280
+ class InfoWindowService {
281
+ constructor(mapService) {
282
+ this.mapService = mapService;
283
+ this.config = {
284
+ fields: {
285
+ name: {
286
+ label: 'Name',
287
+ value: 'name',
288
+ display: 'value',
289
+ style: {
290
+ fontSize: '1rem',
291
+ fontWeight: 600
292
+ }
293
+ },
294
+ phone: {
295
+ label: 'Call',
296
+ value: 'phone',
297
+ display: 'label',
298
+ style: {
299
+ fontSize: '0.8rem',
300
+ padding: '0.1rem 0',
301
+ textAlign: 'justify'
302
+ },
303
+ icon: 'https://cdn-icons-png.flaticon.com/512/60/60720.png'
304
+ },
305
+ address: {
306
+ label: 'Directions',
307
+ value: 'address',
308
+ display: 'label',
309
+ style: {
310
+ fontSize: '0.8rem',
311
+ padding: '0.1rem 0'
312
+ },
313
+ icon: 'https://cdn-icons-png.flaticon.com/512/62/62516.png'
314
+ }
315
+ }
316
+ };
317
+ this.mainInfoWindowStyle = {
318
+ display: 'flex',
319
+ 'flex-direction': 'column',
320
+ 'justify-content': 'center',
321
+ 'align-items': 'stretch',
322
+ gap: '0.5rem',
323
+ padding: '0.5rem'
324
+ };
325
+ this.fieldDivStyle = {
326
+ gap: ' 0.5rem',
327
+ display: 'flex',
328
+ 'flex-direction': 'row'
329
+ };
330
+ }
331
+ getOpenMarker() {
332
+ return this.openMarker;
333
+ }
334
+ setOpenMarker(value) {
335
+ this.openMarker = value;
336
+ }
337
+ /**
338
+ * @description
339
+ * Wrapper method to show Customer Info Window
340
+ *
341
+ * @function showInfo
342
+ * @func showInfo
343
+ * @method showInfo
344
+ */
345
+ showCustomerInformation(customer, marker) {
346
+ let map = this.mapService.getMap();
347
+ let contentString = this.createInfoContent(customer);
348
+ let infowindow = new google.maps.InfoWindow({
349
+ content: contentString
350
+ });
351
+ this.addEventListeners(customer, infowindow);
352
+ this.closeLastOpenedInfoWindow();
353
+ infowindow.open(map, marker);
354
+ this.lastInfoWindowOpened = infowindow;
355
+ map.setCenter(marker.getPosition());
356
+ return { infowindow: infowindow };
357
+ }
358
+ addEventListeners(customer, infowindow) {
359
+ let addressLink = `http://maps.google.com/?q=${customer.extras.loc[0]}, ${customer.extras.loc[1]}`;
360
+ google.maps.event.addListener(infowindow, 'domready', function () {
361
+ document.getElementById('Call').addEventListener('click', function (e) {
362
+ window.open(`tel:${customer.extras.phone}`, '_self');
363
+ });
364
+ document
365
+ .getElementById('Directions')
366
+ .addEventListener('click', function (e) {
367
+ window.open(`${addressLink}`, '_blank');
368
+ });
369
+ document
370
+ .getElementsByClassName('gm-ui-hover-effect')[0]
371
+ .setAttribute('style', ' background: none;\
372
+ display: block; \
373
+ border: 0px; \
374
+ margin: 0px; \
375
+ padding: 0px; \
376
+ text-transform: none; \
377
+ appearance: none; \
378
+ position: absolute; \
379
+ cursor: pointer; \
380
+ user-select: none; \
381
+ top: 0px; \
382
+ right: 0px; \
383
+ width: 30px; \
384
+ height: 30px; \
385
+ ');
386
+ });
387
+ }
388
+ /**
389
+ * @description
390
+ * Wrapper method to close Last Info Window
391
+ *
392
+ * @function closeLastOpenedInfoWindow
393
+ * @func closeLastOpenedInfoWindow
394
+ * @method closeLastOpenedInfoWindow
395
+ */
396
+ closeLastOpenedInfoWindow() {
397
+ if (this.lastInfoWindowOpened) {
398
+ this.lastInfoWindowOpened.close();
399
+ }
400
+ }
401
+ /**
402
+ * @description
403
+ * Closes the previously opened info window.
404
+ *
405
+ * @function infoData
406
+ * @func infoData
407
+ * @method infoData
408
+ */
409
+ createInfoContent(customer) {
410
+ let content = "<div style='padding:4px; font-family: Manrope;' >";
411
+ content += this.createFields(customer, this.config.fields);
412
+ content += '</div>';
413
+ return content;
414
+ }
415
+ /**
416
+ * @description
417
+ * Wrapper method to create Fields Container
418
+ *
419
+ * @function createFields
420
+ * @func createFields
421
+ * @method createFields
422
+ */
423
+ createFields(customer, fields) {
424
+ let _div = document.createElement('div');
425
+ for (const property in this.mainInfoWindowStyle)
426
+ _div.style[property] = this.mainInfoWindowStyle[property];
427
+ for (let key of Object.keys(fields)) {
428
+ let field = fields[key];
429
+ let _fieldDiv = document.createElement('div');
430
+ _fieldDiv.setAttribute('id', field.label);
431
+ for (const property in this.fieldDivStyle)
432
+ _fieldDiv.style[property] = this.fieldDivStyle[property];
433
+ for (const property in field.style)
434
+ _fieldDiv.style[property] = field.style[property];
435
+ let string = field.display == 'label' ? field.label : customer.extras[field.value];
436
+ if (field.icon) {
437
+ let _icon = document.createElement('img');
438
+ _icon.src = field.icon;
439
+ _icon.style.width = field.style.fontSize;
440
+ _icon.style.height = field.style.fontSize;
441
+ _fieldDiv.appendChild(_icon);
442
+ }
443
+ let _fieldText = document.createElement('div');
444
+ _fieldText.innerHTML = string;
445
+ _fieldDiv.appendChild(_fieldText);
446
+ _div.appendChild(_fieldDiv);
447
+ }
448
+ return _div.outerHTML;
449
+ }
450
+ }
451
+ /** @nocollapse */ InfoWindowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: InfoWindowService, deps: [{ token: MapService }], target: i0.ɵɵFactoryTarget.Injectable });
452
+ /** @nocollapse */ InfoWindowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: InfoWindowService, providedIn: 'root' });
453
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: InfoWindowService, decorators: [{
454
+ type: Injectable,
455
+ args: [{
456
+ providedIn: 'root'
457
+ }]
458
+ }], ctorParameters: function () { return [{ type: MapService }]; } });
459
+
460
+ class KycSuccessComponent {
461
+ constructor() { }
462
+ ngOnInit() {
463
+ }
464
+ }
465
+ /** @nocollapse */ KycSuccessComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KycSuccessComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
466
+ /** @nocollapse */ KycSuccessComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KycSuccessComponent, selector: "svg-kyc-success", ngImport: i0, template: "<svg\r\n class=\"status\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n x=\"0px\"\r\n y=\"0px\"\r\n width=\"32\"\r\n height=\"32\"\r\n viewBox=\"0,0,256,256\"\r\n style=\"fill: #000000\"\r\n>\r\n <g transform=\"translate(64,64) scale(0.5,0.5)\">\r\n <g\r\n fill=\"#20c997\"\r\n fill-rule=\"nonzero\"\r\n stroke=\"none\"\r\n stroke-width=\"1\"\r\n stroke-linecap=\"butt\"\r\n stroke-linejoin=\"miter\"\r\n stroke-miterlimit=\"10\"\r\n stroke-dasharray=\"\"\r\n stroke-dashoffset=\"0\"\r\n font-family=\"none\"\r\n font-weight=\"none\"\r\n font-size=\"none\"\r\n text-anchor=\"none\"\r\n style=\"mix-blend-mode: normal\"\r\n >\r\n <path d=\"M-128,384v-512h512v512z\" id=\"bgRectangle\"></path>\r\n </g>\r\n <g\r\n fill=\"#ffffff\"\r\n fill-rule=\"nonzero\"\r\n stroke=\"none\"\r\n stroke-width=\"1\"\r\n stroke-linecap=\"butt\"\r\n stroke-linejoin=\"miter\"\r\n stroke-miterlimit=\"10\"\r\n stroke-dasharray=\"\"\r\n stroke-dashoffset=\"0\"\r\n font-family=\"none\"\r\n font-weight=\"none\"\r\n font-size=\"none\"\r\n text-anchor=\"none\"\r\n style=\"mix-blend-mode: normal\"\r\n >\r\n <g transform=\"scale(8,8)\">\r\n <path\r\n d=\"M28.28125,6.28125l-17.28125,17.28125l-7.28125,-7.28125l-1.4375,1.4375l8,8l0.71875,0.6875l0.71875,-0.6875l18,-18z\"\r\n ></path>\r\n </g>\r\n </g>\r\n </g>\r\n</svg>\r\n", styles: [".status{border-radius:1.5rem}\n"] });
467
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KycSuccessComponent, decorators: [{
468
+ type: Component,
469
+ args: [{
470
+ selector: 'svg-kyc-success',
471
+ templateUrl: './kyc-success.component.html',
472
+ styleUrls: ['./kyc-success.component.css']
473
+ }]
474
+ }], ctorParameters: function () { return []; } });
475
+
476
+ class KycPendingComponent {
477
+ constructor() { }
478
+ ngOnInit() {
479
+ }
480
+ }
481
+ /** @nocollapse */ KycPendingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KycPendingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
482
+ /** @nocollapse */ KycPendingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KycPendingComponent, selector: "svg-kyc-pending", ngImport: i0, template: "<svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n class=\"status\"\r\n x=\"0px\"\r\n y=\"0px\"\r\n width=\"32\"\r\n height=\"32\"\r\n viewBox=\"0,0,256,256\"\r\n style=\"fill: #000000\"\r\n>\r\n <g transform=\"translate(32,32) scale(0.75,0.75)\">\r\n <g\r\n fill=\"#fcb919\"\r\n fill-rule=\"nonzero\"\r\n stroke=\"none\"\r\n stroke-width=\"1\"\r\n stroke-linecap=\"butt\"\r\n stroke-linejoin=\"miter\"\r\n stroke-miterlimit=\"10\"\r\n stroke-dasharray=\"\"\r\n stroke-dashoffset=\"0\"\r\n font-family=\"none\"\r\n font-weight=\"none\"\r\n font-size=\"none\"\r\n text-anchor=\"none\"\r\n style=\"mix-blend-mode: normal\"\r\n >\r\n <path\r\n d=\"M-42.66667,298.66667v-341.33333h341.33333v341.33333z\"\r\n id=\"bgRectangle\"\r\n ></path>\r\n </g>\r\n <g\r\n fill=\"#ffffff\"\r\n fill-rule=\"nonzero\"\r\n stroke=\"none\"\r\n stroke-width=\"1\"\r\n stroke-linecap=\"butt\"\r\n stroke-linejoin=\"miter\"\r\n stroke-miterlimit=\"10\"\r\n stroke-dasharray=\"\"\r\n stroke-dashoffset=\"0\"\r\n font-family=\"none\"\r\n font-weight=\"none\"\r\n font-size=\"none\"\r\n text-anchor=\"none\"\r\n style=\"mix-blend-mode: normal\"\r\n >\r\n <g transform=\"scale(8,8)\">\r\n <path\r\n d=\"M16,4c-6.61719,0 -12,5.38281 -12,12c0,6.61719 5.38281,12 12,12c6.61719,0 12,-5.38281 12,-12c0,-6.61719 -5.38281,-12 -12,-12zM16,6c5.53516,0 10,4.46484 10,10c0,5.53516 -4.46484,10 -10,10c-5.53516,0 -10,-4.46484 -10,-10c0,-5.53516 4.46484,-10 10,-10zM15,8v9h7v-2h-5v-7z\"\r\n ></path>\r\n </g>\r\n </g>\r\n </g>\r\n</svg>\r\n", styles: [".status{border-radius:1.5rem}\n"] });
483
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KycPendingComponent, decorators: [{
484
+ type: Component,
485
+ args: [{
486
+ selector: 'svg-kyc-pending',
487
+ templateUrl: './kyc-pending.component.html',
488
+ styleUrls: ['./kyc-pending.component.css']
489
+ }]
490
+ }], ctorParameters: function () { return []; } });
491
+
492
+ class CustomerTileComponent {
493
+ constructor(mapService, infoWindowService) {
494
+ this.mapService = mapService;
495
+ this.infoWindowService = infoWindowService;
496
+ /**
497
+ * @description
498
+ * Determines Customer Data
499
+ *
500
+ * @default
501
+ * `{}`
502
+ */
503
+ this.customer = {};
504
+ /**
505
+ * @description
506
+ * Determines Index of Customer Data in Customer List
507
+ *
508
+ * @default
509
+ *
510
+ */
511
+ this.index = undefined;
512
+ /**
513
+ * @description
514
+ * Emitter to emit next Step
515
+ *
516
+ * @emits KwikIDAgentDashboardComponent#nextStep
517
+ * @fires KwikIDAgentDashboardComponent#nextStep
518
+ */
519
+ this.nextStep = new EventEmitter();
520
+ this.removeTask = new EventEmitter(); /**
521
+ * @description
522
+ *
523
+ * @constructor
524
+ */
525
+ }
526
+ /**
527
+ * @description
528
+ * To set Google Maps API on script
529
+ *
530
+ * @ngOnInit
531
+ */
532
+ ngOnInit() { }
533
+ tileClick() {
534
+ console.log("Tile Click", this.index);
535
+ if (this.index == this.infoWindowService.getOpenMarker()) {
536
+ this.infoWindowService.setOpenMarker(null);
537
+ this.infoWindowService.lastInfoWindowOpened.close();
538
+ }
539
+ else {
540
+ this.showDetails(this.customer, this.index);
541
+ }
542
+ }
543
+ /**
544
+ * @description
545
+ * Wrapper method to show Customer Info Window
546
+ *
547
+ * @function showDetails
548
+ * @func showDetails
549
+ * @method showDetails
550
+ */
551
+ showDetails(customer, index) {
552
+ let markers = this.mapService.getMarkers();
553
+ let marker = markers[index];
554
+ let { infowindow } = this.infoWindowService.showCustomerInformation(customer, marker);
555
+ this.infoWindowService.setOpenMarker(index);
556
+ }
557
+ /**
558
+ * @description
559
+ * Wrapper method to fire click event for next step.
560
+ *
561
+ * @function goToNextStep
562
+ * @func goToNextStep
563
+ * @method goToNextStep
564
+ */
565
+ goToNextStep(e) {
566
+ this.nextStep.emit(e);
567
+ }
568
+ handleOnClickRemoveTask(task) {
569
+ this.removeTask.emit(task);
570
+ }
571
+ }
572
+ /** @nocollapse */ CustomerTileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerTileComponent, deps: [{ token: MapService }, { token: InfoWindowService }], target: i0.ɵɵFactoryTarget.Component });
573
+ /** @nocollapse */ CustomerTileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerTileComponent, selector: "customer-tile", inputs: { customer: "customer", index: "index" }, outputs: { nextStep: "nextStep", removeTask: "removeTask" }, ngImport: i0, template: "<div class=\"customer-tile-wrapper\">\r\n <div class=\"customer-tile-primary-container\">\r\n <div class=\"customer-tile-primary-container-data\">\r\n <ng-container *ngIf=\"customer.kycComplete\">\r\n <svg-kyc-success></svg-kyc-success>\r\n </ng-container>\r\n <ng-container *ngIf=\"!customer.kycComplete\">\r\n <svg-kyc-pending></svg-kyc-pending>\r\n </ng-container>\r\n <div class=\"customer-tile-prtimary-container-name-phone\">\r\n <div class=\"customer-tile-primary-container-name\">\r\n {{ customer.extras.name }}\r\n </div>\r\n <div class=\"customer-tile-primary-container-phone\">\r\n {{ customer.extras.phone }}\r\n </div>\r\n </div>\r\n </div>\r\n <kwikui-button-icon\r\n [icon]=\"\r\n index == infoWindowService.getOpenMarker()\r\n ? 'tuiIconChevronUpLarge'\r\n : 'tuiIconChevronDownLarge'\r\n \"\r\n [shape]=\"'rounded'\"\r\n appearance=\"icon\"\r\n size=\"s\"\r\n (onClick)=\"tileClick()\"\r\n ></kwikui-button-icon>\r\n </div>\r\n <div\r\n [ngClass]=\"\r\n index == infoWindowService.getOpenMarker()\r\n ? 'customer-tile-secondary-container'\r\n : 'data-collasped'\r\n \"\r\n >\r\n <div class=\"customer-tile-secondary-container-data\">\r\n <div class=\"customer-tile-secondary-container-address\">\r\n {{ customer.extras.address }}\r\n </div>\r\n </div>\r\n <div class=\"customer-tile-secondary-container-actions\">\r\n <kwikui-button-icon\r\n [icon]=\"'tuiIconTrash2'\"\r\n [shape]=\"'rounded'\"\r\n appearance=\"icon\"\r\n size=\"s\"\r\n (onClick)=\"handleOnClickRemoveTask(customer)\"\r\n ></kwikui-button-icon>\r\n <div class=\"customer-tile-secondary-container-journey-buttons\">\r\n <kwikui-button\r\n label=\"Share Link\"\r\n appearance=\"flat\"\r\n size=\"s\"\r\n styles=\"font-size:0.7rem;\"\r\n (onClick)=\"goToNextStep({ customer: customer, process: 'share' })\"\r\n ></kwikui-button>\r\n <kwikui-button\r\n *ngIf=\"!customer.kycComplete\"\r\n label=\"Start Journey\"\r\n appearance=\"primary\"\r\n size=\"s\"\r\n styles=\"font-size:0.7rem;\"\r\n (onClick)=\"goToNextStep({ customer: customer, process: 'kyc' })\"\r\n ></kwikui-button>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".customer-tile-wrapper{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:stretch;flex:1;overflow:auto;grid-gap:.5rem;gap:.5rem;padding:1rem;border-bottom:.5px solid #ddd}.customer-tile-wrapper .customer-tile-primary-container{display:flex;grid-gap:.5rem;gap:.5rem;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;width:100%;height:100%}.customer-tile-wrapper .customer-tile-primary-container .customer-tile-primary-container-data{padding-left:.2rem;grid-gap:.6rem;gap:.6rem;display:flex;flex-direction:row;flex-wrap:nowrap;align-content:stretch;justify-content:space-evenly;align-items:center}.customer-tile-wrapper .customer-tile-primary-container .customer-tile-primary-container-status{border-radius:1.5rem}.customer-tile-wrapper .customer-tile-primary-container .customer-tile-primary-container-name{font-weight:600;line-height:1rem}.customer-tile-wrapper .customer-tile-primary-container .customer-tile-primary-container-phone{font-size:.7rem}.customer-tile-wrapper .customer-tile-secondary-container{width:100%;height:100%;display:flex;flex-direction:column;overflow:auto;grid-gap:.5rem;gap:.5rem}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-data{padding:.4rem .2rem;display:flex;flex-direction:column;font-size:.6rem;grid-gap:.2rem;gap:.2rem}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-data .customer-tile-secondary-container-session-id{width:100%;height:100%;line-height:.9rem;text-align:justify}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-data .customer-tile-secondary-container-address{width:100%;height:100%;line-height:.9rem;text-align:justify}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions{display:flex;flex-wrap:nowrap;justify-content:space-between;align-items:center}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions .customer-tile-secondary-container-journey-buttons{padding-right:.2rem;display:flex;flex-direction:row;grid-gap:.8rem;gap:.8rem;align-items:center}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions .customer-tile-secondary-container-journey-buttons .customer-share-link{font-size:.7rem}.customer-tile-wrapper .data-collasped{display:none}\n"], components: [{ type: KycSuccessComponent, selector: "svg-kyc-success" }, { type: KycPendingComponent, selector: "svg-kyc-pending" }, { type: i5.KwikUIButtonIconComponent, selector: "kwikui-button-icon", inputs: ["disabled", "id", "showLoader", "styles", "class", "type", "appearance", "icon", "shape", "size"], outputs: ["onClick"] }, { type: i5.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
574
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerTileComponent, decorators: [{
575
+ type: Component,
576
+ args: [{
577
+ selector: 'customer-tile',
578
+ templateUrl: './customer-tile.component.html',
579
+ styleUrls: ['./customer-tile.component.scss']
580
+ }]
581
+ }], ctorParameters: function () { return [{ type: MapService }, { type: InfoWindowService }]; }, propDecorators: { customer: [{
582
+ type: Input
583
+ }], index: [{
584
+ type: Input
585
+ }], nextStep: [{
586
+ type: Output
587
+ }], removeTask: [{
588
+ type: Output
589
+ }] } });
590
+
591
+ class CustomerListComponent {
592
+ /**
593
+ * @description
594
+ *
595
+ * @constructor
596
+ */
597
+ constructor(mapService, infoWindowService) {
598
+ this.mapService = mapService;
599
+ this.infoWindowService = infoWindowService;
600
+ /**
601
+ * @description
602
+ * Emitter to emit next Step
603
+ *
604
+ * @emits KwikIDAgentDashboardComponent#nextStep
605
+ * @fires KwikIDAgentDashboardComponent#nextStep
606
+ */
607
+ this.nextStep = new EventEmitter();
608
+ this.removeTask = new EventEmitter();
609
+ this.filteredData = [];
610
+ this.formGroup = new FormGroup({});
611
+ this.fromDate = this.getDate();
612
+ this.toDate = this.getDate();
613
+ this.fromDateFormControl = new FormControl({
614
+ value: new TuiDay(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()),
615
+ disabled: false
616
+ });
617
+ this.formGroup.addControl('fromDate', this.fromDateFormControl);
618
+ this.toDateFormControl = new FormControl({
619
+ value: new TuiDay(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()),
620
+ disabled: false
621
+ });
622
+ this.formGroup.addControl('toDate', this.toDateFormControl);
623
+ }
624
+ /**
625
+ * @description
626
+ * To set Google Maps API on script
627
+ *
628
+ * @ngOnInit
629
+ */
630
+ ngOnInit() {
631
+ this.filteredData = this.getCustomers(this.customers);
632
+ }
633
+ /**
634
+ * @description
635
+ * Wrapper method to fire click event for next step.
636
+ *
637
+ * @function goToNextStep
638
+ * @func goToNextStep
639
+ * @method goToNextStep
640
+ */
641
+ goToNextStep(e) {
642
+ this.nextStep.emit(e);
643
+ }
644
+ getDate() {
645
+ const date = new Date();
646
+ const year = date.getFullYear();
647
+ let month = date.getMonth() + 1;
648
+ let day = date.getDate();
649
+ if (month < 10)
650
+ month = '0' + month;
651
+ if (day < 10)
652
+ day = '0' + day;
653
+ const today = `${year}-${month}-${day}`;
654
+ return today;
655
+ }
656
+ getCustomers(customers) {
657
+ let filterData = customers.filter((customer) => {
658
+ let date = customer.date;
659
+ return date >= this.fromDate && date <= this.toDate;
660
+ });
661
+ return filterData;
662
+ }
663
+ onFromDateChange(event) {
664
+ let year = event.value.year;
665
+ let month = event.value.month + 1;
666
+ let date = event.value.day;
667
+ month = month < 10 ? '0' + month : month;
668
+ date = date < 10 ? '0' + date : date;
669
+ this.fromDate = `${year}-${month}-${date}`;
670
+ this.filteredData = this.getCustomers(this.customers);
671
+ }
672
+ onToDateChange(event) {
673
+ let year = event.value.year;
674
+ let month = event.value.month + 1;
675
+ let date = event.value.day;
676
+ month = month < 10 ? '0' + month : month;
677
+ date = date < 10 ? '0' + date : date;
678
+ this.toDate = `${year}-${month}-${date}`;
679
+ this.filteredData = this.getCustomers(this.customers);
680
+ }
681
+ handleOnClickRemoveTask(task) {
682
+ this.removeTask.emit(task);
683
+ }
684
+ }
685
+ /** @nocollapse */ CustomerListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerListComponent, deps: [{ token: MapService }, { token: InfoWindowService }], target: i0.ɵɵFactoryTarget.Component });
686
+ /** @nocollapse */ CustomerListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerListComponent, selector: "customer-list", inputs: { customers: "customers" }, outputs: { nextStep: "nextStep", removeTask: "removeTask" }, ngImport: i0, template: "<div class=\"customer-list-wrapper\">\r\n <div class=\"customer-list-filter\" [formGroup]=\"formGroup\">\r\n <kwikui-input-date\r\n [label]=\"'From Date'\"\r\n [id]=\"'fromDate'\"\r\n size=\"m\"\r\n [formControlName]=\"'fromDate'\"\r\n [formControl]=\"fromDateFormControl\"\r\n (getKeyValue)=\"onFromDateChange($event)\"\r\n ></kwikui-input-date>\r\n <kwikui-input-date\r\n [label]=\"'To Date'\"\r\n [id]=\"'toDate'\"\r\n size=\"m\"\r\n [formControlName]=\"'toDate'\"\r\n [formControl]=\"toDateFormControl\"\r\n (getKeyValue)=\"onToDateChange($event)\"\r\n ></kwikui-input-date>\r\n </div>\r\n <div class=\"customer-task-list\">\r\n <div *ngFor=\"let customer of filteredData; let index = index\">\r\n <customer-tile\r\n [customer]=\"customer\"\r\n [index]=\"index\"\r\n (nextStep)=\"goToNextStep($event)\"\r\n (removeTask)=\"handleOnClickRemoveTask($event)\"\r\n ></customer-tile>\r\n </div>\r\n </div>\r\n\r\n <div class=\"customer-list-empty\" *ngIf=\"customers.length === 0\">\r\n No Customers Left...\r\n </div>\r\n</div>\r\n", styles: [".customer-list-wrapper{width:100%;height:100%;display:flex;flex-direction:column;overflow:auto}.customer-list-filter{height:80px;width:100%;display:flex;flex-direction:row;padding:1rem;grid-gap:1rem;gap:1rem;border-bottom:.5px solid #ddd}.customer-list-filter>*{width:100%}.customer-list-empty{height:100%;width:100%;margin-top:.5rem;font-size:1rem;text-align:center}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}\n"], components: [{ type: i5.KwikUIInputDateComponent, selector: "kwikui-input-date", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "min", "max", "validators", "properties"], outputs: ["getKeyValue"] }, { type: CustomerTileComponent, selector: "customer-tile", inputs: ["customer", "index"], outputs: ["nextStep", "removeTask"] }], directives: [{ type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i5$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
687
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerListComponent, decorators: [{
688
+ type: Component,
689
+ args: [{
690
+ selector: 'customer-list',
691
+ templateUrl: './customer-list.component.html',
692
+ styleUrls: ['./customer-list.component.css']
693
+ }]
694
+ }], ctorParameters: function () { return [{ type: MapService }, { type: InfoWindowService }]; }, propDecorators: { customers: [{
695
+ type: Input
696
+ }], nextStep: [{
697
+ type: Output
698
+ }], removeTask: [{
699
+ type: Output
700
+ }] } });
701
+
702
+ class AddCustomerComponent {
703
+ constructor(agentService) {
704
+ this.agentService = agentService;
705
+ this.newCustomerFormGroup = undefined;
706
+ this.addTask = new EventEmitter();
707
+ this.newCustomerFormGroup = new FormGroup({
708
+ name: new FormControl(''),
709
+ phone: new FormControl(''),
710
+ address: new FormControl('')
711
+ });
712
+ }
713
+ ngOnInit() { }
714
+ handleGetKeyValue(e) {
715
+ this.newCustomerFormGroup.patchValue({
716
+ [e.key]: e.value
717
+ }, { emitEvent: false });
718
+ }
719
+ handleOnClickAddTask(e) {
720
+ let newTask = {};
721
+ newTask = {
722
+ user_id: String(Math.floor(1000 + Math.random() * 9000)),
723
+ date: this.getDate(),
724
+ extras: {
725
+ name: this.newCustomerFormGroup.controls.name.value,
726
+ phone: this.newCustomerFormGroup.controls.phone.value,
727
+ address: this.newCustomerFormGroup.controls.address.value,
728
+ map: 'https: //www.google.com/maps/place/Westside+-+Borivali,+Mumbai/@19.2288067,72.853972,17z/data=!3m1!5s0x3be7b0d65d0d02dd:0x2bf11ace42a9dad8!4m12!1m6!3m5!1s0x3be7b0d6db21ad03:0xa31af1578987d699!2sBorivali+Station+West!8m2!3d19.2288016!4d72.8561607!3m4!1s0x3be7b12a0f616a41:0x1f4e031b07f5726c!8m2!3d19.2291309!4d72.8523105',
729
+ loc: ['19.2288067', '72.853972']
730
+ },
731
+ kycComplete: false
732
+ };
733
+ this.addTask.emit(newTask);
734
+ this.agentService.setAddTask(false);
735
+ }
736
+ getDate() {
737
+ const date = new Date();
738
+ const year = date.getFullYear();
739
+ let month = date.getMonth() + 1;
740
+ let day = date.getDate();
741
+ if (month < 10)
742
+ month = '0' + month;
743
+ if (day < 10)
744
+ day = '0' + day;
745
+ const today = `${year}-${month}-${day}`;
746
+ return today;
747
+ }
748
+ }
749
+ /** @nocollapse */ AddCustomerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AddCustomerComponent, deps: [{ token: AgentService }], target: i0.ɵɵFactoryTarget.Component });
750
+ /** @nocollapse */ AddCustomerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: AddCustomerComponent, selector: "add-customer", outputs: { addTask: "addTask" }, ngImport: i0, template: "<div class=\"add-customer-container\">\r\n <div class=\"add-customer-form\">\r\n <div class=\"add-customer-form-content\" [formGroup]=\"newCustomerFormGroup\">\r\n <div class=\"add-customer-heading\">Add Task</div>\r\n <kwikui-input\r\n type=\"text\"\r\n label=\"Name\"\r\n id=\"name\"\r\n size=\"m\"\r\n [formControlName]=\"'name'\"\r\n [formControl]=\"newCustomerFormGroup.controls['name']\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-input>\r\n <kwikui-input\r\n type=\"text\"\r\n label=\"Phone\"\r\n id=\"phone\"\r\n size=\"m\"\r\n [formControlName]=\"'phone'\"\r\n [formControl]=\"newCustomerFormGroup.controls['phone']\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-input>\r\n <kwikui-input\r\n type=\"text\"\r\n label=\"Address\"\r\n id=\"address\"\r\n size=\"m\"\r\n [formControlName]=\"'address'\"\r\n [formControl]=\"newCustomerFormGroup.controls['address']\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-input>\r\n <div class=\"add-customer-form-actions\">\r\n <kwikui-button\r\n label=\"Cancel\"\r\n appearance=\"flat\"\r\n size=\"m\"\r\n (onClick)=\"agentService.setAddTask(false)\"\r\n ></kwikui-button>\r\n <kwikui-button\r\n label=\"Submit\"\r\n appearance=\"primary\"\r\n size=\"m\"\r\n (onClick)=\"handleOnClickAddTask($event)\"\r\n ></kwikui-button>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".add-customer-container{position:absolute;background-color:#0000004d;width:100%;height:100%;display:flex;top:0;right:0;justify-content:center;align-items:center}.add-customer-form{width:75%;height:75%;margin:auto;background-color:#fff;border:1px solid lightgray;box-shadow:0 2px 10px -6px #000}.add-customer-form-content{display:flex;flex-direction:column;width:100%;height:100%;align-items:stretch;grid-gap:2rem;gap:2rem;padding:2rem}.add-customer-heading{font-size:1.3rem;font-weight:600;padding:1rem 0;border-bottom:1px solid #ddd}.add-customer-form-actions{display:flex;flex-direction:row;align-content:stretch;justify-content:flex-end}\n"], components: [{ type: i5.KwikUIInputComponent, selector: "kwikui-input", inputs: ["label", "id", "type", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "validators", "case", "properties"], outputs: ["getKeyValue"] }, { type: i5.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }], directives: [{ type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i5$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
751
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AddCustomerComponent, decorators: [{
752
+ type: Component,
753
+ args: [{
754
+ selector: 'add-customer',
755
+ templateUrl: './add-customer.component.html',
756
+ styleUrls: ['./add-customer.component.css']
757
+ }]
758
+ }], ctorParameters: function () { return [{ type: AgentService }]; }, propDecorators: { addTask: [{
759
+ type: Output
760
+ }] } });
761
+
762
+ class KwikIDAgentDashboardComponent {
763
+ /**
764
+ * @description
765
+ *
766
+ * @constructor
767
+ */
768
+ constructor(agentService, mapService, customerService) {
769
+ this.agentService = agentService;
770
+ this.mapService = mapService;
771
+ this.customerService = customerService;
772
+ /**
773
+ * @description
774
+ * Stores agent Config
775
+ *
776
+ * @default
777
+ * `{}`
778
+ */
779
+ this.agentConfig = {};
780
+ /**
781
+ * @description
782
+ * Stores list of customers
783
+ *
784
+ * @default
785
+ * `[]`
786
+ */
787
+ this.customers = [];
788
+ /**
789
+ * @description
790
+ * Stores list of customers
791
+ *
792
+ * @default
793
+ * `[]`
794
+ */
795
+ this.todaysCustomers = [];
796
+ /**
797
+ * @description
798
+ * Emitter to emit next Step
799
+ *
800
+ * @emits KwikIDAgentDashboardComponent#nextStep
801
+ * @fires KwikIDAgentDashboardComponent#nextStep
802
+ */
803
+ this.nextStep = new EventEmitter();
804
+ this.addTask = new EventEmitter();
805
+ this.removeTask = new EventEmitter();
806
+ /**
807
+ * @description
808
+ * Describes whether API Call is in progress or not
809
+ *
810
+ * @default
811
+ * `true`
812
+ */
813
+ this.loading = true;
814
+ /**
815
+ * @description
816
+ * Describes styling of Map Container
817
+ *
818
+ * @default
819
+ * `object`
820
+ */
821
+ this.mapStyle = { height: '100%', width: '100%', zIindex: -1 };
822
+ }
823
+ /**
824
+ * @description
825
+ * To set Google Maps API on script
826
+ *
827
+ * @ngOnInit
828
+ */
829
+ ngOnInit() {
830
+ const DSLScript = document.createElement('script');
831
+ DSLScript.src = this.agentConfig.googleMapsAPI;
832
+ DSLScript.type = 'text/javascript';
833
+ document.body.appendChild(DSLScript);
834
+ this.loading = false;
835
+ this.agentService.setAgentConfig(this.agentConfig);
836
+ this.customerService.setCustomers(this.customers);
837
+ this.todaysCustomers = this.customers.filter((customer) => customer.date == this.getDate());
838
+ this.agentConfig.showMaps == true || this.agentConfig.showMaps == false
839
+ ? this.agentService.setMapview(this.agentConfig.showMaps)
840
+ : null;
841
+ }
842
+ /**
843
+ * @description
844
+ *
845
+ * @ngAfterViewInit
846
+ */
847
+ ngAfterViewInit() {
848
+ setTimeout(() => __awaiter(this, void 0, void 0, function* () {
849
+ yield this.mapService.initMap(this.mapElement);
850
+ this.todaysCustomers = yield this.mapService.plotMarkers(this.todaysCustomers);
851
+ }), 1000);
852
+ }
853
+ /**
854
+ * @description
855
+ * Wrapper method to fire click event for next step.
856
+ *
857
+ * @function goToNextStep
858
+ * @func goToNextStep
859
+ * @method goToNextStep
860
+ */
861
+ goToNextStep(e) {
862
+ this.nextStep.emit(e);
863
+ }
864
+ /**
865
+ * @description
866
+ * Wrapper method to fire click event for next step.
867
+ *
868
+ * @function getDate
869
+ * @func getDate
870
+ * @method getDate
871
+ */
872
+ getDate() {
873
+ const date = new Date();
874
+ const year = date.getFullYear();
875
+ let month = date.getMonth() + 1;
876
+ let day = date.getDate();
877
+ if (month < 10)
878
+ month = '0' + month;
879
+ if (day < 10)
880
+ day = '0' + day;
881
+ const today = `${year}-${month}-${day}`;
882
+ return today;
883
+ }
884
+ handleOnClickAddTask(task) {
885
+ this.addTask.emit(task);
886
+ }
887
+ handleOnClickRemoveTask(task) {
888
+ this.removeTask.emit(task);
889
+ }
890
+ }
891
+ /** @nocollapse */ KwikIDAgentDashboardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardComponent, deps: [{ token: AgentService }, { token: MapService }, { token: CustomerService }], target: i0.ɵɵFactoryTarget.Component });
892
+ /** @nocollapse */ KwikIDAgentDashboardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDAgentDashboardComponent, selector: "kwikid-agent-dashboard", inputs: { agentConfig: "agentConfig", customers: "customers", todaysCustomers: "todaysCustomers" }, outputs: { nextStep: "nextStep", addTask: "addTask", removeTask: "removeTask" }, viewQueries: [{ propertyName: "mapElement", first: true, predicate: ["mapElement"], descendants: true }], ngImport: i0, template: "<div class=\"kwikid-agent-dashboard\">\r\n <div ngClass=\"page-loader\" *ngIf=\"loading\">\r\n <span class=\"loader\"></span>\r\n </div>\r\n <div class=\"wrapper\">\r\n <div class=\"dashboard-header\">\r\n <div class=\"dashboard-header-client-name\">\r\n <kwikui-button-icon\r\n [icon]=\"'tuiIconLink'\"\r\n appearance=\"mono\"\r\n size=\"m\"\r\n ></kwikui-button-icon>\r\n\r\n {{ agentConfig.clientName }}\r\n </div>\r\n <div *ngIf=\"agentService.getMenu()\">\r\n <menu\r\n (close)=\"agentService.setMenu(false)\"\r\n (nextStep)=\"goToNextStep($event)\"\r\n ></menu>\r\n </div>\r\n <kwikui-button-icon\r\n [icon]=\"'tuiIconMoreVertical'\"\r\n (onClick)=\"agentService.toggleMenu()\"\r\n appearance=\"mono\"\r\n size=\"m\"\r\n ></kwikui-button-icon>\r\n </div>\r\n\r\n <div class=\"dashboard-body\">\r\n <div\r\n [class]=\"agentService.showMapview ? 'map' : 'map-hidden'\"\r\n #mapElement\r\n ></div>\r\n <div class=\"customer-list\">\r\n <customer-list\r\n [customers]=\"customers\"\r\n (nextStep)=\"goToNextStep($event)\"\r\n (removeTask)=\"handleOnClickRemoveTask($event)\"\r\n ></customer-list>\r\n </div>\r\n </div>\r\n </div>\r\n <div *ngIf=\"agentService.getAddTask()\">\r\n <add-customer (addTask)=\"handleOnClickAddTask($event)\"></add-customer>\r\n </div>\r\n</div>\r\n", styles: [".kwikid-agent-dashboard{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;width:100%;height:100%;position:relative}.kwikid-agent-dashboard .wrapper{width:100%;height:100%;display:flex;flex-direction:column;align-content:center;justify-content:space-between;align-items:stretch}.kwikid-agent-dashboard .wrapper .dashboard-header{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-column-gap:1rem;column-gap:1rem;padding:.2rem;max-height:max-content;border:1px solid lightgray;box-shadow:0 2px 10px -6px #000}.kwikid-agent-dashboard .wrapper .dashboard-header .dashboard-header-client-name{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;font-size:1rem;font-weight:600}.kwikid-agent-dashboard .wrapper .dashboard-body{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:stretch;flex:1;overflow:auto}.kwikid-agent-dashboard .wrapper .dashboard-body .map{width:100%;height:100%;position:relative;overflow:hidden}.kwikid-agent-dashboard .wrapper .dashboard-body .map-hidden{visibility:collapse}.kwikid-agent-dashboard .wrapper .dashboard-body .customer-list{width:100%;height:100%;background-color:#fafafa;overflow:hidden}@media screen and (min-width: 600px){.kwikid-agent-dashboard{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;width:100%;height:100%}.kwikid-agent-dashboard .wrapper{width:100%;height:100%;display:flex;flex-direction:column;align-content:center;justify-content:space-between;align-items:stretch}.kwikid-agent-dashboard .wrapper .dashboard-header{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-column-gap:1rem;column-gap:1rem;padding:.2rem;max-height:max-content;border:1px solid lightgray;box-shadow:0 2px 10px -6px #000}.kwikid-agent-dashboard .wrapper .dashboard-header .dashboard-header-client-name{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;font-size:1rem;font-weight:600}.kwikid-agent-dashboard .wrapper .dashboard-body{display:flex;flex-direction:row-reverse;align-content:center;justify-content:center;align-items:stretch;padding:1.5rem;grid-gap:1.5rem;gap:1.5rem;overflow:auto;background-color:#fafafa}.kwikid-agent-dashboard .wrapper .dashboard-body .map{width:100%;height:100%;position:relative;overflow:hidden;box-shadow:#0000001a 0 4px 6px -1px,#0000000f 0 2px 4px -1px;border-radius:.5rem}.kwikid-agent-dashboard .wrapper .dashboard-body .map-hidden{visibility:collapse}.kwikid-agent-dashboard .wrapper .dashboard-body .customer-list{min-width:300px;max-width:300px;width:100%;height:100%;overflow:hidden;box-shadow:#0000001a 0 4px 6px -1px,#0000000f 0 2px 4px -1px;border-radius:.5rem}}.menu{position:absolute;transition:\"0.15s linear 0s\"}.page-loader{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.75);display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;z-index:100}.page-loader .loader{width:48px;height:48px;border-radius:50%;display:inline-block;position:relative;border:3px solid;border-color:#fff #fff transparent;box-sizing:border-box;animation:rotation 1s linear infinite}.page-loader .loader:after{content:\"\";box-sizing:border-box;position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;border:3px solid;border-color:transparent var(--tui-primary) var(--tui-primary);width:24px;height:24px;border-radius:50%;animation:rotationBack .5s linear infinite;transform-origin:center center}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotationBack{0%{transform:rotate(0)}to{transform:rotate(-360deg)}}.page-loader .t-loader{display:none!important}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}\n"], components: [{ type: i5.KwikUIButtonIconComponent, selector: "kwikui-button-icon", inputs: ["disabled", "id", "showLoader", "styles", "class", "type", "appearance", "icon", "shape", "size"], outputs: ["onClick"] }, { type: MenuComponent, selector: "menu", outputs: ["nextStep"] }, { type: CustomerListComponent, selector: "customer-list", inputs: ["customers"], outputs: ["nextStep", "removeTask"] }, { type: AddCustomerComponent, selector: "add-customer", outputs: ["addTask"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
893
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardComponent, decorators: [{
894
+ type: Component,
895
+ args: [{
896
+ selector: 'kwikid-agent-dashboard',
897
+ templateUrl: './kwikid-agent-dashboard.component.html',
898
+ styleUrls: ['./kwikid-agent-dashboard.component.scss']
899
+ }]
900
+ }], ctorParameters: function () { return [{ type: AgentService }, { type: MapService }, { type: CustomerService }]; }, propDecorators: { agentConfig: [{
901
+ type: Input
902
+ }], customers: [{
903
+ type: Input
904
+ }], todaysCustomers: [{
905
+ type: Input
906
+ }], nextStep: [{
907
+ type: Output
908
+ }], addTask: [{
909
+ type: Output
910
+ }], removeTask: [{
911
+ type: Output
912
+ }], mapElement: [{
913
+ type: ViewChild,
914
+ args: ['mapElement']
915
+ }] } });
916
+
917
+ class KwikIDAgentDashboardModule {
918
+ }
919
+ /** @nocollapse */ KwikIDAgentDashboardModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
920
+ /** @nocollapse */ KwikIDAgentDashboardModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardModule, declarations: [KwikIDAgentDashboardComponent,
921
+ CustomerListComponent,
922
+ CustomerTileComponent,
923
+ MenuComponent,
924
+ KycSuccessComponent,
925
+ KycPendingComponent,
926
+ AddCustomerComponent], imports: [CommonModule,
927
+ HttpClientModule,
928
+ FormsModule,
929
+ ReactiveFormsModule,
930
+ RouterTestingModule,
931
+ KwikUIButtonModule,
932
+ KwikUIButtonIconModule,
933
+ KwikUIInputModule,
934
+ KwikUIInputDateModule,
935
+ KwikUISelectComboboxModule,
936
+ KwikUITableModule,
937
+ KwikUITablePaginationModule,
938
+ TuiSidebarModule,
939
+ TuiActiveZoneModule], exports: [KwikIDAgentDashboardComponent] });
940
+ /** @nocollapse */ KwikIDAgentDashboardModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardModule, imports: [[
941
+ CommonModule,
942
+ HttpClientModule,
943
+ FormsModule,
944
+ ReactiveFormsModule,
945
+ RouterTestingModule,
946
+ KwikUIButtonModule,
947
+ KwikUIButtonIconModule,
948
+ KwikUIInputModule,
949
+ KwikUIInputDateModule,
950
+ KwikUISelectComboboxModule,
951
+ KwikUITableModule,
952
+ KwikUITablePaginationModule,
953
+ TuiSidebarModule,
954
+ TuiActiveZoneModule,
955
+ ]] });
956
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardModule, decorators: [{
957
+ type: NgModule,
958
+ args: [{
959
+ declarations: [
960
+ KwikIDAgentDashboardComponent,
961
+ CustomerListComponent,
962
+ CustomerTileComponent,
963
+ MenuComponent,
964
+ KycSuccessComponent,
965
+ KycPendingComponent,
966
+ AddCustomerComponent,
967
+ ],
968
+ imports: [
969
+ CommonModule,
970
+ HttpClientModule,
971
+ FormsModule,
972
+ ReactiveFormsModule,
973
+ RouterTestingModule,
974
+ KwikUIButtonModule,
975
+ KwikUIButtonIconModule,
976
+ KwikUIInputModule,
977
+ KwikUIInputDateModule,
978
+ KwikUISelectComboboxModule,
979
+ KwikUITableModule,
980
+ KwikUITablePaginationModule,
981
+ TuiSidebarModule,
982
+ TuiActiveZoneModule,
983
+ ],
984
+ exports: [KwikIDAgentDashboardComponent],
985
+ }]
986
+ }] });
987
+
988
+ /* kwikid-agent-dashboard */
989
+
990
+ /**
991
+ * Generated bundle index. Do not edit.
992
+ */
993
+
994
+ export { KwikIDAgentDashboardComponent, KwikIDAgentDashboardModule };
995
+ //# sourceMappingURL=kwikid-agent-dashboard.js.map