@osovitny/anatoly 2.0.25 → 2.0.27

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 (60) hide show
  1. package/bundles/osovitny-anatoly.umd.js +1807 -1640
  2. package/bundles/osovitny-anatoly.umd.js.map +1 -1
  3. package/bundles/osovitny-anatoly.umd.min.js +2 -2
  4. package/bundles/osovitny-anatoly.umd.min.js.map +1 -1
  5. package/esm2015/lib/core/convert.js +1 -5
  6. package/esm2015/lib/core/core.module.js +7 -8
  7. package/esm2015/lib/core/go/base-go.service.js +4 -4
  8. package/esm2015/lib/core/interceptors/httpInterceptor.js +2 -2
  9. package/esm2015/lib/core/localization/localization.service.js +3 -3
  10. package/esm2015/lib/core/localization/localizationSettings.module.js +3 -3
  11. package/esm2015/lib/core/notifications/alerts.js +5 -3
  12. package/esm2015/lib/core/notifications/services/notification-service.js +1 -1
  13. package/esm2015/lib/core/services/appcontext.service.js +12 -12
  14. package/esm2015/lib/core/services/idle.service.js +65 -0
  15. package/esm2015/lib/core/services/web-storage.service.js +65 -0
  16. package/esm2015/lib/data/consts.js +2 -2
  17. package/esm2015/lib/data/data.module.js +6 -6
  18. package/esm2015/lib/data/services/notifications/notifications-api-service.js +45 -0
  19. package/esm2015/lib/ui/components/billing/buyaccess-button.component.js +9 -9
  20. package/esm2015/lib/ui/components/billing/upgrade-plan-button.component.js +7 -7
  21. package/esm2015/lib/ui/components/html-editor/base-html-editor.component.js +19 -19
  22. package/esm2015/lib/ui/components/loading/loading.component.js +49 -0
  23. package/esm2015/lib/ui/components/spinner/spinner.component.js +73 -0
  24. package/esm2015/lib/ui/pipes/filesize.pipe.js +41 -0
  25. package/esm2015/lib/ui/pipes/replace-text.pipe.js +36 -0
  26. package/esm2015/lib/ui/pipes/safeHtml.pipe.js +36 -0
  27. package/esm2015/lib/ui/ui.module.js +19 -13
  28. package/esm2015/public-api.js +57 -9
  29. package/fesm2015/osovitny-anatoly.js +1577 -1412
  30. package/fesm2015/osovitny-anatoly.js.map +1 -1
  31. package/lib/core/convert.d.ts +0 -4
  32. package/lib/core/go/base-go.service.d.ts +1 -1
  33. package/lib/core/services/appcontext.service.d.ts +2 -2
  34. package/lib/core/services/idle.service.d.ts +13 -0
  35. package/lib/core/services/web-storage.service.d.ts +17 -0
  36. package/lib/data/services/notifications/notifications-api-service.d.ts +9 -0
  37. package/lib/ui/components/billing/buyaccess-button.component.d.ts +3 -3
  38. package/lib/ui/components/billing/upgrade-plan-button.component.d.ts +1 -1
  39. package/lib/ui/components/html-editor/base-html-editor.component.d.ts +2 -2
  40. package/lib/ui/components/loading/loading.component.d.ts +10 -0
  41. package/lib/ui/components/spinner/spinner.component.d.ts +22 -0
  42. package/lib/ui/pipes/filesize.pipe.d.ts +5 -0
  43. package/lib/ui/pipes/replace-text.pipe.d.ts +4 -0
  44. package/lib/ui/pipes/safeHtml.pipe.d.ts +7 -0
  45. package/lib/ui/ui.module.d.ts +2 -3
  46. package/osovitny-anatoly.metadata.json +1 -1
  47. package/package.json +1 -1
  48. package/public-api.d.ts +53 -8
  49. package/esm2015/lib/core/alerts.js +0 -145
  50. package/esm2015/lib/core/consts/index.js +0 -21
  51. package/esm2015/lib/core/index.js +0 -37
  52. package/esm2015/lib/core/localization/index.js +0 -26
  53. package/esm2015/lib/data/index.js +0 -26
  54. package/esm2015/lib/ui/index.js +0 -43
  55. package/lib/core/alerts.d.ts +0 -12
  56. package/lib/core/consts/index.d.ts +0 -2
  57. package/lib/core/index.d.ts +0 -13
  58. package/lib/core/localization/index.d.ts +0 -4
  59. package/lib/data/index.d.ts +0 -5
  60. package/lib/ui/index.d.ts +0 -16
