monkey-front-core 0.0.188 → 0.0.191

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Pipe, Component, ViewEncapsulation, Input, Injectable, NgModule, EventEmitter, Directive, Output, HostBinding, HostListener, forwardRef, Self, InjectionToken, Inject, Optional, NgZone, ErrorHandler, SkipSelf } from '@angular/core';
2
+ import { Pipe, Component, ViewEncapsulation, Input, Injectable, NgModule, EventEmitter, Directive, Output, HostBinding, HostListener, forwardRef, Self, InjectionToken, Inject, Optional, SkipSelf, NgZone, ErrorHandler } from '@angular/core';
3
3
  import * as i1 from 'monkey-style-guide';
4
4
  import { MonkeyButtonModule, MonkeyIconModule, MonkeyInputModule, MonkeyModalModule, MonkeyUtils, MonkeyStyleGuideModule, MonkeyStyleGuideModalService, MonkeyStyleGuideSettingsService, MonkeyStyleGuideSnackbarService } from 'monkey-style-guide';
5
5
  import * as i2 from '@angular/common';
@@ -2191,8 +2191,7 @@ class MonkeyEcxCommonsService {
2191
2191
  router.navigate([`${route}/company-pendency`.toLowerCase()], {
2192
2192
  state: {
2193
2193
  pendencyData: arg
2194
- },
2195
- skipLocationChange: true
2194
+ }
2196
2195
  });
2197
2196
  }
2198
2197
  }
@@ -2214,6 +2213,23 @@ class MonkeyEcxCommonsService {
2214
2213
  const { service, type } = args;
2215
2214
  return service.hasPendencies(type);
2216
2215
  }
2216
+ allowedSecurityAccessByFeature(args) {
2217
+ if (!args) {
2218
+ return true;
2219
+ }
2220
+ const { config, feature } = args;
2221
+ try {
2222
+ if (!MonkeyEcxUtils.persistNullEmptyUndefined(feature) ||
2223
+ !MonkeyEcxUtils.persistNullEmptyUndefined(config?.program?.settings[feature])) {
2224
+ return false;
2225
+ }
2226
+ return !config?.program?.settings[feature];
2227
+ }
2228
+ catch (e) {
2229
+ // not to do
2230
+ }
2231
+ return true;
2232
+ }
2217
2233
  allowedSecurityAccessByCountry(arg) {
2218
2234
  if (!arg)
2219
2235
  return true;
@@ -2334,9 +2350,11 @@ class MonkeyEcxCommonsService {
2334
2350
  this.__tokenCredentials = this.tokenStorage.getToken();
2335
2351
  }
2336
2352
  const pend = this.allowedSecurityAccessByPendency(otherArgs?.pendency);
2353
+ const allowedByProgram = this.allowedSecurityAccessByFeature(otherArgs?.featureByProgram);
2337
2354
  if (this.allowedSecurityAccess(otherArgs?.security) &&
2338
2355
  this.allowedSecurityAccessByCountry(otherArgs?.countrySecurity) &&
2339
- !pend.hasPendencies) {
2356
+ !pend.hasPendencies &&
2357
+ allowedByProgram) {
2340
2358
  if (this.__schedule) {
2341
2359
  this.otherArgs?.schedule?.service?.removeSchedule(this.__schedule);
2342
2360
  this.__schedule = null;
@@ -2384,6 +2402,9 @@ class MonkeyEcxCommonsService {
2384
2402
  otherArgs?.callbackMain();
2385
2403
  }
2386
2404
  }
2405
+ else if (allowedByProgram) {
2406
+ this.navigateToErrorPage(404, otherArgs?.router);
2407
+ }
2387
2408
  else if (pend.hasPendencies) {
2388
2409
  this.navigateToPendencyPage(pend, otherArgs?.router);
2389
2410
  }
@@ -3425,122 +3446,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
3425
3446
  args: ['click']
3426
3447
  }] } });
3427
3448
 
3428
- class MonkeyEcxFeatureDirective {
3429
- constructor(cdr, elementRef, monkeyecxFeatureToggleService) {
3430
- this.cdr = cdr;
3431
- this.elementRef = elementRef;
3432
- this.monkeyecxFeatureToggleService = monkeyecxFeatureToggleService;
3433
- this.unsubscribeAll = new Subject();
3434
- // not to do
3435
- }
3436
- getFeature(feature) {
3437
- const { monkeyecxFeatureToggleService } = this;
3438
- if (!monkeyecxFeatureToggleService) {
3439
- return false;
3440
- }
3441
- return monkeyecxFeatureToggleService?.getFlag(feature) || false;
3442
- }
3443
- handleDisplay() {
3444
- if (!this.feature)
3445
- return;
3446
- const flag = this.getFeature(this.feature);
3447
- let display = 'none';
3448
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(flag)) {
3449
- return;
3450
- }
3451
- if (flag) {
3452
- display = 'block';
3453
- }
3454
- if (display === 'none') {
3455
- this.elementRef.nativeElement.remove();
3456
- }
3457
- this.elementRef.nativeElement.style.display = display;
3458
- this.cdr.detectChanges();
3459
- }
3460
- ngOnDestroy() {
3461
- this.unsubscribeAll.next();
3462
- this.unsubscribeAll.complete();
3463
- }
3464
- ngOnInit() {
3465
- if (!this.feature)
3466
- return;
3467
- this.elementRef.nativeElement.style.display = 'none';
3468
- this.cdr.detectChanges();
3469
- this.monkeyecxFeatureToggleService.onFlags
3470
- .pipe(takeUntil(this.unsubscribeAll))
3471
- .subscribe((val) => {
3472
- if (val) {
3473
- this.handleDisplay();
3474
- }
3475
- });
3476
- }
3477
- }
3478
- MonkeyEcxFeatureDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxFeatureDirective, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: MonkeyEcxFeatureToggleService }], target: i0.ɵɵFactoryTarget.Directive });
3479
- MonkeyEcxFeatureDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.1", type: MonkeyEcxFeatureDirective, selector: "[monkeyecxFeature]", inputs: { feature: ["featureName", "feature"] }, ngImport: i0 });
3480
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxFeatureDirective, decorators: [{
3481
- type: Directive,
3482
- args: [{
3483
- selector: '[monkeyecxFeature]',
3484
- }]
3485
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: MonkeyEcxFeatureToggleService }]; }, propDecorators: { feature: [{
3486
- type: Input,
3487
- args: ['featureName']
3488
- }] } });
3489
-
3490
- class MonkeyEcxDirectivesModule {
3491
- }
3492
- MonkeyEcxDirectivesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxDirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3493
- MonkeyEcxDirectivesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxDirectivesModule, declarations: [MonkeyEcxDragDropDirective,
3494
- MonkeyEcxFormatCurrency,
3495
- MonkeyEcxFeatureDirective,
3496
- MonkeyEcxFormatUpper,
3497
- MonkeyEcxOnlyAlphaNumericDirective,
3498
- MonkeyEcxOnlyNumbersDirective,
3499
- MonkeyEcxSecurityDirective,
3500
- MonkeyEcxTooltipDirective,
3501
- MonkeyEcxPopoverDirective,
3502
- MonkeyEcxPopoverOptionsDirective], imports: [CommonModule, OverlayModule], exports: [MonkeyEcxDragDropDirective,
3503
- MonkeyEcxFormatCurrency,
3504
- MonkeyEcxFeatureDirective,
3505
- MonkeyEcxFormatUpper,
3506
- MonkeyEcxOnlyAlphaNumericDirective,
3507
- MonkeyEcxOnlyNumbersDirective,
3508
- MonkeyEcxSecurityDirective,
3509
- MonkeyEcxTooltipDirective,
3510
- MonkeyEcxPopoverDirective,
3511
- MonkeyEcxPopoverOptionsDirective] });
3512
- MonkeyEcxDirectivesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxDirectivesModule, imports: [[CommonModule, OverlayModule]] });
3513
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxDirectivesModule, decorators: [{
3514
- type: NgModule,
3515
- args: [{
3516
- declarations: [
3517
- MonkeyEcxDragDropDirective,
3518
- MonkeyEcxFormatCurrency,
3519
- MonkeyEcxFeatureDirective,
3520
- MonkeyEcxFormatUpper,
3521
- MonkeyEcxOnlyAlphaNumericDirective,
3522
- MonkeyEcxOnlyNumbersDirective,
3523
- MonkeyEcxSecurityDirective,
3524
- MonkeyEcxTooltipDirective,
3525
- MonkeyEcxPopoverDirective,
3526
- MonkeyEcxPopoverOptionsDirective
3527
- ],
3528
- imports: [CommonModule, OverlayModule],
3529
- exports: [
3530
- MonkeyEcxDragDropDirective,
3531
- MonkeyEcxFormatCurrency,
3532
- MonkeyEcxFeatureDirective,
3533
- MonkeyEcxFormatUpper,
3534
- MonkeyEcxOnlyAlphaNumericDirective,
3535
- MonkeyEcxOnlyNumbersDirective,
3536
- MonkeyEcxSecurityDirective,
3537
- MonkeyEcxTooltipDirective,
3538
- MonkeyEcxPopoverDirective,
3539
- MonkeyEcxPopoverOptionsDirective
3540
- ]
3541
- }]
3542
- }] });
3543
-
3544
3449
  /* eslint-disable no-console */
