@experteam-mx/ngx-services 20.6.0 → 20.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, makeEnvironmentProviders, NgModule, inject, Injectable } from '@angular/core';
3
3
  import { provideHttpClient, HttpClient, HttpHeaders, HttpResponse, HttpParams } from '@angular/common/http';
4
- import { map, mergeMap, forkJoin, tap, Observable, of } from 'rxjs';
4
+ import { map, mergeMap, forkJoin, tap, BehaviorSubject, merge, firstValueFrom, Observable, of } from 'rxjs';
5
5
  import { map as map$1, tap as tap$1, finalize, shareReplay } from 'rxjs/operators';
6
6
  import { CookieService } from 'ngx-cookie-service';
7
7
  import Pusher from 'pusher-js';
@@ -48,11 +48,11 @@ class NgxServicesModule {
48
48
  providers: [provideNgxServices(environment)]
49
49
  };
50
50
  }
51
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: NgxServicesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
52
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.21", ngImport: i0, type: NgxServicesModule });
53
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: NgxServicesModule, providers: [provideHttpClient()] });
51
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: NgxServicesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
52
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.25", ngImport: i0, type: NgxServicesModule });
53
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: NgxServicesModule, providers: [provideHttpClient()] });
54
54
  }
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: NgxServicesModule, decorators: [{
55
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: NgxServicesModule, decorators: [{
56
56
  type: NgModule,
57
57
  args: [{
58
58
  providers: [provideHttpClient()]
@@ -159,10 +159,10 @@ class ApiBillingCOService {
159
159
  return this.http.get(`${this.url}/tributes`, { params })
160
160
  .pipe(map(({ data }) => data));
161
161
  }
162
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiBillingCOService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
163
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiBillingCOService, providedIn: 'root' });
162
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiBillingCOService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
163
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiBillingCOService, providedIn: 'root' });
164
164
  }
165
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiBillingCOService, decorators: [{
165
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiBillingCOService, decorators: [{
166
166
  type: Injectable,
167
167
  args: [{
168
168
  providedIn: 'root'
@@ -189,10 +189,10 @@ class ApiBillingDOService {
189
189
  return this.http.get(`${this.url}/income-types`)
190
190
  .pipe(map(({ data }) => data));
191
191
  }
192
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiBillingDOService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
193
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiBillingDOService, providedIn: 'root' });
192
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiBillingDOService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
193
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiBillingDOService, providedIn: 'root' });
194
194
  }
195
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiBillingDOService, decorators: [{
195
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiBillingDOService, decorators: [{
196
196
  type: Injectable,
197
197
  args: [{
198
198
  providedIn: 'root'
@@ -239,10 +239,10 @@ class ApiBillingGtService {
239
239
  return this.http.post(`${this.url}/locations`, body)
240
240
  .pipe(map(({ data }) => data));
241
241
  }
242
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiBillingGtService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
243
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiBillingGtService, providedIn: 'root' });
242
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiBillingGtService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
243
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiBillingGtService, providedIn: 'root' });
244
244
  }
245
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiBillingGtService, decorators: [{
245
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiBillingGtService, decorators: [{
246
246
  type: Injectable,
247
247
  args: [{
248
248
  providedIn: 'root'
@@ -290,10 +290,10 @@ class ApiBillingMxService {
290
290
  return this.http.get(`${this.url}/postal-codes`, { params })
291
291
  .pipe(map(({ data }) => data));
292
292
  }
293
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiBillingMxService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
294
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiBillingMxService, providedIn: 'root' });
293
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiBillingMxService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
294
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiBillingMxService, providedIn: 'root' });
295
295
  }
296
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiBillingMxService, decorators: [{
296
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiBillingMxService, decorators: [{
297
297
  type: Injectable,
298
298
  args: [{
299
299
  providedIn: 'root'
@@ -384,10 +384,10 @@ class ApiBillingPaService {
384
384
  return this.http.post(`${this.url}/locations`, body)
385
385
  .pipe(map(({ data }) => data));
386
386
  }
387
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiBillingPaService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
388
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiBillingPaService, providedIn: 'root' });
387
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiBillingPaService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
388
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiBillingPaService, providedIn: 'root' });
389
389
  }
390
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiBillingPaService, decorators: [{
390
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiBillingPaService, decorators: [{
391
391
  type: Injectable,
392
392
  args: [{
393
393
  providedIn: 'root'
@@ -456,10 +456,10 @@ class ApiBillingSvService {
456
456
  return this.http.get(`${this.url}/municipalities`, { params })
457
457
  .pipe(map(({ data }) => data));
458
458
  }
459
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiBillingSvService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
460
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiBillingSvService, providedIn: 'root' });
459
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiBillingSvService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
460
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiBillingSvService, providedIn: 'root' });
461
461
  }
462
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiBillingSvService, decorators: [{
462
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiBillingSvService, decorators: [{
463
463
  type: Injectable,
464
464
  args: [{
465
465
  providedIn: 'root'
@@ -647,10 +647,10 @@ class ApiCashOperationsService {
647
647
  return this.http.patch(`${this.url}/deposits/${id}`, body)
648
648
  .pipe(map(({ data }) => data));
649
649
  }
650
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiCashOperationsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
651
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiCashOperationsService, providedIn: 'root' });
650
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiCashOperationsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
651
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiCashOperationsService, providedIn: 'root' });
652
652
  }
653
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiCashOperationsService, decorators: [{
653
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiCashOperationsService, decorators: [{
654
654
  type: Injectable,
655
655
  args: [{
656
656
  providedIn: 'root'
@@ -1430,10 +1430,10 @@ class ApiCatalogsService {
1430
1430
  return this.http.get(`${this.url}/export-reason-types`, { params })
1431
1431
  .pipe(map(({ data }) => data));
1432
1432
  }
1433
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiCatalogsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1434
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiCatalogsService, providedIn: 'root' });
1433
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiCatalogsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1434
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiCatalogsService, providedIn: 'root' });
1435
1435
  }
1436
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiCatalogsService, decorators: [{
1436
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiCatalogsService, decorators: [{
1437
1437
  type: Injectable,
1438
1438
  args: [{
1439
1439
  providedIn: 'root'
@@ -2507,10 +2507,10 @@ class ApiCompaniesService {
2507
2507
  }
2508
2508
  }).pipe(map(({ data }) => data));
2509
2509
  }
2510
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiCompaniesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2511
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiCompaniesService, providedIn: 'root' });
2510
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiCompaniesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2511
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiCompaniesService, providedIn: 'root' });
2512
2512
  }
2513
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiCompaniesService, decorators: [{
2513
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiCompaniesService, decorators: [{
2514
2514
  type: Injectable,
2515
2515
  args: [{
2516
2516
  providedIn: 'root'
@@ -2548,10 +2548,10 @@ class ApiCompositionService {
2548
2548
  return this.http.get(`${this.url}/country-references`, { params })
2549
2549
  .pipe(map(({ data }) => data));
2550
2550
  }
2551
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiCompositionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2552
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiCompositionService, providedIn: 'root' });
2551
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiCompositionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2552
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiCompositionService, providedIn: 'root' });
2553
2553
  }
2554
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiCompositionService, decorators: [{
2554
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiCompositionService, decorators: [{
2555
2555
  type: Injectable,
2556
2556
  args: [{
2557
2557
  providedIn: 'root'
@@ -2694,10 +2694,10 @@ class ApiCustomsService {
2694
2694
  params
2695
2695
  }).pipe(map(({ data }) => data));
2696
2696
  }
2697
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiCustomsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2698
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiCustomsService, providedIn: 'root' });
2697
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiCustomsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2698
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiCustomsService, providedIn: 'root' });
2699
2699
  }
2700
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiCustomsService, decorators: [{
2700
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiCustomsService, decorators: [{
2701
2701
  type: Injectable,
2702
2702
  args: [{
2703
2703
  providedIn: 'root'
@@ -2925,10 +2925,10 @@ class ApiDiscountsService {
2925
2925
  return this.http.put(`${this.url}/customer-restrictions/V2/${id}`, body)
2926
2926
  .pipe(map(({ data }) => data));
2927
2927
  }
2928
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiDiscountsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2929
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiDiscountsService, providedIn: 'root' });
2928
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiDiscountsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2929
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiDiscountsService, providedIn: 'root' });
2930
2930
  }
2931
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiDiscountsService, decorators: [{
2931
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiDiscountsService, decorators: [{
2932
2932
  type: Injectable,
2933
2933
  args: [{
2934
2934
  providedIn: 'root'
@@ -3020,10 +3020,10 @@ class ApiEToolsAutoBillingService {
3020
3020
  return this.http.post(`${this.url}/external-shipments/${id}/re-billing`, body)
3021
3021
  .pipe(map(({ data }) => data));
3022
3022
  }
3023
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiEToolsAutoBillingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3024
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiEToolsAutoBillingService, providedIn: 'root' });
3023
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiEToolsAutoBillingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3024
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiEToolsAutoBillingService, providedIn: 'root' });
3025
3025
  }
3026
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiEToolsAutoBillingService, decorators: [{
3026
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiEToolsAutoBillingService, decorators: [{
3027
3027
  type: Injectable,
3028
3028
  args: [{
3029
3029
  providedIn: 'root'
@@ -3062,10 +3062,10 @@ class ApiEventsService {
3062
3062
  return this.http.put(`${this.url}/operation-modules/${id}/end`, body)
3063
3063
  .pipe(map(({ data }) => data));
3064
3064
  }
3065
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiEventsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3066
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiEventsService, providedIn: 'root' });
3065
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiEventsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3066
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiEventsService, providedIn: 'root' });
3067
3067
  }
3068
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiEventsService, decorators: [{
3068
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiEventsService, decorators: [{
3069
3069
  type: Injectable,
3070
3070
  args: [{
3071
3071
  providedIn: 'root'
@@ -3130,10 +3130,10 @@ class ApiExternalOperationsService {
3130
3130
  return this.http.put(`${this.url}/delivery-confirmation/confirmation/${otp}`, body)
3131
3131
  .pipe(map$1(({ data }) => data));
3132
3132
  }
3133
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiExternalOperationsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3134
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiExternalOperationsService, providedIn: 'root' });
3133
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiExternalOperationsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3134
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiExternalOperationsService, providedIn: 'root' });
3135
3135
  }
3136
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiExternalOperationsService, decorators: [{
3136
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiExternalOperationsService, decorators: [{
3137
3137
  type: Injectable,
3138
3138
  args: [{
3139
3139
  providedIn: 'root'
@@ -3400,10 +3400,10 @@ class ApiInventoriesService {
3400
3400
  return this.http.get(`${this.url}/stock-update/packages/${id}`)
3401
3401
  .pipe(map(({ data }) => data));
3402
3402
  }
3403
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiInventoriesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3404
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiInventoriesService, providedIn: 'root' });
3403
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiInventoriesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3404
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiInventoriesService, providedIn: 'root' });
3405
3405
  }
3406
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiInventoriesService, decorators: [{
3406
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiInventoriesService, decorators: [{
3407
3407
  type: Injectable,
3408
3408
  args: [{
3409
3409
  providedIn: 'root'
@@ -3421,6 +3421,32 @@ class ApiInvoicesService {
3421
3421
  get url() {
3422
3422
  return this.environments.apiInvoicesUrl ?? '';
3423
3423
  }
3424
+ /**
3425
+ * Retrieves the printable ticket payload for a billing operation.
3426
+ *
3427
+ * Sends a GET request to `/operation/print/ticket/{documentId}` and unwraps
3428
+ * the `data` field from the API success envelope.
3429
+ *
3430
+ * @param documentId - Numeric identifier of the document to print.
3431
+ * @returns An Observable that emits the ticket data for the given document.
3432
+ */
3433
+ getOperationPrintTicket(documentId) {
3434
+ return this.http.get(`${this.url}/operation/print/ticket/${documentId}`)
3435
+ .pipe(map(({ data }) => data));
3436
+ }
3437
+ /**
3438
+ * Retrieves the printable document payload for a billing operation.
3439
+ *
3440
+ * Sends a GET request to `/operation/print/document/{documentId}` and unwraps
3441
+ * the `data` field from the API success envelope.
3442
+ *
3443
+ * @param documentId - Numeric identifier of the document to print.
3444
+ * @returns An Observable that emits the printable document data for the given document.
3445
+ */
3446
+ getOperationPrintDocument(documentId) {
3447
+ return this.http.get(`${this.url}/operation/print/document/${documentId}`)
3448
+ .pipe(map(({ data }) => data));
3449
+ }
3424
3450
  /**
3425
3451
  * Sends an operation document to the server and processes the response.
3426
3452
  *
@@ -3525,16 +3551,6 @@ class ApiInvoicesService {
3525
3551
  return this.http.post(`${this.url}/operation/shipment/external/payment`, params)
3526
3552
  .pipe(map(({ data }) => data));
3527
3553
  }
3528
- /**
3529
- * Retrieves and returns billing operation print details for a given document ID.
3530
- *
3531
- * @param {number} documentId - The ID of the document for which to fetch the print billing operation details.
3532
- * @return {Observable<OperationPrintDocumentOut>} An observable emitting the print billing operation details for the specified document.
3533
- */
3534
- getOperationPrintDocument(documentId) {
3535
- return this.http.get(`${this.url}/operation/print/document/${documentId}`)
3536
- .pipe(map(({ data }) => data));
3537
- }
3538
3554
  /**
3539
3555
  * Fetches all country payment types.
3540
3556
  *
@@ -3861,10 +3877,10 @@ class ApiInvoicesService {
3861
3877
  return this.http.put(`${this.url}/operation/document/${id}/customer`, data)
3862
3878
  .pipe(map(({ data }) => data));
3863
3879
  }
3864
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiInvoicesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3865
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiInvoicesService, providedIn: 'root' });
3880
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiInvoicesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3881
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiInvoicesService, providedIn: 'root' });
3866
3882
  }
3867
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiInvoicesService, decorators: [{
3883
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiInvoicesService, decorators: [{
3868
3884
  type: Injectable,
3869
3885
  args: [{
3870
3886
  providedIn: 'root'
@@ -3954,10 +3970,10 @@ class ApiNotificationsService {
3954
3970
  return this.http.get(`${this.url}/notification-types`, { params })
3955
3971
  .pipe(map(({ data }) => data));
3956
3972
  }
3957
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiNotificationsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3958
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiNotificationsService, providedIn: 'root' });
3973
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiNotificationsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3974
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiNotificationsService, providedIn: 'root' });
3959
3975
  }
3960
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiNotificationsService, decorators: [{
3976
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiNotificationsService, decorators: [{
3961
3977
  type: Injectable,
3962
3978
  args: [{
3963
3979
  providedIn: 'root'
@@ -4005,10 +4021,10 @@ class ApiOpenItemsService {
4005
4021
  return this.http.post(`${this.url}/other-invoices`, body)
4006
4022
  .pipe(map(({ data }) => data));
4007
4023
  }
4008
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiOpenItemsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4009
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiOpenItemsService, providedIn: 'root' });
4024
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiOpenItemsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4025
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiOpenItemsService, providedIn: 'root' });
4010
4026
  }
4011
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiOpenItemsService, decorators: [{
4027
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiOpenItemsService, decorators: [{
4012
4028
  type: Injectable,
4013
4029
  args: [{
4014
4030
  providedIn: 'root'
@@ -4075,10 +4091,10 @@ class ApiQuoteService {
4075
4091
  return this.http.get(`${this.url}/quote-event-types`, { params })
4076
4092
  .pipe(map(({ data }) => data));
4077
4093
  }
4078
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiQuoteService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4079
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiQuoteService, providedIn: 'root' });
4094
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiQuoteService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4095
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiQuoteService, providedIn: 'root' });
4080
4096
  }
4081
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiQuoteService, decorators: [{
4097
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiQuoteService, decorators: [{
4082
4098
  type: Injectable,
4083
4099
  args: [{
4084
4100
  providedIn: 'root'
@@ -4296,10 +4312,10 @@ class ApiReportsService {
4296
4312
  return this.http.get(`${this.url}/billing-details`, { params })
4297
4313
  .pipe(map(({ data }) => data));
4298
4314
  }
4299
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiReportsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4300
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiReportsService, providedIn: 'root' });
4315
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiReportsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4316
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiReportsService, providedIn: 'root' });
4301
4317
  }
4302
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiReportsService, decorators: [{
4318
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiReportsService, decorators: [{
4303
4319
  type: Injectable,
4304
4320
  args: [{
4305
4321
  providedIn: 'root'
@@ -4535,10 +4551,10 @@ class ApiSecurityService {
4535
4551
  }
4536
4552
  }).pipe(map(({ data }) => data));
4537
4553
  }
4538
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiSecurityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4539
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiSecurityService, providedIn: 'root' });
4554
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiSecurityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4555
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiSecurityService, providedIn: 'root' });
4540
4556
  }
4541
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiSecurityService, decorators: [{
4557
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiSecurityService, decorators: [{
4542
4558
  type: Injectable,
4543
4559
  args: [{
4544
4560
  providedIn: 'root'
@@ -4647,10 +4663,10 @@ class ApiServicesService {
4647
4663
  params: queryParams
4648
4664
  }).pipe(map(({ data }) => data));
4649
4665
  }
4650
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiServicesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4651
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiServicesService, providedIn: 'root' });
4666
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiServicesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4667
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiServicesService, providedIn: 'root' });
4652
4668
  }
4653
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiServicesService, decorators: [{
4669
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiServicesService, decorators: [{
4654
4670
  type: Injectable,
4655
4671
  args: [{
4656
4672
  providedIn: 'root'
@@ -4799,10 +4815,10 @@ class ApiShipmentsService {
4799
4815
  return this.http.put(`${this.url}/signature-page-settings/${id}`, body)
4800
4816
  .pipe(map(({ data }) => data));
4801
4817
  }
4802
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiShipmentsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4803
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiShipmentsService, providedIn: 'root' });
4818
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiShipmentsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4819
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiShipmentsService, providedIn: 'root' });
4804
4820
  }
4805
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiShipmentsService, decorators: [{
4821
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiShipmentsService, decorators: [{
4806
4822
  type: Injectable,
4807
4823
  args: [{
4808
4824
  providedIn: 'root'
@@ -4921,10 +4937,10 @@ class ApiSuppliesService {
4921
4937
  return this.http.get(`${this.url}/supply-locations/export/excel`, { params })
4922
4938
  .pipe(map(({ data }) => data));
4923
4939
  }
4924
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiSuppliesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4925
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiSuppliesService, providedIn: 'root' });
4940
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiSuppliesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4941
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiSuppliesService, providedIn: 'root' });
4926
4942
  }
4927
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiSuppliesService, decorators: [{
4943
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiSuppliesService, decorators: [{
4928
4944
  type: Injectable,
4929
4945
  args: [{
4930
4946
  providedIn: 'root'
@@ -5057,10 +5073,172 @@ class ApiSurveysService {
5057
5073
  return this.http.post(`${this.url}/customer-surveys/${uuid}/finish`, body)
5058
5074
  .pipe(map(({ data }) => data));
5059
5075
  }
5060
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiSurveysService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5061
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiSurveysService, providedIn: 'root' });
5076
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiSurveysService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5077
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiSurveysService, providedIn: 'root' });
5062
5078
  }
5063
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiSurveysService, decorators: [{
5079
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ApiSurveysService, decorators: [{
5080
+ type: Injectable,
5081
+ args: [{
5082
+ providedIn: 'root'
5083
+ }]
5084
+ }] });
5085
+
5086
+ const base64PdfToUrl = (base64) => {
5087
+ const data = new Uint8Array(atob(base64)
5088
+ .split('')
5089
+ .map(char => char.charCodeAt(0)));
5090
+ const blob = new Blob([data], { type: 'application/pdf' });
5091
+ return window.URL.createObjectURL(blob);
5092
+ };
5093
+ const downloadBase64Pdf = (base64) => window.open(base64PdfToUrl(base64));
5094
+
5095
+ var PrintMode;
5096
+ (function (PrintMode) {
5097
+ PrintMode["PRINT"] = "PRINT";
5098
+ PrintMode["DISPLAY"] = "DISPLAY";
5099
+ PrintMode["BOTH"] = "BOTH";
5100
+ })(PrintMode || (PrintMode = {}));
5101
+ var PrintableFormat;
5102
+ (function (PrintableFormat) {
5103
+ PrintableFormat["PDF"] = "pdf";
5104
+ PrintableFormat["ZPL2"] = "zpl2";
5105
+ })(PrintableFormat || (PrintableFormat = {}));
5106
+ var PrintersType;
5107
+ (function (PrintersType) {
5108
+ PrintersType["LABEL"] = "label";
5109
+ PrintersType["RECEIPT"] = "receipt";
5110
+ PrintersType["OTHERS"] = "others";
5111
+ })(PrintersType || (PrintersType = {}));
5112
+
5113
+ class PrintersService {
5114
+ environments = inject(ENVIRONMENT_TOKEN);
5115
+ http = inject(HttpClient);
5116
+ availablePrinters$ = new BehaviorSubject([]);
5117
+ printMode = PrintMode.DISPLAY;
5118
+ printers = [];
5119
+ /**
5120
+ * Retrieves the print URL from the environments configuration or defaults to 'http://localhost:9100'
5121
+ * if not specified.
5122
+ *
5123
+ * @return {string} The URL to be used for printing.
5124
+ */
5125
+ get url() {
5126
+ return this.environments.printUrl ?? 'http://localhost:9100';
5127
+ }
5128
+ /**
5129
+ * Prints or displays a document based on the current print mode.
5130
+ * It can handle printing to a physical printer, displaying in the browser,
5131
+ * or both simultaneously.
5132
+ *
5133
+ * @param {Printable} document - The document to be printed or displayed.
5134
+ * @return {Promise<void>} A promise that resolves when the printing or displaying process is complete, or rejects if an error occurs.
5135
+ */
5136
+ print(document) {
5137
+ return new Promise((resolve, reject) => {
5138
+ switch (this.printMode) {
5139
+ case PrintMode.PRINT:
5140
+ this.sendToPrinter(document).then(() => resolve()).catch(reject);
5141
+ break;
5142
+ case PrintMode.DISPLAY:
5143
+ this.sendToBrowser(document).then(resolve).catch(reject);
5144
+ break;
5145
+ case PrintMode.BOTH:
5146
+ merge([
5147
+ this.sendToBrowser(document),
5148
+ this.sendToPrinter(document)
5149
+ ]).subscribe({
5150
+ next: () => resolve(),
5151
+ error: reject,
5152
+ });
5153
+ break;
5154
+ }
5155
+ });
5156
+ }
5157
+ /**
5158
+ * Configures and initializes the print settings based on the provided parameters.
5159
+ *
5160
+ * @param {Object} config - The configuration object to set up the print mode and manage printers.
5161
+ * @param {string} config.country - The country code used to determine printer configurations.
5162
+ * @param {PrintMode} config.printMode - The mode of printing, defining whether to use print, digital, or both.
5163
+ * @return {void} This method does not return any value.
5164
+ */
5165
+ setUp({ country, printMode }) {
5166
+ this.printMode = printMode;
5167
+ if (this.printMode === PrintMode.BOTH || this.printMode === PrintMode.PRINT) {
5168
+ this.checkPrinters(country);
5169
+ }
5170
+ }
5171
+ /**
5172
+ * Resets the printers list and updates the availablePrinters$ observable.
5173
+ * The method clears the current list of printers, emits the updated empty list
5174
+ * through the availablePrinters$ observable, and finalizes the observable stream.
5175
+ *
5176
+ * @return {void} No return value.
5177
+ */
5178
+ setDown() {
5179
+ this.printers = [];
5180
+ this.availablePrinters$.next(this.printers);
5181
+ this.availablePrinters$.complete();
5182
+ }
5183
+ sendToPrinter({ type, content, format }) {
5184
+ const printer = this.printers.find(({ name }) => name === type);
5185
+ if (!printer) {
5186
+ throw new Error(`Printer ${type} not found.`);
5187
+ }
5188
+ return firstValueFrom(this.http.post(`${this.url}/print`, {
5189
+ base64: content,
5190
+ deviceName: printer.name,
5191
+ format,
5192
+ }).pipe(map(({ data }) => data)));
5193
+ }
5194
+ sendToBrowser({ format, content }) {
5195
+ return new Promise((resolve, reject) => {
5196
+ try {
5197
+ if (format === PrintableFormat.ZPL2) {
5198
+ return;
5199
+ }
5200
+ downloadBase64Pdf(content);
5201
+ resolve();
5202
+ }
5203
+ catch (e) {
5204
+ reject(e);
5205
+ }
5206
+ });
5207
+ }
5208
+ checkPrinters(country) {
5209
+ if (country.label_printer_name) {
5210
+ this.printers.push({
5211
+ name: PrintersType.LABEL,
5212
+ configured: false,
5213
+ });
5214
+ }
5215
+ if (country.receipt_printer_name) {
5216
+ this.printers.push({
5217
+ name: PrintersType.RECEIPT,
5218
+ configured: false,
5219
+ });
5220
+ }
5221
+ if (country.others_printer_name) {
5222
+ this.printers.push({
5223
+ name: PrintersType.OTHERS,
5224
+ configured: false,
5225
+ });
5226
+ }
5227
+ this.http.get(`${this.url}/available`)
5228
+ .subscribe({
5229
+ next: ({ printer }) => {
5230
+ this.printers = this.printers.map((item) => {
5231
+ const available = printer.some(({ name }) => name === item.name);
5232
+ return available ? { ...item, configured: true } : item;
5233
+ });
5234
+ this.availablePrinters$.next(this.printers);
5235
+ }
5236
+ });
5237
+ }
5238
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: PrintersService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5239
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: PrintersService, providedIn: 'root' });
5240
+ }
5241
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: PrintersService, decorators: [{
5064
5242
  type: Injectable,
5065
5243
  args: [{
5066
5244
  providedIn: 'root'
@@ -5258,10 +5436,10 @@ class WebSocketsService {
5258
5436
  const waitTime = 3 * 1000;
5259
5437
  return new Promise((resolve) => setTimeout(resolve, waitTime));
5260
5438
  }
5261
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: WebSocketsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5262
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: WebSocketsService, providedIn: 'root' });
5439
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: WebSocketsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5440
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: WebSocketsService, providedIn: 'root' });
5263
5441
  }
5264
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: WebSocketsService, decorators: [{
5442
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: WebSocketsService, decorators: [{
5265
5443
  type: Injectable,
5266
5444
  args: [{
5267
5445
  providedIn: 'root',
@@ -5347,10 +5525,10 @@ class CryptoService {
5347
5525
  }
5348
5526
  return bytes.buffer;
5349
5527
  }
5350
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: CryptoService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5351
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: CryptoService, providedIn: 'root' });
5528
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: CryptoService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5529
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: CryptoService, providedIn: 'root' });
5352
5530
  }
5353
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: CryptoService, decorators: [{
5531
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: CryptoService, decorators: [{
5354
5532
  type: Injectable,
5355
5533
  args: [{
5356
5534
  providedIn: 'root'
@@ -5454,15 +5632,6 @@ function httpCachingInterceptor(req, next) {
5454
5632
  return sharedRequest;
5455
5633
  }
5456
5634
 
5457
- const base64PdfToUrl = (base64) => {
5458
- const data = new Uint8Array(atob(base64)
5459
- .split('')
5460
- .map(char => char.charCodeAt(0)));
5461
- const blob = new Blob([data], { type: 'application/pdf' });
5462
- return window.URL.createObjectURL(blob);
5463
- };
5464
- const downloadBase64Pdf = (base64) => window.open(base64PdfToUrl(base64));
5465
-
5466
5635
  /**
5467
5636
  * Convert an object of key-value pairs into a URL query string.
5468
5637
  *
@@ -5536,5 +5705,5 @@ const xmlHeaders = (format = 'object') => {
5536
5705
  * Generated bundle index. Do not edit.
5537
5706
  */
5538
5707
 
5539
- export { AlphaNumeric, ApiBillingCOService, ApiBillingDOService, ApiBillingGtService, ApiBillingMxService, ApiBillingPaService, ApiBillingSvService, ApiCashOperationsService, ApiCatalogsService, ApiCompaniesService, ApiCompositionService, ApiCustomsService, ApiDiscountsService, ApiEToolsAutoBillingService, ApiEventsService, ApiExternalOperationsService, ApiInventoriesService, ApiInvoicesService, ApiNotificationsService, ApiOpenItemsService, ApiQuoteService, ApiReportsService, ApiSecurityService, ApiServicesService, ApiShipmentsService, ApiSuppliesService, ApiSurveysService, CryptoService, DefaultValueType, DepositTypeCode, DocumentStatusCode, ENVIRONMENT_TOKEN, Event, Group, NgxServicesModule, OpeningStatusCode, OperationModuleStatus, PaymentTypeCode, ShipmentIncomeTypeCode, TransferenceTypeCode, ViewSectionOption, WebSocketsService, apiHeadersInterceptor, apiTokenInterceptor, base64PdfToUrl, downloadBase64Pdf, httpCachingInterceptor, httpParams, pdfHeaders, provideNgxServices, queryString, xmlHeaders };
5708
+ export { AlphaNumeric, ApiBillingCOService, ApiBillingDOService, ApiBillingGtService, ApiBillingMxService, ApiBillingPaService, ApiBillingSvService, ApiCashOperationsService, ApiCatalogsService, ApiCompaniesService, ApiCompositionService, ApiCustomsService, ApiDiscountsService, ApiEToolsAutoBillingService, ApiEventsService, ApiExternalOperationsService, ApiInventoriesService, ApiInvoicesService, ApiNotificationsService, ApiOpenItemsService, ApiQuoteService, ApiReportsService, ApiSecurityService, ApiServicesService, ApiShipmentsService, ApiSuppliesService, ApiSurveysService, CryptoService, DefaultValueType, DepositTypeCode, DocumentStatusCode, ENVIRONMENT_TOKEN, Event, Group, NgxServicesModule, OpeningStatusCode, OperationModuleStatus, PaymentTypeCode, PrintMode, PrintableFormat, PrintersService, PrintersType, ShipmentIncomeTypeCode, TransferenceTypeCode, ViewSectionOption, WebSocketsService, apiHeadersInterceptor, apiTokenInterceptor, base64PdfToUrl, downloadBase64Pdf, httpCachingInterceptor, httpParams, pdfHeaders, provideNgxServices, queryString, xmlHeaders };
5540
5709
  //# sourceMappingURL=experteam-mx-ngx-services.mjs.map