@@ -1,11 +1,11 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('sweetalert2'), require('@angular/core'), require('@angular/common'), require('@angular/common/http'), require('rxjs/operators'), require('rxjs'), require('ngx-toastr'), require('uuid'), require('@ngx-translate/core'), require('date-fns'), require('date-fns/locale/en-US'), require('@angular/router'), require('@angular/forms'), require('angular-froala-wysiwyg'), require('@ngx-translate/http-loader')) :
3
- typeof define === 'function' && define.amd ? define('@osovitny/anatoly', ['exports', 'sweetalert2', '@angular/core', '@angular/common', '@angular/common/http', 'rxjs/operators', 'rxjs', 'ngx-toastr', 'uuid', '@ngx-translate/core', 'date-fns', 'date-fns/locale/en-US', '@angular/router', '@angular/forms', 'angular-froala-wysiwyg', '@ngx-translate/http-loader'], factory) :
4
- (global = global || self, factory((global.osovitny = global.osovitny || {}, global.osovitny.anatoly = {}), global.Swal, global.ng.core, global.ng.common, global.ng.common.http, global.rxjs.operators, global.rxjs, global.i1, global.uuid, global.i1$1, global.dateFns, global.enUS, global.ng.router, global.ng.forms, global.angularFroalaWysiwyg, global.httpLoader));
5
- }(this, (function (exports, Swal, i0, common, http, operators, rxjs, i1, uuid, i1$1, dateFns, enUS, router, forms, angularFroalaWysiwyg, httpLoader) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/router'), require('@angular/common/http'), require('rxjs/operators'), require('rxjs'), require('@ngx-translate/core'), require('date-fns'), require('date-fns/locale/en-US'), require('@angular/common'), require('@ngx-translate/http-loader'), require('sweetalert2'), require('ngx-toastr'), require('uuid'), require('@angular/forms'), require('@angular/platform-browser'), require('angular-froala-wysiwyg')) :
3
+ typeof define === 'function' && define.amd ? define('@osovitny/anatoly', ['exports', '@angular/core', '@angular/router', '@angular/common/http', 'rxjs/operators', 'rxjs', '@ngx-translate/core', 'date-fns', 'date-fns/locale/en-US', '@angular/common', '@ngx-translate/http-loader', 'sweetalert2', 'ngx-toastr', 'uuid', '@angular/forms', '@angular/platform-browser', 'angular-froala-wysiwyg'], factory) :
4
+ (global = global || self, factory((global.osovitny = global.osovitny || {}, global.osovitny.anatoly = {}), global.ng.core, global.ng.router, global.ng.common.http, global.rxjs.operators, global.rxjs, global.i1$1, global.dateFns, global.enUS, global.ng.common, global.httpLoader, global.Swal, global.i1$2, global.uuid, global.ng.forms, global.ng.platformBrowser, global.angularFroalaWysiwyg));
5
+ }(this, (function (exports, i0, router, i1, operators, rxjs, i1$1, dateFns, enUS, common, httpLoader, Swal, i1$2, uuid, forms, platformBrowser, angularFroalaWysiwyg) { 'use strict';
6
6
 
7
- Swal = Swal && Object.prototype.hasOwnProperty.call(Swal, 'default') ? Swal['default'] : Swal;
8
7
  enUS = enUS && Object.prototype.hasOwnProperty.call(enUS, 'default') ? enUS['default'] : enUS;
8
+ Swal = Swal && Object.prototype.hasOwnProperty.call(Swal, 'default') ? Swal['default'] : Swal;
9
9
 
10
10
  /*
11
11
  <file>
@@ -60,14 +60,32 @@
60
60
  Anatoly Osovitny
61
61
 
62
62
  Created:
63
- 26 Jun 2020
63
+ 17 Jun 2018
64
64
 
65
65
  Version:
66
66
  1.0
67
67
 
68
68
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
69
69
  </file>
70
- */
70
+ */
71
+ var BaseGoService = /** @class */ (function () {
72
+ function BaseGoService(route, router) {
73
+ this.route = route;
74
+ this.router = router;
75
+ }
76
+ BaseGoService.prototype.locationReload = function () {
77
+ // this.router.navigate([this.route.url]);
78
+ window.location.reload();
79
+ };
80
+ return BaseGoService;
81
+ }());
82
+ BaseGoService.decorators = [
83
+ { type: i0.Injectable }
84
+ ];
85
+ BaseGoService.ctorParameters = function () { return [
86
+ { type: router.ActivatedRoute },
87
+ { type: router.Router }
88
+ ]; };
71
89
 
72
90
  /*
73
91
  <file>
@@ -93,153 +111,6 @@
93
111
  }
94
112
  }
95
113
 
96
- /*
97
- <file>
98
- Project:
99
- @osovitny/anatoly
100
-
101
- Authors:
102
- Vadim Osovitny
103
- Anatoly Osovitny
104
-
105
- Created:
106
- 4 Mar 2020
107
-
108
- Version:
109
- 1.0
110
-
111
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
112
- </file>
113
- */
114
- var Alerts = /** @class */ (function () {
115
- function Alerts() {
116
- }
117
- Alerts.Info = function (text) {
118
- Swal.fire({
119
- title: 'Information',
120
- text: text,
121
- icon: 'info',
122
- confirmButtonText: 'OK',
123
- });
124
- };
125
- Alerts.Warning = function (text) {
126
- Swal.fire({
127
- title: 'Warning',
128
- text: text,
129
- icon: 'warning',
130
- confirmButtonText: 'OK',
131
- });
132
- };
133
- Alerts.Error = function (text) {
134
- Swal.fire({
135
- title: 'Error',
136
- text: text,
137
- icon: 'error',
138
- confirmButtonText: 'OK',
139
- });
140
- };
141
- Alerts.NotImplemented = function () {
142
- this.Warning('Not Implemented Yet');
143
- };
144
- Alerts.ErrorOccurred = function () {
145
- this.Error('Sorry, an unexpected error occurred');
146
- };
147
- Alerts.AreYouSure = function (text, title, confirmButtonText, cancelButtonText, successAction, cancelAction) {
148
- if (typeof title === 'undefined' || title == null)
149
- title = 'Are you sure?';
150
- Swal.fire({
151
- title: title,
152
- text: text,
153
- icon: 'warning',
154
- confirmButtonText: confirmButtonText,
155
- cancelButtonText: cancelButtonText,
156
- showCancelButton: true,
157
- }).then(function (result) {
158
- if (result.value) {
159
- if (successAction) {
160
- successAction();
161
- }
162
- }
163
- // result.dismiss can be 'cancel', 'overlay', 'close', and 'timer'
164
- else if (result.dismiss === Swal.DismissReason.cancel ||
165
- result.dismiss === Swal.DismissReason.close) {
166
- if (cancelAction) {
167
- cancelAction();
168
- }
169
- }
170
- });
171
- };
172
- Alerts.Success = function (text, title, successAction) {
173
- if (typeof title === 'undefined' || title == null)
174
- title = 'Success';
175
- if (!text) {
176
- text = 'Operation was successful';
177
- }
178
- Swal.fire({
179
- title: title,
180
- text: text,
181
- icon: 'success',
182
- confirmButtonText: 'OK',
183
- }).then(function () {
184
- if (successAction) {
185
- successAction();
186
- }
187
- });
188
- };
189
- Alerts.Cancel = function (text) {
190
- if (!text) {
191
- text = 'Operation has been cancled';
192
- }
193
- Swal.fire({
194
- title: 'Cancelled',
195
- text: text,
196
- icon: 'info',
197
- });
198
- };
199
- // Notifications
200
- Alerts.NotificationCancel = function (text, title) {
201
- if (typeof title === 'undefined' || title == null) {
202
- title = 'Canceled';
203
- }
204
- if (!text) {
205
- text = 'Operation has been canceled';
206
- }
207
- var toast = Swal.mixin({
208
- toast: true,
209
- position: 'top-end',
210
- showConfirmButton: false,
211
- timer: 3000,
212
- timerProgressBar: true,
213
- });
214
- toast.fire({
215
- title: title,
216
- text: text,
217
- icon: 'info',
218
- });
219
- };
220
- Alerts.NotificationSuccess = function (text, title) {
221
- if (typeof title === 'undefined' || title == null) {
222
- title = 'Success';
223
- }
224
- if (!text) {
225
- text = 'Operation was successful';
226
- }
227
- var toast = Swal.mixin({
228
- toast: true,
229
- position: 'top-end',
230
- showConfirmButton: false,
231
- timer: 3000,
232
- timerProgressBar: true,
233
- });
234
- toast.fire({
235
- title: title,
236
- text: text,
237
- icon: 'success',
238
- });
239
- };
240
- return Alerts;
241
- }());
242
-
243
114
  /*! *****************************************************************************
244
115
  Copyright (c) Microsoft Corporation.
245
116
 
@@ -541,6 +412,52 @@
541
412
  return value;
542
413
  }
543
414
 
415
+ var LoadingService = /** @class */ (function (_super) {
416
+ __extends(LoadingService, _super);
417
+ function LoadingService() {
418
+ var _this = _super.call(this, false) || this;
419
+ _this.counter = 0;
420
+ //Public
421
+ _this.isFreezed = false;
422
+ return _this;
423
+ }
424
+ LoadingService.prototype.show = function () {
425
+ this.counter++;
426
+ var that = this;
427
+ setTimeout(function () {
428
+ if (that.counter > 0) {
429
+ that.next(true);
430
+ }
431
+ }, 1000);
432
+ };
433
+ LoadingService.prototype.hide = function () {
434
+ if (this.counter <= 0) {
435
+ return;
436
+ }
437
+ this.counter--;
438
+ if (this.counter == 0) {
439
+ this.next(false);
440
+ }
441
+ };
442
+ LoadingService.prototype.freeze = function (timeout) {
443
+ var _this = this;
444
+ if (timeout === void 0) { timeout = 1000; }
445
+ this.isFreezed = true;
446
+ var that = this;
447
+ setTimeout(function () {
448
+ _this.isFreezed = false;
449
+ }, timeout);
450
+ };
451
+ return LoadingService;
452
+ }(rxjs.BehaviorSubject));
453
+ LoadingService.ɵprov = i0.ɵɵdefineInjectable({ factory: function LoadingService_Factory() { return new LoadingService(); }, token: LoadingService, providedIn: "root" });
454
+ LoadingService.decorators = [
455
+ { type: i0.Injectable, args: [{
456
+ providedIn: "root",
457
+ },] }
458
+ ];
459
+ LoadingService.ctorParameters = function () { return []; };
460
+
544
461
  /*
545
462
  <file>
546
463
  Project:
@@ -578,188 +495,149 @@
578
495
  ];
579
496
  LoggingService.ctorParameters = function () { return []; };
580
497
 
581
- /*
582
- <file>
583
- Project:
584
- @osovitny/anatoly
585
-
586
- Authors:
587
- Vadim Osovitny
588
- Anatoly Osovitny
589
-
590
- Created:
591
- 13 Nov 2017
592
-
593
- Version:
594
- 1.0
595
-
596
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
597
- </file>
598
- */
599
- var BaseApiService = /** @class */ (function () {
600
- function BaseApiService(http) {
601
- this.http = http;
602
- this.baseUrl = '';
498
+ var AnatolyHttpInterceptor = /** @class */ (function () {
499
+ function AnatolyHttpInterceptor(loadingService, loggingService) {
500
+ this.loadingService = loadingService;
501
+ this.loggingService = loggingService;
502
+ this.longRunningExceptionsList = [];
503
+ this.autoCDNSASTokenUrls = ['chunks', 'resources'];
504
+ this.externalSiteUrls = ['azurewebsites.net'];
603
505
  }
604
- BaseApiService.prototype.serializeParams = function (data) {
605
- return data ? '?' + $.param(data) : '';
606
- };
607
- // api
608
- BaseApiService.prototype.get = function (action, data, responseType) {
609
- if (!responseType) {
610
- responseType = 'json';
611
- }
612
- var url = this.baseUrl + "/" + action + this.serializeParams(data);
613
- return this.http
614
- .get(url, { responseType: responseType })
615
- .pipe(operators.map(function (res) { return res; }));
616
- };
617
- BaseApiService.prototype.post = function (action, data, responseType) {
618
- if (!responseType) {
619
- responseType = 'text';
506
+ AnatolyHttpInterceptor.prototype.intercept = function (req, next) {
507
+ var e_1, _a, e_2, _b, e_3, _c;
508
+ var _this = this;
509
+ var isCDNEnabled = AppCoreSettings.IsCDNEnabled;
510
+ var cdnSasToken = AppCoreSettings.CDNSASToken;
511
+ var isLoadingFreezed = this.loadingService.isFreezed;
512
+ var loadingRequired = !isLoadingFreezed;
513
+ var authorizationTokenRequired = true;
514
+ var url = req.url.toLowerCase();
515
+ var originalUrl = req.url;
516
+ var isExternalSite = false;
517
+ if (!isLoadingFreezed) {
518
+ try {
519
+ for (var _d = __values(this.longRunningExceptionsList), _e = _d.next(); !_e.done; _e = _d.next()) {
520
+ var i = _e.value;
521
+ if (url.indexOf(this.longRunningExceptionsList[i]) >= 0) {
522
+ loadingRequired = false;
523
+ break;
524
+ }
525
+ }
526
+ }
527
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
528
+ finally {
529
+ try {
530
+ if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
531
+ }
532
+ finally { if (e_1) throw e_1.error; }
533
+ }
620
534
  }
621
- var url = this.baseUrl + "/" + action;
622
- return this.http.post(url, data, { responseType: responseType });
623
- };
624
- BaseApiService.prototype.postQS = function (action, data, responseType) {
625
- if (!responseType) {
626
- responseType = 'text';
535
+ if (isCDNEnabled) {
536
+ try {
537
+ for (var _f = __values(this.autoCDNSASTokenUrls), _g = _f.next(); !_g.done; _g = _f.next()) {
538
+ var i = _g.value;
539
+ if (url.indexOf(this.autoCDNSASTokenUrls[i]) >= 0) {
540
+ req = req.clone({ url: originalUrl + cdnSasToken });
541
+ break;
542
+ }
543
+ }
544
+ }
545
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
546
+ finally {
547
+ try {
548
+ if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
549
+ }
550
+ finally { if (e_2) throw e_2.error; }
551
+ }
627
552
  }
628
- var url = this.baseUrl + "/" + action + this.serializeParams(data);
629
- return this.http.post(url, null, { responseType: responseType });
630
- };
631
- BaseApiService.prototype.delete = function (action, data, responseType) {
632
- if (!responseType) {
633
- responseType = 'text';
553
+ try {
554
+ for (var _h = __values(this.externalSiteUrls), _j = _h.next(); !_j.done; _j = _h.next()) {
555
+ var i = _j.value;
556
+ if (url.indexOf(this.externalSiteUrls[i]) >= 0) {
557
+ isExternalSite = true;
558
+ break;
559
+ }
560
+ }
634
561
  }
635
- var url = this.baseUrl + "/" + action + this.serializeParams(data);
636
- return this.http.delete(url, { responseType: responseType });
637
- };
638
- // gets
639
- BaseApiService.prototype.getById = function (id) {
640
- return this.get('getById', { id: id });
641
- };
642
- BaseApiService.prototype.getAll = function (data) {
643
- return this.get('getall', data).pipe(operators.map(function (res) { return res; }));
644
- };
645
- BaseApiService.prototype.getJsonFile = function (fileName, jsonUrl, jsonVersion) {
646
- if (!jsonUrl) {
647
- jsonUrl = '/dist/jsons';
562
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
563
+ finally {
564
+ try {
565
+ if (_j && !_j.done && (_c = _h.return)) _c.call(_h);
566
+ }
567
+ finally { if (e_3) throw e_3.error; }
648
568
  }
649
- if (!jsonVersion) {
650
- jsonVersion = '1.0';
569
+ // VadimOS: IE11-fix
570
+ if (url.indexOf('/api/') > -1) {
571
+ var newUrl = '';
572
+ var t = new Date().getTime().toString();
573
+ if (url.indexOf('?') > -1) {
574
+ newUrl = originalUrl + '&t=' + t;
575
+ }
576
+ else {
577
+ newUrl = originalUrl + '?t=' + t;
578
+ }
579
+ req = req.clone({ url: newUrl });
651
580
  }
652
- var url = jsonUrl + '/' + fileName + '?' + jsonVersion;
653
- return this.http.get(url).pipe(operators.map(function (res) { return res; }));
581
+ req = req.clone({ headers: req.headers.set('Accept', 'application/json') });
582
+ this.onRequestStart(loadingRequired);
583
+ return next.handle(req).pipe(operators.tap(function (event) {
584
+ if (event instanceof i1.HttpResponse) {
585
+ _this.onRequestEnd(loadingRequired);
586
+ }
587
+ }, function (err) {
588
+ _this.onRequestEnd(loadingRequired);
589
+ _this.loggingService.logError(err);
590
+ }));
654
591
  };
655
- return BaseApiService;
656
- }());
657
- BaseApiService.decorators = [
658
- { type: i0.Injectable }
659
- ];
660
- BaseApiService.ctorParameters = function () { return [
661
- { type: http.HttpClient }
662
- ]; };
663
-
664
- var AppContextService = /** @class */ (function (_super) {
665
- __extends(AppContextService, _super);
666
- function AppContextService(http) {
667
- var _this = _super.call(this, http) || this;
668
- _this.http = http;
669
- _this.current = null;
670
- _this.successes = [];
671
- _this.subscription = null;
672
- _this.baseUrl = "/api/appContext";
673
- return _this;
674
- }
675
- AppContextService.prototype.getCurrent = function (success) {
676
- var _this = this;
677
- if (typeof success == "undefined") {
678
- return;
679
- }
680
- if (this.current != null) {
681
- success(this.current);
682
- return;
683
- }
684
- this.successes.push(success);
685
- if (this.subscription != null) {
686
- return;
592
+ AnatolyHttpInterceptor.prototype.onRequestStart = function (loadingRequired) {
593
+ if (loadingRequired) {
594
+ this.loadingService.show();
687
595
  }
688
- this.subscription = this.get("GetCurrentContext", null).subscribe(function (data) {
689
- _this.dataReceived(data);
690
- }, function (e) { });
691
596
  };
692
- AppContextService.prototype.dataReceived = function (data) {
693
- this.current = data;
694
- for (var i = 0; i < this.successes.length; i++) {
695
- var success = this.successes[i];
696
- success(data);
597
+ AnatolyHttpInterceptor.prototype.onRequestEnd = function (loadingRequired) {
598
+ if (loadingRequired) {
599
+ this.loadingService.hide();
697
600
  }
698
- this.successes = [];
699
- this.subscription.unsubscribe();
700
- this.subscription = null;
701
- this.current = null;
702
- };
703
- AppContextService.prototype.isUserSignedIn = function () {
704
- return ContextInitState.isUserSignedIn;
705
- };
706
- AppContextService.prototype.isUserAdmin = function () {
707
- return ContextInitState.isUserAdmin;
708
601
  };
709
- return AppContextService;
710
- }(BaseApiService));
711
- AppContextService.decorators = [
602
+ return AnatolyHttpInterceptor;
603
+ }());
604
+ AnatolyHttpInterceptor.decorators = [
712
605
  { type: i0.Injectable }
713
606
  ];
714
- AppContextService.ctorParameters = function () { return [
715
- { type: http.HttpClient }
607
+ AnatolyHttpInterceptor.ctorParameters = function () { return [
608
+ { type: LoadingService },
609
+ { type: LoggingService }
716
610
  ]; };
717
611
 
718
- var LoadingService = /** @class */ (function (_super) {
719
- __extends(LoadingService, _super);
720
- function LoadingService() {
721
- var _this = _super.call(this, false) || this;
722
- _this.counter = 0;
723
- //Public
724
- _this.isFreezed = false;
725
- return _this;
612
+ /*
613
+ <file>
614
+ Project:
615
+ @osovitny/anatoly
616
+
617
+ Authors:
618
+ Vadim Osovitny
619
+ Anatoly Osovitny
620
+
621
+ Created:
622
+ 29 June 2020
623
+
624
+ Version:
625
+ 1.0
626
+
627
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
628
+ </file>
629
+ */
630
+ var Convert = /** @class */ (function () {
631
+ function Convert() {
726
632
  }
727
- LoadingService.prototype.show = function () {
728
- this.counter++;
729
- var that = this;
730
- setTimeout(function () {
731
- if (that.counter > 0) {
732
- that.next(true);
733
- }
734
- }, 1000);
735
- };
736
- LoadingService.prototype.hide = function () {
737
- if (this.counter <= 0) {
738
- return;
739
- }
740
- this.counter--;
741
- if (this.counter == 0) {
742
- this.next(false);
633
+ Convert.toLocalizedDateTime = function (value) {
634
+ if (value) {
635
+ return new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate(), value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds()));
743
636
  }
637
+ return null;
744
638
  };
745
- LoadingService.prototype.freeze = function (timeout) {
746
- var _this = this;
747
- if (timeout === void 0) { timeout = 1000; }
748
- this.isFreezed = true;
749
- var that = this;
750
- setTimeout(function () {
751
- _this.isFreezed = false;
752
- }, timeout);
753
- };
754
- return LoadingService;
755
- }(rxjs.BehaviorSubject));
756
- LoadingService.ɵprov = i0.ɵɵdefineInjectable({ factory: function LoadingService_Factory() { return new LoadingService(); }, token: LoadingService, providedIn: "root" });
757
- LoadingService.decorators = [
758
- { type: i0.Injectable, args: [{
759
- providedIn: "root",
760
- },] }
761
- ];
762
- LoadingService.ctorParameters = function () { return []; };
639
+ return Convert;
640
+ }());
763
641
 
764
642
  /*
765
643
  <file>
@@ -771,7 +649,7 @@
771
649
  Anatoly Osovitny
772
650
 
773
651
  Created:
774
- 26 Jun 2020
652
+ 05 May 2020
775
653
 
776
654
  Version:
777
655
  1.0
@@ -779,314 +657,14 @@
779
657
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
780
658
  </file>
781
659
  */
782
- var Guid = /** @class */ (function () {
783
- function Guid() {
660
+ var LocalizationService = /** @class */ (function () {
661
+ function LocalizationService(translate) {
662
+ this.translate = translate;
663
+ this.setSupportedLanguages(['en']);
784
664
  }
785
- Guid.newGuid = function () {
786
- return uuid.v4();
787
- };
788
- return Guid;
789
- }());
790
-
791
- // SignalR
792
- // import * as signalR from '@microsoft/signalr';
793
- // import { NotificationsApiService } from '../../../data/services/notifications/notifications-api-service';
794
- var NotificationService = /** @class */ (function () {
795
- function NotificationService(toastrService) {
796
- this.toastrService = toastrService;
797
- // SignalR
798
- // private hubConnection: signalR.HubConnection;
799
- // private socketUrl: string;
800
- // Notifications
801
- this._sessionNotifications = new rxjs.BehaviorSubject([]);
802
- this._serverNotifications = new rxjs.BehaviorSubject([]);
803
- // Public
804
- this.sessionNotifications$ = this._sessionNotifications.asObservable();
805
- this.serverNotifications$ = this._serverNotifications.asObservable();
806
- // this.onInit();
807
- }
808
- /*
809
- onInit() {
810
- if (AppCoreSettings.AzureAD) {
811
- this.authService.getAuthToken().subscribe((token: string) => {
812
- this.startSignalRConnection(token);
813
- });
814
-
815
- return;
816
- }
817
-
818
- this.startSignalRConnection();
819
- }
820
-
821
- ngOnDestroy() {
822
- this.stopSignalRConnection();
823
- }
824
-
825
- // SignalR
826
- private startSignalRConnection(accessToken?) {
827
- const cskii = AppCoreSettings.selectedClientID;
828
- // tslint:disable-next-line:variable-name
829
- const cskii_upn = AppCoreSettings.CSKII_UPN;
830
- // tslint:disable-next-line:variable-name
831
- const cli_sessionguid = AppCoreSettings.CLI_SessionGUID;
832
-
833
- const url = this.socketUrl + '?cskii=' + cskii + '&cskii_upn=' + cskii_upn + '&cli_sessionguid=' + cli_sessionguid;
834
-
835
- if (accessToken) {
836
- this.hubConnection = new signalR.HubConnectionBuilder()
837
- .withUrl(url, {
838
- skipNegotiation: false,
839
- transport: signalR.HttpTransportType.WebSockets,
840
- accessTokenFactory: () => accessToken
841
- })
842
- .withAutomaticReconnect()
843
- .configureLogging(signalR.LogLevel.Debug)
844
- .build();
845
- }
846
- else {
847
- this.hubConnection = new signalR.HubConnectionBuilder()
848
- .withUrl(this.socketUrl, {
849
- skipNegotiation: true,
850
- transport: signalR.HttpTransportType.WebSockets
851
- })
852
- .withAutomaticReconnect()
853
- .configureLogging(signalR.LogLevel.Debug)
854
- .build();
855
- }
856
-
857
- this.hubConnection
858
- .start()
859
- .then(() => this.signalRConnection_onSuccess())
860
- .catch(err => {
861
- console.error('Connection failed to SignalR Notification Hub')
862
- })
863
- }
864
-
865
- private signalRConnection_onSuccess() {
866
- this.addReceiveMessageDataListener();
867
-
868
- this.notificationsApiService.retrieveNotifications().subscribe(data => {
869
- this.serverNotifications = data;
870
- });
871
- }
872
-
873
- stopSignalRConnection() {
874
- if (this.hubConnection) {
875
- this.hubConnection.stop();
876
- this.hubConnection = null;
877
- }
878
- }
879
-
880
- private addReceiveMessageDataListener = () => {
881
- this.hubConnection.on('ReceiveMessage', (message) => {
882
- if (message) {
883
- if (message.type === 'error') {
884
- this.error(message.text, null, null, false);
885
- }
886
- else {
887
- this.success(message.text, null, null, false);
888
- }
889
-
890
- const notification = {
891
- id: message.id,
892
- isNew: message.isNew,
893
- isSession: true,
894
- text: message.text,
895
- type: message.type,
896
- createdDate: message.createdDate
897
- };
898
-
899
- this.addSessionNotificationToList(notification);
900
- }
901
- });
902
- }
903
- */
904
- NotificationService.prototype.addSessionNotification = function (text, type) {
905
- var id = Guid.newGuid();
906
- var notification = { id: id, isNew: true, isSession: true, text: text, type: type, createdDate: new Date(Date.now()).toISOString() };
907
- this.addSessionNotificationToList(notification);
908
- };
909
- NotificationService.prototype.addSessionNotificationToList = function (notification) {
910
- this.sessionNotifications = __spread([
911
- notification
912
- ], this.sessionNotifications);
913
- };
914
- // Public API
915
- NotificationService.prototype.removeNotification = function (id, isSession) {
916
- if (isSession) {
917
- this.sessionNotifications = this.sessionNotifications.filter(function (notifications) { return notifications.id !== id; });
918
- }
919
- else {
920
- this.serverNotifications = this.serverNotifications.filter(function (notifications) { return notifications.id !== id; });
921
- }
922
- };
923
- NotificationService.prototype.success = function (text, params, title, createSessionNotification) {
924
- if (createSessionNotification === void 0) { createSessionNotification = true; }
925
- text = Utils.getLocalizedValue(text, params, 'OperationSuccessFull');
926
- title = Utils.getLocalizedValue(title);
927
- this.toastrService.success(text, title, {
928
- timeOut: 3000,
929
- progressBar: true
930
- });
931
- if (createSessionNotification) {
932
- this.addSessionNotification(text, 'success');
933
- }
934
- };
935
- NotificationService.prototype.info = function (text, params, title) {
936
- text = Utils.getLocalizedValue(text, params);
937
- title = Utils.getLocalizedValue(title);
938
- this.toastrService.info(text, title, {
939
- timeOut: 3000,
940
- progressBar: true
941
- });
942
- };
943
- NotificationService.prototype.warning = function (text, params, title) {
944
- text = Utils.getLocalizedValue(text, params);
945
- title = Utils.getLocalizedValue(title);
946
- this.toastrService.warning(text, title, {
947
- timeOut: 3000,
948
- progressBar: true
949
- });
950
- };
951
- NotificationService.prototype.error = function (text, params, title, createSessionNotification) {
952
- if (createSessionNotification === void 0) { createSessionNotification = true; }
953
- text = Utils.getLocalizedValue(text, params, 'ErrorOccured');
954
- title = Utils.getLocalizedValue(title);
955
- this.toastrService.error(text, title, {
956
- timeOut: 3000,
957
- progressBar: true
958
- });
959
- if (createSessionNotification) {
960
- this.addSessionNotification(text, 'error');
961
- }
962
- };
963
- NotificationService.prototype.cancel = function (text, params, title) {
964
- text = Utils.getLocalizedValue(text, params, 'OperationCancelled');
965
- title = Utils.getLocalizedValue(title);
966
- this.toastrService.info(text, title, {
967
- timeOut: 3000,
968
- progressBar: true
969
- });
970
- };
971
- Object.defineProperty(NotificationService.prototype, "sessionNotifications", {
972
- // SessionNotifications
973
- get: function () {
974
- return this._sessionNotifications.getValue();
975
- },
976
- set: function (val) {
977
- this._sessionNotifications.next(val);
978
- },
979
- enumerable: false,
980
- configurable: true
981
- });
982
- Object.defineProperty(NotificationService.prototype, "serverNotifications", {
983
- // ServerNotifications
984
- get: function () {
985
- return this._serverNotifications.getValue();
986
- },
987
- set: function (val) {
988
- this._serverNotifications.next(val);
989
- },
990
- enumerable: false,
991
- configurable: true
992
- });
993
- return NotificationService;
994
- }());
995
- NotificationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function NotificationService_Factory() { return new NotificationService(i0.ɵɵinject(i1.ToastrService)); }, token: NotificationService, providedIn: "root" });
996
- NotificationService.decorators = [
997
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
998
- ];
999
- NotificationService.ctorParameters = function () { return [
1000
- { type: i1.ToastrService }
1001
- ]; };
1002
-
1003
- var providers = [
1004
- LoggingService,
1005
- NotificationService,
1006
- AppContextService,
1007
- LoadingService
1008
- ];
1009
- var InjectorInstance;
1010
- var AnatolyCoreModule = /** @class */ (function () {
1011
- function AnatolyCoreModule(injector, parentModule) {
1012
- this.injector = injector;
1013
- throwIfAlreadyLoaded(parentModule, 'AnatolyCoreModule');
1014
- InjectorInstance = this.injector;
1015
- }
1016
- return AnatolyCoreModule;
1017
- }());
1018
- AnatolyCoreModule.decorators = [
1019
- { type: i0.NgModule, args: [{
1020
- imports: [common.CommonModule],
1021
- exports: [],
1022
- providers: __spread(providers),
1023
- },] }
1024
- ];
1025
- AnatolyCoreModule.ctorParameters = function () { return [
1026
- { type: i0.Injector },
1027
- { type: AnatolyCoreModule, decorators: [{ type: i0.Optional }, { type: i0.SkipSelf }] }
1028
- ]; };
1029
-
1030
- /*
1031
- <file>
1032
- Project:
1033
- @osovitny/anatoly
1034
-
1035
- Authors:
1036
- Vadim Osovitny
1037
- Anatoly Osovitny
1038
-
1039
- Created:
1040
- 29 June 2020
1041
-
1042
- Version:
1043
- 1.0
1044
-
1045
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1046
- </file>
1047
- */
1048
- var Convert = /** @class */ (function () {
1049
- function Convert() {
1050
- }
1051
- /**
1052
- * Convert date time lo local time zone value.
1053
- * @param value
1054
- */
1055
- Convert.toLocalizedDateTime = function (value) {
1056
- if (value) {
1057
- return new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate(), value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds()));
1058
- }
1059
- return null;
1060
- };
1061
- return Convert;
1062
- }());
1063
-
1064
- /*
1065
- <file>
1066
- Project:
1067
- @osovitny/anatoly
1068
-
1069
- Authors:
1070
- Vadim Osovitny
1071
- Anatoly Osovitny
1072
-
1073
- Created:
1074
- 05 May 2020
1075
-
1076
- Version:
1077
- 1.0
1078
-
1079
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1080
- </file>
1081
- */
1082
- var LocalizationService = /** @class */ (function () {
1083
- function LocalizationService(translate) {
1084
- this.translate = translate;
1085
- this.setSupportedLanguages(['en']);
1086
- }
1087
- LocalizationService.prototype.format = function (str, args) {
1088
- // tslint:disable-next-line:variable-name
1089
- return str.replace(/{(\d+)}/g, function (match, number) { return typeof args[number] !== 'undefined' ? args[number] : match; });
665
+ LocalizationService.prototype.format = function (str, args) {
666
+ // tslint:disable-next-line:variable-name
667
+ return str.replace(/{(\d+)}/g, function (match, number) { return typeof args[number] !== 'undefined' ? args[number] : match; });
1090
668
  };
1091
669
  ;
1092
670
  LocalizationService.prototype.configureTranslationSettings = function (translate) {
@@ -1174,7 +752,7 @@
1174
752
  Anatoly Osovitny
1175
753
 
1176
754
  Created:
1177
- 19 March 2020
755
+ 10 May 2020
1178
756
 
1179
757
  Version:
1180
758
  1.0
@@ -1182,75 +760,49 @@
1182
760
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1183
761
  </file>
1184
762
  */
1185
- var Utils = /** @class */ (function () {
1186
- function Utils() {
763
+ var LocalizePipe = /** @class */ (function () {
764
+ function LocalizePipe(localizeService) {
765
+ this.localizeService = localizeService;
1187
766
  }
1188
- Utils.getValueByNameInQS = function (name) {
1189
- return Utils.getValueByName(location.search, name);
1190
- };
1191
- Utils.getValueByName = function (url, name) {
1192
- name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
1193
- // tslint:disable-next-line:one-variable-per-declaration
1194
- var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), results = regex.exec(url);
1195
- return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
1196
- };
1197
- Utils.copyToClipBoard = function (event, val) {
1198
- event.preventDefault();
1199
- var selBox = document.createElement('textarea');
1200
- selBox.style.position = 'fixed';
1201
- selBox.style.left = '0';
1202
- selBox.style.top = '0';
1203
- selBox.style.opacity = '0';
1204
- selBox.value = val;
1205
- document.body.appendChild(selBox);
1206
- selBox.focus();
1207
- selBox.select();
1208
- document.execCommand('copy');
1209
- document.body.removeChild(selBox);
1210
- };
1211
- Utils.downloadFile = function (name, url) {
1212
- var link = document.createElement('a');
1213
- link.download = name;
1214
- link.href = url;
1215
- link.click();
1216
- };
1217
- Object.defineProperty(Utils, "localizationService", {
1218
- // Localization
1219
- // @dynamic
1220
- get: function () {
1221
- var ns = InjectorInstance.get(LocalizationService);
1222
- return ns;
1223
- },
1224
- enumerable: false,
1225
- configurable: true
1226
- });
1227
- Utils.getLocalizedValue = function (key, params, defaultKey) {
1228
- // VadimOS: DON'T CHANGE THIS CODE. NEED TO BE REVIEWED AND APPROVED BY VADIMOS
1229
- // defaultKey definition:
1230
- // if key is empty and defaultKey is defined => get localization for defaultKey
1231
- // Example: cancel()
1232
- if (!key && defaultKey) {
1233
- return this.localizationService.getLocalizedValue(defaultKey);
767
+ LocalizePipe.prototype.transform = function (inputData, type, param2) {
768
+ if (!inputData) {
769
+ return;
1234
770
  }
1235
- // VadimOS:
1236
- // if key is not empty value MUST be in localization table, othewise we will return key
1237
- if (key) {
1238
- var value = this.localizationService.getLocalizedValue(key, params);
1239
- return value;
771
+ if (!type) {
772
+ type = 't';
1240
773
  }
1241
- return key;
1242
- };
1243
- Utils.downloadBlobFile = function (value, fileName) {
1244
- if (window.navigator.msSaveOrOpenBlob) {
1245
- window.navigator.msSaveOrOpenBlob(value, fileName);
774
+ // Translate
775
+ if (type === 't') {
776
+ return this.localizeService.getLocalizedValue(inputData);
1246
777
  }
1247
- else {
1248
- var downloadURL = window.URL.createObjectURL(value);
1249
- Utils.downloadFile(fileName, downloadURL);
778
+ // Date
779
+ if (type === 'd') {
780
+ return this.localizeService.getLocalizedDate(inputData);
781
+ }
782
+ // DateTime
783
+ if (type === 'dt') {
784
+ return this.localizeService.getLocalizedDateTime(inputData);
785
+ }
786
+ // DistanceToNowInWords
787
+ if (type === 'dis2now') {
788
+ return this.localizeService.getLocalizedDistanceToNowInWords(inputData);
789
+ }
790
+ // DistanceInWords
791
+ if (type === 'dis') {
792
+ return this.localizeService.getLocalizedDistanceInWords(inputData, param2);
1250
793
  }
794
+ return inputData;
1251
795
  };
1252
- return Utils;
1253
- }());
796
+ return LocalizePipe;
797
+ }());
798
+ LocalizePipe.decorators = [
799
+ { type: i0.Pipe, args: [{
800
+ name: 'localize'
801
+ },] }
802
+ ];
803
+ LocalizePipe.ctorParameters = function () { return [
804
+ { type: LocalizationService }
805
+ ]; };
1254
806
 
1255
807
  /*
1256
808
  <file>
@@ -1262,7 +814,7 @@
1262
814
  Anatoly Osovitny
1263
815
 
1264
816
  Created:
1265
- 26 Jun 2020
817
+ 05 May 2020
1266
818
 
1267
819
  Version:
1268
820
  1.0
@@ -1270,30 +822,51 @@
1270
822
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1271
823
  </file>
1272
824
  */
1273
- var Subs = /** @class */ (function () {
1274
- function Subs() {
1275
- this.subs = [];
825
+ function customTranslateLoaderFactory(http) {
826
+ return new httpLoader.TranslateHttpLoader(http, AppCoreSettings.resourcesUrl + "/", '.json');
827
+ }
828
+ function localizationInitializerFactory(translate, localizationService, injector) {
829
+ return function () { return new Promise(function (resolve) {
830
+ var locationInitialized = injector.get(common.LOCATION_INITIALIZED, Promise.resolve(null));
831
+ locationInitialized.then(function () {
832
+ var languageToSet = localizationService.configureTranslationSettings(translate);
833
+ translate.use(languageToSet).subscribe(function () {
834
+ }, function () {
835
+ resolve(null);
836
+ }, function () {
837
+ resolve(null);
838
+ });
839
+ });
840
+ }); };
841
+ }
842
+ var TranslateModuleAtRoot = i1$1.TranslateModule.forRoot({
843
+ loader: {
844
+ provide: i1$1.TranslateLoader,
845
+ useFactory: customTranslateLoaderFactory,
846
+ deps: [i1.HttpClient]
1276
847
  }
1277
- Subs.prototype.add = function () {
1278
- var subscriptions = [];
1279
- for (var _i = 0; _i < arguments.length; _i++) {
1280
- subscriptions[_i] = arguments[_i];
1281
- }
1282
- this.subs = this.subs.concat(subscriptions);
1283
- };
1284
- Object.defineProperty(Subs.prototype, "sink", {
1285
- set: function (subscription) {
1286
- this.subs.push(subscription);
1287
- },
1288
- enumerable: false,
1289
- configurable: true
1290
- });
1291
- Subs.prototype.unsubscribe = function () {
1292
- this.subs.forEach(function (sub) { return sub && sub.unsubscribe(); });
1293
- this.subs = [];
1294
- };
1295
- return Subs;
1296
- }());
848
+ });
849
+ var LocalizationSettingsModule = /** @class */ (function () {
850
+ function LocalizationSettingsModule() {
851
+ }
852
+ return LocalizationSettingsModule;
853
+ }());
854
+ LocalizationSettingsModule.decorators = [
855
+ { type: i0.NgModule, args: [{
856
+ imports: [
857
+ TranslateModuleAtRoot
858
+ ],
859
+ providers: [
860
+ {
861
+ provide: i0.APP_INITIALIZER,
862
+ useFactory: localizationInitializerFactory,
863
+ deps: [i1$1.TranslateService, LocalizationService, i0.Injector],
864
+ multi: true
865
+ }
866
+ ],
867
+ exports: []
868
+ },] }
869
+ ];
1297
870
 
1298
871
  /*
1299
872
  <file>
@@ -1305,7 +878,7 @@
1305
878
  Anatoly Osovitny
1306
879
 
1307
880
  Created:
1308
- 17 Jun 2018
881
+ 12 May 2020
1309
882
 
1310
883
  Version:
1311
884
  1.0
@@ -1313,24 +886,26 @@
1313
886
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1314
887
  </file>
1315
888
  */
1316
- var BaseGoService = /** @class */ (function () {
1317
- function BaseGoService(route, router) {
1318
- this.route = route;
1319
- this.router = router;
889
+ var LocalizationModule = /** @class */ (function () {
890
+ function LocalizationModule() {
1320
891
  }
1321
- BaseGoService.prototype.locationReload = function () {
1322
- //this.router.navigate([this.route.url]);
1323
- window.location.reload();
1324
- };
1325
- return BaseGoService;
892
+ return LocalizationModule;
1326
893
  }());
1327
- BaseGoService.decorators = [
1328
- { type: i0.Injectable }
1329
- ];
1330
- BaseGoService.ctorParameters = function () { return [
1331
- { type: router.ActivatedRoute },
1332
- { type: router.Router }
1333
- ]; };
894
+ LocalizationModule.decorators = [
895
+ { type: i0.NgModule, args: [{
896
+ imports: [
897
+ i1$1.TranslateModule
898
+ ],
899
+ exports: [
900
+ i1$1.TranslateModule,
901
+ LocalizePipe
902
+ ],
903
+ declarations: [
904
+ LocalizePipe
905
+ ],
906
+ providers: []
907
+ },] }
908
+ ];
1334
909
 
1335
910
  /*
1336
911
  <file>
@@ -1369,240 +944,141 @@
1369
944
  { type: i0.Injector }
1370
945
  ]; };
1371
946
 
1372
- var AnatolyHttpInterceptor = /** @class */ (function () {
1373
- function AnatolyHttpInterceptor(loadingService, loggingService) {
1374
- this.loadingService = loadingService;
1375
- this.loggingService = loggingService;
1376
- this.longRunningExceptionsList = [];
1377
- this.autoCDNSASTokenUrls = ['chunks', 'resources'];
1378
- this.externalSiteUrls = ['azurewebsites.net'];
947
+ /*
948
+ <file>
949
+ Project:
950
+ @osovitny/anatoly
951
+
952
+ Authors:
953
+ Vadim Osovitny
954
+ Anatoly Osovitny
955
+
956
+ Created:
957
+ 13 Nov 2017
958
+
959
+ Version:
960
+ 1.0
961
+
962
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
963
+ </file>
964
+ */
965
+ var BaseApiService = /** @class */ (function () {
966
+ function BaseApiService(http) {
967
+ this.http = http;
968
+ this.baseUrl = '';
1379
969
  }
1380
- AnatolyHttpInterceptor.prototype.intercept = function (req, next) {
1381
- var e_1, _a, e_2, _b, e_3, _c;
1382
- var _this = this;
1383
- var isCDNEnabled = AppCoreSettings.IsCDNEnabled;
1384
- var cdnSasToken = AppCoreSettings.CDNSASToken;
1385
- var isLoadingFreezed = this.loadingService.isFreezed;
1386
- var loadingRequired = !isLoadingFreezed;
1387
- var authorizationTokenRequired = true;
1388
- var url = req.url.toLowerCase();
1389
- var originalUrl = req.url;
1390
- var isExternalSite = false;
1391
- if (!isLoadingFreezed) {
1392
- try {
1393
- for (var _d = __values(this.longRunningExceptionsList), _e = _d.next(); !_e.done; _e = _d.next()) {
1394
- var i = _e.value;
1395
- if (url.indexOf(this.longRunningExceptionsList[i]) >= 0) {
1396
- loadingRequired = false;
1397
- break;
1398
- }
1399
- }
1400
- }
1401
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
1402
- finally {
1403
- try {
1404
- if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
1405
- }
1406
- finally { if (e_1) throw e_1.error; }
1407
- }
970
+ BaseApiService.prototype.serializeParams = function (data) {
971
+ return data ? '?' + $.param(data) : '';
972
+ };
973
+ // api
974
+ BaseApiService.prototype.get = function (action, data, responseType) {
975
+ if (!responseType) {
976
+ responseType = 'json';
1408
977
  }
1409
- if (isCDNEnabled) {
1410
- try {
1411
- for (var _f = __values(this.autoCDNSASTokenUrls), _g = _f.next(); !_g.done; _g = _f.next()) {
1412
- var i = _g.value;
1413
- if (url.indexOf(this.autoCDNSASTokenUrls[i]) >= 0) {
1414
- req = req.clone({ url: originalUrl + cdnSasToken });
1415
- break;
1416
- }
1417
- }
1418
- }
1419
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
1420
- finally {
1421
- try {
1422
- if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
1423
- }
1424
- finally { if (e_2) throw e_2.error; }
1425
- }
1426
- }
1427
- try {
1428
- for (var _h = __values(this.externalSiteUrls), _j = _h.next(); !_j.done; _j = _h.next()) {
1429
- var i = _j.value;
1430
- if (url.indexOf(this.externalSiteUrls[i]) >= 0) {
1431
- isExternalSite = true;
1432
- break;
1433
- }
1434
- }
1435
- }
1436
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
1437
- finally {
1438
- try {
1439
- if (_j && !_j.done && (_c = _h.return)) _c.call(_h);
1440
- }
1441
- finally { if (e_3) throw e_3.error; }
1442
- }
1443
- // VadimOS: IE11-fix
1444
- if (url.indexOf('/api/') > -1) {
1445
- var newUrl = '';
1446
- var t = new Date().getTime().toString();
1447
- if (url.indexOf('?') > -1) {
1448
- newUrl = originalUrl + '&t=' + t;
1449
- }
1450
- else {
1451
- newUrl = originalUrl + '?t=' + t;
1452
- }
1453
- req = req.clone({ url: newUrl });
978
+ var url = this.baseUrl + "/" + action + this.serializeParams(data);
979
+ return this.http
980
+ .get(url, { responseType: responseType })
981
+ .pipe(operators.map(function (res) { return res; }));
982
+ };
983
+ BaseApiService.prototype.post = function (action, data, responseType) {
984
+ if (!responseType) {
985
+ responseType = 'text';
1454
986
  }
1455
- req = req.clone({ headers: req.headers.set('Accept', 'application/json') });
1456
- this.onRequestStart(loadingRequired);
1457
- return next.handle(req).pipe(operators.tap(function (event) {
1458
- if (event instanceof http.HttpResponse) {
1459
- _this.onRequestEnd(loadingRequired);
1460
- }
1461
- }, function (err) {
1462
- _this.onRequestEnd(loadingRequired);
1463
- _this.loggingService.logError(err);
1464
- }));
987
+ var url = this.baseUrl + "/" + action;
988
+ return this.http.post(url, data, { responseType: responseType });
1465
989
  };
1466
- AnatolyHttpInterceptor.prototype.onRequestStart = function (loadingRequired) {
1467
- if (loadingRequired) {
1468
- this.loadingService.show();
990
+ BaseApiService.prototype.postQS = function (action, data, responseType) {
991
+ if (!responseType) {
992
+ responseType = 'text';
1469
993
  }
994
+ var url = this.baseUrl + "/" + action + this.serializeParams(data);
995
+ return this.http.post(url, null, { responseType: responseType });
1470
996
  };
1471
- AnatolyHttpInterceptor.prototype.onRequestEnd = function (loadingRequired) {
1472
- if (loadingRequired) {
1473
- this.loadingService.hide();
997
+ BaseApiService.prototype.delete = function (action, data, responseType) {
998
+ if (!responseType) {
999
+ responseType = 'text';
1474
1000
  }
1001
+ var url = this.baseUrl + "/" + action + this.serializeParams(data);
1002
+ return this.http.delete(url, { responseType: responseType });
1475
1003
  };
1476
- return AnatolyHttpInterceptor;
1477
- }());
1478
- AnatolyHttpInterceptor.decorators = [
1479
- { type: i0.Injectable }
1480
- ];
1481
- AnatolyHttpInterceptor.ctorParameters = function () { return [
1482
- { type: LoadingService },
1483
- { type: LoggingService }
1484
- ]; };
1485
-
1486
- /*
1487
- <file>
1488
- Project:
1489
- @osovitny/anatoly
1490
-
1491
- Authors:
1492
- Vadim Osovitny
1493
- Anatoly Osovitny
1494
-
1495
- Created:
1496
- 26 Jun 2020
1497
-
1498
- Version:
1499
- 1.0
1500
-
1501
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1502
- </file>
1503
- */
1504
-
1505
- var BaseGridReadService = /** @class */ (function (_super) {
1506
- __extends(BaseGridReadService, _super);
1507
- function BaseGridReadService(http) {
1508
- var _this = _super.call(this, []) || this;
1509
- _this.http = http;
1510
- _this.baseReadUrl = "";
1511
- _this.data = [];
1512
- return _this;
1513
- }
1514
- BaseGridReadService.prototype.serializeParams = function (data) {
1515
- return data ? "?" + $.param(data) : "";
1004
+ // gets
1005
+ BaseApiService.prototype.getById = function (id) {
1006
+ return this.get('getById', { id: id });
1516
1007
  };
1517
- BaseGridReadService.prototype.read = function (params, success, error) {
1518
- var _this = this;
1519
- if (this.data.length) {
1520
- return _super.prototype.next.call(this, this.data);
1521
- }
1522
- var url = this.baseReadUrl;
1523
- if (typeof params === "undefined") {
1524
- params = this.savedReadParams;
1008
+ BaseApiService.prototype.getAll = function (data) {
1009
+ return this.get('getall', data).pipe(operators.map(function (res) { return res; }));
1010
+ };
1011
+ BaseApiService.prototype.getJsonFile = function (fileName, jsonUrl, jsonVersion) {
1012
+ if (!jsonUrl) {
1013
+ jsonUrl = '/dist/jsons';
1525
1014
  }
1526
- if (params) {
1527
- url = this.baseReadUrl + ("" + this.serializeParams(params));
1528
- this.savedReadParams = params;
1015
+ if (!jsonVersion) {
1016
+ jsonVersion = '1.0';
1529
1017
  }
1530
- this.http
1531
- .get(url)
1532
- .pipe(operators.map(function (res) { return res; }))
1533
- .subscribe(function (data) {
1534
- _super.prototype.next.call(_this, data);
1535
- if (success)
1536
- success();
1537
- }, function (e) {
1538
- if (error)
1539
- error(e);
1540
- });
1018
+ var url = jsonUrl + '/' + fileName + '?' + jsonVersion;
1019
+ return this.http.get(url).pipe(operators.map(function (res) { return res; }));
1541
1020
  };
1542
- return BaseGridReadService;
1543
- }(rxjs.BehaviorSubject));
1544
- BaseGridReadService.decorators = [
1021
+ return BaseApiService;
1022
+ }());
1023
+ BaseApiService.decorators = [
1545
1024
  { type: i0.Injectable }
1546
1025
  ];
1547
- BaseGridReadService.ctorParameters = function () { return [
1548
- { type: http.HttpClient }
1026
+ BaseApiService.ctorParameters = function () { return [
1027
+ { type: i1.HttpClient }
1549
1028
  ]; };
1550
1029
 
1551
- var BaseGridEditService = /** @class */ (function (_super) {
1552
- __extends(BaseGridEditService, _super);
1553
- function BaseGridEditService(http) {
1030
+ var AppContextService = /** @class */ (function (_super) {
1031
+ __extends(AppContextService, _super);
1032
+ function AppContextService(http) {
1554
1033
  var _this = _super.call(this, http) || this;
1555
1034
  _this.http = http;
1556
- _this.baseUrl = "";
1035
+ _this.current = null;
1036
+ _this.successes = [];
1037
+ _this.subscription = null;
1038
+ _this.baseUrl = '/api/appContext';
1557
1039
  return _this;
1558
1040
  }
1559
- BaseGridEditService.prototype.reset = function () {
1560
- this.data = [];
1561
- };
1562
- BaseGridEditService.prototype.resetItem = function (dataItem) {
1563
- if (!dataItem) {
1041
+ AppContextService.prototype.getCurrent = function (success) {
1042
+ var _this = this;
1043
+ if (typeof success == 'undefined') {
1564
1044
  return;
1565
1045
  }
1566
- //find orignal data item
1567
- var originalDataItem = this.data.find(function (item) { return item.Id === dataItem.Id; });
1568
- //revert changes
1569
- Object.assign(originalDataItem, dataItem);
1570
- _super.prototype.next.call(this, this.data);
1046
+ if (this.current != null) {
1047
+ success(this.current);
1048
+ return;
1049
+ }
1050
+ this.successes.push(success);
1051
+ if (this.subscription != null) {
1052
+ return;
1053
+ }
1054
+ this.subscription = this.get('GetCurrentContext', null).subscribe(function (data) {
1055
+ _this.dataReceived(data);
1056
+ }, function (e) { });
1571
1057
  };
1572
- BaseGridEditService.prototype.save = function (data, isNew, sucess) {
1573
- var _this = this;
1574
- var action = isNew ? "add" : "update";
1575
- this.reset();
1576
- this.post(action, data).subscribe(function () { }, function () {
1577
- _this.read();
1578
- }, function () {
1579
- _this.read();
1580
- if (sucess)
1581
- sucess();
1582
- });
1058
+ AppContextService.prototype.dataReceived = function (data) {
1059
+ this.current = data;
1060
+ for (var i = 0; i < this.successes.length; i++) {
1061
+ var success = this.successes[i];
1062
+ success(data);
1063
+ }
1064
+ this.successes = [];
1065
+ this.subscription.unsubscribe();
1066
+ this.subscription = null;
1067
+ this.current = null;
1583
1068
  };
1584
- BaseGridEditService.prototype.remove = function (data, sucess) {
1585
- var _this = this;
1586
- this.reset();
1587
- this.post("remove", data).subscribe(function () { }, function () {
1588
- _this.read();
1589
- }, function () {
1590
- _this.read();
1591
- if (sucess)
1592
- sucess();
1593
- });
1069
+ AppContextService.prototype.isUserSignedIn = function () {
1070
+ return ContextInitState.isUserSignedIn;
1594
1071
  };
1595
- BaseGridEditService.prototype.post = function (action, data) {
1596
- var url = this.baseUrl + ("" + action + this.serializeParams(data));
1597
- return this.http.post(url, data).pipe(operators.map(function (res) { return res; }));
1072
+ AppContextService.prototype.isUserAdmin = function () {
1073
+ return ContextInitState.isUserAdmin;
1598
1074
  };
1599
- return BaseGridEditService;
1600
- }(BaseGridReadService));
1601
- BaseGridEditService.decorators = [
1075
+ return AppContextService;
1076
+ }(BaseApiService));
1077
+ AppContextService.decorators = [
1602
1078
  { type: i0.Injectable }
1603
1079
  ];
1604
- BaseGridEditService.ctorParameters = function () { return [
1605
- { type: http.HttpClient }
1080
+ AppContextService.ctorParameters = function () { return [
1081
+ { type: i1.HttpClient }
1606
1082
  ]; };
1607
1083
 
1608
1084
  /*
@@ -1615,7 +1091,7 @@
1615
1091
  Anatoly Osovitny
1616
1092
 
1617
1093
  Created:
1618
- 30 April 2020
1094
+ 26 Jun 2020
1619
1095
 
1620
1096
  Version:
1621
1097
  1.0
@@ -1623,28 +1099,790 @@
1623
1099
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1624
1100
  </file>
1625
1101
  */
1626
- var consts = {
1627
- billingApiPath: "api/billing",
1628
- // Notifications API
1629
- notificationsApiPath: 'api/notifications',
1630
- };
1631
-
1632
- var BillingApiService = /** @class */ (function (_super) {
1633
- __extends(BillingApiService, _super);
1634
- function BillingApiService(http) {
1635
- var _this = _super.call(this, http) || this;
1636
- _this.http = http;
1637
- _this.baseUrl = consts.billingApiPath;
1638
- return _this;
1102
+ var Guid = /** @class */ (function () {
1103
+ function Guid() {
1639
1104
  }
1640
- BillingApiService.prototype.requestNewSubscription = function (requestedPlan, success, error) {
1641
- this.postQS("requestNewSubscription", { requestedPlan: requestedPlan }).subscribe(function (data) { }, function (e) {
1642
- if (error)
1643
- error();
1644
- }, function () {
1645
- if (success)
1646
- success();
1647
- });
1105
+ Guid.newGuid = function () {
1106
+ return uuid.v4();
1107
+ };
1108
+ return Guid;
1109
+ }());
1110
+
1111
+ // SignalR
1112
+ // import * as signalR from '@microsoft/signalr';
1113
+ // import { NotificationsApiService } from '../../../data/services/notifications/notifications-api-service';
1114
+ var NotificationService = /** @class */ (function () {
1115
+ function NotificationService(toastrService) {
1116
+ this.toastrService = toastrService;
1117
+ // SignalR
1118
+ // private hubConnection: signalR.HubConnection;
1119
+ // private socketUrl: string;
1120
+ // Notifications
1121
+ this._sessionNotifications = new rxjs.BehaviorSubject([]);
1122
+ this._serverNotifications = new rxjs.BehaviorSubject([]);
1123
+ // Public
1124
+ this.sessionNotifications$ = this._sessionNotifications.asObservable();
1125
+ this.serverNotifications$ = this._serverNotifications.asObservable();
1126
+ // this.onInit();
1127
+ }
1128
+ /*
1129
+ onInit() {
1130
+ if (AppCoreSettings.AzureAD) {
1131
+ this.authService.getAuthToken().subscribe((token: string) => {
1132
+ this.startSignalRConnection(token);
1133
+ });
1134
+
1135
+ return;
1136
+ }
1137
+
1138
+ this.startSignalRConnection();
1139
+ }
1140
+
1141
+ ngOnDestroy() {
1142
+ this.stopSignalRConnection();
1143
+ }
1144
+
1145
+ // SignalR
1146
+ private startSignalRConnection(accessToken?) {
1147
+ const cskii = AppCoreSettings.selectedClientID;
1148
+ // tslint:disable-next-line:variable-name
1149
+ const cskii_upn = AppCoreSettings.CSKII_UPN;
1150
+ // tslint:disable-next-line:variable-name
1151
+ const cli_sessionguid = AppCoreSettings.CLI_SessionGUID;
1152
+
1153
+ const url = this.socketUrl + '?cskii=' + cskii + '&cskii_upn=' + cskii_upn + '&cli_sessionguid=' + cli_sessionguid;
1154
+
1155
+ if (accessToken) {
1156
+ this.hubConnection = new signalR.HubConnectionBuilder()
1157
+ .withUrl(url, {
1158
+ skipNegotiation: false,
1159
+ transport: signalR.HttpTransportType.WebSockets,
1160
+ accessTokenFactory: () => accessToken
1161
+ })
1162
+ .withAutomaticReconnect()
1163
+ .configureLogging(signalR.LogLevel.Debug)
1164
+ .build();
1165
+ }
1166
+ else {
1167
+ this.hubConnection = new signalR.HubConnectionBuilder()
1168
+ .withUrl(this.socketUrl, {
1169
+ skipNegotiation: true,
1170
+ transport: signalR.HttpTransportType.WebSockets
1171
+ })
1172
+ .withAutomaticReconnect()
1173
+ .configureLogging(signalR.LogLevel.Debug)
1174
+ .build();
1175
+ }
1176
+
1177
+ this.hubConnection
1178
+ .start()
1179
+ .then(() => this.signalRConnection_onSuccess())
1180
+ .catch(err => {
1181
+ console.error('Connection failed to SignalR Notification Hub')
1182
+ })
1183
+ }
1184
+
1185
+ private signalRConnection_onSuccess() {
1186
+ this.addReceiveMessageDataListener();
1187
+
1188
+ this.notificationsApiService.retrieveNotifications().subscribe(data => {
1189
+ this.serverNotifications = data;
1190
+ });
1191
+ }
1192
+
1193
+ stopSignalRConnection() {
1194
+ if (this.hubConnection) {
1195
+ this.hubConnection.stop();
1196
+ this.hubConnection = null;
1197
+ }
1198
+ }
1199
+
1200
+ private addReceiveMessageDataListener = () => {
1201
+ this.hubConnection.on('ReceiveMessage', (message) => {
1202
+ if (message) {
1203
+ if (message.type === 'error') {
1204
+ this.error(message.text, null, null, false);
1205
+ }
1206
+ else {
1207
+ this.success(message.text, null, null, false);
1208
+ }
1209
+
1210
+ const notification = {
1211
+ id: message.id,
1212
+ isNew: message.isNew,
1213
+ isSession: true,
1214
+ text: message.text,
1215
+ type: message.type,
1216
+ createdDate: message.createdDate
1217
+ };
1218
+
1219
+ this.addSessionNotificationToList(notification);
1220
+ }
1221
+ });
1222
+ }
1223
+ */
1224
+ NotificationService.prototype.addSessionNotification = function (text, type) {
1225
+ var id = Guid.newGuid();
1226
+ var notification = { id: id, isNew: true, isSession: true, text: text, type: type, createdDate: new Date(Date.now()).toISOString() };
1227
+ this.addSessionNotificationToList(notification);
1228
+ };
1229
+ NotificationService.prototype.addSessionNotificationToList = function (notification) {
1230
+ this.sessionNotifications = __spread([
1231
+ notification
1232
+ ], this.sessionNotifications);
1233
+ };
1234
+ // Public API
1235
+ NotificationService.prototype.removeNotification = function (id, isSession) {
1236
+ if (isSession) {
1237
+ this.sessionNotifications = this.sessionNotifications.filter(function (notifications) { return notifications.id !== id; });
1238
+ }
1239
+ else {
1240
+ this.serverNotifications = this.serverNotifications.filter(function (notifications) { return notifications.id !== id; });
1241
+ }
1242
+ };
1243
+ NotificationService.prototype.success = function (text, params, title, createSessionNotification) {
1244
+ if (createSessionNotification === void 0) { createSessionNotification = true; }
1245
+ text = Utils.getLocalizedValue(text, params, 'OperationSuccessFull');
1246
+ title = Utils.getLocalizedValue(title);
1247
+ this.toastrService.success(text, title, {
1248
+ timeOut: 3000,
1249
+ progressBar: true
1250
+ });
1251
+ if (createSessionNotification) {
1252
+ this.addSessionNotification(text, 'success');
1253
+ }
1254
+ };
1255
+ NotificationService.prototype.info = function (text, params, title) {
1256
+ text = Utils.getLocalizedValue(text, params);
1257
+ title = Utils.getLocalizedValue(title);
1258
+ this.toastrService.info(text, title, {
1259
+ timeOut: 3000,
1260
+ progressBar: true
1261
+ });
1262
+ };
1263
+ NotificationService.prototype.warning = function (text, params, title) {
1264
+ text = Utils.getLocalizedValue(text, params);
1265
+ title = Utils.getLocalizedValue(title);
1266
+ this.toastrService.warning(text, title, {
1267
+ timeOut: 3000,
1268
+ progressBar: true
1269
+ });
1270
+ };
1271
+ NotificationService.prototype.error = function (text, params, title, createSessionNotification) {
1272
+ if (createSessionNotification === void 0) { createSessionNotification = true; }
1273
+ text = Utils.getLocalizedValue(text, params, 'ErrorOccured');
1274
+ title = Utils.getLocalizedValue(title);
1275
+ this.toastrService.error(text, title, {
1276
+ timeOut: 3000,
1277
+ progressBar: true
1278
+ });
1279
+ if (createSessionNotification) {
1280
+ this.addSessionNotification(text, 'error');
1281
+ }
1282
+ };
1283
+ NotificationService.prototype.cancel = function (text, params, title) {
1284
+ text = Utils.getLocalizedValue(text, params, 'OperationCancelled');
1285
+ title = Utils.getLocalizedValue(title);
1286
+ this.toastrService.info(text, title, {
1287
+ timeOut: 3000,
1288
+ progressBar: true
1289
+ });
1290
+ };
1291
+ Object.defineProperty(NotificationService.prototype, "sessionNotifications", {
1292
+ // SessionNotifications
1293
+ get: function () {
1294
+ return this._sessionNotifications.getValue();
1295
+ },
1296
+ set: function (val) {
1297
+ this._sessionNotifications.next(val);
1298
+ },
1299
+ enumerable: false,
1300
+ configurable: true
1301
+ });
1302
+ Object.defineProperty(NotificationService.prototype, "serverNotifications", {
1303
+ // ServerNotifications
1304
+ get: function () {
1305
+ return this._serverNotifications.getValue();
1306
+ },
1307
+ set: function (val) {
1308
+ this._serverNotifications.next(val);
1309
+ },
1310
+ enumerable: false,
1311
+ configurable: true
1312
+ });
1313
+ return NotificationService;
1314
+ }());
1315
+ NotificationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function NotificationService_Factory() { return new NotificationService(i0.ɵɵinject(i1$2.ToastrService)); }, token: NotificationService, providedIn: "root" });
1316
+ NotificationService.decorators = [
1317
+ { type: i0.Injectable, args: [{ providedIn: 'root' },] }
1318
+ ];
1319
+ NotificationService.ctorParameters = function () { return [
1320
+ { type: i1$2.ToastrService }
1321
+ ]; };
1322
+
1323
+ var AnatolyCoreModule = /** @class */ (function () {
1324
+ function AnatolyCoreModule(injector, parentModule) {
1325
+ this.injector = injector;
1326
+ throwIfAlreadyLoaded(parentModule, 'AnatolyCoreModule');
1327
+ exports.InjectorInstance = this.injector;
1328
+ }
1329
+ return AnatolyCoreModule;
1330
+ }());
1331
+ AnatolyCoreModule.decorators = [
1332
+ { type: i0.NgModule, args: [{
1333
+ imports: [common.CommonModule],
1334
+ exports: [],
1335
+ providers: [
1336
+ LoggingService,
1337
+ NotificationService,
1338
+ AppContextService,
1339
+ LoadingService
1340
+ ],
1341
+ },] }
1342
+ ];
1343
+ AnatolyCoreModule.ctorParameters = function () { return [
1344
+ { type: i0.Injector },
1345
+ { type: AnatolyCoreModule, decorators: [{ type: i0.Optional }, { type: i0.SkipSelf }] }
1346
+ ]; };
1347
+
1348
+ /*
1349
+ <file>
1350
+ Project:
1351
+ @osovitny/anatoly
1352
+
1353
+ Authors:
1354
+ Vadim Osovitny
1355
+ Anatoly Osovitny
1356
+
1357
+ Created:
1358
+ 19 March 2020
1359
+
1360
+ Version:
1361
+ 1.0
1362
+
1363
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1364
+ </file>
1365
+ */
1366
+ var Utils = /** @class */ (function () {
1367
+ function Utils() {
1368
+ }
1369
+ Utils.getValueByNameInQS = function (name) {
1370
+ return Utils.getValueByName(location.search, name);
1371
+ };
1372
+ Utils.getValueByName = function (url, name) {
1373
+ name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
1374
+ // tslint:disable-next-line:one-variable-per-declaration
1375
+ var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), results = regex.exec(url);
1376
+ return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
1377
+ };
1378
+ Utils.copyToClipBoard = function (event, val) {
1379
+ event.preventDefault();
1380
+ var selBox = document.createElement('textarea');
1381
+ selBox.style.position = 'fixed';
1382
+ selBox.style.left = '0';
1383
+ selBox.style.top = '0';
1384
+ selBox.style.opacity = '0';
1385
+ selBox.value = val;
1386
+ document.body.appendChild(selBox);
1387
+ selBox.focus();
1388
+ selBox.select();
1389
+ document.execCommand('copy');
1390
+ document.body.removeChild(selBox);
1391
+ };
1392
+ Utils.downloadFile = function (name, url) {
1393
+ var link = document.createElement('a');
1394
+ link.download = name;
1395
+ link.href = url;
1396
+ link.click();
1397
+ };
1398
+ Object.defineProperty(Utils, "localizationService", {
1399
+ // Localization
1400
+ // @dynamic
1401
+ get: function () {
1402
+ var ns = exports.InjectorInstance.get(LocalizationService);
1403
+ return ns;
1404
+ },
1405
+ enumerable: false,
1406
+ configurable: true
1407
+ });
1408
+ Utils.getLocalizedValue = function (key, params, defaultKey) {
1409
+ // VadimOS: DON'T CHANGE THIS CODE. NEED TO BE REVIEWED AND APPROVED BY VADIMOS
1410
+ // defaultKey definition:
1411
+ // if key is empty and defaultKey is defined => get localization for defaultKey
1412
+ // Example: cancel()
1413
+ if (!key && defaultKey) {
1414
+ return this.localizationService.getLocalizedValue(defaultKey);
1415
+ }
1416
+ // VadimOS:
1417
+ // if key is not empty value MUST be in localization table, othewise we will return key
1418
+ if (key) {
1419
+ var value = this.localizationService.getLocalizedValue(key, params);
1420
+ return value;
1421
+ }
1422
+ return key;
1423
+ };
1424
+ Utils.downloadBlobFile = function (value, fileName) {
1425
+ if (window.navigator.msSaveOrOpenBlob) {
1426
+ window.navigator.msSaveOrOpenBlob(value, fileName);
1427
+ }
1428
+ else {
1429
+ var downloadURL = window.URL.createObjectURL(value);
1430
+ Utils.downloadFile(fileName, downloadURL);
1431
+ }
1432
+ };
1433
+ return Utils;
1434
+ }());
1435
+
1436
+ /*
1437
+ <file>
1438
+ Project:
1439
+ @osovitny/anatoly
1440
+
1441
+ Authors:
1442
+ Vadim Osovitny
1443
+ Anatoly Osovitny
1444
+
1445
+ Created:
1446
+ 3 March 2020
1447
+
1448
+ Version:
1449
+ 1.0
1450
+
1451
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1452
+ </file>
1453
+ */
1454
+ var Alerts = /** @class */ (function () {
1455
+ function Alerts() {
1456
+ }
1457
+ Alerts.success = function (text, params, title, successAction) {
1458
+ text = Utils.getLocalizedValue(text, params, 'OperationSuccessFull');
1459
+ title = Utils.getLocalizedValue(title, null, 'Success');
1460
+ Swal.fire({
1461
+ text: text,
1462
+ title: title,
1463
+ icon: 'success',
1464
+ confirmButtonText: Utils.getLocalizedValue('Ok')
1465
+ })
1466
+ .then(function () {
1467
+ if (successAction) {
1468
+ successAction();
1469
+ }
1470
+ });
1471
+ };
1472
+ Alerts.info = function (text, params, title) {
1473
+ text = Utils.getLocalizedValue(text, params);
1474
+ title = Utils.getLocalizedValue(title, null, 'Info');
1475
+ Swal.fire({
1476
+ text: text,
1477
+ title: title,
1478
+ icon: 'info',
1479
+ confirmButtonText: Utils.getLocalizedValue('Ok')
1480
+ });
1481
+ };
1482
+ Alerts.warning = function (text, params, title) {
1483
+ text = Utils.getLocalizedValue(text, params);
1484
+ title = Utils.getLocalizedValue(title, null, 'Warning');
1485
+ Swal.fire({
1486
+ text: text,
1487
+ title: title,
1488
+ icon: 'warning',
1489
+ confirmButtonText: Utils.getLocalizedValue('Ok')
1490
+ });
1491
+ };
1492
+ Alerts.error = function (text, params, title) {
1493
+ text = Utils.getLocalizedValue(text, params, 'ErrorOccured');
1494
+ title = Utils.getLocalizedValue(title, null, 'Error');
1495
+ Swal.fire({
1496
+ text: text,
1497
+ title: title,
1498
+ icon: 'error',
1499
+ confirmButtonText: Utils.getLocalizedValue('Ok')
1500
+ });
1501
+ };
1502
+ Alerts.cancel = function (text, params, title) {
1503
+ text = Utils.getLocalizedValue(text, params, 'OperationCancelled');
1504
+ title = Utils.getLocalizedValue(title, null, 'Cancelled');
1505
+ Swal.fire({
1506
+ text: text,
1507
+ title: title,
1508
+ icon: 'info'
1509
+ });
1510
+ };
1511
+ Alerts.notImplemented = function () {
1512
+ this.warning('Not Implemented Yet');
1513
+ };
1514
+ ;
1515
+ Alerts.areYouSure = function (text, title, confirmButtonText, cancelButtonText, successAction, cancelAction) {
1516
+ text = Utils.getLocalizedValue(text);
1517
+ title = Utils.getLocalizedValue(title, null, 'AreYouSure');
1518
+ confirmButtonText = Utils.getLocalizedValue(confirmButtonText, null, 'AreYouSure-ConfirmButtonText');
1519
+ cancelButtonText = Utils.getLocalizedValue(cancelButtonText, null, 'AreYouSure-CancelButtonText');
1520
+ Swal.fire({
1521
+ text: text,
1522
+ title: title,
1523
+ icon: 'warning',
1524
+ confirmButtonText: confirmButtonText,
1525
+ cancelButtonText: cancelButtonText,
1526
+ showCancelButton: true
1527
+ })
1528
+ .then(function (result) {
1529
+ if (result.value) {
1530
+ if (successAction) {
1531
+ successAction();
1532
+ }
1533
+ }
1534
+ // result.dismiss can be 'cancel', 'overlay', 'close', and 'timer'
1535
+ else if (result.dismiss == Swal.DismissReason.cancel || result.dismiss == Swal.DismissReason.close) {
1536
+ if (cancelAction) {
1537
+ cancelAction();
1538
+ }
1539
+ }
1540
+ });
1541
+ };
1542
+ ;
1543
+ return Alerts;
1544
+ }());
1545
+
1546
+ /*
1547
+ <file>
1548
+ Project:
1549
+ @osovitny/anatoly
1550
+
1551
+ Authors:
1552
+ Vadim Osovitny
1553
+ Anatoly Osovitny
1554
+
1555
+ Created:
1556
+ 2 Jun 2020
1557
+
1558
+ Version:
1559
+ 1.0
1560
+
1561
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1562
+ </file>
1563
+ */
1564
+
1565
+ /*
1566
+ <file>
1567
+ Project:
1568
+ @osovitny/anatoly
1569
+
1570
+ Authors:
1571
+ Vadim Osovitny
1572
+ Anatoly Osovitny
1573
+
1574
+ Created:
1575
+ 26 Jun 2020
1576
+
1577
+ Version:
1578
+ 1.0
1579
+
1580
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1581
+ </file>
1582
+ */
1583
+ var IdleService = /** @class */ (function () {
1584
+ function IdleService() {
1585
+ this.expired$ = new rxjs.Subject();
1586
+ }
1587
+ IdleService.prototype.startWatching = function (timeOutSeconds) {
1588
+ var _this = this;
1589
+ this.idle$ = rxjs.merge(rxjs.fromEvent(document, "mousemove"), rxjs.fromEvent(document, "click"), rxjs.fromEvent(document, "mousedown"), rxjs.fromEvent(document, "keypress"), rxjs.fromEvent(document, "DOMMouseScroll"), rxjs.fromEvent(document, "mousewheel"), rxjs.fromEvent(document, "touchmove"), rxjs.fromEvent(document, "MSPointerMove"), rxjs.fromEvent(window, "mousemove"), rxjs.fromEvent(window, "resize"));
1590
+ this.timeOutMilliSeconds = timeOutSeconds * 1000;
1591
+ this.idleSubscription = this.idle$.subscribe(function (res) {
1592
+ _this.resetTimer();
1593
+ });
1594
+ this.startTimer();
1595
+ return this.expired$;
1596
+ };
1597
+ IdleService.prototype.startTimer = function () {
1598
+ var _this = this;
1599
+ this.timer$ = rxjs.timer(this.timeOutMilliSeconds, this.timeOutMilliSeconds).subscribe(function (res) {
1600
+ _this.expired$.next(true);
1601
+ });
1602
+ };
1603
+ IdleService.prototype.resetTimer = function () {
1604
+ this.timer$.unsubscribe();
1605
+ this.startTimer();
1606
+ };
1607
+ IdleService.prototype.stopTimer = function () {
1608
+ this.timer$.unsubscribe();
1609
+ this.idleSubscription.unsubscribe();
1610
+ };
1611
+ IdleService.prototype.restartIdleTimer = function () {
1612
+ var _this = this;
1613
+ this.timer$.unsubscribe();
1614
+ this.idleSubscription.unsubscribe();
1615
+ this.idleSubscription = this.idle$.subscribe(function (res) {
1616
+ _this.resetTimer();
1617
+ });
1618
+ this.startTimer();
1619
+ };
1620
+ return IdleService;
1621
+ }());
1622
+ IdleService.ɵprov = i0.ɵɵdefineInjectable({ factory: function IdleService_Factory() { return new IdleService(); }, token: IdleService, providedIn: "root" });
1623
+ IdleService.decorators = [
1624
+ { type: i0.Injectable, args: [{
1625
+ providedIn: "root",
1626
+ },] }
1627
+ ];
1628
+
1629
+ var WebStorageService = /** @class */ (function () {
1630
+ function WebStorageService(storage) {
1631
+ this.currentClientKey = AppCoreSettings.SERVICES_CONF.selectedClientID;
1632
+ this.storage =
1633
+ storage === 'local' || storage === 'localStorage'
1634
+ ? localStorage
1635
+ : sessionStorage;
1636
+ }
1637
+ WebStorageService.prototype.setItem = function (key, value) {
1638
+ this.storage.setItem(this.currentClientKey + key, value);
1639
+ };
1640
+ WebStorageService.prototype.setObject = function (key, value) {
1641
+ this.storage.setItem(this.currentClientKey + key, JSON.stringify(value));
1642
+ };
1643
+ WebStorageService.prototype.getItem = function (key) {
1644
+ return this.storage.getItem(this.currentClientKey + key);
1645
+ };
1646
+ WebStorageService.prototype.getObject = function (key) {
1647
+ return JSON.parse(this.storage.getItem(this.currentClientKey + key) || '{}');
1648
+ };
1649
+ WebStorageService.prototype.remove = function (key) {
1650
+ this.storage.removeItem(this.currentClientKey + key);
1651
+ };
1652
+ return WebStorageService;
1653
+ }());
1654
+ var LocalStorageService = /** @class */ (function (_super) {
1655
+ __extends(LocalStorageService, _super);
1656
+ function LocalStorageService() {
1657
+ return _super.call(this, 'localStorage') || this;
1658
+ }
1659
+ return LocalStorageService;
1660
+ }(WebStorageService));
1661
+ LocalStorageService.decorators = [
1662
+ { type: i0.Injectable }
1663
+ ];
1664
+ LocalStorageService.ctorParameters = function () { return []; };
1665
+ var SessionStorageService = /** @class */ (function (_super) {
1666
+ __extends(SessionStorageService, _super);
1667
+ function SessionStorageService() {
1668
+ return _super.call(this, 'sessionStorage') || this;
1669
+ }
1670
+ return SessionStorageService;
1671
+ }(WebStorageService));
1672
+ SessionStorageService.decorators = [
1673
+ { type: i0.Injectable }
1674
+ ];
1675
+ SessionStorageService.ctorParameters = function () { return []; };
1676
+
1677
+ /*
1678
+ <file>
1679
+ Project:
1680
+ @osovitny/anatoly
1681
+
1682
+ Authors:
1683
+ Vadim Osovitny
1684
+ Anatoly Osovitny
1685
+
1686
+ Created:
1687
+ 26 Jun 2020
1688
+
1689
+ Version:
1690
+ 1.0
1691
+
1692
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1693
+ </file>
1694
+ */
1695
+ var Subs = /** @class */ (function () {
1696
+ function Subs() {
1697
+ this.subs = [];
1698
+ }
1699
+ Subs.prototype.add = function () {
1700
+ var subscriptions = [];
1701
+ for (var _i = 0; _i < arguments.length; _i++) {
1702
+ subscriptions[_i] = arguments[_i];
1703
+ }
1704
+ this.subs = this.subs.concat(subscriptions);
1705
+ };
1706
+ Object.defineProperty(Subs.prototype, "sink", {
1707
+ set: function (subscription) {
1708
+ this.subs.push(subscription);
1709
+ },
1710
+ enumerable: false,
1711
+ configurable: true
1712
+ });
1713
+ Subs.prototype.unsubscribe = function () {
1714
+ this.subs.forEach(function (sub) { return sub && sub.unsubscribe(); });
1715
+ this.subs = [];
1716
+ };
1717
+ return Subs;
1718
+ }());
1719
+
1720
+ var BaseGridReadService = /** @class */ (function (_super) {
1721
+ __extends(BaseGridReadService, _super);
1722
+ function BaseGridReadService(http) {
1723
+ var _this = _super.call(this, []) || this;
1724
+ _this.http = http;
1725
+ _this.baseReadUrl = "";
1726
+ _this.data = [];
1727
+ return _this;
1728
+ }
1729
+ BaseGridReadService.prototype.serializeParams = function (data) {
1730
+ return data ? "?" + $.param(data) : "";
1731
+ };
1732
+ BaseGridReadService.prototype.read = function (params, success, error) {
1733
+ var _this = this;
1734
+ if (this.data.length) {
1735
+ return _super.prototype.next.call(this, this.data);
1736
+ }
1737
+ var url = this.baseReadUrl;
1738
+ if (typeof params === "undefined") {
1739
+ params = this.savedReadParams;
1740
+ }
1741
+ if (params) {
1742
+ url = this.baseReadUrl + ("" + this.serializeParams(params));
1743
+ this.savedReadParams = params;
1744
+ }
1745
+ this.http
1746
+ .get(url)
1747
+ .pipe(operators.map(function (res) { return res; }))
1748
+ .subscribe(function (data) {
1749
+ _super.prototype.next.call(_this, data);
1750
+ if (success)
1751
+ success();
1752
+ }, function (e) {
1753
+ if (error)
1754
+ error(e);
1755
+ });
1756
+ };
1757
+ return BaseGridReadService;
1758
+ }(rxjs.BehaviorSubject));
1759
+ BaseGridReadService.decorators = [
1760
+ { type: i0.Injectable }
1761
+ ];
1762
+ BaseGridReadService.ctorParameters = function () { return [
1763
+ { type: i1.HttpClient }
1764
+ ]; };
1765
+
1766
+ var BaseGridEditService = /** @class */ (function (_super) {
1767
+ __extends(BaseGridEditService, _super);
1768
+ function BaseGridEditService(http) {
1769
+ var _this = _super.call(this, http) || this;
1770
+ _this.http = http;
1771
+ _this.baseUrl = "";
1772
+ return _this;
1773
+ }
1774
+ BaseGridEditService.prototype.reset = function () {
1775
+ this.data = [];
1776
+ };
1777
+ BaseGridEditService.prototype.resetItem = function (dataItem) {
1778
+ if (!dataItem) {
1779
+ return;
1780
+ }
1781
+ //find orignal data item
1782
+ var originalDataItem = this.data.find(function (item) { return item.Id === dataItem.Id; });
1783
+ //revert changes
1784
+ Object.assign(originalDataItem, dataItem);
1785
+ _super.prototype.next.call(this, this.data);
1786
+ };
1787
+ BaseGridEditService.prototype.save = function (data, isNew, sucess) {
1788
+ var _this = this;
1789
+ var action = isNew ? "add" : "update";
1790
+ this.reset();
1791
+ this.post(action, data).subscribe(function () { }, function () {
1792
+ _this.read();
1793
+ }, function () {
1794
+ _this.read();
1795
+ if (sucess)
1796
+ sucess();
1797
+ });
1798
+ };
1799
+ BaseGridEditService.prototype.remove = function (data, sucess) {
1800
+ var _this = this;
1801
+ this.reset();
1802
+ this.post("remove", data).subscribe(function () { }, function () {
1803
+ _this.read();
1804
+ }, function () {
1805
+ _this.read();
1806
+ if (sucess)
1807
+ sucess();
1808
+ });
1809
+ };
1810
+ BaseGridEditService.prototype.post = function (action, data) {
1811
+ var url = this.baseUrl + ("" + action + this.serializeParams(data));
1812
+ return this.http.post(url, data).pipe(operators.map(function (res) { return res; }));
1813
+ };
1814
+ return BaseGridEditService;
1815
+ }(BaseGridReadService));
1816
+ BaseGridEditService.decorators = [
1817
+ { type: i0.Injectable }
1818
+ ];
1819
+ BaseGridEditService.ctorParameters = function () { return [
1820
+ { type: i1.HttpClient }
1821
+ ]; };
1822
+
1823
+ /*
1824
+ <file>
1825
+ Project:
1826
+ @osovitny/anatoly
1827
+
1828
+ Authors:
1829
+ Vadim Osovitny
1830
+ Anatoly Osovitny
1831
+
1832
+ Created:
1833
+ 30 April 2020
1834
+
1835
+ Version:
1836
+ 1.0
1837
+
1838
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1839
+ </file>
1840
+ */
1841
+ var consts = {
1842
+ billingApiPath: 'api/billing',
1843
+ // Notifications API
1844
+ notificationsApiPath: 'api/notifications',
1845
+ };
1846
+
1847
+ var NotificationsApiService = /** @class */ (function (_super) {
1848
+ __extends(NotificationsApiService, _super);
1849
+ function NotificationsApiService(http) {
1850
+ var _this = _super.call(this, http) || this;
1851
+ _this.http = http;
1852
+ _this.baseUrl = consts.notificationsApiPath;
1853
+ return _this;
1854
+ }
1855
+ NotificationsApiService.prototype.retrieveNotifications = function () {
1856
+ return this.get('retrieveNotifications');
1857
+ };
1858
+ return NotificationsApiService;
1859
+ }(BaseApiService));
1860
+ NotificationsApiService.ɵprov = i0.ɵɵdefineInjectable({ factory: function NotificationsApiService_Factory() { return new NotificationsApiService(i0.ɵɵinject(i1.HttpClient)); }, token: NotificationsApiService, providedIn: "root" });
1861
+ NotificationsApiService.decorators = [
1862
+ { type: i0.Injectable, args: [{
1863
+ providedIn: 'root'
1864
+ },] }
1865
+ ];
1866
+ NotificationsApiService.ctorParameters = function () { return [
1867
+ { type: i1.HttpClient }
1868
+ ]; };
1869
+
1870
+ var BillingApiService = /** @class */ (function (_super) {
1871
+ __extends(BillingApiService, _super);
1872
+ function BillingApiService(http) {
1873
+ var _this = _super.call(this, http) || this;
1874
+ _this.http = http;
1875
+ _this.baseUrl = consts.billingApiPath;
1876
+ return _this;
1877
+ }
1878
+ BillingApiService.prototype.requestNewSubscription = function (requestedPlan, success, error) {
1879
+ this.postQS("requestNewSubscription", { requestedPlan: requestedPlan }).subscribe(function (data) { }, function (e) {
1880
+ if (error)
1881
+ error();
1882
+ }, function () {
1883
+ if (success)
1884
+ success();
1885
+ });
1648
1886
  };
1649
1887
  BillingApiService.prototype.cancelRequestedSubscription = function (success, error) {
1650
1888
  this.postQS("cancelRequestedSubscription", null).subscribe(function (data) { }, function (e) {
@@ -1670,7 +1908,7 @@
1670
1908
  { type: i0.Injectable }
1671
1909
  ];
1672
1910
  BillingApiService.ctorParameters = function () { return [
1673
- { type: http.HttpClient }
1911
+ { type: i1.HttpClient }
1674
1912
  ]; };
1675
1913
 
1676
1914
  /*
@@ -1711,25 +1949,6 @@
1711
1949
  { type: AnatolyDataModule, decorators: [{ type: i0.Optional }, { type: i0.SkipSelf }] }
1712
1950
  ]; };
1713
1951
 
1714
- /*
1715
- <file>
1716
- Project:
1717
- @osovitny/anatoly
1718
-
1719
- Authors:
1720
- Vadim Osovitny
1721
- Anatoly Osovitny
1722
-
1723
- Created:
1724
- 4 Mar 2020
1725
-
1726
- Version:
1727
- 1.0
1728
-
1729
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1730
- </file>
1731
- */
1732
-
1733
1952
  /*
1734
1953
  <file>
1735
1954
  Project:
@@ -1755,7 +1974,7 @@
1755
1974
  this.contextUpdated = false;
1756
1975
  this.isUserSignedIn = false;
1757
1976
  this.currentPlan = 0;
1758
- this.currentPlanTitle = "";
1977
+ this.currentPlanTitle = '';
1759
1978
  }
1760
1979
  BuyAccessButtonComponent.prototype.ngOnInit = function () {
1761
1980
  var _this = this;
@@ -1775,9 +1994,9 @@
1775
1994
  BuyAccessButtonComponent.prototype.onBuyPlan = function () {
1776
1995
  var text = "Requested plan: " + this.plantitle + " ";
1777
1996
  var that = this;
1778
- Alerts.AreYouSure(text, "Buying access", "Confirm change", "Cancel", function () {
1997
+ Alerts.areYouSure(text, 'Buying access', 'Confirm change', 'Cancel', function () {
1779
1998
  that.api.buyAccess(that.plan, function () {
1780
- Alerts.Success("Access Granted", null, function () {
1999
+ Alerts.success('Access Granted', null, null, function () {
1781
2000
  window.location.reload();
1782
2001
  });
1783
2002
  });
@@ -1787,7 +2006,7 @@
1787
2006
  }());
1788
2007
  BuyAccessButtonComponent.decorators = [
1789
2008
  { type: i0.Component, args: [{
1790
- selector: "anatoly-buyaccess-button",
2009
+ selector: 'anatoly-buyaccess-button',
1791
2010
  template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"plan != currentPlan && currentPlan == 1\" (click)=\"onBuyPlan()\">\r\n Buy Now\r\n </button>\r\n </div>\r\n</div>\r\n"
1792
2011
  },] }
1793
2012
  ];
@@ -1853,97 +2072,12 @@
1853
2072
  template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"requestedPlan != null && requestedPlan != 0 && plan == requestedPlan\">\r\n Requested\r\n </button>\r\n\r\n <anatoly-upgrade-plan-button *ngIf=\"plan != currentPlan && plan != requestedPlan\"\r\n [currentplantitle]=\"currentPlanTitle\"\r\n [requestedplan]=plan\r\n [requestedplantitle]=\"plantitle\">\r\n </anatoly-upgrade-plan-button>\r\n </div>\r\n</div>\r\n"
1854
2073
  },] }
1855
2074
  ];
1856
- SubscribePlanButtonComponent.ctorParameters = function () { return [
1857
- { type: AppContextService }
1858
- ]; };
1859
- SubscribePlanButtonComponent.propDecorators = {
1860
- plan: [{ type: i0.Input }],
1861
- plantitle: [{ type: i0.Input }]
1862
- };
1863
-
1864
- /*
1865
- <file>
1866
- Project:
1867
- @osovitny/anatoly
1868
-
1869
- Authors:
1870
- Vadim Osovitny
1871
- Anatoly Osovitny
1872
-
1873
- Created:
1874
- 12 Nov 2017
1875
-
1876
- Version:
1877
- 1.0
1878
-
1879
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1880
- </file>
1881
- */
1882
- // Services
1883
- var UpgradePlanButtonComponent = /** @class */ (function () {
1884
- function UpgradePlanButtonComponent(api) {
1885
- this.api = api;
1886
- }
1887
- UpgradePlanButtonComponent.prototype.onUpgradePlan = function () {
1888
- var text = "Current plan: " + this.currentplantitle + " New plan: " + this.requestedplantitle;
1889
- var that = this;
1890
- Alerts.AreYouSure(text, "Change billing plan", "Confirm change", "Cancel", function () {
1891
- that.api.requestNewSubscription(that.requestedplan, function () {
1892
- Alerts.Success("Your request for changing plan has been sent.", null, function () {
1893
- window.location.reload();
1894
- });
1895
- });
1896
- });
1897
- };
1898
- return UpgradePlanButtonComponent;
1899
- }());
1900
- UpgradePlanButtonComponent.decorators = [
1901
- { type: i0.Component, args: [{
1902
- selector: "anatoly-upgrade-plan-button",
1903
- template: "<button class=\"btn btn-block btn-primary\" (click)=\"onUpgradePlan()\">\r\n Upgrade\r\n</button>\r\n"
1904
- },] }
1905
- ];
1906
- UpgradePlanButtonComponent.ctorParameters = function () { return [
1907
- { type: BillingApiService }
1908
- ]; };
1909
- UpgradePlanButtonComponent.propDecorators = {
1910
- currentplantitle: [{ type: i0.Input }],
1911
- requestedplan: [{ type: i0.Input }],
1912
- requestedplantitle: [{ type: i0.Input }]
1913
- };
1914
-
1915
- /*
1916
- <file>
1917
- Project:
1918
- @osovitny/anatoly
1919
-
1920
- Authors:
1921
- Vadim Osovitny
1922
- Anatoly Osovitny
1923
-
1924
- Created:
1925
- 4 Jul 2018
1926
-
1927
- Version:
1928
- 1.0
1929
-
1930
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1931
- </file>
1932
- */
1933
- var SignInButtonComponent = /** @class */ (function () {
1934
- function SignInButtonComponent() {
1935
- }
1936
- return SignInButtonComponent;
1937
- }());
1938
- SignInButtonComponent.decorators = [
1939
- { type: i0.Component, args: [{
1940
- selector: "anatoly-signin-button",
1941
- template: "<a href=\"identity/signIn\" class=\"{{classbtn}}\">Sign In</a>\r\n"
1942
- },] }
1943
- ];
1944
- SignInButtonComponent.ctorParameters = function () { return []; };
1945
- SignInButtonComponent.propDecorators = {
1946
- classbtn: [{ type: i0.Input }]
2075
+ SubscribePlanButtonComponent.ctorParameters = function () { return [
2076
+ { type: AppContextService }
2077
+ ]; };
2078
+ SubscribePlanButtonComponent.propDecorators = {
2079
+ plan: [{ type: i0.Input }],
2080
+ plantitle: [{ type: i0.Input }]
1947
2081
  };
1948
2082
 
1949
2083
  /*
@@ -1956,7 +2090,7 @@
1956
2090
  Anatoly Osovitny
1957
2091
 
1958
2092
  Created:
1959
- 4 Jul 2018
2093
+ 12 Nov 2017
1960
2094
 
1961
2095
  Version:
1962
2096
  1.0
@@ -1964,20 +2098,37 @@
1964
2098
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1965
2099
  </file>
1966
2100
  */
1967
- var SignOutButtonComponent = /** @class */ (function () {
1968
- function SignOutButtonComponent() {
2101
+ // Services
2102
+ var UpgradePlanButtonComponent = /** @class */ (function () {
2103
+ function UpgradePlanButtonComponent(api) {
2104
+ this.api = api;
1969
2105
  }
1970
- return SignOutButtonComponent;
2106
+ UpgradePlanButtonComponent.prototype.onUpgradePlan = function () {
2107
+ var text = "Current plan: " + this.currentplantitle + " New plan: " + this.requestedplantitle;
2108
+ var that = this;
2109
+ Alerts.areYouSure(text, 'Change billing plan', 'Confirm change', 'Cancel', function () {
2110
+ that.api.requestNewSubscription(that.requestedplan, function () {
2111
+ Alerts.success('Your request for changing plan has been sent.', null, null, function () {
2112
+ window.location.reload();
2113
+ });
2114
+ });
2115
+ });
2116
+ };
2117
+ return UpgradePlanButtonComponent;
1971
2118
  }());
1972
- SignOutButtonComponent.decorators = [
2119
+ UpgradePlanButtonComponent.decorators = [
1973
2120
  { type: i0.Component, args: [{
1974
- selector: "anatoly-signout-button",
1975
- template: "<a href=\"identity/signOut\" class=\"{{classbtn}}\">Sign Out</a>\r\n"
2121
+ selector: 'anatoly-upgrade-plan-button',
2122
+ template: "<button class=\"btn btn-block btn-primary\" (click)=\"onUpgradePlan()\">\r\n Upgrade\r\n</button>\r\n"
1976
2123
  },] }
1977
2124
  ];
1978
- SignOutButtonComponent.ctorParameters = function () { return []; };
1979
- SignOutButtonComponent.propDecorators = {
1980
- classbtn: [{ type: i0.Input }]
2125
+ UpgradePlanButtonComponent.ctorParameters = function () { return [
2126
+ { type: BillingApiService }
2127
+ ]; };
2128
+ UpgradePlanButtonComponent.propDecorators = {
2129
+ currentplantitle: [{ type: i0.Input }],
2130
+ requestedplan: [{ type: i0.Input }],
2131
+ requestedplantitle: [{ type: i0.Input }]
1981
2132
  };
1982
2133
 
1983
2134
  /*
@@ -1990,7 +2141,7 @@
1990
2141
  Anatoly Osovitny
1991
2142
 
1992
2143
  Created:
1993
- 4 Jul 2018
2144
+ 23 Apr 2018
1994
2145
 
1995
2146
  Version:
1996
2147
  1.0
@@ -1998,19 +2149,24 @@
1998
2149
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1999
2150
  </file>
2000
2151
  */
2001
- var SignUpButtonComponent = /** @class */ (function () {
2002
- function SignUpButtonComponent() {
2152
+ var ContentHeaderComponent = /** @class */ (function () {
2153
+ function ContentHeaderComponent() {
2003
2154
  }
2004
- return SignUpButtonComponent;
2155
+ ContentHeaderComponent.prototype.ngOnInit = function () {
2156
+ if (this.title == null) {
2157
+ this.title = "";
2158
+ }
2159
+ };
2160
+ return ContentHeaderComponent;
2005
2161
  }());
2006
- SignUpButtonComponent.decorators = [
2162
+ ContentHeaderComponent.decorators = [
2007
2163
  { type: i0.Component, args: [{
2008
- selector: "anatoly-signup-button",
2009
- template: "<a href=\"identity/signup\" class=\"{{classbtn}}\">Sign Up</a>\r\n"
2164
+ selector: "anatoly-content-header",
2165
+ template: "<h2 class=\"page-header\">\r\n {{title}}\r\n <!--<small>Optional {{title}}</small>-->\r\n</h2>\r\n"
2010
2166
  },] }
2011
2167
  ];
2012
- SignUpButtonComponent.propDecorators = {
2013
- classbtn: [{ type: i0.Input }]
2168
+ ContentHeaderComponent.propDecorators = {
2169
+ title: [{ type: i0.Input }]
2014
2170
  };
2015
2171
 
2016
2172
  /*
@@ -2023,7 +2179,7 @@
2023
2179
  Anatoly Osovitny
2024
2180
 
2025
2181
  Created:
2026
- 23 Apr 2018
2182
+ 12 Dec 2017
2027
2183
 
2028
2184
  Version:
2029
2185
  1.0
@@ -2031,24 +2187,75 @@
2031
2187
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2032
2188
  </file>
2033
2189
  */
2034
- var ContentHeaderComponent = /** @class */ (function () {
2035
- function ContentHeaderComponent() {
2036
- }
2037
- ContentHeaderComponent.prototype.ngOnInit = function () {
2038
- if (this.title == null) {
2039
- this.title = "";
2040
- }
2041
- };
2042
- return ContentHeaderComponent;
2043
- }());
2044
- ContentHeaderComponent.decorators = [
2045
- { type: i0.Component, args: [{
2046
- selector: "anatoly-content-header",
2047
- template: "<h2 class=\"page-header\">\r\n {{title}}\r\n <!--<small>Optional {{title}}</small>-->\r\n</h2>\r\n"
2048
- },] }
2049
- ];
2050
- ContentHeaderComponent.propDecorators = {
2051
- title: [{ type: i0.Input }]
2190
+ var DefaultEditorOptions = {
2191
+ placeholderText: "Edit Your Content Here",
2192
+ charCounterCount: true,
2193
+ heightMin: 100,
2194
+ toolbarInline: false,
2195
+ toolbarButtons: {
2196
+ moreText: {
2197
+ buttons: [
2198
+ "bold",
2199
+ "italic",
2200
+ "underline",
2201
+ "strikeThrough",
2202
+ "subscript",
2203
+ "superscript",
2204
+ "fontFamily",
2205
+ "fontSize",
2206
+ "textColor",
2207
+ "backgroundColor",
2208
+ "inlineClass",
2209
+ "inlineStyle",
2210
+ ],
2211
+ },
2212
+ moreParagraph: {
2213
+ buttons: [
2214
+ "alignLeft",
2215
+ "alignCenter",
2216
+ "formatOLSimple",
2217
+ "alignRight",
2218
+ "alignJustify",
2219
+ "formatOL",
2220
+ "formatUL",
2221
+ "paragraphFormat",
2222
+ "paragraphStyle",
2223
+ "lineHeight",
2224
+ "outdent",
2225
+ "indent",
2226
+ "quote",
2227
+ ],
2228
+ },
2229
+ moreRich: {
2230
+ buttons: [
2231
+ "insertLink",
2232
+ "insertImage",
2233
+ "insertTable",
2234
+ "emoticons",
2235
+ "fontAwesome",
2236
+ "specialCharacters",
2237
+ "embedly",
2238
+ ],
2239
+ },
2240
+ moreMisc: {
2241
+ buttons: [
2242
+ "selectAll",
2243
+ "clearFormatting",
2244
+ "html",
2245
+ "undo",
2246
+ "redo",
2247
+ "fullscreen",
2248
+ ],
2249
+ align: "right",
2250
+ },
2251
+ },
2252
+ /*
2253
+ Upload:
2254
+ https://www.froala.com/wysiwyg-editor/docs/concepts/image/upload
2255
+ */
2256
+ imageUploadURL: "/api/HtmlEditor/UploadImage",
2257
+ imageAllowedTypes: ["jpeg", "jpg", "png"],
2258
+ imageUploadParams: { uploadType: "", uploadParentId: "" },
2052
2259
  };
2053
2260
 
2054
2261
  /*
@@ -2144,109 +2351,20 @@
2144
2351
  formSubmitted: [{ type: i0.Input }]
2145
2352
  };
2146
2353
 
2147
- /*
2148
- <file>
2149
- Project:
2150
- @osovitny/anatoly
2151
-
2152
- Authors:
2153
- Vadim Osovitny
2154
- Anatoly Osovitny
2155
-
2156
- Created:
2157
- 12 Dec 2017
2158
-
2159
- Version:
2160
- 1.0
2161
-
2162
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2163
- </file>
2164
- */
2165
- var DefaultEditorOptions = {
2166
- placeholderText: "Edit Your Content Here",
2167
- charCounterCount: true,
2168
- heightMin: 100,
2169
- toolbarInline: false,
2170
- toolbarButtons: {
2171
- moreText: {
2172
- buttons: [
2173
- "bold",
2174
- "italic",
2175
- "underline",
2176
- "strikeThrough",
2177
- "subscript",
2178
- "superscript",
2179
- "fontFamily",
2180
- "fontSize",
2181
- "textColor",
2182
- "backgroundColor",
2183
- "inlineClass",
2184
- "inlineStyle",
2185
- ],
2186
- },
2187
- moreParagraph: {
2188
- buttons: [
2189
- "alignLeft",
2190
- "alignCenter",
2191
- "formatOLSimple",
2192
- "alignRight",
2193
- "alignJustify",
2194
- "formatOL",
2195
- "formatUL",
2196
- "paragraphFormat",
2197
- "paragraphStyle",
2198
- "lineHeight",
2199
- "outdent",
2200
- "indent",
2201
- "quote",
2202
- ],
2203
- },
2204
- moreRich: {
2205
- buttons: [
2206
- "insertLink",
2207
- "insertImage",
2208
- "insertTable",
2209
- "emoticons",
2210
- "fontAwesome",
2211
- "specialCharacters",
2212
- "embedly",
2213
- ],
2214
- },
2215
- moreMisc: {
2216
- buttons: [
2217
- "selectAll",
2218
- "clearFormatting",
2219
- "html",
2220
- "undo",
2221
- "redo",
2222
- "fullscreen",
2223
- ],
2224
- align: "right",
2225
- },
2226
- },
2227
- /*
2228
- Upload:
2229
- https://www.froala.com/wysiwyg-editor/docs/concepts/image/upload
2230
- */
2231
- imageUploadURL: "/api/HtmlEditor/UploadImage",
2232
- imageAllowedTypes: ["jpeg", "jpg", "png"],
2233
- imageUploadParams: { uploadType: "", uploadParentId: "" },
2234
- };
2235
-
2236
2354
  var BaseHtmlEditorComponent = /** @class */ (function (_super) {
2237
2355
  __extends(BaseHtmlEditorComponent, _super);
2238
2356
  function BaseHtmlEditorComponent() {
2239
2357
  var _this = _super.call(this) || this;
2240
2358
  _this.froalaEditorInitialized = false;
2241
2359
  _this.afterInitializedActions = [];
2242
- //Inputs
2243
- _this.editorLabelText = "Html";
2360
+ // Inputs
2361
+ _this.editorLabelText = 'Html';
2244
2362
  _this.editorOptions = {};
2245
2363
  return _this;
2246
2364
  }
2247
2365
  BaseHtmlEditorComponent.prototype.ngOnInit = function () {
2248
2366
  var opt = this.editorOptions;
2249
- if (typeof this.editorOptions == "string") {
2367
+ if (typeof this.editorOptions == 'string') {
2250
2368
  opt = JSON.parse(this.editorOptions);
2251
2369
  }
2252
2370
  var newOptions = $.extend({}, DefaultEditorOptions, opt);
@@ -2268,7 +2386,7 @@
2268
2386
  };
2269
2387
  BaseHtmlEditorComponent.prototype.onInitialized = function () {
2270
2388
  var actions = this.afterInitializedActions;
2271
- //Clear actions
2389
+ // Clear actions
2272
2390
  this.afterInitializedActions = [];
2273
2391
  if (actions) {
2274
2392
  for (var i = 0; i < actions.length; i++) {
@@ -2281,7 +2399,7 @@
2281
2399
  return this.froalaEditor.getEditor();
2282
2400
  return null;
2283
2401
  };
2284
- //Public Funcs
2402
+ // Public Funcs
2285
2403
  BaseHtmlEditorComponent.prototype.doAfterInitialized = function (action) {
2286
2404
  var that = this;
2287
2405
  if (!this.froalaEditorInitialized) {
@@ -2300,7 +2418,7 @@
2300
2418
  BaseHtmlEditorComponent.prototype.setUploadParams = function (uploadType, uploadParentId) {
2301
2419
  this.doAfterInitialized(function (that) {
2302
2420
  var editor = that.getEditor();
2303
- if (typeof editor == "undefined" || editor == null) {
2421
+ if (typeof editor == 'undefined' || editor == null) {
2304
2422
  return;
2305
2423
  }
2306
2424
  editor.opts.imageUploadParams.uploadType = uploadType;
@@ -2314,6 +2432,31 @@
2314
2432
  editorOptions: [{ type: i0.Input }]
2315
2433
  };
2316
2434
 
2435
+ var FormsHtmlEditorComponent = /** @class */ (function (_super) {
2436
+ __extends(FormsHtmlEditorComponent, _super);
2437
+ function FormsHtmlEditorComponent() {
2438
+ var _this = _super.call(this) || this;
2439
+ _this.editorFormKey = "html";
2440
+ return _this;
2441
+ }
2442
+ FormsHtmlEditorComponent.prototype.setFormValueAfterInitialized = function (name, value) {
2443
+ this.doAfterInitialized(function (that) {
2444
+ that.setFormValue(name, value);
2445
+ });
2446
+ };
2447
+ return FormsHtmlEditorComponent;
2448
+ }(BaseHtmlEditorComponent));
2449
+ FormsHtmlEditorComponent.decorators = [
2450
+ { type: i0.Component, args: [{
2451
+ selector: "anatoly-forms-html-editor",
2452
+ template: "<div [formGroup]=\"formGroup\">\r\n <div class=\"form-group\" [ngClass]=\"{'has-error': isControlInvalid(editorFormKey) }\">\r\n <label class=\"control-label\">{{ editorLabelText }}</label>\r\n <textarea [formControlName]=\"editorFormKey\"\r\n [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n <anatoly-item-validation-summary [formGroup]=\"formGroup\"\r\n [formSubmitted]=\"formSubmitted\"\r\n [controlName]=\"editorFormKey\"\r\n [controlTitle]=\"editorLabelText\">\r\n </anatoly-item-validation-summary>\r\n </div>\r\n</div>\r\n"
2453
+ },] }
2454
+ ];
2455
+ FormsHtmlEditorComponent.ctorParameters = function () { return []; };
2456
+ FormsHtmlEditorComponent.propDecorators = {
2457
+ editorFormKey: [{ type: i0.Input }]
2458
+ };
2459
+
2317
2460
  var HtmlEditorComponent = /** @class */ (function (_super) {
2318
2461
  __extends(HtmlEditorComponent, _super);
2319
2462
  function HtmlEditorComponent() {
@@ -2342,33 +2485,379 @@
2342
2485
  selector: "anatoly-html-editor",
2343
2486
  template: "<div>\r\n <label>{{ editorLabelText }}</label>\r\n <textarea [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n</div>"
2344
2487
  },] }
2345
- ];
2346
- HtmlEditorComponent.ctorParameters = function () { return []; };
2488
+ ];
2489
+ HtmlEditorComponent.ctorParameters = function () { return []; };
2490
+
2491
+ /*
2492
+ <file>
2493
+ Project:
2494
+ @osovitny/anatoly
2495
+
2496
+ Authors:
2497
+ Vadim Osovitny
2498
+ Anatoly Osovitny
2499
+
2500
+ Created:
2501
+ 4 Jul 2018
2502
+
2503
+ Version:
2504
+ 1.0
2505
+
2506
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2507
+ </file>
2508
+ */
2509
+ var SignInButtonComponent = /** @class */ (function () {
2510
+ function SignInButtonComponent() {
2511
+ }
2512
+ return SignInButtonComponent;
2513
+ }());
2514
+ SignInButtonComponent.decorators = [
2515
+ { type: i0.Component, args: [{
2516
+ selector: "anatoly-signin-button",
2517
+ template: "<a href=\"identity/signIn\" class=\"{{classbtn}}\">Sign In</a>\r\n"
2518
+ },] }
2519
+ ];
2520
+ SignInButtonComponent.ctorParameters = function () { return []; };
2521
+ SignInButtonComponent.propDecorators = {
2522
+ classbtn: [{ type: i0.Input }]
2523
+ };
2524
+
2525
+ /*
2526
+ <file>
2527
+ Project:
2528
+ @osovitny/anatoly
2529
+
2530
+ Authors:
2531
+ Vadim Osovitny
2532
+ Anatoly Osovitny
2533
+
2534
+ Created:
2535
+ 4 Jul 2018
2536
+
2537
+ Version:
2538
+ 1.0
2539
+
2540
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2541
+ </file>
2542
+ */
2543
+ var SignOutButtonComponent = /** @class */ (function () {
2544
+ function SignOutButtonComponent() {
2545
+ }
2546
+ return SignOutButtonComponent;
2547
+ }());
2548
+ SignOutButtonComponent.decorators = [
2549
+ { type: i0.Component, args: [{
2550
+ selector: "anatoly-signout-button",
2551
+ template: "<a href=\"identity/signOut\" class=\"{{classbtn}}\">Sign Out</a>\r\n"
2552
+ },] }
2553
+ ];
2554
+ SignOutButtonComponent.ctorParameters = function () { return []; };
2555
+ SignOutButtonComponent.propDecorators = {
2556
+ classbtn: [{ type: i0.Input }]
2557
+ };
2558
+
2559
+ /*
2560
+ <file>
2561
+ Project:
2562
+ @osovitny/anatoly
2563
+
2564
+ Authors:
2565
+ Vadim Osovitny
2566
+ Anatoly Osovitny
2567
+
2568
+ Created:
2569
+ 4 Jul 2018
2570
+
2571
+ Version:
2572
+ 1.0
2573
+
2574
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2575
+ </file>
2576
+ */
2577
+ var SignUpButtonComponent = /** @class */ (function () {
2578
+ function SignUpButtonComponent() {
2579
+ }
2580
+ return SignUpButtonComponent;
2581
+ }());
2582
+ SignUpButtonComponent.decorators = [
2583
+ { type: i0.Component, args: [{
2584
+ selector: "anatoly-signup-button",
2585
+ template: "<a href=\"identity/signup\" class=\"{{classbtn}}\">Sign Up</a>\r\n"
2586
+ },] }
2587
+ ];
2588
+ SignUpButtonComponent.propDecorators = {
2589
+ classbtn: [{ type: i0.Input }]
2590
+ };
2591
+
2592
+ /*
2593
+ <file>
2594
+ Project:
2595
+ @osovitny/anatoly
2596
+
2597
+ Authors:
2598
+ Vadim Osovitny
2599
+ Anatoly Osovitny
2600
+
2601
+ Created:
2602
+ 9 May 2020
2603
+
2604
+ Version:
2605
+ 1.0
2606
+
2607
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2608
+ </file>
2609
+ */
2610
+ var LoadingComponent = /** @class */ (function () {
2611
+ function LoadingComponent(loadingService) {
2612
+ this.loadingService = loadingService;
2613
+ // Private
2614
+ this.subs = new Subs();
2615
+ // Public
2616
+ this.show = false;
2617
+ }
2618
+ LoadingComponent.prototype.ngOnInit = function () {
2619
+ var _this = this;
2620
+ this.subs.sink = this.loadingService.subscribe(function (state) {
2621
+ _this.show = state;
2622
+ });
2623
+ };
2624
+ LoadingComponent.prototype.ngOnDestroy = function () {
2625
+ this.subs.unsubscribe();
2626
+ };
2627
+ return LoadingComponent;
2628
+ }());
2629
+ LoadingComponent.decorators = [
2630
+ { type: i0.Component, args: [{
2631
+ selector: 'anatoly-loading',
2632
+ template: "<div *ngIf=\"show\">\r\n <span id=\"pnlLoading\" class=\"k-icon k-i-loading\"></span>\r\n</div>\r\n"
2633
+ },] }
2634
+ ];
2635
+ LoadingComponent.ctorParameters = function () { return [
2636
+ { type: LoadingService }
2637
+ ]; };
2638
+
2639
+ /*
2640
+ <file>
2641
+ Project:
2642
+ @osovitny/anatoly
2643
+
2644
+ Authors:
2645
+ Vadim Osovitny
2646
+ Anatoly Osovitny
2647
+
2648
+ Created:
2649
+ 16 May 2020
2650
+
2651
+ Version:
2652
+ 1.0
2653
+
2654
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2655
+ </file>
2656
+ */
2657
+ var SpinnerSpinKit = {
2658
+ spinnerLine: 'spinner-line-material',
2659
+ // ToDo
2660
+ ChasingDots: 'spinner-chasing-dots',
2661
+ CubeGrid: 'spinner-cube-grid',
2662
+ DoubleBounce: 'spinner-double-bounce',
2663
+ RotatingPlane: 'spinner-rotationg-plane',
2664
+ SpinnerPulse: 'spinner-spinner-pulse',
2665
+ ThreeBounce: 'spinner-three-bounce',
2666
+ WanderingCubes: 'spinner-wandering-cubes',
2667
+ Wave: 'spinner-wave'
2668
+ };
2669
+ var SpinnerComponent = /** @class */ (function () {
2670
+ function SpinnerComponent(router$1, document) {
2671
+ var _this = this;
2672
+ this.router = router$1;
2673
+ this.document = document;
2674
+ this.isSpinnerVisible = true;
2675
+ this.spinnerSpinKit = SpinnerSpinKit;
2676
+ this.backgroundColor = '#007CB0';
2677
+ this.spinner = SpinnerSpinKit.spinnerLine;
2678
+ this.router.events.subscribe(function (event) {
2679
+ if (event instanceof router.NavigationStart) {
2680
+ _this.isSpinnerVisible = true;
2681
+ }
2682
+ else if (event instanceof router.NavigationEnd || event instanceof router.NavigationCancel || event instanceof router.NavigationError) {
2683
+ _this.isSpinnerVisible = false;
2684
+ }
2685
+ }, function () {
2686
+ _this.isSpinnerVisible = false;
2687
+ });
2688
+ }
2689
+ SpinnerComponent.prototype.ngOnDestroy = function () {
2690
+ this.isSpinnerVisible = false;
2691
+ };
2692
+ return SpinnerComponent;
2693
+ }());
2694
+ SpinnerComponent.decorators = [
2695
+ { type: i0.Component, args: [{
2696
+ selector: 'spinner',
2697
+ template: "<div id=\"spinner-loader\" *ngIf=\"isSpinnerVisible\">\r\n <div class=\"loader-bg\">\r\n <div class=\"spinner-line-material\" [class.colored]=\"!backgroundColor\" *ngIf=\"spinner === spinnerSpinKit.spinnerLine\">\r\n <div class=\"spinner-child spinner-bounce1\" [style.background-color]='backgroundColor'></div>\r\n </div>\r\n </div>\r\n</div>\r\n",
2698
+ encapsulation: i0.ViewEncapsulation.None
2699
+ },] }
2700
+ ];
2701
+ SpinnerComponent.ctorParameters = function () { return [
2702
+ { type: router.Router },
2703
+ { type: Document, decorators: [{ type: i0.Inject, args: [common.DOCUMENT,] }] }
2704
+ ]; };
2705
+ SpinnerComponent.propDecorators = {
2706
+ backgroundColor: [{ type: i0.Input }],
2707
+ spinner: [{ type: i0.Input }]
2708
+ };
2709
+
2710
+ /*
2711
+ <file>
2712
+ Project:
2713
+ @osovitny/anatoly
2714
+
2715
+ Authors:
2716
+ Vadim Osovitny
2717
+ Anatoly Osovitny
2718
+
2719
+ Created:
2720
+ 28 Jun 2020
2721
+
2722
+ Version:
2723
+ 1.0
2724
+
2725
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2726
+ </file>
2727
+ */
2728
+ var NativeElementDirective = /** @class */ (function () {
2729
+ function NativeElementDirective(el, control) {
2730
+ this.el = el;
2731
+ this.control = control;
2732
+ }
2733
+ NativeElementDirective.prototype.ngOnInit = function () {
2734
+ // sets the localization key to the control
2735
+ this.control.control.nativeElement = this.el.nativeElement;
2736
+ };
2737
+ return NativeElementDirective;
2738
+ }());
2739
+ NativeElementDirective.decorators = [
2740
+ { type: i0.Directive, args: [{
2741
+ selector: '[formControl], [formControlName]'
2742
+ },] }
2743
+ ];
2744
+ NativeElementDirective.ctorParameters = function () { return [
2745
+ { type: i0.ElementRef },
2746
+ { type: forms.NgControl }
2747
+ ]; };
2748
+
2749
+ /*
2750
+ <file>
2751
+ Project:
2752
+ @osovitny/anatoly
2753
+
2754
+ Authors:
2755
+ Vadim Osovitny
2756
+ Anatoly Osovitny
2757
+
2758
+ Created:
2759
+ 26 Jun 2020
2760
+
2761
+ Version:
2762
+ 1.0
2763
+
2764
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2765
+ </file>
2766
+ */
2767
+ var ReplaceTextPipe = /** @class */ (function () {
2768
+ function ReplaceTextPipe() {
2769
+ }
2770
+ ReplaceTextPipe.prototype.transform = function (inputData, search, replacement) {
2771
+ if (inputData) {
2772
+ return inputData.replace(new RegExp(search, "g"), replacement);
2773
+ }
2774
+ else {
2775
+ return inputData;
2776
+ }
2777
+ };
2778
+ return ReplaceTextPipe;
2779
+ }());
2780
+ ReplaceTextPipe.decorators = [
2781
+ { type: i0.Pipe, args: [{
2782
+ name: "replaceText",
2783
+ },] }
2784
+ ];
2785
+
2786
+ /*
2787
+ <file>
2788
+ Project:
2789
+ @osovitny/anatoly
2790
+
2791
+ Authors:
2792
+ Vadim Osovitny
2793
+ Anatoly Osovitny
2794
+
2795
+ Created:
2796
+ 26 Jun 2020
2797
+
2798
+ Version:
2799
+ 1.0
2800
+
2801
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2802
+ </file>
2803
+ */
2804
+ var FileSizePipe = /** @class */ (function () {
2805
+ function FileSizePipe() {
2806
+ this.units = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
2807
+ }
2808
+ FileSizePipe.prototype.transform = function (bytes, precision) {
2809
+ if (bytes === void 0) { bytes = 0; }
2810
+ if (precision === void 0) { precision = 0; }
2811
+ if (isNaN(parseFloat(String(bytes))) || !isFinite(bytes))
2812
+ return '';
2813
+ var unit = 0;
2814
+ while (bytes >= 1024) {
2815
+ bytes /= 1024;
2816
+ unit++;
2817
+ }
2818
+ return bytes.toFixed(+precision) + ' ' + this.units[unit];
2819
+ };
2820
+ return FileSizePipe;
2821
+ }());
2822
+ FileSizePipe.decorators = [
2823
+ { type: i0.Pipe, args: [{
2824
+ name: 'filesize',
2825
+ },] }
2826
+ ];
2347
2827
 
2348
- var FormsHtmlEditorComponent = /** @class */ (function (_super) {
2349
- __extends(FormsHtmlEditorComponent, _super);
2350
- function FormsHtmlEditorComponent() {
2351
- var _this = _super.call(this) || this;
2352
- _this.editorFormKey = "html";
2353
- return _this;
2828
+ /*
2829
+ <file>
2830
+ Project:
2831
+ @osovitny/anatoly
2832
+
2833
+ Authors:
2834
+ Vadim Osovitny
2835
+ Anatoly Osovitny
2836
+
2837
+ Created:
2838
+ 27 Oct 2019
2839
+
2840
+ Version:
2841
+ 1.0
2842
+
2843
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2844
+ </file>
2845
+ */
2846
+ var SafeHtmlPipe = /** @class */ (function () {
2847
+ function SafeHtmlPipe(sanitized) {
2848
+ this.sanitized = sanitized;
2354
2849
  }
2355
- FormsHtmlEditorComponent.prototype.setFormValueAfterInitialized = function (name, value) {
2356
- this.doAfterInitialized(function (that) {
2357
- that.setFormValue(name, value);
2358
- });
2850
+ SafeHtmlPipe.prototype.transform = function (value) {
2851
+ return this.sanitized.bypassSecurityTrustHtml(value);
2359
2852
  };
2360
- return FormsHtmlEditorComponent;
2361
- }(BaseHtmlEditorComponent));
2362
- FormsHtmlEditorComponent.decorators = [
2363
- { type: i0.Component, args: [{
2364
- selector: "anatoly-forms-html-editor",
2365
- template: "<div [formGroup]=\"formGroup\">\r\n <div class=\"form-group\" [ngClass]=\"{'has-error': isControlInvalid(editorFormKey) }\">\r\n <label class=\"control-label\">{{ editorLabelText }}</label>\r\n <textarea [formControlName]=\"editorFormKey\"\r\n [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n <anatoly-item-validation-summary [formGroup]=\"formGroup\"\r\n [formSubmitted]=\"formSubmitted\"\r\n [controlName]=\"editorFormKey\"\r\n [controlTitle]=\"editorLabelText\">\r\n </anatoly-item-validation-summary>\r\n </div>\r\n</div>\r\n"
2366
- },] }
2853
+ return SafeHtmlPipe;
2854
+ }());
2855
+ SafeHtmlPipe.decorators = [
2856
+ { type: i0.Pipe, args: [{ name: 'safeHtml' },] }
2367
2857
  ];
2368
- FormsHtmlEditorComponent.ctorParameters = function () { return []; };
2369
- FormsHtmlEditorComponent.propDecorators = {
2370
- editorFormKey: [{ type: i0.Input }]
2371
- };
2858
+ SafeHtmlPipe.ctorParameters = function () { return [
2859
+ { type: platformBrowser.DomSanitizer }
2860
+ ]; };
2372
2861
 
2373
2862
  var ValidationSummaryComponent = /** @class */ (function (_super) {
2374
2863
  __extends(ValidationSummaryComponent, _super);
@@ -2512,215 +3001,28 @@
2512
3001
  FormValidationSummaryComponent.ctorParameters = function () { return []; };
2513
3002
  FormValidationSummaryComponent.propDecorators = {
2514
3003
  visible: [{ type: i0.Input }],
2515
- customerrors: [{ type: i0.Input }],
2516
- viewtype: [{ type: i0.Input }]
2517
- };
2518
-
2519
- var ItemValidationSummaryComponent = /** @class */ (function (_super) {
2520
- __extends(ItemValidationSummaryComponent, _super);
2521
- function ItemValidationSummaryComponent() {
2522
- return _super.call(this) || this;
2523
- }
2524
- return ItemValidationSummaryComponent;
2525
- }(ValidationSummaryComponent));
2526
- ItemValidationSummaryComponent.decorators = [
2527
- { type: i0.Component, args: [{
2528
- selector: "anatoly-item-validation-summary",
2529
- template: "<ul class=\"list-unstyled\" *ngIf=\"isControlInvalid(controlName)\">\r\n <li *ngFor=\"let error of getValidationMessages(formGroup.get(controlName), controlTitle)\">\r\n <span class=\"help-block\">{{ error }}</span>\r\n </li>\r\n</ul>\r\n\r\n"
2530
- },] }
2531
- ];
2532
- ItemValidationSummaryComponent.ctorParameters = function () { return []; };
2533
- ItemValidationSummaryComponent.propDecorators = {
2534
- controlName: [{ type: i0.Input }],
2535
- controlTitle: [{ type: i0.Input }]
2536
- };
2537
-
2538
- /*
2539
- <file>
2540
- Project:
2541
- @osovitny/anatoly
2542
-
2543
- Authors:
2544
- Vadim Osovitny
2545
- Anatoly Osovitny
2546
-
2547
- Created:
2548
- 28 Jun 2020
2549
-
2550
- Version:
2551
- 1.0
2552
-
2553
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2554
- </file>
2555
- */
2556
- var NativeElementDirective = /** @class */ (function () {
2557
- function NativeElementDirective(el, control) {
2558
- this.el = el;
2559
- this.control = control;
2560
- }
2561
- NativeElementDirective.prototype.ngOnInit = function () {
2562
- // sets the localization key to the control
2563
- this.control.control.nativeElement = this.el.nativeElement;
2564
- };
2565
- return NativeElementDirective;
2566
- }());
2567
- NativeElementDirective.decorators = [
2568
- { type: i0.Directive, args: [{
2569
- selector: '[formControl], [formControlName]'
2570
- },] }
2571
- ];
2572
- NativeElementDirective.ctorParameters = function () { return [
2573
- { type: i0.ElementRef },
2574
- { type: forms.NgControl }
2575
- ]; };
2576
-
2577
- /*
2578
- <file>
2579
- Project:
2580
- @osovitny/anatoly
2581
-
2582
- Authors:
2583
- Vadim Osovitny
2584
- Anatoly Osovitny
2585
-
2586
- Created:
2587
- 26 Jun 2020
2588
-
2589
- Version:
2590
- 1.0
2591
-
2592
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2593
- </file>
2594
- */
2595
- var FroalaEditorModuleWithProviders = angularFroalaWysiwyg.FroalaEditorModule.forRoot();
2596
- var FroalaViewModuleWithProviders = angularFroalaWysiwyg.FroalaViewModule.forRoot();
2597
- var AnatolyUIModule = /** @class */ (function () {
2598
- function AnatolyUIModule() {
2599
- }
2600
- return AnatolyUIModule;
2601
- }());
2602
- AnatolyUIModule.decorators = [
2603
- { type: i0.NgModule, args: [{
2604
- imports: [
2605
- common.CommonModule,
2606
- forms.ReactiveFormsModule,
2607
- forms.FormsModule,
2608
- FroalaEditorModuleWithProviders,
2609
- FroalaViewModuleWithProviders,
2610
- ],
2611
- exports: [
2612
- SubscribePlanButtonComponent,
2613
- UpgradePlanButtonComponent,
2614
- BuyAccessButtonComponent,
2615
- SignInButtonComponent,
2616
- SignUpButtonComponent,
2617
- SignOutButtonComponent,
2618
- FormValidationSummaryComponent,
2619
- ItemValidationSummaryComponent,
2620
- HtmlEditorComponent,
2621
- FormsHtmlEditorComponent,
2622
- ContentHeaderComponent,
2623
- // Directives
2624
- NativeElementDirective
2625
- ],
2626
- declarations: [
2627
- SubscribePlanButtonComponent,
2628
- UpgradePlanButtonComponent,
2629
- BuyAccessButtonComponent,
2630
- SignInButtonComponent,
2631
- SignUpButtonComponent,
2632
- SignOutButtonComponent,
2633
- FormValidationSummaryComponent,
2634
- ItemValidationSummaryComponent,
2635
- HtmlEditorComponent,
2636
- FormsHtmlEditorComponent,
2637
- ContentHeaderComponent,
2638
- // Directives
2639
- NativeElementDirective
2640
- ]
2641
- },] }
2642
- ];
2643
-
2644
- /*
2645
- <file>
2646
- Project:
2647
- @osovitny/anatoly
2648
-
2649
- Authors:
2650
- Vadim Osovitny
2651
- Anatoly Osovitny
2652
-
2653
- Created:
2654
- 26 Jun 2020
2655
-
2656
- Version:
2657
- 1.0
2658
-
2659
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2660
- </file>
2661
- */
2662
-
2663
- /*
2664
- <file>
2665
- Project:
2666
- @osovitny/anatoly
2667
-
2668
- Authors:
2669
- Vadim Osovitny
2670
- Anatoly Osovitny
2671
-
2672
- Created:
2673
- 10 May 2020
2674
-
2675
- Version:
2676
- 1.0
2677
-
2678
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2679
- </file>
2680
- */
2681
- var LocalizePipe = /** @class */ (function () {
2682
- function LocalizePipe(localizeService) {
2683
- this.localizeService = localizeService;
2684
- }
2685
- LocalizePipe.prototype.transform = function (inputData, type, param2) {
2686
- if (!inputData) {
2687
- return;
2688
- }
2689
- if (!type) {
2690
- type = 't';
2691
- }
2692
- // Translate
2693
- if (type === 't') {
2694
- return this.localizeService.getLocalizedValue(inputData);
2695
- }
2696
- // Date
2697
- if (type === 'd') {
2698
- return this.localizeService.getLocalizedDate(inputData);
2699
- }
2700
- // DateTime
2701
- if (type === 'dt') {
2702
- return this.localizeService.getLocalizedDateTime(inputData);
2703
- }
2704
- // DistanceToNowInWords
2705
- if (type === 'dis2now') {
2706
- return this.localizeService.getLocalizedDistanceToNowInWords(inputData);
2707
- }
2708
- // DistanceInWords
2709
- if (type === 'dis') {
2710
- return this.localizeService.getLocalizedDistanceInWords(inputData, param2);
2711
- }
2712
- return inputData;
2713
- };
2714
- return LocalizePipe;
2715
- }());
2716
- LocalizePipe.decorators = [
2717
- { type: i0.Pipe, args: [{
2718
- name: 'localize'
3004
+ customerrors: [{ type: i0.Input }],
3005
+ viewtype: [{ type: i0.Input }]
3006
+ };
3007
+
3008
+ var ItemValidationSummaryComponent = /** @class */ (function (_super) {
3009
+ __extends(ItemValidationSummaryComponent, _super);
3010
+ function ItemValidationSummaryComponent() {
3011
+ return _super.call(this) || this;
3012
+ }
3013
+ return ItemValidationSummaryComponent;
3014
+ }(ValidationSummaryComponent));
3015
+ ItemValidationSummaryComponent.decorators = [
3016
+ { type: i0.Component, args: [{
3017
+ selector: "anatoly-item-validation-summary",
3018
+ template: "<ul class=\"list-unstyled\" *ngIf=\"isControlInvalid(controlName)\">\r\n <li *ngFor=\"let error of getValidationMessages(formGroup.get(controlName), controlTitle)\">\r\n <span class=\"help-block\">{{ error }}</span>\r\n </li>\r\n</ul>\r\n\r\n"
2719
3019
  },] }
2720
3020
  ];
2721
- LocalizePipe.ctorParameters = function () { return [
2722
- { type: LocalizationService }
2723
- ]; };
3021
+ ItemValidationSummaryComponent.ctorParameters = function () { return []; };
3022
+ ItemValidationSummaryComponent.propDecorators = {
3023
+ controlName: [{ type: i0.Input }],
3024
+ controlTitle: [{ type: i0.Input }]
3025
+ };
2724
3026
 
2725
3027
  /*
2726
3028
  <file>
@@ -2732,7 +3034,7 @@
2732
3034
  Anatoly Osovitny
2733
3035
 
2734
3036
  Created:
2735
- 12 May 2020
3037
+ 26 Jun 2020
2736
3038
 
2737
3039
  Version:
2738
3040
  1.0
@@ -2740,218 +3042,63 @@
2740
3042
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2741
3043
  </file>
2742
3044
  */
2743
- var LocalizationModule = /** @class */ (function () {
2744
- function LocalizationModule() {
3045
+ var FroalaEditorModuleWithProviders = angularFroalaWysiwyg.FroalaEditorModule.forRoot();
3046
+ var FroalaViewModuleWithProviders = angularFroalaWysiwyg.FroalaViewModule.forRoot();
3047
+ var AnatolyUIModule = /** @class */ (function () {
3048
+ function AnatolyUIModule() {
2745
3049
  }
2746
- return LocalizationModule;
3050
+ return AnatolyUIModule;
2747
3051
  }());
2748
- LocalizationModule.decorators = [
3052
+ AnatolyUIModule.decorators = [
2749
3053
  { type: i0.NgModule, args: [{
2750
3054
  imports: [
2751
- i1$1.TranslateModule
3055
+ common.CommonModule,
3056
+ forms.ReactiveFormsModule,
3057
+ forms.FormsModule,
3058
+ FroalaEditorModuleWithProviders,
3059
+ FroalaViewModuleWithProviders,
2752
3060
  ],
2753
3061
  exports: [
2754
- i1$1.TranslateModule,
2755
- LocalizePipe
3062
+ SubscribePlanButtonComponent,
3063
+ UpgradePlanButtonComponent,
3064
+ BuyAccessButtonComponent,
3065
+ SignInButtonComponent,
3066
+ SignUpButtonComponent,
3067
+ SignOutButtonComponent,
3068
+ FormValidationSummaryComponent,
3069
+ ItemValidationSummaryComponent,
3070
+ HtmlEditorComponent,
3071
+ FormsHtmlEditorComponent,
3072
+ ContentHeaderComponent,
3073
+ SpinnerComponent,
3074
+ LoadingComponent,
3075
+ NativeElementDirective,
3076
+ SafeHtmlPipe,
3077
+ ReplaceTextPipe,
3078
+ FileSizePipe
2756
3079
  ],
2757
3080
  declarations: [
2758
- LocalizePipe
2759
- ],
2760
- providers: []
2761
- },] }
2762
- ];
2763
-
2764
- /*
2765
- <file>
2766
- Project:
2767
- @osovitny/anatoly
2768
-
2769
- Authors:
2770
- Vadim Osovitny
2771
- Anatoly Osovitny
2772
-
2773
- Created:
2774
- 05 May 2020
2775
-
2776
- Version:
2777
- 1.0
2778
-
2779
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2780
- </file>
2781
- */
2782
- function customTranslateLoaderFactory(http) {
2783
- return new httpLoader.TranslateHttpLoader(http, AppCoreSettings.resourcesUrl + "/", '.json');
2784
- }
2785
- function localizationInitializerFactory(translate, localizationService, injector) {
2786
- return function () { return new Promise(function (resolve) {
2787
- var locationInitialized = injector.get(common.LOCATION_INITIALIZED, Promise.resolve(null));
2788
- locationInitialized.then(function () {
2789
- var languageToSet = localizationService.configureTranslationSettings(translate);
2790
- translate.use(languageToSet).subscribe(function () {
2791
- }, function () {
2792
- resolve(null);
2793
- }, function () {
2794
- resolve(null);
2795
- });
2796
- });
2797
- }); };
2798
- }
2799
- var TranslateModuleAtRoot = i1$1.TranslateModule.forRoot({
2800
- loader: {
2801
- provide: i1$1.TranslateLoader,
2802
- useFactory: customTranslateLoaderFactory,
2803
- deps: [http.HttpClient]
2804
- }
2805
- });
2806
- var LocalizationSettingsModule = /** @class */ (function () {
2807
- function LocalizationSettingsModule() {
2808
- }
2809
- return LocalizationSettingsModule;
2810
- }());
2811
- LocalizationSettingsModule.decorators = [
2812
- { type: i0.NgModule, args: [{
2813
- imports: [
2814
- TranslateModuleAtRoot
2815
- ],
2816
- providers: [
2817
- {
2818
- provide: i0.APP_INITIALIZER,
2819
- useFactory: localizationInitializerFactory,
2820
- deps: [i1$1.TranslateService, LocalizationService, i0.Injector],
2821
- multi: true
2822
- }
2823
- ],
2824
- exports: []
3081
+ SubscribePlanButtonComponent,
3082
+ UpgradePlanButtonComponent,
3083
+ BuyAccessButtonComponent,
3084
+ SignInButtonComponent,
3085
+ SignUpButtonComponent,
3086
+ SignOutButtonComponent,
3087
+ FormValidationSummaryComponent,
3088
+ ItemValidationSummaryComponent,
3089
+ HtmlEditorComponent,
3090
+ FormsHtmlEditorComponent,
3091
+ ContentHeaderComponent,
3092
+ SpinnerComponent,
3093
+ LoadingComponent,
3094
+ NativeElementDirective,
3095
+ SafeHtmlPipe,
3096
+ ReplaceTextPipe,
3097
+ FileSizePipe
3098
+ ]
2825
3099
  },] }
2826
3100
  ];
2827
3101
 
2828
- /*
2829
- <file>
2830
- Project:
2831
- @osovitny/anatoly
2832
-
2833
- Authors:
2834
- Vadim Osovitny
2835
- Anatoly Osovitny
2836
-
2837
- Created:
2838
- 26 Jun 2020
2839
-
2840
- Version:
2841
- 1.0
2842
-
2843
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2844
- </file>
2845
- */
2846
-
2847
- /*
2848
- <file>
2849
- Project:
2850
- @osovitny/anatoly
2851
-
2852
- Authors:
2853
- Vadim Osovitny
2854
- Anatoly Osovitny
2855
-
2856
- Created:
2857
- 3 March 2020
2858
-
2859
- Version:
2860
- 1.0
2861
-
2862
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2863
- </file>
2864
- */
2865
- var Alerts$1 = /** @class */ (function () {
2866
- function Alerts() {
2867
- }
2868
- Alerts.success = function (text, params, title, successAction) {
2869
- text = Utils.getLocalizedValue(text, params, 'OperationSuccessFull');
2870
- title = Utils.getLocalizedValue(title, null, 'Success');
2871
- Swal.fire({
2872
- text: text,
2873
- title: title,
2874
- icon: 'success',
2875
- confirmButtonText: Utils.getLocalizedValue('Ok')
2876
- })
2877
- .then(function () {
2878
- if (successAction) {
2879
- successAction();
2880
- }
2881
- });
2882
- };
2883
- Alerts.info = function (text, params, title) {
2884
- text = Utils.getLocalizedValue(text, params);
2885
- title = Utils.getLocalizedValue(title, null, 'Info');
2886
- Swal.fire({
2887
- text: text,
2888
- title: title,
2889
- icon: 'info',
2890
- confirmButtonText: Utils.getLocalizedValue('Ok')
2891
- });
2892
- };
2893
- Alerts.warning = function (text, params, title) {
2894
- text = Utils.getLocalizedValue(text, params);
2895
- title = Utils.getLocalizedValue(title, null, 'Warning');
2896
- Swal.fire({
2897
- text: text,
2898
- title: title,
2899
- icon: 'warning',
2900
- confirmButtonText: Utils.getLocalizedValue('Ok')
2901
- });
2902
- };
2903
- Alerts.error = function (text, params, title) {
2904
- text = Utils.getLocalizedValue(text, params, 'ErrorOccured');
2905
- title = Utils.getLocalizedValue(title, null, 'Error');
2906
- Swal.fire({
2907
- text: text,
2908
- title: title,
2909
- icon: 'error',
2910
- confirmButtonText: Utils.getLocalizedValue('Ok')
2911
- });
2912
- };
2913
- Alerts.cancel = function (text, params, title) {
2914
- text = Utils.getLocalizedValue(text, params, 'OperationCancelled');
2915
- title = Utils.getLocalizedValue(title, null, 'Cancelled');
2916
- Swal.fire({
2917
- text: text,
2918
- title: title,
2919
- icon: 'info'
2920
- });
2921
- };
2922
- Alerts.notImplemented = function () {
2923
- this.warning('Not Implemented Yet');
2924
- };
2925
- ;
2926
- Alerts.areYouSure = function (text, title, confirmButtonText, cancelButtonText, successAction, cancelAction) {
2927
- text = Utils.getLocalizedValue(text);
2928
- title = Utils.getLocalizedValue(title, null, 'AreYouSure');
2929
- Swal.fire({
2930
- text: text,
2931
- title: title,
2932
- icon: 'warning',
2933
- confirmButtonText: Utils.getLocalizedValue(confirmButtonText),
2934
- cancelButtonText: Utils.getLocalizedValue(cancelButtonText),
2935
- showCancelButton: true
2936
- })
2937
- .then(function (result) {
2938
- if (result.value) {
2939
- if (successAction) {
2940
- successAction();
2941
- }
2942
- }
2943
- // result.dismiss can be 'cancel', 'overlay', 'close', and 'timer'
2944
- else if (result.dismiss == Swal.DismissReason.cancel || result.dismiss == Swal.DismissReason.close) {
2945
- if (cancelAction) {
2946
- cancelAction();
2947
- }
2948
- }
2949
- });
2950
- };
2951
- ;
2952
- return Alerts;
2953
- }());
2954
-
2955
3102
  /*
2956
3103
  * Public API Surface of anatoly
2957
3104
  */
@@ -2960,7 +3107,7 @@
2960
3107
  * Generated bundle index. Do not edit.
2961
3108
  */
2962
3109
 
2963
- exports.Alerts = Alerts$1;
3110
+ exports.Alerts = Alerts;
2964
3111
  exports.AnatolyCoreModule = AnatolyCoreModule;
2965
3112
  exports.AnatolyDataModule = AnatolyDataModule;
2966
3113
  exports.AnatolyHttpInterceptor = AnatolyHttpInterceptor;
@@ -2973,31 +3120,51 @@
2973
3120
  exports.BaseGoService = BaseGoService;
2974
3121
  exports.BaseGridEditService = BaseGridEditService;
2975
3122
  exports.BaseGridReadService = BaseGridReadService;
3123
+ exports.BaseHtmlEditorComponent = BaseHtmlEditorComponent;
2976
3124
  exports.BillingApiService = BillingApiService;
2977
3125
  exports.BuyAccessButtonComponent = BuyAccessButtonComponent;
2978
3126
  exports.ContentHeaderComponent = ContentHeaderComponent;
2979
3127
  exports.ContextInitState = ContextInitState;
3128
+ exports.Convert = Convert;
3129
+ exports.DefaultEditorOptions = DefaultEditorOptions;
3130
+ exports.FileSizePipe = FileSizePipe;
2980
3131
  exports.FormValidationSummaryComponent = FormValidationSummaryComponent;
2981
3132
  exports.FormsHtmlEditorComponent = FormsHtmlEditorComponent;
3133
+ exports.FroalaEditorModuleWithProviders = FroalaEditorModuleWithProviders;
3134
+ exports.FroalaViewModuleWithProviders = FroalaViewModuleWithProviders;
2982
3135
  exports.GlobalErrorHandler = GlobalErrorHandler;
2983
3136
  exports.Guid = Guid;
2984
3137
  exports.HtmlEditorComponent = HtmlEditorComponent;
3138
+ exports.IdleService = IdleService;
2985
3139
  exports.ItemValidationSummaryComponent = ItemValidationSummaryComponent;
3140
+ exports.LoadingComponent = LoadingComponent;
2986
3141
  exports.LoadingService = LoadingService;
3142
+ exports.LocalStorageService = LocalStorageService;
2987
3143
  exports.LocalizationModule = LocalizationModule;
2988
3144
  exports.LocalizationService = LocalizationService;
2989
3145
  exports.LocalizationSettingsModule = LocalizationSettingsModule;
2990
3146
  exports.LocalizePipe = LocalizePipe;
2991
3147
  exports.LoggingService = LoggingService;
2992
3148
  exports.NativeElementDirective = NativeElementDirective;
3149
+ exports.NotificationService = NotificationService;
3150
+ exports.NotificationsApiService = NotificationsApiService;
3151
+ exports.ReplaceTextPipe = ReplaceTextPipe;
3152
+ exports.SafeHtmlPipe = SafeHtmlPipe;
3153
+ exports.SessionStorageService = SessionStorageService;
2993
3154
  exports.SignInButtonComponent = SignInButtonComponent;
2994
3155
  exports.SignOutButtonComponent = SignOutButtonComponent;
2995
3156
  exports.SignUpButtonComponent = SignUpButtonComponent;
3157
+ exports.SpinnerComponent = SpinnerComponent;
2996
3158
  exports.Subs = Subs;
2997
3159
  exports.SubscribePlanButtonComponent = SubscribePlanButtonComponent;
3160
+ exports.TranslateModuleAtRoot = TranslateModuleAtRoot;
2998
3161
  exports.UpgradePlanButtonComponent = UpgradePlanButtonComponent;
3162
+ exports.Urls = Urls;
2999
3163
  exports.Utils = Utils;
3000
3164
  exports.ValidationSummaryComponent = ValidationSummaryComponent;
3165
+ exports.consts = consts;
3166
+ exports.customTranslateLoaderFactory = customTranslateLoaderFactory;
3167
+ exports.localizationInitializerFactory = localizationInitializerFactory;
3001
3168
  exports.throwIfAlreadyLoaded = throwIfAlreadyLoaded;
3002
3169
 
3003
3170
  Object.defineProperty(exports, '__esModule', { value: true });