3545
3450
  class MonkeyEcxAuthenticationService {
3546
3451
  constructor() {
@@ -3675,6 +3580,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
3675
3580
  }]
3676
3581
  }], ctorParameters: function () { return [{ type: MonkeyEcxAuthenticationService }]; } });
3677
3582
 
3583
+ /* eslint-disable indent */
3584
+ class MonkeyEcxConfigModule {
3585
+ constructor(parentModule) {
3586
+ if (parentModule) {
3587
+ throw new Error('MonkeyEcxConfigModule is already loaded. Import it in the AppModule only!');
3588
+ }
3589
+ }
3590
+ static forRoot() {
3591
+ return {
3592
+ ngModule: MonkeyEcxConfigModule,
3593
+ providers: [MonkeyEcxConfigService]
3594
+ };
3595
+ }
3596
+ }
3597
+ MonkeyEcxConfigModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxConfigModule, deps: [{ token: MonkeyEcxConfigModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
3598
+ MonkeyEcxConfigModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxConfigModule });
3599
+ MonkeyEcxConfigModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxConfigModule });
3600
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxConfigModule, decorators: [{
3601
+ type: NgModule
3602
+ }], ctorParameters: function () { return [{ type: MonkeyEcxConfigModule, decorators: [{
3603
+ type: Optional
3604
+ }, {
3605
+ type: SkipSelf
3606
+ }] }]; } });
3607
+
3678
3608
  class MonkeyEcxHttpErrorHandlingService extends MonkeyEcxCommonsService {
3679
3609
  constructor(monkeyecxService, tokenStorage, monkeyecxAuthenticationService, router, snackbarService, translateService) {
3680
3610
  super(monkeyecxService, tokenStorage);
@@ -3878,75 +3808,225 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
3878
3808
  }]
3879
3809
  }] });
3880
3810
 
3881
- class MonkeyEcxHttpConfigErrorInterceptor {
3882
- constructor(monkeyecxAuthenticationService, monkeyecxErrorHandlingService) {
3883
- this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
3884
- this.monkeyecxErrorHandlingService = monkeyecxErrorHandlingService;
3885
- // no to do
3811
+ class MonkeyEcxLoggedHandlingService {
3812
+ constructor() {
3813
+ this.schedules = [];
3814
+ this.genericSchedules = [];
3815
+ // not to do
3886
3816
  }
3887
- intercept(request, next) {
3888
- return next.handle(request).pipe(map((event) => {
3889
- return event;
3890
- }), catchError((error) => {
3891
- if (this.monkeyecxAuthenticationService.refreshShouldHappen(error)) {
3892
- return this.monkeyecxAuthenticationService?.refreshToken()?.pipe(take(1), map(() => {
3893
- return this.monkeyecxAuthenticationService.getRequestWithHeaders(request);
3894
- }), mergeMap((resp) => {
3895
- return next.handle(resp).pipe(catchError((error) => {
3896
- this.monkeyecxErrorHandlingService.handleError(error, 'refresh_token');
3897
- return throwError(null);
3898
- }));
3899
- }), catchError((error) => {
3900
- this.monkeyecxErrorHandlingService.handleError(error, 'refresh_token');
3901
- return throwError(null);
3902
- })) || throwError(error);
3903
- }
3904
- return throwError(error);
3905
- }));
3817
+ destroySchedule() {
3818
+ this.schedules.forEach((sch) => {
3819
+ clearInterval(sch.interval);
3820
+ });
3821
+ this.schedules = [];
3906
3822
  }
3907
- }
3908
- MonkeyEcxHttpConfigErrorInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigErrorInterceptor, deps: [{ token: MonkeyEcxAuthenticationService }, { token: MonkeyEcxErrorHandlingService }], target: i0.ɵɵFactoryTarget.Injectable });
3909
- MonkeyEcxHttpConfigErrorInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigErrorInterceptor });
3910
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigErrorInterceptor, decorators: [{
3911
- type: Injectable
3912
- }], ctorParameters: function () { return [{ type: MonkeyEcxAuthenticationService }, { type: MonkeyEcxErrorHandlingService }]; } });
3913
-
3914
- class MonkeyEcxHttpConfigHeaderInterceptor {
3915
- constructor(monkeyecxAuthenticationService, monkeyecxErrorHandlingService) {
3916
- this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
3917
- this.monkeyecxErrorHandlingService = monkeyecxErrorHandlingService;
3918
- // not to do
3823
+ destroyGenericSchedule() {
3824
+ this.genericSchedules.forEach((sch) => {
3825
+ clearInterval(sch.interval);
3826
+ });
3827
+ this.genericSchedules = [];
3919
3828
  }
3920
- intercept(request, next) {
3921
- return this.monkeyecxAuthenticationService?.getRequestWithHeadersOb(request)?.pipe(take(1), map((event) => {
3922
- return event;
3923
- }), mergeMap((resp) => {
3924
- request = request.clone({
3925
- setHeaders: resp
3926
- });
3927
- return next.handle(request);
3928
- }), catchError((error) => {
3929
- this.monkeyecxErrorHandlingService.handleError(error);
3930
- return throwError(error);
3931
- })) || throwError('getRequestWithHeadersOb undefined');
3829
+ addSchedule(sch) {
3830
+ this.schedules = sch;
3831
+ }
3832
+ addGenericSchedule(sch) {
3833
+ this.genericSchedules = sch;
3834
+ }
3835
+ destroy() {
3836
+ this.destroySchedule();
3837
+ this.destroyGenericSchedule();
3932
3838
  }
3933
3839
  }
3934
- MonkeyEcxHttpConfigHeaderInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigHeaderInterceptor, deps: [{ token: MonkeyEcxAuthenticationService }, { token: MonkeyEcxErrorHandlingService }], target: i0.ɵɵFactoryTarget.Injectable });
3935
- MonkeyEcxHttpConfigHeaderInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigHeaderInterceptor });
3936
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigHeaderInterceptor, decorators: [{
3937
- type: Injectable
3938
- }], ctorParameters: function () { return [{ type: MonkeyEcxAuthenticationService }, { type: MonkeyEcxErrorHandlingService }]; } });
3840
+ MonkeyEcxLoggedHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxLoggedHandlingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3841
+ MonkeyEcxLoggedHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxLoggedHandlingService, providedIn: 'root' });
3842
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxLoggedHandlingService, decorators: [{
3843
+ type: Injectable,
3844
+ args: [{
3845
+ providedIn: 'root'
3846
+ }]
3847
+ }], ctorParameters: function () { return []; } });
3939
3848
 
3940
- class MonkeyEcxRequestQueueHandlingService {
3849
+ class MonkeyEcxPaginationService {
3941
3850
  constructor() {
3942
- this.queue = [];
3943
- this.newQueue = new BehaviorSubject(false);
3944
- this.queues$ = new BehaviorSubject([]);
3851
+ this.callbacks = {};
3852
+ // not to do
3945
3853
  }
3946
- addToQueue(q) {
3947
- this.queue.push(q);
3948
- this.queues$.next(this.queue);
3949
- this.newQueue.next(true);
3854
+ setCallback(callback, name = 'main') {
3855
+ this.callbacks = {
3856
+ ...this.callbacks,
3857
+ [name]: callback
3858
+ };
3859
+ }
3860
+ execute(type, name = 'main') {
3861
+ const { callbacks } = this;
3862
+ const callback = callbacks?.[name];
3863
+ if (callback)
3864
+ callback(type);
3865
+ }
3866
+ }
3867
+ MonkeyEcxPaginationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxPaginationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3868
+ MonkeyEcxPaginationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxPaginationService, providedIn: 'root' });
3869
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxPaginationService, decorators: [{
3870
+ type: Injectable,
3871
+ args: [{
3872
+ providedIn: 'root'
3873
+ }]
3874
+ }], ctorParameters: function () { return []; } });
3875
+
3876
+ class MonkeyEcxRequestDownloadHandlingService {
3877
+ constructor() {
3878
+ this.download = [];
3879
+ this.download$ = new BehaviorSubject([]);
3880
+ }
3881
+ addTo(q) {
3882
+ this.download.push(q);
3883
+ this.download$.next(this.download);
3884
+ }
3885
+ markItemAsFinish(q, status) {
3886
+ const saved = [...this.download];
3887
+ this.download = [
3888
+ ...saved
3889
+ .map((val) => {
3890
+ if (val.status === MonkeyEcxDownloadEvents.OnGoing) {
3891
+ const valSaved = {
3892
+ ...val
3893
+ };
3894
+ if (valSaved.item.id === q.item.id) {
3895
+ return {
3896
+ ...valSaved,
3897
+ status: status || MonkeyEcxDownloadEvents.Finished
3898
+ };
3899
+ }
3900
+ return valSaved;
3901
+ }
3902
+ return null;
3903
+ })
3904
+ .filter((_) => {
3905
+ return _;
3906
+ })
3907
+ ];
3908
+ this.download = this.download.filter((_) => {
3909
+ return _.status === MonkeyEcxDownloadEvents.OnGoing;
3910
+ });
3911
+ this.download$.next(this.download);
3912
+ }
3913
+ updateItem(q, loaded, total) {
3914
+ const saved = [...this.download];
3915
+ this.download = [
3916
+ ...saved.map((val) => {
3917
+ const valSaved = {
3918
+ ...val
3919
+ };
3920
+ const currentPecentage = Math.floor(((loaded || 0) / (total || 0)) * 100);
3921
+ const totalPercentage = 100;
3922
+ if (valSaved.item.id === q.item.id) {
3923
+ return {
3924
+ ...valSaved,
3925
+ loaded,
3926
+ total,
3927
+ currentPercentage: currentPecentage,
3928
+ totalPercentage
3929
+ };
3930
+ }
3931
+ return valSaved;
3932
+ })
3933
+ ];
3934
+ this.download$.next(this.download);
3935
+ }
3936
+ set(q) {
3937
+ this.addTo(q);
3938
+ }
3939
+ get() {
3940
+ return this.download$.asObservable();
3941
+ }
3942
+ update(q, loaded, total) {
3943
+ this.updateItem(q, loaded, total);
3944
+ }
3945
+ finishItem(q, status) {
3946
+ this.markItemAsFinish(q, status);
3947
+ }
3948
+ hasDownloadOnGoing() {
3949
+ const found = this.download.find((_) => {
3950
+ return _.status === MonkeyEcxDownloadEvents.OnGoing;
3951
+ });
3952
+ return MonkeyEcxUtils.persistNullEmptyUndefined(found);
3953
+ }
3954
+ }
3955
+ MonkeyEcxRequestDownloadHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxRequestDownloadHandlingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3956
+ MonkeyEcxRequestDownloadHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxRequestDownloadHandlingService, providedIn: 'root' });
3957
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxRequestDownloadHandlingService, decorators: [{
3958
+ type: Injectable,
3959
+ args: [{
3960
+ providedIn: 'root'
3961
+ }]
3962
+ }], ctorParameters: function () { return []; } });
3963
+
3964
+ class MonkeyEcxRequestDownloadedHandlingService {
3965
+ constructor() {
3966
+ this.downloaded = [];
3967
+ this.downloaded$ = new BehaviorSubject([]);
3968
+ }
3969
+ addTo(q) {
3970
+ this.downloaded.push(q);
3971
+ this.downloaded$.next(this.downloaded);
3972
+ }
3973
+ markItemAsFinish(q, status) {
3974
+ const saved = [...this.downloaded];
3975
+ this.downloaded = [
3976
+ ...saved.map((val) => {
3977
+ if (val.status === MonkeyEcxDownloadEvents.OnGoing) {
3978
+ const valSaved = {
3979
+ ...val
3980
+ };
3981
+ if (valSaved.item.id === q.item.id) {
3982
+ return {
3983
+ ...valSaved,
3984
+ status: status || MonkeyEcxDownloadEvents.Finished,
3985
+ action: q.action
3986
+ };
3987
+ }
3988
+ return valSaved;
3989
+ }
3990
+ return val;
3991
+ })
3992
+ ];
3993
+ this.downloaded$.next(this.downloaded);
3994
+ }
3995
+ set(q) {
3996
+ this.addTo(q);
3997
+ }
3998
+ get() {
3999
+ return this.downloaded$.asObservable();
4000
+ }
4001
+ finishItem(q, status) {
4002
+ this.markItemAsFinish(q, status);
4003
+ }
4004
+ hasDownloadOnGoing() {
4005
+ const found = this.downloaded.find((_) => {
4006
+ return _.status === MonkeyEcxDownloadEvents.OnGoing;
4007
+ });
4008
+ return MonkeyEcxUtils.persistNullEmptyUndefined(found);
4009
+ }
4010
+ }
4011
+ MonkeyEcxRequestDownloadedHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxRequestDownloadedHandlingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4012
+ MonkeyEcxRequestDownloadedHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxRequestDownloadedHandlingService, providedIn: 'root' });
4013
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxRequestDownloadedHandlingService, decorators: [{
4014
+ type: Injectable,
4015
+ args: [{
4016
+ providedIn: 'root'
4017
+ }]
4018
+ }], ctorParameters: function () { return []; } });
4019
+
4020
+ class MonkeyEcxRequestQueueHandlingService {
4021
+ constructor() {
4022
+ this.queue = [];
4023
+ this.newQueue = new BehaviorSubject(false);
4024
+ this.queues$ = new BehaviorSubject([]);
4025
+ }
4026
+ addToQueue(q) {
4027
+ this.queue.push(q);
4028
+ this.queues$.next(this.queue);
4029
+ this.newQueue.next(true);
3950
4030
  }
3951
4031
  markQueueItemAsFinish(q, status, action) {
3952
4032
  const saved = [...this.queue];
@@ -4160,473 +4240,107 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
4160
4240
  }]
4161
4241
  }], ctorParameters: function () { return []; } });
4162
4242
 
4163
- /* eslint-disable max-len */
4164
- class MonkeyEcxHttpConfigQueueInterceptor {
4165
- constructor(injector, monkeyecxRequestQueueHandlingService) {
4166
- this.injector = injector;
4167
- this.monkeyecxRequestQueueHandlingService = monkeyecxRequestQueueHandlingService;
4243
+ class MonkeyEcxDiscoveryParamsService {
4244
+ constructor(router) {
4245
+ this.router = router;
4168
4246
  // not to do
4169
4247
  }
4170
- intercept(request, next) {
4171
- const { injector, isQueueProperty } = this;
4172
- const monkeyecxHandlingService = injector.get(MonkeyEcxHandlingService);
4173
- const monkeyecxRequestQueue = monkeyecxHandlingService?.getMonkeyEcxRequestQueue();
4174
- if (isQueueProperty(monkeyecxRequestQueue)) {
4175
- this.monkeyecxRequestQueueHandlingService.setQueue(monkeyecxRequestQueue);
4248
+ getLastChild(route) {
4249
+ if (route.firstChild) {
4250
+ return this.getLastChild(route.firstChild);
4176
4251
  }
4177
- return next.handle(request).pipe(finalize(() => {
4178
- if (isQueueProperty(monkeyecxRequestQueue)) {
4179
- this.monkeyecxRequestQueueHandlingService.finishQueueItem(monkeyecxRequestQueue);
4180
- }
4181
- }));
4252
+ return route;
4182
4253
  }
4183
- isQueueProperty(mrq) {
4184
- return (MonkeyEcxUtils.persistNullEmptyUndefined(mrq) &&
4185
- MonkeyEcxUtils.persistNullEmptyUndefined(mrq?.item?.name));
4254
+ setData(field, value) {
4255
+ const { root } = this.router.routerState.snapshot;
4256
+ const route = this.getLastChild(root);
4257
+ route.data[field] = value;
4186
4258
  }
4187
- }
4188
- MonkeyEcxHttpConfigQueueInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigQueueInterceptor, deps: [{ token: i0.Injector }, { token: MonkeyEcxRequestQueueHandlingService }], target: i0.ɵɵFactoryTarget.Injectable });
4189
- MonkeyEcxHttpConfigQueueInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigQueueInterceptor });
4190
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigQueueInterceptor, decorators: [{
4191
- type: Injectable
4192
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: MonkeyEcxRequestQueueHandlingService }]; } });
4193
-
4194
- /* eslint-disable max-len */
4195
- class MonkeyEcxHttpConfigLoadingInProgressInterceptor {
4196
- constructor(injector) {
4197
- this.injector = injector;
4198
- // no to do
4259
+ getData(field) {
4260
+ const { root } = this.router.routerState.snapshot;
4261
+ const route = this.getLastChild(root);
4262
+ const found = MonkeyEcxUtils.persistNullEmptyUndefined(route) ? route.data[field] : null;
4263
+ return found;
4199
4264
  }
4200
- intercept(request, next) {
4201
- const { injector, isLoadingInProgressProperty } = this;
4202
- const handlingService = injector.get(MonkeyEcxHandlingService);
4203
- const progressBarService = injector.get(MonkeyEcxProgressBarService);
4204
- const inProgress = handlingService?.getMonkeyEcxServiceCredentials()
4205
- ? handlingService?.getMonkeyEcxServiceCredentials()?.requestInProgress || null
4206
- : null;
4207
- if (isLoadingInProgressProperty(inProgress)) {
4208
- progressBarService.show();
4265
+ getDataFromCurrentNavigation(field) {
4266
+ const navigation = this.router.getCurrentNavigation();
4267
+ let state = null;
4268
+ if (MonkeyEcxUtils.persistNullEmptyUndefined(navigation)) {
4269
+ state = navigation?.extras.state;
4209
4270
  }
4210
- return next.handle(request).pipe(finalize(() => {
4211
- if (isLoadingInProgressProperty(inProgress)) {
4212
- progressBarService.hide();
4213
- }
4214
- }));
4271
+ return state ? state[field] : null;
4215
4272
  }
4216
- isLoadingInProgressProperty(mlp) {
4217
- if (!mlp)
4218
- return false;
4219
- return MonkeyEcxUtils.persistNullEmptyUndefined(mlp) &&
4220
- MonkeyEcxUtils.persistNullEmptyUndefined(mlp.showProgress)
4221
- ? mlp.showProgress
4222
- : true;
4273
+ getParam(param) {
4274
+ const { root } = this.router.routerState.snapshot;
4275
+ const route = this.getLastChild(root);
4276
+ let found = MonkeyEcxUtils.persistNullEmptyUndefined(route)
4277
+ ? route?.paramMap?.get(param) || ''
4278
+ : '';
4279
+ if (!MonkeyEcxUtils.persistNullEmptyUndefined(found))
4280
+ found = this.getData(param);
4281
+ return found;
4223
4282
  }
4224
4283
  }
4225
- MonkeyEcxHttpConfigLoadingInProgressInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigLoadingInProgressInterceptor, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
4226
- MonkeyEcxHttpConfigLoadingInProgressInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigLoadingInProgressInterceptor });
4227
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigLoadingInProgressInterceptor, decorators: [{
4228
- type: Injectable
4229
- }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
4230
-
4231
- class MonkeyEcxHttpConfigInterceptorModule {
4232
- static forRoot() {
4233
- return {
4234
- ngModule: MonkeyEcxHttpConfigInterceptorModule,
4235
- providers: [
4236
- {
4237
- provide: HTTP_INTERCEPTORS,
4238
- useClass: MonkeyEcxHttpConfigHeaderInterceptor,
4239
- multi: true,
4240
- },
4241
- {
4242
- provide: HTTP_INTERCEPTORS,
4243
- useClass: MonkeyEcxHttpConfigErrorInterceptor,
4244
- multi: true,
4245
- },
4246
- {
4247
- provide: HTTP_INTERCEPTORS,
4248
- useClass: MonkeyEcxHttpConfigQueueInterceptor,
4249
- multi: true,
4250
- },
4251
- {
4252
- provide: HTTP_INTERCEPTORS,
4253
- useClass: MonkeyEcxHttpConfigLoadingInProgressInterceptor,
4254
- multi: true,
4255
- },
4256
- ],
4257
- };
4258
- }
4259
- }
4260
- MonkeyEcxHttpConfigInterceptorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigInterceptorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4261
- MonkeyEcxHttpConfigInterceptorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigInterceptorModule, imports: [CommonModule] });
4262
- MonkeyEcxHttpConfigInterceptorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigInterceptorModule, imports: [[CommonModule]] });
4263
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigInterceptorModule, decorators: [{
4264
- type: NgModule,
4265
- args: [{
4266
- imports: [CommonModule],
4267
- }]
4268
- }] });
4269
-
4270
- class Link {
4271
- constructor(data) {
4272
- this.href = data?.href;
4273
- this.type = data?.type;
4274
- this.templated = data?.templated;
4275
- }
4276
- }
4277
- class MonkeyEcxModel {
4278
- getAction(type, replaceOptions) {
4279
- const { _links } = this;
4280
- if (!_links)
4281
- return null;
4282
- let link = _links[type.toLowerCase()];
4283
- link = new Link(link);
4284
- if (link && replaceOptions && link?.templated) {
4285
- const { from, to } = replaceOptions;
4286
- link = new Link({
4287
- ...link,
4288
- href: `${link.href}`.replace(from, to),
4289
- });
4290
- }
4291
- return link;
4292
- }
4293
- }
4294
-
4295
- /* eslint-disable indent */
4296
- class MonkeyEcxConfigModule {
4297
- constructor(parentModule) {
4298
- if (parentModule) {
4299
- throw new Error('MonkeyEcxConfigModule is already loaded. Import it in the AppModule only!');
4300
- }
4301
- }
4302
- static forRoot() {
4303
- return {
4304
- ngModule: MonkeyEcxConfigModule,
4305
- providers: [MonkeyEcxConfigService]
4306
- };
4307
- }
4308
- }
4309
- MonkeyEcxConfigModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxConfigModule, deps: [{ token: MonkeyEcxConfigModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
4310
- MonkeyEcxConfigModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxConfigModule });
4311
- MonkeyEcxConfigModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxConfigModule });
4312
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxConfigModule, decorators: [{
4313
- type: NgModule
4314
- }], ctorParameters: function () { return [{ type: MonkeyEcxConfigModule, decorators: [{
4315
- type: Optional
4316
- }, {
4317
- type: SkipSelf
4318
- }] }]; } });
4319
-
4320
- class MonkeyEcxLoggedHandlingService {
4321
- constructor() {
4322
- this.schedules = [];
4323
- this.genericSchedules = [];
4324
- // not to do
4325
- }
4326
- destroySchedule() {
4327
- this.schedules.forEach((sch) => {
4328
- clearInterval(sch.interval);
4329
- });
4330
- this.schedules = [];
4331
- }
4332
- destroyGenericSchedule() {
4333
- this.genericSchedules.forEach((sch) => {
4334
- clearInterval(sch.interval);
4335
- });
4336
- this.genericSchedules = [];
4337
- }
4338
- addSchedule(sch) {
4339
- this.schedules = sch;
4340
- }
4341
- addGenericSchedule(sch) {
4342
- this.genericSchedules = sch;
4343
- }
4344
- destroy() {
4345
- this.destroySchedule();
4346
- this.destroyGenericSchedule();
4347
- }
4348
- }
4349
- MonkeyEcxLoggedHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxLoggedHandlingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4350
- MonkeyEcxLoggedHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxLoggedHandlingService, providedIn: 'root' });
4351
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxLoggedHandlingService, decorators: [{
4284
+ MonkeyEcxDiscoveryParamsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxDiscoveryParamsService, deps: [{ token: i1$3.Router }], target: i0.ɵɵFactoryTarget.Injectable });
4285
+ MonkeyEcxDiscoveryParamsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxDiscoveryParamsService, providedIn: 'root' });
4286
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxDiscoveryParamsService, decorators: [{
4352
4287
  type: Injectable,
4353
4288
  args: [{
4354
4289
  providedIn: 'root'
4355
4290
  }]
4356
- }], ctorParameters: function () { return []; } });
4291
+ }], ctorParameters: function () { return [{ type: i1$3.Router }]; } });
4357
4292
 
4358
- class MonkeyEcxPaginationService {
4359
- constructor() {
4360
- this.callbacks = {};
4293
+ class MonkeyEcxRequestScheduleService {
4294
+ constructor(monkeyecxService, monkeyLoggedHandlingService) {
4295
+ this.monkeyecxService = monkeyecxService;
4296
+ this.monkeyLoggedHandlingService = monkeyLoggedHandlingService;
4297
+ this.schedule = [];
4298
+ this.genericSchedule = [];
4361
4299
  // not to do
4362
4300
  }
4363
- setCallback(callback, name = 'main') {
4364
- this.callbacks = {
4365
- ...this.callbacks,
4366
- [name]: callback
4367
- };
4368
- }
4369
- execute(type, name = 'main') {
4370
- const { callbacks } = this;
4371
- const callback = callbacks?.[name];
4372
- if (callback)
4373
- callback(type);
4374
- }
4375
- }
4376
- MonkeyEcxPaginationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxPaginationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4377
- MonkeyEcxPaginationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxPaginationService, providedIn: 'root' });
4378
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxPaginationService, decorators: [{
4379
- type: Injectable,
4380
- args: [{
4381
- providedIn: 'root'
4382
- }]
4383
- }], ctorParameters: function () { return []; } });
4384
-
4385
- class MonkeyEcxRequestDownloadHandlingService {
4386
- constructor() {
4387
- this.download = [];
4388
- this.download$ = new BehaviorSubject([]);
4301
+ addToSchedule(q) {
4302
+ this.schedule.push(q);
4303
+ this.monkeyLoggedHandlingService.addSchedule(this.schedule);
4389
4304
  }
4390
- addTo(q) {
4391
- this.download.push(q);
4392
- this.download$.next(this.download);
4305
+ addToGenericSchedule(q) {
4306
+ this.genericSchedule.push(q);
4307
+ this.monkeyLoggedHandlingService.addGenericSchedule(this.genericSchedule);
4393
4308
  }
4394
- markItemAsFinish(q, status) {
4395
- const saved = [...this.download];
4396
- this.download = [
4397
- ...saved
4398
- .map((val) => {
4399
- if (val.status === MonkeyEcxDownloadEvents.OnGoing) {
4400
- const valSaved = {
4401
- ...val
4402
- };
4403
- if (valSaved.item.id === q.item.id) {
4404
- return {
4405
- ...valSaved,
4406
- status: status || MonkeyEcxDownloadEvents.Finished
4407
- };
4408
- }
4409
- return valSaved;
4309
+ removeFromSchedule(q) {
4310
+ clearInterval(q.interval);
4311
+ const saved = [...this.schedule];
4312
+ this.schedule = [
4313
+ ...saved.map((sch) => {
4314
+ const savedLocal = {
4315
+ ...sch
4316
+ };
4317
+ if (sch.id === q.id) {
4318
+ return null;
4410
4319
  }
4411
- return null;
4412
- })
4413
- .filter((_) => {
4414
- return _;
4320
+ return savedLocal;
4415
4321
  })
4416
- ];
4417
- this.download = this.download.filter((_) => {
4418
- return _.status === MonkeyEcxDownloadEvents.OnGoing;
4322
+ ].filter((_) => {
4323
+ return _;
4419
4324
  });
4420
- this.download$.next(this.download);
4325
+ this.monkeyLoggedHandlingService.addSchedule(this.schedule);
4421
4326
  }
4422
- updateItem(q, loaded, total) {
4423
- const saved = [...this.download];
4424
- this.download = [
4425
- ...saved.map((val) => {
4426
- const valSaved = {
4427
- ...val
4327
+ removeFromGenericSchedule(q) {
4328
+ clearInterval(q.interval);
4329
+ const saved = [...this.genericSchedule];
4330
+ this.genericSchedule = [
4331
+ ...saved.map((sch) => {
4332
+ const savedLocal = {
4333
+ ...sch
4428
4334
  };
4429
- const currentPecentage = Math.floor(((loaded || 0) / (total || 0)) * 100);
4430
- const totalPercentage = 100;
4431
- if (valSaved.item.id === q.item.id) {
4432
- return {
4433
- ...valSaved,
4434
- loaded,
4435
- total,
4436
- currentPercentage: currentPecentage,
4437
- totalPercentage
4438
- };
4335
+ if (sch.id === q.id) {
4336
+ return null;
4439
4337
  }
4440
- return valSaved;
4338
+ return savedLocal;
4441
4339
  })
4442
- ];
4443
- this.download$.next(this.download);
4444
- }
4445
- set(q) {
4446
- this.addTo(q);
4447
- }
4448
- get() {
4449
- return this.download$.asObservable();
4450
- }
4451
- update(q, loaded, total) {
4452
- this.updateItem(q, loaded, total);
4453
- }
4454
- finishItem(q, status) {
4455
- this.markItemAsFinish(q, status);
4456
- }
4457
- hasDownloadOnGoing() {
4458
- const found = this.download.find((_) => {
4459
- return _.status === MonkeyEcxDownloadEvents.OnGoing;
4460
- });
4461
- return MonkeyEcxUtils.persistNullEmptyUndefined(found);
4462
- }
4463
- }
4464
- MonkeyEcxRequestDownloadHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxRequestDownloadHandlingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4465
- MonkeyEcxRequestDownloadHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxRequestDownloadHandlingService, providedIn: 'root' });
4466
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxRequestDownloadHandlingService, decorators: [{
4467
- type: Injectable,
4468
- args: [{
4469
- providedIn: 'root'
4470
- }]
4471
- }], ctorParameters: function () { return []; } });
4472
-
4473
- class MonkeyEcxRequestDownloadedHandlingService {
4474
- constructor() {
4475
- this.downloaded = [];
4476
- this.downloaded$ = new BehaviorSubject([]);
4477
- }
4478
- addTo(q) {
4479
- this.downloaded.push(q);
4480
- this.downloaded$.next(this.downloaded);
4481
- }
4482
- markItemAsFinish(q, status) {
4483
- const saved = [...this.downloaded];
4484
- this.downloaded = [
4485
- ...saved.map((val) => {
4486
- if (val.status === MonkeyEcxDownloadEvents.OnGoing) {
4487
- const valSaved = {
4488
- ...val
4489
- };
4490
- if (valSaved.item.id === q.item.id) {
4491
- return {
4492
- ...valSaved,
4493
- status: status || MonkeyEcxDownloadEvents.Finished,
4494
- action: q.action
4495
- };
4496
- }
4497
- return valSaved;
4498
- }
4499
- return val;
4500
- })
4501
- ];
4502
- this.downloaded$.next(this.downloaded);
4503
- }
4504
- set(q) {
4505
- this.addTo(q);
4506
- }
4507
- get() {
4508
- return this.downloaded$.asObservable();
4509
- }
4510
- finishItem(q, status) {
4511
- this.markItemAsFinish(q, status);
4512
- }
4513
- hasDownloadOnGoing() {
4514
- const found = this.downloaded.find((_) => {
4515
- return _.status === MonkeyEcxDownloadEvents.OnGoing;
4516
- });
4517
- return MonkeyEcxUtils.persistNullEmptyUndefined(found);
4518
- }
4519
- }
4520
- MonkeyEcxRequestDownloadedHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxRequestDownloadedHandlingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4521
- MonkeyEcxRequestDownloadedHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxRequestDownloadedHandlingService, providedIn: 'root' });
4522
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxRequestDownloadedHandlingService, decorators: [{
4523
- type: Injectable,
4524
- args: [{
4525
- providedIn: 'root'
4526
- }]
4527
- }], ctorParameters: function () { return []; } });
4528
-
4529
- class MonkeyEcxDiscoveryParamsService {
4530
- constructor(router) {
4531
- this.router = router;
4532
- // not to do
4533
- }
4534
- getLastChild(route) {
4535
- if (route.firstChild) {
4536
- return this.getLastChild(route.firstChild);
4537
- }
4538
- return route;
4539
- }
4540
- setData(field, value) {
4541
- const { root } = this.router.routerState.snapshot;
4542
- const route = this.getLastChild(root);
4543
- route.data[field] = value;
4544
- }
4545
- getData(field) {
4546
- const { root } = this.router.routerState.snapshot;
4547
- const route = this.getLastChild(root);
4548
- const found = MonkeyEcxUtils.persistNullEmptyUndefined(route) ? route.data[field] : null;
4549
- return found;
4550
- }
4551
- getDataFromCurrentNavigation(field) {
4552
- const navigation = this.router.getCurrentNavigation();
4553
- let state = null;
4554
- if (MonkeyEcxUtils.persistNullEmptyUndefined(navigation)) {
4555
- state = navigation?.extras.state;
4556
- }
4557
- return state ? state[field] : null;
4558
- }
4559
- getParam(param) {
4560
- const { root } = this.router.routerState.snapshot;
4561
- const route = this.getLastChild(root);
4562
- let found = MonkeyEcxUtils.persistNullEmptyUndefined(route)
4563
- ? route?.paramMap?.get(param) || ''
4564
- : '';
4565
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(found))
4566
- found = this.getData(param);
4567
- return found;
4568
- }
4569
- }
4570
- MonkeyEcxDiscoveryParamsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxDiscoveryParamsService, deps: [{ token: i1$3.Router }], target: i0.ɵɵFactoryTarget.Injectable });
4571
- MonkeyEcxDiscoveryParamsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxDiscoveryParamsService, providedIn: 'root' });
4572
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxDiscoveryParamsService, decorators: [{
4573
- type: Injectable,
4574
- args: [{
4575
- providedIn: 'root'
4576
- }]
4577
- }], ctorParameters: function () { return [{ type: i1$3.Router }]; } });
4578
-
4579
- class MonkeyEcxRequestScheduleService {
4580
- constructor(monkeyecxService, monkeyLoggedHandlingService) {
4581
- this.monkeyecxService = monkeyecxService;
4582
- this.monkeyLoggedHandlingService = monkeyLoggedHandlingService;
4583
- this.schedule = [];
4584
- this.genericSchedule = [];
4585
- // not to do
4586
- }
4587
- addToSchedule(q) {
4588
- this.schedule.push(q);
4589
- this.monkeyLoggedHandlingService.addSchedule(this.schedule);
4590
- }
4591
- addToGenericSchedule(q) {
4592
- this.genericSchedule.push(q);
4593
- this.monkeyLoggedHandlingService.addGenericSchedule(this.genericSchedule);
4594
- }
4595
- removeFromSchedule(q) {
4596
- clearInterval(q.interval);
4597
- const saved = [...this.schedule];
4598
- this.schedule = [
4599
- ...saved.map((sch) => {
4600
- const savedLocal = {
4601
- ...sch
4602
- };
4603
- if (sch.id === q.id) {
4604
- return null;
4605
- }
4606
- return savedLocal;
4607
- })
4608
- ].filter((_) => {
4609
- return _;
4610
- });
4611
- this.monkeyLoggedHandlingService.addSchedule(this.schedule);
4612
- }
4613
- removeFromGenericSchedule(q) {
4614
- clearInterval(q.interval);
4615
- const saved = [...this.genericSchedule];
4616
- this.genericSchedule = [
4617
- ...saved.map((sch) => {
4618
- const savedLocal = {
4619
- ...sch
4620
- };
4621
- if (sch.id === q.id) {
4622
- return null;
4623
- }
4624
- return savedLocal;
4625
- })
4626
- ].filter((_) => {
4627
- return _;
4628
- });
4629
- this.monkeyLoggedHandlingService.addGenericSchedule(this.genericSchedule);
4340
+ ].filter((_) => {
4341
+ return _;
4342
+ });
4343
+ this.monkeyLoggedHandlingService.addGenericSchedule(this.genericSchedule);
4630
4344
  }
4631
4345
  removeFromScheduleById(id) {
4632
4346
  const q = this.getScheduleById(id);
@@ -4757,6 +4471,364 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
4757
4471
  }]
4758
4472
  }], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: MonkeyEcxLoggedHandlingService }]; }, propDecorators: { doCall: [], doGenericCall: [] } });
4759
4473
 
4474
+ class MonkeyEcxFeatureByProgramDirective {
4475
+ constructor(cdr, elementRef, monkeyConfigService) {
4476
+ this.cdr = cdr;
4477
+ this.elementRef = elementRef;
4478
+ this.monkeyConfigService = monkeyConfigService;
4479
+ this.feature = '';
4480
+ this.monkeyConfigService.config().subscribe((_) => {
4481
+ this.config = _;
4482
+ });
4483
+ }
4484
+ handleDisplay() {
4485
+ const { feature, config } = this;
4486
+ let display = 'none';
4487
+ if (!MonkeyEcxUtils.persistNullEmptyUndefined(feature) ||
4488
+ !MonkeyEcxUtils.persistNullEmptyUndefined(config?.program?.settings[feature])) {
4489
+ return;
4490
+ }
4491
+ const disabled = config?.program?.settings[feature];
4492
+ if (!disabled) {
4493
+ display = 'block';
4494
+ }
4495
+ this.elementRef.nativeElement.style.display = display;
4496
+ if (display === 'none') {
4497
+ this.elementRef.nativeElement.remove();
4498
+ }
4499
+ this.cdr.detectChanges();
4500
+ }
4501
+ ngOnInit() {
4502
+ if (!this.feature)
4503
+ return;
4504
+ this.elementRef.nativeElement.style.display = 'none';
4505
+ this.cdr.detectChanges();
4506
+ this.handleDisplay();
4507
+ }
4508
+ }
4509
+ MonkeyEcxFeatureByProgramDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxFeatureByProgramDirective, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: MonkeyEcxConfigService }], target: i0.ɵɵFactoryTarget.Directive });
4510
+ MonkeyEcxFeatureByProgramDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.1", type: MonkeyEcxFeatureByProgramDirective, selector: "[monkeyecxFeatureByProgram]", inputs: { feature: "feature" }, ngImport: i0 });
4511
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxFeatureByProgramDirective, decorators: [{
4512
+ type: Directive,
4513
+ args: [{
4514
+ selector: '[monkeyecxFeatureByProgram]'
4515
+ }]
4516
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: MonkeyEcxConfigService }]; }, propDecorators: { feature: [{
4517
+ type: Input,
4518
+ args: ['feature']
4519
+ }] } });
4520
+
4521
+ class MonkeyEcxFeatureDirective {
4522
+ constructor(cdr, elementRef, monkeyecxFeatureToggleService) {
4523
+ this.cdr = cdr;
4524
+ this.elementRef = elementRef;
4525
+ this.monkeyecxFeatureToggleService = monkeyecxFeatureToggleService;
4526
+ this.unsubscribeAll = new Subject();
4527
+ // not to do
4528
+ }
4529
+ getFeature(feature) {
4530
+ const { monkeyecxFeatureToggleService } = this;
4531
+ if (!monkeyecxFeatureToggleService) {
4532
+ return false;
4533
+ }
4534
+ return monkeyecxFeatureToggleService?.getFlag(feature) || false;
4535
+ }
4536
+ handleDisplay() {
4537
+ if (!this.feature)
4538
+ return;
4539
+ const flag = this.getFeature(this.feature);
4540
+ let display = 'none';
4541
+ if (!MonkeyEcxUtils.persistNullEmptyUndefined(flag)) {
4542
+ return;
4543
+ }
4544
+ if (flag) {
4545
+ display = 'block';
4546
+ }
4547
+ if (display === 'none') {
4548
+ this.elementRef.nativeElement.remove();
4549
+ }
4550
+ this.elementRef.nativeElement.style.display = display;
4551
+ this.cdr.detectChanges();
4552
+ }
4553
+ ngOnDestroy() {
4554
+ this.unsubscribeAll.next();
4555
+ this.unsubscribeAll.complete();
4556
+ }
4557
+ ngOnInit() {
4558
+ if (!this.feature)
4559
+ return;
4560
+ this.elementRef.nativeElement.style.display = 'none';
4561
+ this.cdr.detectChanges();
4562
+ this.monkeyecxFeatureToggleService.onFlags
4563
+ .pipe(takeUntil(this.unsubscribeAll))
4564
+ .subscribe((val) => {
4565
+ if (val) {
4566
+ this.handleDisplay();
4567
+ }
4568
+ });
4569
+ }
4570
+ }
4571
+ MonkeyEcxFeatureDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxFeatureDirective, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: MonkeyEcxFeatureToggleService }], target: i0.ɵɵFactoryTarget.Directive });
4572
+ MonkeyEcxFeatureDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.1", type: MonkeyEcxFeatureDirective, selector: "[monkeyecxFeature]", inputs: { feature: ["featureName", "feature"] }, ngImport: i0 });
4573
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxFeatureDirective, decorators: [{
4574
+ type: Directive,
4575
+ args: [{
4576
+ selector: '[monkeyecxFeature]'
4577
+ }]
4578
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: MonkeyEcxFeatureToggleService }]; }, propDecorators: { feature: [{
4579
+ type: Input,
4580
+ args: ['featureName']
4581
+ }] } });
4582
+
4583
+ class MonkeyEcxDirectivesModule {
4584
+ }
4585
+ MonkeyEcxDirectivesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxDirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4586
+ MonkeyEcxDirectivesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxDirectivesModule, declarations: [MonkeyEcxDragDropDirective,
4587
+ MonkeyEcxFormatCurrency,
4588
+ MonkeyEcxFeatureDirective,
4589
+ MonkeyEcxFeatureByProgramDirective,
4590
+ MonkeyEcxFormatUpper,
4591
+ MonkeyEcxOnlyAlphaNumericDirective,
4592
+ MonkeyEcxOnlyNumbersDirective,
4593
+ MonkeyEcxSecurityDirective,
4594
+ MonkeyEcxTooltipDirective,
4595
+ MonkeyEcxPopoverDirective,
4596
+ MonkeyEcxPopoverOptionsDirective], imports: [CommonModule, OverlayModule], exports: [MonkeyEcxDragDropDirective,
4597
+ MonkeyEcxFormatCurrency,
4598
+ MonkeyEcxFeatureDirective,
4599
+ MonkeyEcxFeatureByProgramDirective,
4600
+ MonkeyEcxFormatUpper,
4601
+ MonkeyEcxOnlyAlphaNumericDirective,
4602
+ MonkeyEcxOnlyNumbersDirective,
4603
+ MonkeyEcxSecurityDirective,
4604
+ MonkeyEcxTooltipDirective,
4605
+ MonkeyEcxPopoverDirective,
4606
+ MonkeyEcxPopoverOptionsDirective] });
4607
+ MonkeyEcxDirectivesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxDirectivesModule, imports: [[CommonModule, OverlayModule]] });
4608
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxDirectivesModule, decorators: [{
4609
+ type: NgModule,
4610
+ args: [{
4611
+ declarations: [
4612
+ MonkeyEcxDragDropDirective,
4613
+ MonkeyEcxFormatCurrency,
4614
+ MonkeyEcxFeatureDirective,
4615
+ MonkeyEcxFeatureByProgramDirective,
4616
+ MonkeyEcxFormatUpper,
4617
+ MonkeyEcxOnlyAlphaNumericDirective,
4618
+ MonkeyEcxOnlyNumbersDirective,
4619
+ MonkeyEcxSecurityDirective,
4620
+ MonkeyEcxTooltipDirective,
4621
+ MonkeyEcxPopoverDirective,
4622
+ MonkeyEcxPopoverOptionsDirective
4623
+ ],
4624
+ imports: [CommonModule, OverlayModule],
4625
+ exports: [
4626
+ MonkeyEcxDragDropDirective,
4627
+ MonkeyEcxFormatCurrency,
4628
+ MonkeyEcxFeatureDirective,
4629
+ MonkeyEcxFeatureByProgramDirective,
4630
+ MonkeyEcxFormatUpper,
4631
+ MonkeyEcxOnlyAlphaNumericDirective,
4632
+ MonkeyEcxOnlyNumbersDirective,
4633
+ MonkeyEcxSecurityDirective,
4634
+ MonkeyEcxTooltipDirective,
4635
+ MonkeyEcxPopoverDirective,
4636
+ MonkeyEcxPopoverOptionsDirective
4637
+ ]
4638
+ }]
4639
+ }] });
4640
+
4641
+ class MonkeyEcxHttpConfigErrorInterceptor {
4642
+ constructor(monkeyecxAuthenticationService, monkeyecxErrorHandlingService) {
4643
+ this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
4644
+ this.monkeyecxErrorHandlingService = monkeyecxErrorHandlingService;
4645
+ // no to do
4646
+ }
4647
+ intercept(request, next) {
4648
+ return next.handle(request).pipe(map((event) => {
4649
+ return event;
4650
+ }), catchError((error) => {
4651
+ if (this.monkeyecxAuthenticationService.refreshShouldHappen(error)) {
4652
+ return this.monkeyecxAuthenticationService?.refreshToken()?.pipe(take(1), map(() => {
4653
+ return this.monkeyecxAuthenticationService.getRequestWithHeaders(request);
4654
+ }), mergeMap((resp) => {
4655
+ return next.handle(resp).pipe(catchError((error) => {
4656
+ this.monkeyecxErrorHandlingService.handleError(error, 'refresh_token');
4657
+ return throwError(null);
4658
+ }));
4659
+ }), catchError((error) => {
4660
+ this.monkeyecxErrorHandlingService.handleError(error, 'refresh_token');
4661
+ return throwError(null);
4662
+ })) || throwError(error);
4663
+ }
4664
+ return throwError(error);
4665
+ }));
4666
+ }
4667
+ }
4668
+ MonkeyEcxHttpConfigErrorInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigErrorInterceptor, deps: [{ token: MonkeyEcxAuthenticationService }, { token: MonkeyEcxErrorHandlingService }], target: i0.ɵɵFactoryTarget.Injectable });
4669
+ MonkeyEcxHttpConfigErrorInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigErrorInterceptor });
4670
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigErrorInterceptor, decorators: [{
4671
+ type: Injectable
4672
+ }], ctorParameters: function () { return [{ type: MonkeyEcxAuthenticationService }, { type: MonkeyEcxErrorHandlingService }]; } });
4673
+
4674
+ class MonkeyEcxHttpConfigHeaderInterceptor {
4675
+ constructor(monkeyecxAuthenticationService, monkeyecxErrorHandlingService) {
4676
+ this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
4677
+ this.monkeyecxErrorHandlingService = monkeyecxErrorHandlingService;
4678
+ // not to do
4679
+ }
4680
+ intercept(request, next) {
4681
+ return this.monkeyecxAuthenticationService?.getRequestWithHeadersOb(request)?.pipe(take(1), map((event) => {
4682
+ return event;
4683
+ }), mergeMap((resp) => {
4684
+ request = request.clone({
4685
+ setHeaders: resp
4686
+ });
4687
+ return next.handle(request);
4688
+ }), catchError((error) => {
4689
+ this.monkeyecxErrorHandlingService.handleError(error);
4690
+ return throwError(error);
4691
+ })) || throwError('getRequestWithHeadersOb undefined');
4692
+ }
4693
+ }
4694
+ MonkeyEcxHttpConfigHeaderInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigHeaderInterceptor, deps: [{ token: MonkeyEcxAuthenticationService }, { token: MonkeyEcxErrorHandlingService }], target: i0.ɵɵFactoryTarget.Injectable });
4695
+ MonkeyEcxHttpConfigHeaderInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigHeaderInterceptor });
4696
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigHeaderInterceptor, decorators: [{
4697
+ type: Injectable
4698
+ }], ctorParameters: function () { return [{ type: MonkeyEcxAuthenticationService }, { type: MonkeyEcxErrorHandlingService }]; } });
4699
+
4700
+ /* eslint-disable max-len */
4701
+ class MonkeyEcxHttpConfigQueueInterceptor {
4702
+ constructor(injector, monkeyecxRequestQueueHandlingService) {
4703
+ this.injector = injector;
4704
+ this.monkeyecxRequestQueueHandlingService = monkeyecxRequestQueueHandlingService;
4705
+ // not to do
4706
+ }
4707
+ intercept(request, next) {
4708
+ const { injector, isQueueProperty } = this;
4709
+ const monkeyecxHandlingService = injector.get(MonkeyEcxHandlingService);
4710
+ const monkeyecxRequestQueue = monkeyecxHandlingService?.getMonkeyEcxRequestQueue();
4711
+ if (isQueueProperty(monkeyecxRequestQueue)) {
4712
+ this.monkeyecxRequestQueueHandlingService.setQueue(monkeyecxRequestQueue);
4713
+ }
4714
+ return next.handle(request).pipe(finalize(() => {
4715
+ if (isQueueProperty(monkeyecxRequestQueue)) {
4716
+ this.monkeyecxRequestQueueHandlingService.finishQueueItem(monkeyecxRequestQueue);
4717
+ }
4718
+ }));
4719
+ }
4720
+ isQueueProperty(mrq) {
4721
+ return (MonkeyEcxUtils.persistNullEmptyUndefined(mrq) &&
4722
+ MonkeyEcxUtils.persistNullEmptyUndefined(mrq?.item?.name));
4723
+ }
4724
+ }
4725
+ MonkeyEcxHttpConfigQueueInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigQueueInterceptor, deps: [{ token: i0.Injector }, { token: MonkeyEcxRequestQueueHandlingService }], target: i0.ɵɵFactoryTarget.Injectable });
4726
+ MonkeyEcxHttpConfigQueueInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigQueueInterceptor });
4727
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigQueueInterceptor, decorators: [{
4728
+ type: Injectable
4729
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: MonkeyEcxRequestQueueHandlingService }]; } });
4730
+
4731
+ /* eslint-disable max-len */
4732
+ class MonkeyEcxHttpConfigLoadingInProgressInterceptor {
4733
+ constructor(injector) {
4734
+ this.injector = injector;
4735
+ // no to do
4736
+ }
4737
+ intercept(request, next) {
4738
+ const { injector, isLoadingInProgressProperty } = this;
4739
+ const handlingService = injector.get(MonkeyEcxHandlingService);
4740
+ const progressBarService = injector.get(MonkeyEcxProgressBarService);
4741
+ const inProgress = handlingService?.getMonkeyEcxServiceCredentials()
4742
+ ? handlingService?.getMonkeyEcxServiceCredentials()?.requestInProgress || null
4743
+ : null;
4744
+ if (isLoadingInProgressProperty(inProgress)) {
4745
+ progressBarService.show();
4746
+ }
4747
+ return next.handle(request).pipe(finalize(() => {
4748
+ if (isLoadingInProgressProperty(inProgress)) {
4749
+ progressBarService.hide();
4750
+ }
4751
+ }));
4752
+ }
4753
+ isLoadingInProgressProperty(mlp) {
4754
+ if (!mlp)
4755
+ return false;
4756
+ return MonkeyEcxUtils.persistNullEmptyUndefined(mlp) &&
4757
+ MonkeyEcxUtils.persistNullEmptyUndefined(mlp.showProgress)
4758
+ ? mlp.showProgress
4759
+ : true;
4760
+ }
4761
+ }
4762
+ MonkeyEcxHttpConfigLoadingInProgressInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigLoadingInProgressInterceptor, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
4763
+ MonkeyEcxHttpConfigLoadingInProgressInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigLoadingInProgressInterceptor });
4764
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigLoadingInProgressInterceptor, decorators: [{
4765
+ type: Injectable
4766
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
4767
+
4768
+ class MonkeyEcxHttpConfigInterceptorModule {
4769
+ static forRoot() {
4770
+ return {
4771
+ ngModule: MonkeyEcxHttpConfigInterceptorModule,
4772
+ providers: [
4773
+ {
4774
+ provide: HTTP_INTERCEPTORS,
4775
+ useClass: MonkeyEcxHttpConfigHeaderInterceptor,
4776
+ multi: true,
4777
+ },
4778
+ {
4779
+ provide: HTTP_INTERCEPTORS,
4780
+ useClass: MonkeyEcxHttpConfigErrorInterceptor,
4781
+ multi: true,
4782
+ },
4783
+ {
4784
+ provide: HTTP_INTERCEPTORS,
4785
+ useClass: MonkeyEcxHttpConfigQueueInterceptor,
4786
+ multi: true,
4787
+ },
4788
+ {
4789
+ provide: HTTP_INTERCEPTORS,
4790
+ useClass: MonkeyEcxHttpConfigLoadingInProgressInterceptor,
4791
+ multi: true,
4792
+ },
4793
+ ],
4794
+ };
4795
+ }
4796
+ }
4797
+ MonkeyEcxHttpConfigInterceptorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigInterceptorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4798
+ MonkeyEcxHttpConfigInterceptorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigInterceptorModule, imports: [CommonModule] });
4799
+ MonkeyEcxHttpConfigInterceptorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigInterceptorModule, imports: [[CommonModule]] });
4800
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigInterceptorModule, decorators: [{
4801
+ type: NgModule,
4802
+ args: [{
4803
+ imports: [CommonModule],
4804
+ }]
4805
+ }] });
4806
+
4807
+ class Link {
4808
+ constructor(data) {
4809
+ this.href = data?.href;
4810
+ this.type = data?.type;
4811
+ this.templated = data?.templated;
4812
+ }
4813
+ }
4814
+ class MonkeyEcxModel {
4815
+ getAction(type, replaceOptions) {
4816
+ const { _links } = this;
4817
+ if (!_links)
4818
+ return null;
4819
+ let link = _links[type.toLowerCase()];
4820
+ link = new Link(link);
4821
+ if (link && replaceOptions && link?.templated) {
4822
+ const { from, to } = replaceOptions;
4823
+ link = new Link({
4824
+ ...link,
4825
+ href: `${link.href}`.replace(from, to),
4826
+ });
4827
+ }
4828
+ return link;
4829
+ }
4830
+ }
4831
+
4760
4832
  /* eslint-disable no-unused-vars */
4761
4833
  var OpSearch;
4762
4834
  (function (OpSearch) {
@@ -4917,5 +4989,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
4917
4989
  * Generated bundle index. Do not edit.
4918
4990
  */
4919
4991
 
4920
- export { ClosedToMaintenanceComponent, ClosedToMaintenanceModule, decoratorsUtils as DecoratorsUtils, Link, MonkeyEcxAuthGuard, MonkeyEcxAuthGuardCompany, MonkeyEcxAuthGuardLogin, MonkeyEcxAuthenticationService, MonkeyEcxCommonsService, MonkeyEcxConfigModule, MonkeyEcxConfigService, MonkeyEcxCookieStorageService, MonkeyEcxCoreCharts, MonkeyEcxCoreClearDecorators, MonkeyEcxCoreLog, MonkeyEcxCoreService, MonkeyEcxCoreServiceConstructor, MonkeyEcxCoreServicePaged, MonkeyEcxCoreServiceQueue, MonkeyEcxDirectivesModule, MonkeyEcxDiscoveryParamsService, MonkeyEcxDisplayFirstNamePipe, MonkeyEcxDragDropDirective, MonkeyEcxErrorConfigService, MonkeyEcxErrorHandlingModule, MonkeyEcxErrorHandlingService, MonkeyEcxFeatureDirective, MonkeyEcxFeatureToggleService, MonkeyEcxFormatAddressPipe, MonkeyEcxFormatBeaufityJSONPipe, MonkeyEcxFormatCurrency, MonkeyEcxFormatCurrencyPipe, MonkeyEcxFormatDateGroupPipe, MonkeyEcxFormatDateTimelapsePipe, MonkeyEcxFormatDateUnixTimelapsePipe, MonkeyEcxFormatDocumentPipe, MonkeyEcxFormatDocumentTypePipe, MonkeyEcxFormatNumberPipe, MonkeyEcxFormatPhonePipe, MonkeyEcxFormatSizePipe, MonkeyEcxFormatTaxPipe, MonkeyEcxFormatUpper, MonkeyEcxFormatValue, MonkeyEcxFormatZipCodePipe, MonkeyEcxHandlingService, MonkeyEcxHttpConfigErrorInterceptor, MonkeyEcxHttpConfigHeaderInterceptor, MonkeyEcxHttpConfigInterceptorModule, MonkeyEcxHttpConfigLoadingInProgressInterceptor, MonkeyEcxHttpConfigQueueInterceptor, MonkeyEcxHttpErrorHandlingService, MonkeyEcxLoggedHandlingService, MonkeyEcxLogsConfigService, MonkeyEcxMaintenanceConfigService, MonkeyEcxModel, MonkeyEcxOnlyAlphaNumericDirective, MonkeyEcxOnlyNumbersDirective, MonkeyEcxOthersErrorsHandlingService, MonkeyEcxPaginationService, MonkeyEcxPipesModule, MonkeyEcxPopoverDirective, MonkeyEcxPopoverOptionsDirective, MonkeyEcxProgressBarComponent, MonkeyEcxProgressBarModule, MonkeyEcxProgressBarService, MonkeyEcxRequestDownloadHandlingService, MonkeyEcxRequestDownloadedHandlingService, MonkeyEcxRequestPagedHandling, MonkeyEcxRequestQueueHandlingService, MonkeyEcxRequestQueueModalHandlingService, MonkeyEcxRequestScheduleService, MonkeyEcxSecurityConsoleConfigService, MonkeyEcxSecurityDirective, MonkeyEcxService, MonkeyEcxServiceDownload, MonkeyEcxServiceUpload, MonkeyEcxServiceWorkerConfigService, MonkeyEcxSpecificationSearch, MonkeyEcxTextTruncatePipe, MonkeyEcxTokenStorageService, MonkeyEcxTooltipDirective, MonkeyEcxTruncateQtdPipe, MonkeyEcxUtils, MonkeyEcxi18nConfigService, MonkeyFrontCoreModule, OpSearch, POPOVER_OPTIONS, statics as Statics, validateUtils as ValidateUtils, Validators, VersionChangedComponent, VersionChangedModule, comboValidator, dateRangeValidator, dateStartEndValidator, dateValidator, documentValidator, emailValidator, passwordConfirmValidator, registerValidator, trueValidator, urlValidator, valueGreaterThanZero, zipCodeValidator };
4992
+ export { ClosedToMaintenanceComponent, ClosedToMaintenanceModule, decoratorsUtils as DecoratorsUtils, Link, MonkeyEcxAuthGuard, MonkeyEcxAuthGuardCompany, MonkeyEcxAuthGuardLogin, MonkeyEcxAuthenticationService, MonkeyEcxCommonsService, MonkeyEcxConfigModule, MonkeyEcxConfigService, MonkeyEcxCookieStorageService, MonkeyEcxCoreCharts, MonkeyEcxCoreClearDecorators, MonkeyEcxCoreLog, MonkeyEcxCoreService, MonkeyEcxCoreServiceConstructor, MonkeyEcxCoreServicePaged, MonkeyEcxCoreServiceQueue, MonkeyEcxDirectivesModule, MonkeyEcxDiscoveryParamsService, MonkeyEcxDisplayFirstNamePipe, MonkeyEcxDragDropDirective, MonkeyEcxErrorConfigService, MonkeyEcxErrorHandlingModule, MonkeyEcxErrorHandlingService, MonkeyEcxFeatureByProgramDirective, MonkeyEcxFeatureDirective, MonkeyEcxFeatureToggleService, MonkeyEcxFormatAddressPipe, MonkeyEcxFormatBeaufityJSONPipe, MonkeyEcxFormatCurrency, MonkeyEcxFormatCurrencyPipe, MonkeyEcxFormatDateGroupPipe, MonkeyEcxFormatDateTimelapsePipe, MonkeyEcxFormatDateUnixTimelapsePipe, MonkeyEcxFormatDocumentPipe, MonkeyEcxFormatDocumentTypePipe, MonkeyEcxFormatNumberPipe, MonkeyEcxFormatPhonePipe, MonkeyEcxFormatSizePipe, MonkeyEcxFormatTaxPipe, MonkeyEcxFormatUpper, MonkeyEcxFormatValue, MonkeyEcxFormatZipCodePipe, MonkeyEcxHandlingService, MonkeyEcxHttpConfigErrorInterceptor, MonkeyEcxHttpConfigHeaderInterceptor, MonkeyEcxHttpConfigInterceptorModule, MonkeyEcxHttpConfigLoadingInProgressInterceptor, MonkeyEcxHttpConfigQueueInterceptor, MonkeyEcxHttpErrorHandlingService, MonkeyEcxLoggedHandlingService, MonkeyEcxLogsConfigService, MonkeyEcxMaintenanceConfigService, MonkeyEcxModel, MonkeyEcxOnlyAlphaNumericDirective, MonkeyEcxOnlyNumbersDirective, MonkeyEcxOthersErrorsHandlingService, MonkeyEcxPaginationService, MonkeyEcxPipesModule, MonkeyEcxPopoverDirective, MonkeyEcxPopoverOptionsDirective, MonkeyEcxProgressBarComponent, MonkeyEcxProgressBarModule, MonkeyEcxProgressBarService, MonkeyEcxRequestDownloadHandlingService, MonkeyEcxRequestDownloadedHandlingService, MonkeyEcxRequestPagedHandling, MonkeyEcxRequestQueueHandlingService, MonkeyEcxRequestQueueModalHandlingService, MonkeyEcxRequestScheduleService, MonkeyEcxSecurityConsoleConfigService, MonkeyEcxSecurityDirective, MonkeyEcxService, MonkeyEcxServiceDownload, MonkeyEcxServiceUpload, MonkeyEcxServiceWorkerConfigService, MonkeyEcxSpecificationSearch, MonkeyEcxTextTruncatePipe, MonkeyEcxTokenStorageService, MonkeyEcxTooltipDirective, MonkeyEcxTruncateQtdPipe, MonkeyEcxUtils, MonkeyEcxi18nConfigService, MonkeyFrontCoreModule, OpSearch, POPOVER_OPTIONS, statics as Statics, validateUtils as ValidateUtils, Validators, VersionChangedComponent, VersionChangedModule, comboValidator, dateRangeValidator, dateStartEndValidator, dateValidator, documentValidator, emailValidator, passwordConfirmValidator, registerValidator, trueValidator, urlValidator, valueGreaterThanZero, zipCodeValidator };
4921
4993
  //# sourceMappingURL=monkey-front-core.mjs.map