@veloceapps/sdk 10.0.0-36 → 10.0.0-37

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,11 +1,11 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, Injectable, Optional, Inject, NgModule, inject, Directive, Input, LOCALE_ID, Pipe } from '@angular/core';
3
- import { UUID, ConfigurationContextMode, ConfigurationContext, UITemplateType, QuoteDraft, isDefined, ConfigurationProcessorTypes, EntityUtil, ChargeGroupUtils, DEFAULT_CURRENCY_ISO_CODE, DEFAULT_CURRENCY_SYMBOL, validateDateFormat, DEFAULT_DATE_FORMAT, DEFAULT_DECIMALS_COUNT, getSupportedDateFormats, DEFAULT_DECIMAL_SEPARATOR, DEFAULT_THOUSANDS_SEPARATOR, DEFAULT_ACTION_CODE_LABELS, parseJsonSafely, ConfigurationMode, extractErrorDetails, ConfigurationTranslatorUtils, RuntimeModel, isNotLegacyUIDefinition, SalesforceIdUtils, DEFAULT_TIME_FORMAT, formatNumber } from '@veloceapps/core';
4
- import { BehaviorSubject, switchMap, map as map$1, tap as tap$1, noop, catchError, throwError, forkJoin, of, zip, combineLatest, Subject, filter as filter$1, shareReplay as shareReplay$1, finalize, takeUntil, buffer, debounceTime, share, take as take$1, distinctUntilChanged } from 'rxjs';
5
- import { map, filter, tap, switchMap as switchMap$1, skip, take, shareReplay, catchError as catchError$1, finalize as finalize$1, first } from 'rxjs/operators';
3
+ import { UUID, ConfigurationContextMode, DEFAULT_CURRENCY_ISO_CODE, DEFAULT_CURRENCY_SYMBOL, validateDateFormat, DEFAULT_DATE_FORMAT, DEFAULT_DECIMALS_COUNT, getSupportedDateFormats, DEFAULT_DECIMAL_SEPARATOR, DEFAULT_THOUSANDS_SEPARATOR, DEFAULT_ACTION_CODE_LABELS, parseJsonSafely, ConfigurationContext, UITemplateType, QuoteDraft, isDefined, ConfigurationProcessorTypes, EntityUtil, ChargeGroupUtils, ConfigurationMode, extractErrorDetails, ConfigurationTranslatorUtils, RuntimeModel, isNotLegacyUIDefinition, SalesforceIdUtils, DEFAULT_TIME_FORMAT, formatNumber } from '@veloceapps/core';
4
+ import { BehaviorSubject, map, tap, of, noop, catchError, throwError, forkJoin, zip, combineLatest, Subject, filter as filter$1, switchMap as switchMap$1, shareReplay as shareReplay$1, finalize, takeUntil, buffer, debounceTime, share, take as take$1, distinctUntilChanged } from 'rxjs';
5
+ import { map as map$1, filter, tap as tap$1, switchMap, skip, take, shareReplay, catchError as catchError$1, finalize as finalize$1, first } from 'rxjs/operators';
6
6
  import * as i1 from '@veloceapps/api';
7
7
  import { ApiModule } from '@veloceapps/api';
8
- import { merge, isEqual, cloneDeep, assign, flatten, entries, sortBy, map as map$2, omit, uniqBy, transform } from 'lodash';
8
+ import { uniqBy, merge, isEqual, cloneDeep, assign, flatten, entries, sortBy, map as map$2, omit, transform } from 'lodash';
9
9
  import * as i6 from '@veloceapps/components';
10
10
  import { ToastType, ConfirmationComponent, ConfirmationDialogModule } from '@veloceapps/components';
11
11
  import moment from 'moment';
@@ -92,22 +92,130 @@ var RuntimeStep;
92
92
 
93
93
  const UI_DEFINITION_VERSION = 3;
94
94
 
95
+ class RuntimeSettingsService {
96
+ constructor(configurationSettingsApiService) {
97
+ this.configurationSettingsApiService = configurationSettingsApiService;
98
+ this.configurationSettings$ = new BehaviorSubject({});
99
+ this.currencySettings$ = new BehaviorSubject({
100
+ iso: DEFAULT_CURRENCY_ISO_CODE,
101
+ symbol: DEFAULT_CURRENCY_SYMBOL,
102
+ });
103
+ this.shoppingCartSettings$ = new BehaviorSubject([]);
104
+ this.getCurrencySymbol = (locale, currency) => {
105
+ return (0)
106
+ .toLocaleString(locale, { style: 'currency', currency, minimumFractionDigits: 0, maximumFractionDigits: 0 })
107
+ .replace(/\d/g, '')
108
+ .trim();
109
+ };
110
+ }
111
+ create() {
112
+ return this.configurationSettingsApiService.fetchSettings().pipe(map(settings => this.parseConfigurationSettings(settings)), tap(configurationSettings => {
113
+ var _a;
114
+ this.configurationSettings$.next(configurationSettings);
115
+ this.addShoppingCartSettings((_a = configurationSettings['shopping-cart']) !== null && _a !== void 0 ? _a : []);
116
+ this.formattingSettings = this.getFormattingSettings();
117
+ }), map(() => undefined));
118
+ }
119
+ initCurrency(iso) {
120
+ if (iso) {
121
+ const symbol = this.getCurrencySymbol('en-US', iso);
122
+ this.currencySettings$.next({ iso, symbol });
123
+ if (this.formattingSettings) {
124
+ this.formattingSettings.currencySymbol = symbol;
125
+ }
126
+ }
127
+ }
128
+ getFormattingSettings() {
129
+ var _a, _b;
130
+ if (this.formattingSettings) {
131
+ return this.formattingSettings;
132
+ }
133
+ const shoppingCartSettings = (_a = this.configurationSettings['shopping-cart']) === null || _a === void 0 ? void 0 : _a.reduce((acc, setting) => {
134
+ return Object.assign(Object.assign({}, acc), { [setting.id]: setting.properties });
135
+ }, {});
136
+ const currencySettings = this.getCurrencySettings();
137
+ const dateFormat = (validateDateFormat((_b = shoppingCartSettings === null || shoppingCartSettings === void 0 ? void 0 : shoppingCartSettings.DATE_FORMAT) !== null && _b !== void 0 ? _b : '') && (shoppingCartSettings === null || shoppingCartSettings === void 0 ? void 0 : shoppingCartSettings.DATE_FORMAT)) ||
138
+ DEFAULT_DATE_FORMAT;
139
+ const decimalSeparator = shoppingCartSettings === null || shoppingCartSettings === void 0 ? void 0 : shoppingCartSettings.DECIMAL_SEPARATOR;
140
+ const thousandsSeparator = shoppingCartSettings === null || shoppingCartSettings === void 0 ? void 0 : shoppingCartSettings.THOUSANDS_SEPARATOR;
141
+ // the number of decimal places can be 0
142
+ const priceScale = shoppingCartSettings === null || shoppingCartSettings === void 0 ? void 0 : shoppingCartSettings.PRICE_SCALE;
143
+ const decimalsCount = priceScale !== null && priceScale !== '' && !isNaN(Number(priceScale)) && Number(priceScale) >= 0
144
+ ? Number(priceScale)
145
+ : DEFAULT_DECIMALS_COUNT;
146
+ const actionCodeSettings = shoppingCartSettings === null || shoppingCartSettings === void 0 ? void 0 : shoppingCartSettings.STATUS_LABEL;
147
+ return {
148
+ currencySymbol: currencySettings.symbol,
149
+ dateFormats: getSupportedDateFormats(dateFormat),
150
+ decimalsCount,
151
+ decimalSeparator: decimalSeparator !== undefined && ['.', ','].includes(decimalSeparator)
152
+ ? decimalSeparator
153
+ : DEFAULT_DECIMAL_SEPARATOR,
154
+ // thousands separator can be a blank value, so it can also be null
155
+ thousandsSeparator: thousandsSeparator !== undefined && ['.', ',', '', null].includes(thousandsSeparator)
156
+ ? thousandsSeparator || ''
157
+ : DEFAULT_THOUSANDS_SEPARATOR,
158
+ actionCodeLabels: (actionCodeSettings === null || actionCodeSettings === void 0 ? void 0 : actionCodeSettings.length)
159
+ ? actionCodeSettings.reduce((result, setting) => (Object.assign(Object.assign({}, result), { [setting.status_label]: setting.custom_label })), {})
160
+ : DEFAULT_ACTION_CODE_LABELS,
161
+ };
162
+ }
163
+ get configurationSettings() {
164
+ return this.configurationSettings$.value;
165
+ }
166
+ getShoppingCartSettings() {
167
+ return this.shoppingCartSettings$.value;
168
+ }
169
+ getCurrencySettings() {
170
+ return this.currencySettings$.value;
171
+ }
172
+ parseConfigurationSettings(settings) {
173
+ return settings.reduce((acc, setting) => {
174
+ switch (setting.key) {
175
+ case 'shopping-cart':
176
+ acc['shopping-cart'] = parseJsonSafely(setting.value, []);
177
+ break;
178
+ case 'navigation':
179
+ acc.navigation = parseJsonSafely(setting.value, {});
180
+ break;
181
+ case 'flows':
182
+ acc.flows = parseJsonSafely(setting.value, []);
183
+ break;
184
+ default:
185
+ acc[setting.key] = setting.value;
186
+ }
187
+ return acc;
188
+ }, {});
189
+ }
190
+ addShoppingCartSettings(settings) {
191
+ // uniqBy removes items with the biggest index
192
+ const newSettings = uniqBy([...settings, ...this.shoppingCartSettings$.value], 'id');
193
+ this.shoppingCartSettings$.next(newSettings);
194
+ }
195
+ }
196
+ RuntimeSettingsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeSettingsService, deps: [{ token: i1.ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
197
+ RuntimeSettingsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeSettingsService });
198
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeSettingsService, decorators: [{
199
+ type: Injectable
200
+ }], ctorParameters: function () { return [{ type: i1.ConfigurationSettingsApiService }]; } });
201
+
95
202
  class ContextService {
96
- constructor(contextApiService) {
203
+ constructor(contextApiService, runtimeSettingsService) {
97
204
  this.contextApiService = contextApiService;
205
+ this.runtimeSettingsService = runtimeSettingsService;
98
206
  this.context = new BehaviorSubject(null);
99
207
  }
100
208
  get isInitialized() {
101
209
  return Boolean(this.context.value);
102
210
  }
103
211
  get isInitialized$() {
104
- return this.context.pipe(map(Boolean));
212
+ return this.context.pipe(map$1(Boolean));
105
213
  }
106
214
  get mode() {
107
215
  return this.resolve().properties['#mode'];
108
216
  }
109
217
  get isEditMode$() {
110
- return this.resolve$().pipe(map(() => this.isEditMode));
218
+ return this.resolve$().pipe(map$1(() => this.isEditMode));
111
219
  }
112
220
  get isEditMode() {
113
221
  const context = this.resolve();
@@ -129,10 +237,16 @@ class ContextService {
129
237
  return this.context.pipe(filter((ctx) => Boolean(ctx)));
130
238
  }
131
239
  create(headerId, mode) {
132
- return this.contextApiService.getContext(headerId, mode).pipe(tap(context => this.context.next(merge(new ConfigurationContext(headerId, mode), context))), map(() => this.resolve()));
240
+ const configurationSettings = this.runtimeSettingsService.configurationSettings;
241
+ const skipContextRequest = configurationSettings['SKIP_CONTEXT_REQUEST'] === 'true';
242
+ let contextRequest$ = this.contextApiService.getContext(headerId, mode);
243
+ if (skipContextRequest) {
244
+ contextRequest$ = of({});
245
+ }
246
+ return contextRequest$.pipe(tap$1(context => this.context.next(merge(new ConfigurationContext(headerId, mode), context))), map$1(() => this.resolve()));
133
247
  }
134
248
  initTestMode() {
135
- return this.create('TestId', ConfigurationContextMode.TEST).pipe(map(context => {
249
+ return this.create('TestId', ConfigurationContextMode.TEST).pipe(map$1(context => {
136
250
  return this.update({
137
251
  properties: Object.assign(Object.assign({}, context.properties), { RuntimeMode: ConfigurationContextMode.TEST, StartDate: new Date().toISOString().substring(0, 10), standalone: 'true' }),
138
252
  });
@@ -154,11 +268,11 @@ class ContextService {
154
268
  this.context.next(null);
155
269
  }
156
270
  }
157
- ContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextService, deps: [{ token: i1.ContextApiService }], target: i0.ɵɵFactoryTarget.Injectable });
271
+ ContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextService, deps: [{ token: i1.ContextApiService }, { token: RuntimeSettingsService }], target: i0.ɵɵFactoryTarget.Injectable });
158
272
  ContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextService });
159
273
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextService, decorators: [{
160
274
  type: Injectable
161
- }], ctorParameters: function () { return [{ type: i1.ContextApiService }]; } });
275
+ }], ctorParameters: function () { return [{ type: i1.ContextApiService }, { type: RuntimeSettingsService }]; } });
162
276
 
163
277
  class FlowInfoService {
164
278
  get flow() {
@@ -175,9 +289,10 @@ class FlowInfoService {
175
289
  var _a;
176
290
  return !!((_a = this.flow) === null || _a === void 0 ? void 0 : _a.properties.stateful);
177
291
  }
178
- constructor(flowsApiService, templatesApiService, customizationService) {
292
+ constructor(flowsApiService, templatesApiService, runtimeSettingsService, customizationService) {
179
293
  this.flowsApiService = flowsApiService;
180
294
  this.templatesApiService = templatesApiService;
295
+ this.runtimeSettingsService = runtimeSettingsService;
181
296
  this.customizationService = customizationService;
182
297
  this.templates = {};
183
298
  this.defaultTemplates = {
@@ -187,10 +302,19 @@ class FlowInfoService {
187
302
  this.flow$ = this.flowSubj$.asObservable();
188
303
  }
189
304
  init$(flowId, routeQueryParams) {
190
- return this.flowsApiService.getFlow(flowId).pipe(switchMap(flow => this.initFlowTemplates$(flow).pipe(map$1(() => flow))), tap$1(flow => {
305
+ const flows = this.runtimeSettingsService.configurationSettings['flows'];
306
+ const flow = flows === null || flows === void 0 ? void 0 : flows.find(({ id }) => id === flowId);
307
+ if (!flow) {
308
+ return of(undefined);
309
+ }
310
+ let flowTemplates$ = of(undefined);
311
+ if (!this.isLegacy) {
312
+ flowTemplates$ = this.initFlowTemplates$(flow).pipe(map(() => undefined));
313
+ }
314
+ return flowTemplates$.pipe(tap(() => {
191
315
  this.params = Object.assign(Object.assign({}, routeQueryParams), flow.properties.queryParams);
192
316
  this.flowSubj$.next(flow);
193
- }), map$1(noop), catchError(e => {
317
+ }), map(noop), catchError(e => {
194
318
  this.flowSubj$.next(null);
195
319
  return throwError(() => e);
196
320
  }));
@@ -205,7 +329,7 @@ class FlowInfoService {
205
329
  return forkJoin([
206
330
  this.templatesApiService.fetchTemplates$(),
207
331
  (_c = (_b = (_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplates) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : of([]),
208
- ]).pipe(map$1(([templates, localTemplates]) => {
332
+ ]).pipe(map(([templates, localTemplates]) => {
209
333
  Object.entries(Object.assign(Object.assign({}, this.defaultTemplates), flow.properties.templates)).forEach(([key, name]) => {
210
334
  var _a;
211
335
  const type = this.remapTemplateName(key);
@@ -242,12 +366,12 @@ class FlowInfoService {
242
366
  return undefined;
243
367
  }
244
368
  }
245
- FlowInfoService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowInfoService, deps: [{ token: i1.FlowsApiService }, { token: i1.UITemplatesApiService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
369
+ FlowInfoService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowInfoService, deps: [{ token: i1.FlowsApiService }, { token: i1.UITemplatesApiService }, { token: RuntimeSettingsService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
246
370
  FlowInfoService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowInfoService });
247
371
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowInfoService, decorators: [{
248
372
  type: Injectable
249
373
  }], ctorParameters: function () {
250
- return [{ type: i1.FlowsApiService }, { type: i1.UITemplatesApiService }, { type: undefined, decorators: [{
374
+ return [{ type: i1.FlowsApiService }, { type: i1.UITemplatesApiService }, { type: RuntimeSettingsService }, { type: undefined, decorators: [{
251
375
  type: Optional
252
376
  }, {
253
377
  type: Inject,
@@ -278,14 +402,14 @@ class QuoteDraftService {
278
402
  }
279
403
  }
280
404
  get hasProducts$() {
281
- return this.quoteSubj$.pipe(map(() => this.hasProducts));
405
+ return this.quoteSubj$.pipe(map$1(() => this.hasProducts));
282
406
  }
283
407
  get hasProducts() {
284
408
  var _a;
285
409
  return Boolean((_a = this.quoteSubj$.value) === null || _a === void 0 ? void 0 : _a.currentState.length);
286
410
  }
287
411
  get hasAssets$() {
288
- return this.assetsSubj$.pipe(map(() => this.hasAssets));
412
+ return this.assetsSubj$.pipe(map$1(() => this.hasAssets));
289
413
  }
290
414
  get hasAssets() {
291
415
  var _a;
@@ -294,11 +418,12 @@ class QuoteDraftService {
294
418
  get assetsState() {
295
419
  return this.assetsSubj$.value;
296
420
  }
297
- constructor(context, flowInfoService, accountApiService, quoteApiService) {
421
+ constructor(context, flowInfoService, accountApiService, quoteApiService, runtimeSettingsService) {
298
422
  this.context = context;
299
423
  this.flowInfoService = flowInfoService;
300
424
  this.accountApiService = accountApiService;
301
425
  this.quoteApiService = quoteApiService;
426
+ this.runtimeSettingsService = runtimeSettingsService;
302
427
  this.quoteSubj$ = new BehaviorSubject(null);
303
428
  this.assetsSubj$ = new BehaviorSubject(null);
304
429
  this.resetSubj$ = new BehaviorSubject(true);
@@ -307,7 +432,7 @@ class QuoteDraftService {
307
432
  this._hasUnsavedChanges = false;
308
433
  this.reset$ = this.resetSubj$.asObservable();
309
434
  this.isInitializedSubj$
310
- .pipe(filter(isInitialized => isInitialized), switchMap$1(() => this.quoteSubj$.asObservable()), skip(1), tap(quote => this.markAsUpdated(quote)))
435
+ .pipe(filter(isInitialized => isInitialized), switchMap(() => this.quoteSubj$.asObservable()), skip(1), tap$1(quote => this.markAsUpdated(quote)))
311
436
  .subscribe();
312
437
  }
313
438
  reset() {
@@ -318,23 +443,33 @@ class QuoteDraftService {
318
443
  this.hasUnsavedChanges = false;
319
444
  }
320
445
  init(headerId, params) {
446
+ var _a;
321
447
  const ctx = this.context.resolve();
322
448
  const isAccountMode = this.context.mode === ConfigurationContextMode.ACCOUNT;
323
- const accountId = isAccountMode ? headerId : ctx.properties.AccountId;
324
- return zip(accountId ? this.accountApiService.getAssetsState(accountId, params) : of(null), isAccountMode
449
+ const accountId = isAccountMode ? headerId : (_a = ctx.properties) === null || _a === void 0 ? void 0 : _a.AccountId;
450
+ const configurationSettings = this.runtimeSettingsService.configurationSettings;
451
+ const skipAssetsQuery = configurationSettings['SKIP_ASSETS_QUERY'] === 'true';
452
+ let assetRequest$ = of(null);
453
+ if (accountId && !skipAssetsQuery) {
454
+ assetRequest$ = this.accountApiService.getAssetsState(accountId, params);
455
+ }
456
+ return zip(assetRequest$, isAccountMode
325
457
  ? of(QuoteDraft.emptyQuote(ConfigurationContextMode.ACCOUNT))
326
- : this.quoteApiService.getQuoteState(headerId, params)).pipe(tap(([assets, quote]) => {
458
+ : this.quoteApiService.getQuoteState(headerId, params)).pipe(tap$1(([assets, quote]) => {
327
459
  if (assets) {
328
460
  this.assetsSubj$.next(assets);
329
461
  }
462
+ let context;
330
463
  this.quoteSubj$.next(quote);
331
464
  if (assets && isAccountMode) {
332
- this.context.update(assets.context);
465
+ context = assets.context;
333
466
  }
334
467
  else {
335
- this.context.update(quote.context);
468
+ context = quote.context;
336
469
  }
337
- }), map(() => noop()), take(1));
470
+ this.context.update(context);
471
+ this.runtimeSettingsService.initCurrency(context.properties['CurrencyIsoCode']);
472
+ }), map$1(() => noop()), take(1));
338
473
  }
339
474
  finalizeInit() {
340
475
  this.isInitialized = true;
@@ -372,7 +507,7 @@ class QuoteDraftService {
372
507
  this.assetsSubj$.next(assetsState);
373
508
  }
374
509
  get quoteDraft$() {
375
- return combineLatest([this.quoteSubj$, this.context.resolve$()]).pipe(map(() => this.quoteDraft), filter((quote) => Boolean(quote)), shareReplay());
510
+ return combineLatest([this.quoteSubj$, this.context.resolve$()]).pipe(map$1(() => this.quoteDraft), filter((quote) => Boolean(quote)), shareReplay());
376
511
  }
377
512
  get quoteDraft() {
378
513
  const quote = this.quoteSubj$.value;
@@ -382,7 +517,7 @@ class QuoteDraftService {
382
517
  return Object.assign(Object.assign({}, quote), { context: this.context.resolve() });
383
518
  }
384
519
  get currentState$() {
385
- return this.quoteDraft$.pipe(map(quote => quote.currentState));
520
+ return this.quoteDraft$.pipe(map$1(quote => quote.currentState));
386
521
  }
387
522
  get currentState() {
388
523
  var _a, _b;
@@ -393,13 +528,13 @@ class QuoteDraftService {
393
528
  return (_b = (_a = this.flowInfoService.flow) === null || _a === void 0 ? void 0 : _a.properties.standalone) !== null && _b !== void 0 ? _b : false;
394
529
  }
395
530
  get isStandalone$() {
396
- return this.flowInfoService.flow$.pipe(map(() => this.isStandalone));
531
+ return this.flowInfoService.flow$.pipe(map$1(() => this.isStandalone));
397
532
  }
398
533
  getInitialCurrentState() {
399
534
  return this.initialCurrentState;
400
535
  }
401
536
  isEditMode$() {
402
- return this.context.resolve$().pipe(map(() => this.isEditMode()));
537
+ return this.context.resolve$().pipe(map$1(() => this.isEditMode()));
403
538
  }
404
539
  isEditMode() {
405
540
  const context = this.context.resolve();
@@ -420,11 +555,11 @@ class QuoteDraftService {
420
555
  }
421
556
  }
422
557
  }
423
- QuoteDraftService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteDraftService, deps: [{ token: ContextService }, { token: FlowInfoService }, { token: i1.AccountApiService }, { token: i1.QuoteApiService }], target: i0.ɵɵFactoryTarget.Injectable });
558
+ QuoteDraftService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteDraftService, deps: [{ token: ContextService }, { token: FlowInfoService }, { token: i1.AccountApiService }, { token: i1.QuoteApiService }, { token: RuntimeSettingsService }], target: i0.ɵɵFactoryTarget.Injectable });
424
559
  QuoteDraftService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteDraftService });
425
560
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteDraftService, decorators: [{
426
561
  type: Injectable
427
- }], ctorParameters: function () { return [{ type: ContextService }, { type: FlowInfoService }, { type: i1.AccountApiService }, { type: i1.QuoteApiService }]; } });
562
+ }], ctorParameters: function () { return [{ type: ContextService }, { type: FlowInfoService }, { type: i1.AccountApiService }, { type: i1.QuoteApiService }, { type: RuntimeSettingsService }]; } });
428
563
 
429
564
  class FlowStateService {
430
565
  constructor(contextService, quoteDraftService, flowInfoService, flowConfiguration, processorsApiService, flowStateApiService, quoteApiService, toastService, customizationService) {
@@ -455,55 +590,59 @@ class FlowStateService {
455
590
  all subscriptions get their updates according to updated QuoteDraft
456
591
  */
457
592
  this.isInitialized$()
458
- .pipe(filter$1(Boolean), filter$1(() => !this.getFlowSafe().properties.stateful), switchMap(() => this.flowConfiguration.updated$), switchMap(() => this.executeRequest$({}, true)))
593
+ .pipe(filter$1(Boolean), filter$1(() => !this.getFlowSafe().properties.stateful), switchMap$1(() => this.flowConfiguration.updated$), switchMap$1(() => this.executeRequest$({}, true)))
459
594
  .subscribe();
460
- this.charges$ = this.flowInfoService.flow$.pipe(filter$1(isDefined), switchMap(() => {
595
+ this.charges$ = this.flowInfoService.flow$.pipe(filter$1(isDefined), switchMap$1(() => {
461
596
  if (this.flowInfoService.isLegacy) {
462
- return this.quoteDraftService.quoteDraft$.pipe(map$1(quoteDraft => quoteDraft.charges));
597
+ return this.quoteDraftService.quoteDraft$.pipe(map(quoteDraft => quoteDraft.charges));
463
598
  }
464
599
  else {
465
600
  return this.subscribe$(UITemplateType.FLOW_ENGINE, 'CHARGES', null, {
466
601
  cold: true,
467
- }).pipe(map$1(response => (response.success ? response.result : {})));
602
+ }).pipe(map(response => (response.success ? response.result : {})));
468
603
  }
469
604
  }), shareReplay$1(1));
470
605
  this.charges$.subscribe();
471
- this.pricePlans$ = this.flowInfoService.flow$.pipe(filter$1(isDefined), switchMap(() => {
606
+ this.pricePlans$ = this.flowInfoService.flow$.pipe(filter$1(isDefined), switchMap$1(() => {
472
607
  if (this.flowInfoService.isLegacy) {
473
- return this.quoteDraftService.quoteDraft$.pipe(map$1(quoteDraft => quoteDraft.pricePlans));
608
+ return this.quoteDraftService.quoteDraft$.pipe(map(quoteDraft => quoteDraft.pricePlans));
474
609
  }
475
610
  else {
476
611
  return this.subscribe$(UITemplateType.FLOW_ENGINE, 'PRICE_PLANS', null, {
477
612
  cold: true,
478
- }).pipe(map$1(response => (response.success ? response.result : {})));
613
+ }).pipe(map(response => (response.success ? response.result : {})));
479
614
  }
480
615
  }), shareReplay$1(1));
481
616
  this.pricePlans$.subscribe();
482
- this.activeMetrics$ = this.flowInfoService.flow$.pipe(filter$1(isDefined), switchMap(() => {
617
+ this.activeMetrics$ = this.flowInfoService.flow$.pipe(filter$1(isDefined), switchMap$1(() => {
483
618
  if (this.flowInfoService.isLegacy) {
484
- return this.quoteDraftService.quoteDraft$.pipe(map$1(quoteDraft => quoteDraft.activeMetrics));
619
+ return this.quoteDraftService.quoteDraft$.pipe(map(quoteDraft => quoteDraft.activeMetrics));
485
620
  }
486
621
  else {
487
622
  return this.subscribe$(UITemplateType.FLOW_ENGINE, 'ACTIVE_METRICS', null, {
488
623
  cold: true,
489
- }).pipe(map$1(response => (response.success ? response.result : [])));
624
+ }).pipe(map(response => (response.success ? response.result : [])));
490
625
  }
491
626
  }), shareReplay$1(1));
492
627
  this.activeMetrics$.subscribe();
493
- this.isPriceListLocked$ = this.flowInfoService.flow$.pipe(filter$1(isDefined), switchMap(() => {
628
+ this.isPriceListLocked$ = this.flowInfoService.flow$.pipe(filter$1(isDefined), switchMap$1(() => {
494
629
  if (this.flowInfoService.isLegacy) {
495
630
  return of(false);
496
631
  }
497
632
  else {
498
633
  return this.subscribe$(UITemplateType.FLOW_ENGINE, 'IS_PRICE_LIST_LOCKED', null, {
499
634
  cold: true,
500
- }).pipe(map$1(response => (response.success ? response.result : false)));
635
+ }).pipe(map(response => (response.success ? response.result : false)));
501
636
  }
502
637
  }), shareReplay$1(1));
503
638
  this.isPriceListLocked$.subscribe();
504
639
  }
505
640
  init$() {
506
- return this.initProcessors$().pipe(switchMap(() => {
641
+ let processors$ = this.initProcessors$();
642
+ if (this.flowInfoService.isLegacy) {
643
+ processors$ = of(undefined);
644
+ }
645
+ return processors$.pipe(switchMap$1(() => {
507
646
  if (this.getFlowSafe().properties.stateful) {
508
647
  return this.initStateful$();
509
648
  }
@@ -535,14 +674,14 @@ class FlowStateService {
535
674
  return this.executionInProgress$.asObservable();
536
675
  }
537
676
  isInitialized$() {
538
- return combineLatest([this.stateId$, this.quoteDraftService.isInitialized$]).pipe(map$1(values => values.some(Boolean)));
677
+ return combineLatest([this.stateId$, this.quoteDraftService.isInitialized$]).pipe(map(values => values.some(Boolean)));
539
678
  }
540
679
  isInitialized() {
541
680
  return Boolean(this.stateId$.value) || this.quoteDraftService.isInitialized;
542
681
  }
543
682
  execute$(scope, exec) {
544
683
  const request = this.execToRequest(scope, exec);
545
- return this.executeRequest$(request).pipe(map$1(result => {
684
+ return this.executeRequest$(request).pipe(map(result => {
546
685
  // Keep only requested results
547
686
  const actualSelectors = Object.entries(result.selectors).reduce((trunk, [requestId, result]) => {
548
687
  var _a;
@@ -555,11 +694,14 @@ class FlowStateService {
555
694
  }));
556
695
  }
557
696
  dispatch$(scope, action, inputData) {
697
+ if (this.flowInfoService.isLegacy) {
698
+ return of(undefined);
699
+ }
558
700
  const exec = {
559
701
  actions: [{ name: action, inputData }],
560
702
  };
561
703
  const request = this.execToRequest(scope, exec);
562
- return this.executeRequest$(request).pipe(map$1(noop));
704
+ return this.executeRequest$(request).pipe(map(noop));
563
705
  }
564
706
  select$(scope, selectorName, inputData) {
565
707
  const requestId = this.generateRequestId(scope, selectorName, inputData);
@@ -571,9 +713,15 @@ class FlowStateService {
571
713
  },
572
714
  },
573
715
  });
574
- return this.executeRequest$(request).pipe(map$1(response => response.selectors[requestId]));
716
+ return this.executeRequest$(request).pipe(map(response => response.selectors[requestId]));
575
717
  }
576
718
  subscribe$(scope, selectorName, inputData, options) {
719
+ if (this.flowInfoService.isLegacy) {
720
+ return of({
721
+ success: false,
722
+ errorMessage: '',
723
+ });
724
+ }
577
725
  const requestId = this.generateRequestId(scope, selectorName, inputData);
578
726
  let subscription = this.subscriptions[requestId];
579
727
  if (!subscription) {
@@ -597,7 +745,7 @@ class FlowStateService {
597
745
  this.executeRequest$(request).subscribe();
598
746
  }
599
747
  }
600
- return subscription.data$.pipe(filter$1(data => data != this.NOT_INITIALIZED), map$1(data => data), finalize(() => {
748
+ return subscription.data$.pipe(filter$1(data => data != this.NOT_INITIALIZED), map(data => data), finalize(() => {
601
749
  var _a;
602
750
  if (!((_a = this.subscriptions[requestId]) === null || _a === void 0 ? void 0 : _a.data$.observed)) {
603
751
  delete this.subscriptions[requestId];
@@ -607,7 +755,7 @@ class FlowStateService {
607
755
  save$() {
608
756
  if (this.getFlowSafe().properties.stateful) {
609
757
  if (this.stateId$.value) {
610
- return this.flowStateApiService.save(this.stateId$.value).pipe(tap$1(() => {
758
+ return this.flowStateApiService.save(this.stateId$.value).pipe(tap(() => {
611
759
  Array.from(this.trackedStatefulChangesMap.keys()).forEach(key => {
612
760
  this.trackedStatefulChangesMap.set(key, false);
613
761
  });
@@ -617,7 +765,7 @@ class FlowStateService {
617
765
  else {
618
766
  const quoteDraft = this.quoteDraftService.quoteDraft;
619
767
  if (quoteDraft) {
620
- return this.quoteApiService.upsertQuote(quoteDraft).pipe(tap$1(({ versionId }) => {
768
+ return this.quoteApiService.upsertQuote(quoteDraft).pipe(tap(({ versionId }) => {
621
769
  this.contextService.update({ properties: { VELOCPQ__VersionId__c: versionId } });
622
770
  }));
623
771
  }
@@ -633,7 +781,7 @@ class FlowStateService {
633
781
  else {
634
782
  const quoteDraft = this.quoteDraftService.quoteDraft;
635
783
  if (quoteDraft) {
636
- return this.quoteApiService.submitQuote(quoteDraft).pipe(tap$1(({ versionId }) => {
784
+ return this.quoteApiService.submitQuote(quoteDraft).pipe(tap(({ versionId }) => {
637
785
  this.contextService.update({ properties: { VELOCPQ__VersionId__c: versionId } });
638
786
  }));
639
787
  }
@@ -682,7 +830,7 @@ class FlowStateService {
682
830
  const execution$ = this.getFlowSafe().properties.stateful
683
831
  ? this.executeStateful$(fullRequest)
684
832
  : this.executeStateless$(fullRequest);
685
- return execution$.pipe(tap$1(result => this.handleSelectorsResponse(result.selectors)));
833
+ return execution$.pipe(tap(result => this.handleSelectorsResponse(result.selectors)));
686
834
  }
687
835
  handleSelectorsResponse(selectors) {
688
836
  Object.entries(selectors).forEach(([requestId, selectorResult]) => {
@@ -701,7 +849,7 @@ class FlowStateService {
701
849
  var _a;
702
850
  // Subscriptions
703
851
  this.subscribe$(UITemplateType.FLOW_ENGINE, 'CONTEXT', null, { cold: true })
704
- .pipe(tap$1(response => {
852
+ .pipe(tap(response => {
705
853
  if (response.success) {
706
854
  this.contextService.update(response.result);
707
855
  }
@@ -723,13 +871,13 @@ class FlowStateService {
723
871
  selectors: Object.assign(Object.assign({}, selectors), request.selectors),
724
872
  actions: request.actions,
725
873
  })
726
- .pipe(map$1(({ stateId, selectors }) => {
874
+ .pipe(map(({ stateId, selectors }) => {
727
875
  this.handleSelectorsResponse(selectors);
728
876
  this.stateId$.next(stateId);
729
877
  }));
730
878
  }
731
879
  initBufferedRequest$() {
732
- return this.statefulRequestStream$.pipe(buffer(this.statefulRequestStream$.pipe(debounceTime(this.EXECUTION_BUFFER_TIME))), switchMap(requests => {
880
+ return this.statefulRequestStream$.pipe(buffer(this.statefulRequestStream$.pipe(debounceTime(this.EXECUTION_BUFFER_TIME))), switchMap$1(requests => {
733
881
  if (!this.stateId$.value) {
734
882
  throw 'Stateful session is not initialized';
735
883
  }
@@ -743,33 +891,33 @@ class FlowStateService {
743
891
  };
744
892
  this.executionInProgress$.next(true);
745
893
  return this.flowStateApiService.execute(this.stateId$.value, request);
746
- }), tap$1(({ stateId }) => this.stateId$.next(stateId)), share(), tap$1(() => this.executionInProgress$.next(false)), catchError(e => {
894
+ }), tap(({ stateId }) => this.stateId$.next(stateId)), share(), tap(() => this.executionInProgress$.next(false)), catchError(e => {
747
895
  this.executionInProgress$.next(false);
748
896
  return throwError(() => e);
749
897
  }));
750
898
  }
751
899
  executeStateful$(request) {
752
- return this.executionInProgress$.pipe(filter$1(inProgress => !inProgress), take$1(1), switchMap(() =>
900
+ return this.executionInProgress$.pipe(filter$1(inProgress => !inProgress), take$1(1), switchMap$1(() =>
753
901
  // make sure stream switches to statefulExecutionRequest$ before pushing an execution request
754
902
  combineLatest([
755
903
  this.statefulExecutionRequest$,
756
- of(undefined).pipe(tap$1(() => this.statefulRequestStream$.next(request))),
757
- ])), map$1(([response]) => response), take$1(1));
904
+ of(undefined).pipe(tap(() => this.statefulRequestStream$.next(request))),
905
+ ])), map(([response]) => response), take$1(1));
758
906
  }
759
907
  initStateless$() {
760
908
  var _a;
761
909
  const { headerId } = this.contextService.resolve();
762
- return this.quoteDraftService.init(headerId, (_a = this.flowInfoService.params) !== null && _a !== void 0 ? _a : {}).pipe(tap$1(() => {
910
+ return this.quoteDraftService.init(headerId, (_a = this.flowInfoService.params) !== null && _a !== void 0 ? _a : {}).pipe(tap(() => {
763
911
  const assets = this.quoteDraftService.assetsState;
764
912
  if (assets) {
765
913
  this.flowStore = Object.assign(Object.assign({}, this.flowStore), { assets });
766
914
  }
767
- }), switchMap(() => {
915
+ }), switchMap$1(() => {
768
916
  if (this.flowInfoService.isLegacy) {
769
917
  return of(null);
770
918
  }
771
919
  return this.executeRequest$(this.getDefaultExecutionRequestDTO());
772
- }), switchMap(() => this.calculate$()), tap$1(() => this.quoteDraftService.finalizeInit()), map$1(noop));
920
+ }), switchMap$1(() => this.calculate$()), tap(() => this.quoteDraftService.finalizeInit()), map(noop));
773
921
  }
774
922
  calculate$() {
775
923
  var _a;
@@ -793,7 +941,7 @@ class FlowStateService {
793
941
  }
794
942
  executeStateless$(request) {
795
943
  this.executionInProgress$.next(true);
796
- return of(undefined).pipe(tap$1(() => this.executeStatelessActions(request)), switchMap(() => {
944
+ return of(undefined).pipe(tap(() => this.executeStatelessActions(request)), switchMap$1(() => {
797
945
  var _a;
798
946
  /*
799
947
  Skip price calculation in case
@@ -806,7 +954,7 @@ class FlowStateService {
806
954
  else {
807
955
  return this.calculate$();
808
956
  }
809
- }), map$1(() => this.executeStatelessSelectors(request)), tap$1(() => this.executionInProgress$.next(false)), catchError(e => {
957
+ }), map(() => this.executeStatelessSelectors(request)), tap(() => this.executionInProgress$.next(false)), catchError(e => {
810
958
  this.executionInProgress$.next(false);
811
959
  return throwError(() => e);
812
960
  }));
@@ -874,7 +1022,7 @@ class FlowStateService {
874
1022
  return;
875
1023
  }
876
1024
  const localProcessors$ = (_c = (_b = (_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplateConfigurationProcessors) === null || _b === void 0 ? void 0 : _b.call(_a, template.name)) !== null && _c !== void 0 ? _c : of(null);
877
- return localProcessors$.pipe(switchMap(processors => processors ? of(processors) : this.processorsApiService.fetchConfigurationProcessors$(template.id)), tap$1(processors => {
1025
+ return localProcessors$.pipe(switchMap$1(processors => processors ? of(processors) : this.processorsApiService.fetchConfigurationProcessors$(template.id)), tap(processors => {
878
1026
  const processorsMap = processors.reduce((acc, p) => {
879
1027
  acc[p.apiName] = p;
880
1028
  return acc;
@@ -886,7 +1034,7 @@ class FlowStateService {
886
1034
  if (!owners$.length) {
887
1035
  return of(undefined);
888
1036
  }
889
- return forkJoin(owners$).pipe(map$1(noop));
1037
+ return forkJoin(owners$).pipe(map(noop));
890
1038
  }
891
1039
  executeActionScript(request, executable) {
892
1040
  var _a;
@@ -1316,113 +1464,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1316
1464
  type: Injectable
1317
1465
  }] });
1318
1466
 
1319
- class RuntimeSettingsService {
1320
- constructor(configurationSettingsApiService) {
1321
- this.configurationSettingsApiService = configurationSettingsApiService;
1322
- this.configurationSettings$ = new BehaviorSubject({});
1323
- this.currencySettings$ = new BehaviorSubject({
1324
- iso: DEFAULT_CURRENCY_ISO_CODE,
1325
- symbol: DEFAULT_CURRENCY_SYMBOL,
1326
- });
1327
- this.shoppingCartSettings$ = new BehaviorSubject([]);
1328
- this.getCurrencySymbol = (locale, currency) => {
1329
- return (0)
1330
- .toLocaleString(locale, { style: 'currency', currency, minimumFractionDigits: 0, maximumFractionDigits: 0 })
1331
- .replace(/\d/g, '')
1332
- .trim();
1333
- };
1334
- }
1335
- create() {
1336
- return this.configurationSettingsApiService.fetchSettings().pipe(map$1(settings => this.parseConfigurationSettings(settings)), tap$1(configurationSettings => {
1337
- var _a;
1338
- this.configurationSettings$.next(configurationSettings);
1339
- this.addShoppingCartSettings((_a = configurationSettings['shopping-cart']) !== null && _a !== void 0 ? _a : []);
1340
- this.formattingSettings = this.getFormattingSettings();
1341
- }), map$1(() => undefined));
1342
- }
1343
- initCurrency(iso) {
1344
- if (iso) {
1345
- const symbol = this.getCurrencySymbol('en-US', iso);
1346
- this.currencySettings$.next({ iso, symbol });
1347
- if (this.formattingSettings) {
1348
- this.formattingSettings.currencySymbol = symbol;
1349
- }
1350
- }
1351
- }
1352
- getFormattingSettings() {
1353
- var _a, _b;
1354
- if (this.formattingSettings) {
1355
- return this.formattingSettings;
1356
- }
1357
- const shoppingCartSettings = (_a = this.getConfigurationSettings()['shopping-cart']) === null || _a === void 0 ? void 0 : _a.reduce((acc, setting) => {
1358
- return Object.assign(Object.assign({}, acc), { [setting.id]: setting.properties });
1359
- }, {});
1360
- const currencySettings = this.getCurrencySettings();
1361
- const dateFormat = (validateDateFormat((_b = shoppingCartSettings === null || shoppingCartSettings === void 0 ? void 0 : shoppingCartSettings.DATE_FORMAT) !== null && _b !== void 0 ? _b : '') && (shoppingCartSettings === null || shoppingCartSettings === void 0 ? void 0 : shoppingCartSettings.DATE_FORMAT)) ||
1362
- DEFAULT_DATE_FORMAT;
1363
- const decimalSeparator = shoppingCartSettings === null || shoppingCartSettings === void 0 ? void 0 : shoppingCartSettings.DECIMAL_SEPARATOR;
1364
- const thousandsSeparator = shoppingCartSettings === null || shoppingCartSettings === void 0 ? void 0 : shoppingCartSettings.THOUSANDS_SEPARATOR;
1365
- // the number of decimal places can be 0
1366
- const priceScale = shoppingCartSettings === null || shoppingCartSettings === void 0 ? void 0 : shoppingCartSettings.PRICE_SCALE;
1367
- const decimalsCount = priceScale !== null && priceScale !== '' && !isNaN(Number(priceScale)) && Number(priceScale) >= 0
1368
- ? Number(priceScale)
1369
- : DEFAULT_DECIMALS_COUNT;
1370
- const actionCodeSettings = shoppingCartSettings === null || shoppingCartSettings === void 0 ? void 0 : shoppingCartSettings.STATUS_LABEL;
1371
- return {
1372
- currencySymbol: currencySettings.symbol,
1373
- dateFormats: getSupportedDateFormats(dateFormat),
1374
- decimalsCount,
1375
- decimalSeparator: decimalSeparator !== undefined && ['.', ','].includes(decimalSeparator)
1376
- ? decimalSeparator
1377
- : DEFAULT_DECIMAL_SEPARATOR,
1378
- // thousands separator can be a blank value, so it can also be null
1379
- thousandsSeparator: thousandsSeparator !== undefined && ['.', ',', '', null].includes(thousandsSeparator)
1380
- ? thousandsSeparator || ''
1381
- : DEFAULT_THOUSANDS_SEPARATOR,
1382
- actionCodeLabels: (actionCodeSettings === null || actionCodeSettings === void 0 ? void 0 : actionCodeSettings.length)
1383
- ? actionCodeSettings.reduce((result, setting) => (Object.assign(Object.assign({}, result), { [setting.status_label]: setting.custom_label })), {})
1384
- : DEFAULT_ACTION_CODE_LABELS,
1385
- };
1386
- }
1387
- getConfigurationSettings() {
1388
- return this.configurationSettings$.value;
1389
- }
1390
- getShoppingCartSettings() {
1391
- return this.shoppingCartSettings$.value;
1392
- }
1393
- getCurrencySettings() {
1394
- return this.currencySettings$.value;
1395
- }
1396
- parseConfigurationSettings(settings) {
1397
- return settings.reduce((acc, setting) => {
1398
- switch (setting.key) {
1399
- case 'shopping-cart':
1400
- acc['shopping-cart'] = parseJsonSafely(setting.value, []);
1401
- break;
1402
- case 'navigation':
1403
- acc.navigation = parseJsonSafely(setting.value, {});
1404
- break;
1405
- case 'flows':
1406
- acc.flows = parseJsonSafely(setting.value, []);
1407
- break;
1408
- default:
1409
- acc[setting.key] = setting.value;
1410
- }
1411
- return acc;
1412
- }, {});
1413
- }
1414
- addShoppingCartSettings(settings) {
1415
- // uniqBy removes items with the biggest index
1416
- const newSettings = uniqBy([...settings, ...this.shoppingCartSettings$.value], 'id');
1417
- this.shoppingCartSettings$.next(newSettings);
1418
- }
1419
- }
1420
- RuntimeSettingsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeSettingsService, deps: [{ token: i1.ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1421
- RuntimeSettingsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeSettingsService });
1422
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeSettingsService, decorators: [{
1423
- type: Injectable
1424
- }], ctorParameters: function () { return [{ type: i1.ConfigurationSettingsApiService }]; } });
1425
-
1426
1467
  class ConfigurationService {
1427
1468
  constructor(quoteDraftService, runtimeService, contextService, configurationApiService, messageService, dialogService, runtimeSettings) {
1428
1469
  this.quoteDraftService = quoteDraftService;
@@ -1462,7 +1503,7 @@ class ConfigurationService {
1462
1503
  const prevState = this.configurationState.value;
1463
1504
  this.configurationState.next(prevState ? Object.assign({}, prevState) : null);
1464
1505
  return throwError(() => error);
1465
- }), tap(() => {
1506
+ }), tap$1(() => {
1466
1507
  if (!this.hasUnsavedChanges) {
1467
1508
  this.hasUnsavedChanges = true;
1468
1509
  }
@@ -1475,7 +1516,7 @@ class ConfigurationService {
1475
1516
  this.configurableRamp = lineItem;
1476
1517
  }
1477
1518
  get() {
1478
- return this.configurationState.pipe(map(state => state === null || state === void 0 ? void 0 : state.lineItem), shareReplay$1());
1519
+ return this.configurationState.pipe(map$1(state => state === null || state === void 0 ? void 0 : state.lineItem), shareReplay$1());
1479
1520
  }
1480
1521
  getSnapshot() {
1481
1522
  var _a, _b;
@@ -1511,21 +1552,21 @@ class ConfigurationService {
1511
1552
  return this.contextService.resolve$();
1512
1553
  }
1513
1554
  get charges$() {
1514
- return this.configurationState.pipe(map(state => { var _a; return (_a = state === null || state === void 0 ? void 0 : state.charges) !== null && _a !== void 0 ? _a : {}; }));
1555
+ return this.configurationState.pipe(map$1(state => { var _a; return (_a = state === null || state === void 0 ? void 0 : state.charges) !== null && _a !== void 0 ? _a : {}; }));
1515
1556
  }
1516
1557
  get chargesSnapshot() {
1517
1558
  var _a, _b;
1518
1559
  return (_b = (_a = this.configurationState.value) === null || _a === void 0 ? void 0 : _a.charges) !== null && _b !== void 0 ? _b : {};
1519
1560
  }
1520
1561
  get pricePlans$() {
1521
- return this.configurationState.pipe(map(state => { var _a; return (_a = state === null || state === void 0 ? void 0 : state.pricePlans) !== null && _a !== void 0 ? _a : {}; }));
1562
+ return this.configurationState.pipe(map$1(state => { var _a; return (_a = state === null || state === void 0 ? void 0 : state.pricePlans) !== null && _a !== void 0 ? _a : {}; }));
1522
1563
  }
1523
1564
  get pricePlansSnapshot() {
1524
1565
  var _a, _b;
1525
1566
  return (_b = (_a = this.configurationState.value) === null || _a === void 0 ? void 0 : _a.pricePlans) !== null && _b !== void 0 ? _b : {};
1526
1567
  }
1527
1568
  get procedureContext$() {
1528
- return this.configurationState.pipe(map(state => { var _a; return (_a = state === null || state === void 0 ? void 0 : state.procedureContext) !== null && _a !== void 0 ? _a : {}; }));
1569
+ return this.configurationState.pipe(map$1(state => { var _a; return (_a = state === null || state === void 0 ? void 0 : state.procedureContext) !== null && _a !== void 0 ? _a : {}; }));
1529
1570
  }
1530
1571
  get procedureContextSnapshot() {
1531
1572
  var _a, _b;
@@ -1541,7 +1582,7 @@ class ConfigurationService {
1541
1582
  const uiDefinitionProperties = this.getUIDefinitionProperties();
1542
1583
  const mainPricingEnabled = (_a = runtimeContext.properties) === null || _a === void 0 ? void 0 : _a.PricingEnabled;
1543
1584
  const pricingEnabled = mainPricingEnabled ? mainPricingEnabled === 'true' : uiDefinitionProperties.pricingEnabled;
1544
- const customPriceApi = this.runtimeSettings.getConfigurationSettings()['CUSTOM_PRICE_API'];
1585
+ const customPriceApi = this.runtimeSettings.configurationSettings['CUSTOM_PRICE_API'];
1545
1586
  this.isLoadingSubj$.next(true);
1546
1587
  const configure$ = pricingEnabled && customPriceApi
1547
1588
  ? this.configurationApiService.customConfigurePrice({ url: customPriceApi, configurationRequest, runtimeModel })
@@ -1550,7 +1591,7 @@ class ConfigurationService {
1550
1591
  runtimeModel,
1551
1592
  pricingEnabled,
1552
1593
  });
1553
- return configure$.pipe(tap(result => {
1594
+ return configure$.pipe(tap$1(result => {
1554
1595
  var _a;
1555
1596
  this.contextService.update(result.context);
1556
1597
  this.configurationState.next(result);
@@ -1559,7 +1600,7 @@ class ConfigurationService {
1559
1600
  this.showInactiveProductsConfirmation();
1560
1601
  }
1561
1602
  this.configurableRamp = result.lineItem;
1562
- }), map(({ lineItem }) => lineItem), catchError$1(error => throwError(() => {
1603
+ }), map$1(({ lineItem }) => lineItem), catchError$1(error => throwError(() => {
1563
1604
  const resetState = this.previousConfigurationState.value;
1564
1605
  if (resetState) {
1565
1606
  this.previousConfigurationState.next(cloneDeep(resetState));
@@ -1574,7 +1615,7 @@ class ConfigurationService {
1574
1615
  configureExternal$(props) {
1575
1616
  return this.runtimeService
1576
1617
  .init({ productId: props.productId, defaultQty: props.qty, attributesMap: props.attributesMap })
1577
- .pipe(switchMap$1(() => this.configure()), first(), catchError$1(error => {
1618
+ .pipe(switchMap(() => this.configure()), first(), catchError$1(error => {
1578
1619
  this.messageService.add({ severity: ToastType.error, summary: error });
1579
1620
  throw error;
1580
1621
  }), finalize$1(() => this.reset()));
@@ -1680,14 +1721,14 @@ class FlowConfigurationService {
1680
1721
  this.updated$ = this.updatedSubj$.asObservable();
1681
1722
  }
1682
1723
  calculate$(quoteDraft) {
1683
- return this.extendedApply$(quoteDraft).pipe(tap$1(result => {
1724
+ return this.extendedApply$(quoteDraft).pipe(tap(result => {
1684
1725
  // sort the result current state based on the quote draft initial state
1685
1726
  const initialStateIds = quoteDraft.initialState.map(lineItem => lineItem.integrationId);
1686
1727
  result.currentState = result.currentState
1687
1728
  .slice()
1688
1729
  .sort((a, b) => initialStateIds.indexOf(a.integrationId) - initialStateIds.indexOf(b.integrationId));
1689
1730
  this.quoteDraftService.updateQuoteDraft(result);
1690
- }), map$1(noop));
1731
+ }), map(noop));
1691
1732
  }
1692
1733
  calculate(quoteDraft) {
1693
1734
  this.calculate$(quoteDraft).subscribe();
@@ -1697,11 +1738,11 @@ class FlowConfigurationService {
1697
1738
  if (!quoteDraft) {
1698
1739
  return of(null);
1699
1740
  }
1700
- return of([]).pipe(map$1(() => {
1741
+ return of([]).pipe(map(() => {
1701
1742
  const updatedState = cloneDeep(quoteDraft.currentState);
1702
1743
  this.updateService.update(updatedState, updates, quoteDraft.charges);
1703
1744
  return updatedState;
1704
- }), switchMap(updatedState => this.calculate$(Object.assign(Object.assign({}, quoteDraft), { currentState: updatedState }))), map$1(() => this.quoteDraftService.quoteDraft), tap$1(() => this.updatedSubj$.next()), this.handleErrorAndBounceBack());
1745
+ }), switchMap$1(updatedState => this.calculate$(Object.assign(Object.assign({}, quoteDraft), { currentState: updatedState }))), map(() => this.quoteDraftService.quoteDraft), tap(() => this.updatedSubj$.next()), this.handleErrorAndBounceBack());
1705
1746
  }
1706
1747
  update(updates) {
1707
1748
  this.update$(updates).subscribe();
@@ -1718,9 +1759,9 @@ class FlowConfigurationService {
1718
1759
  }
1719
1760
  const updatedState = cloneDeep(currentState);
1720
1761
  updatedState.splice(currentLineItemIndex, 1, initialLineItem);
1721
- return of([]).pipe(tap$1(() => {
1762
+ return of([]).pipe(tap(() => {
1722
1763
  this.quoteDraftService.setCurrentLineItemState(updatedState);
1723
- }), switchMap(() => this.calculate$(Object.assign(Object.assign({}, quoteDraft), { currentState: updatedState }))), map$1(() => this.quoteDraftService.quoteDraft), tap$1(() => this.updatedSubj$.next()), this.handleErrorAndBounceBack());
1764
+ }), switchMap$1(() => this.calculate$(Object.assign(Object.assign({}, quoteDraft), { currentState: updatedState }))), map(() => this.quoteDraftService.quoteDraft), tap(() => this.updatedSubj$.next()), this.handleErrorAndBounceBack());
1724
1765
  }
1725
1766
  revert(lineItemId) {
1726
1767
  this.revert$(lineItemId).subscribe();
@@ -1731,7 +1772,7 @@ class FlowConfigurationService {
1731
1772
  if (!quoteDraft) {
1732
1773
  return of(null);
1733
1774
  }
1734
- return of([]).pipe(map$1(() => ids.reduce((result, id) => this.updateService.delete(result, id), currentState)), switchMap(updatedState => this.calculate$(Object.assign(Object.assign({}, quoteDraft), { currentState: updatedState }))), map$1(() => this.quoteDraftService.quoteDraft), tap$1(() => this.updatedSubj$.next()), this.handleErrorAndBounceBack());
1775
+ return of([]).pipe(map(() => ids.reduce((result, id) => this.updateService.delete(result, id), currentState)), switchMap$1(updatedState => this.calculate$(Object.assign(Object.assign({}, quoteDraft), { currentState: updatedState }))), map(() => this.quoteDraftService.quoteDraft), tap(() => this.updatedSubj$.next()), this.handleErrorAndBounceBack());
1735
1776
  }
1736
1777
  delete(ids) {
1737
1778
  this.delete$(ids).subscribe();
@@ -1742,36 +1783,36 @@ class FlowConfigurationService {
1742
1783
  return of(null);
1743
1784
  }
1744
1785
  const updatedState = [...quoteDraft.currentState, term];
1745
- return of([]).pipe(switchMap(() => this.calculate$(Object.assign(Object.assign({}, quoteDraft), { currentState: updatedState }))), map$1(() => this.quoteDraftService.quoteDraft), tap$1(() => this.updatedSubj$.next()), this.handleErrorAndBounceBack());
1786
+ return of([]).pipe(switchMap$1(() => this.calculate$(Object.assign(Object.assign({}, quoteDraft), { currentState: updatedState }))), map(() => this.quoteDraftService.quoteDraft), tap(() => this.updatedSubj$.next()), this.handleErrorAndBounceBack());
1746
1787
  }
1747
1788
  addToCart$(props) {
1748
1789
  const quoteDraft = this.quoteDraftService.quoteDraft;
1749
1790
  if (!quoteDraft) {
1750
1791
  return of(null);
1751
1792
  }
1752
- return this.configurationService.configureExternal$(props).pipe(map$1(lineItem => {
1793
+ return this.configurationService.configureExternal$(props).pipe(map(lineItem => {
1753
1794
  var _a, _b, _c;
1754
1795
  const model = this.configurationService.getRuntimeModel();
1755
1796
  const split = (_b = (_a = model === null || model === void 0 ? void 0 : model.types.find(type => type.name === lineItem.type)) === null || _a === void 0 ? void 0 : _a.split) !== null && _b !== void 0 ? _b : false;
1756
1797
  const lineItems = multiplyLineItems(lineItem, (_c = props.qty) !== null && _c !== void 0 ? _c : 1, split);
1757
1798
  return [...quoteDraft.currentState, ...lineItems];
1758
- }), switchMap(updatedState => this.calculate$(Object.assign(Object.assign({}, quoteDraft), { currentState: updatedState }))), map$1(() => this.quoteDraftService.quoteDraft), tap$1(() => this.updatedSubj$.next()), this.handleErrorAndBounceBack());
1799
+ }), switchMap$1(updatedState => this.calculate$(Object.assign(Object.assign({}, quoteDraft), { currentState: updatedState }))), map(() => this.quoteDraftService.quoteDraft), tap(() => this.updatedSubj$.next()), this.handleErrorAndBounceBack());
1759
1800
  }
1760
1801
  get() {
1761
- return this.quoteDraftService.quoteDraft$.pipe(map$1(() => this.quoteDraftService.currentState), shareReplay$1());
1802
+ return this.quoteDraftService.quoteDraft$.pipe(map(() => this.quoteDraftService.currentState), shareReplay$1());
1762
1803
  }
1763
1804
  getSnapshot() {
1764
1805
  var _a, _b;
1765
1806
  return (_b = (_a = this.quoteDraftService) === null || _a === void 0 ? void 0 : _a.currentState.slice()) !== null && _b !== void 0 ? _b : [];
1766
1807
  }
1767
1808
  get charges$() {
1768
- return this.quoteDraftService.quoteDraft$.pipe(map$1(({ charges }) => charges));
1809
+ return this.quoteDraftService.quoteDraft$.pipe(map(({ charges }) => charges));
1769
1810
  }
1770
1811
  get pricePlans$() {
1771
- return this.quoteDraftService.quoteDraft$.pipe(map$1(({ pricePlans }) => pricePlans));
1812
+ return this.quoteDraftService.quoteDraft$.pipe(map(({ pricePlans }) => pricePlans));
1772
1813
  }
1773
1814
  get activeMetrics$() {
1774
- return this.quoteDraftService.quoteDraft$.pipe(map$1(({ activeMetrics }) => activeMetrics));
1815
+ return this.quoteDraftService.quoteDraft$.pipe(map(({ activeMetrics }) => activeMetrics));
1775
1816
  }
1776
1817
  get chargesSnapshot() {
1777
1818
  var _a, _b;
@@ -1856,18 +1897,18 @@ class FlowStateConfigurationService {
1856
1897
  }
1857
1898
  else {
1858
1899
  const lineItem = generateConfigurationLineItem(props, props.qty);
1859
- request$ = this.flowStateApiService.newConfiguration(stateId, { lineItem }).pipe(tap$1(r => this.configurationStateId$.next(r.stateId)), switchMap(() => {
1900
+ request$ = this.flowStateApiService.newConfiguration(stateId, { lineItem }).pipe(tap(r => this.configurationStateId$.next(r.stateId)), switchMap$1(() => {
1860
1901
  if (!this.configurationStateId) {
1861
1902
  return of();
1862
1903
  }
1863
- return this.flowStateApiService.saveConfiguration(stateId, this.configurationStateId).pipe(tap$1(() => this.configurationStateId$.next(null)), map$1(noop));
1904
+ return this.flowStateApiService.saveConfiguration(stateId, this.configurationStateId).pipe(tap(() => this.configurationStateId$.next(null)), map(noop));
1864
1905
  }));
1865
1906
  }
1866
1907
  }
1867
1908
  else {
1868
- request$ = this.flowConfigurationService.addToCart$(props).pipe(map$1(noop));
1909
+ request$ = this.flowConfigurationService.addToCart$(props).pipe(map(noop));
1869
1910
  }
1870
- return request$.pipe(switchMap(() => this.flowStateService.executeRequest$({}, true)), map$1(noop));
1911
+ return request$.pipe(switchMap$1(() => this.flowStateService.executeRequest$({}, true)), map(noop));
1871
1912
  }
1872
1913
  }
1873
1914
  FlowStateConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowStateConfigurationService, deps: [{ token: FlowInfoService }, { token: FlowConfigurationService }, { token: i1.FlowStateApiService }, { token: FlowStateService }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -1894,7 +1935,7 @@ class IntegrationState {
1894
1935
  this.action$.next(action);
1895
1936
  }
1896
1937
  listen$(actionType) {
1897
- return this.action$.pipe(filter$1(action => action.type === actionType), map$1(action => action.payload));
1938
+ return this.action$.pipe(filter$1(action => action.type === actionType), map(action => action.payload));
1898
1939
  }
1899
1940
  listenAll$() {
1900
1941
  return this.action$.asObservable();
@@ -1919,12 +1960,12 @@ class ProductImagesService {
1919
1960
  this.imagesMap$.next(Object.assign(Object.assign({}, this.imagesMap$.value), { [productId]: '' }));
1920
1961
  this.fetchProductImage(productId);
1921
1962
  }
1922
- return this.imagesMap$.pipe(map$1(imagesMap => { var _a; return (_a = imagesMap[productId]) !== null && _a !== void 0 ? _a : null; }), distinctUntilChanged());
1963
+ return this.imagesMap$.pipe(map(imagesMap => { var _a; return (_a = imagesMap[productId]) !== null && _a !== void 0 ? _a : null; }), distinctUntilChanged());
1923
1964
  }
1924
1965
  fetchProductImage(productId) {
1925
1966
  this.productApiService
1926
1967
  .fetchImage$(productId)
1927
- .pipe(map$1(file => URL.createObjectURL(file)), catchError(() => of('')), tap$1(url => this.imagesMap$.next(Object.assign(Object.assign({}, this.imagesMap$.value), { [productId]: url }))))
1968
+ .pipe(map(file => URL.createObjectURL(file)), catchError(() => of('')), tap(url => this.imagesMap$.next(Object.assign(Object.assign({}, this.imagesMap$.value), { [productId]: url }))))
1928
1969
  .subscribe();
1929
1970
  }
1930
1971
  }
@@ -1939,7 +1980,7 @@ class RuntimeContextService {
1939
1980
  this.configurationApiService = configurationApiService;
1940
1981
  }
1941
1982
  getRuntimeContext(productId, offeringId) {
1942
- return this.configurationApiService.getRuntimeDataByProductId(productId, offeringId).pipe(map(runtimeData => {
1983
+ return this.configurationApiService.getRuntimeDataByProductId(productId, offeringId).pipe(map$1(runtimeData => {
1943
1984
  var _a;
1944
1985
  const uiDefinitionContainer = this.getUIDefinitionContainer(runtimeData);
1945
1986
  const runtimeModel = RuntimeModel.create(runtimeData.types, runtimeData.products);
@@ -1993,7 +2034,7 @@ class ConfigurationRuntimeService {
1993
2034
  return combineLatest([
1994
2035
  this.apiService.getRuntimeDataByModelId(uiDefinitionContainer.modelId),
1995
2036
  this.contextService.initTestMode(),
1996
- ]).pipe(first(), map(([runtimeData, context]) => {
2037
+ ]).pipe(first(), map$1(([runtimeData, context]) => {
1997
2038
  var _a;
1998
2039
  this.contextService.update({
1999
2040
  properties: Object.assign(Object.assign(Object.assign(Object.assign({}, (_a = this.runtimeContext) === null || _a === void 0 ? void 0 : _a.properties), context.properties), { ModelId: uiDefinitionContainer.modelId, PricingEnabled: this.uiDefinitionProperties.pricingEnabled ? 'true' : 'false', PriceListId: this.uiDefinitionProperties.priceList, offeringId: this.uiDefinitionProperties.offeringId }), uiDefinitionExternals),
@@ -2005,12 +2046,12 @@ class ConfigurationRuntimeService {
2005
2046
  uiDefinitionContainer,
2006
2047
  };
2007
2048
  return this._runtimeContext;
2008
- }), tap(() => (this._isInitialized = true)));
2049
+ }), tap$1(() => (this._isInitialized = true)));
2009
2050
  }
2010
2051
  init(props) {
2011
2052
  this.initializationProps = props;
2012
2053
  const context = this.contextService.resolve();
2013
- return this.runtimeContextService.getRuntimeContext(props.productId, props.offeringId).pipe(tap(runtimeContext => {
2054
+ return this.runtimeContextService.getRuntimeContext(props.productId, props.offeringId).pipe(tap$1(runtimeContext => {
2014
2055
  var _a, _b, _c, _d;
2015
2056
  this.uiDefinitionProperties = (_b = (_a = runtimeContext.uiDefinitionContainer) === null || _a === void 0 ? void 0 : _a.source.properties) !== null && _b !== void 0 ? _b : {};
2016
2057
  const { PriceListId } = (_c = context.properties) !== null && _c !== void 0 ? _c : {};
@@ -2023,7 +2064,7 @@ class ConfigurationRuntimeService {
2023
2064
  });
2024
2065
  }
2025
2066
  return this._runtimeContext;
2026
- }), tap(() => (this._isInitialized = true)));
2067
+ }), tap$1(() => (this._isInitialized = true)));
2027
2068
  }
2028
2069
  overrideUIDefinition(uiDefinitionContainer) {
2029
2070
  var _a;
@@ -2112,7 +2153,7 @@ class ConfigurationStateService {
2112
2153
  }
2113
2154
  execute$(exec) {
2114
2155
  const request = this.execToRequest(exec);
2115
- return this.executeRequest$(request).pipe(map$1(result => {
2156
+ return this.executeRequest$(request).pipe(map(result => {
2116
2157
  // Keep only requested results
2117
2158
  const actualSelectors = Object.entries(result.selectors).reduce((trunk, [requestId, result]) => {
2118
2159
  var _a;
@@ -2149,7 +2190,7 @@ class ConfigurationStateService {
2149
2190
  },
2150
2191
  },
2151
2192
  });
2152
- return this.executeRequest$(request).pipe(map$1(response => response.selectors[requestId]));
2193
+ return this.executeRequest$(request).pipe(map(response => response.selectors[requestId]));
2153
2194
  }
2154
2195
  subscribe$(selectorName, inputData = {}, options) {
2155
2196
  const requestId = UUID.UUID();
@@ -2172,7 +2213,7 @@ class ConfigurationStateService {
2172
2213
  this.executeRequest$(request).subscribe();
2173
2214
  }
2174
2215
  }
2175
- return subscription.data$.pipe(filter$1(data => data != this.NOT_INITIALIZED), map$1(data => data), distinctUntilChanged(), finalize(() => {
2216
+ return subscription.data$.pipe(filter$1(data => data != this.NOT_INITIALIZED), map(data => data), distinctUntilChanged(), finalize(() => {
2176
2217
  var _a;
2177
2218
  if (!((_a = this.subscriptions[requestId]) === null || _a === void 0 ? void 0 : _a.data$.observed)) {
2178
2219
  delete this.subscriptions[requestId];
@@ -2185,7 +2226,7 @@ class ConfigurationStateService {
2185
2226
  if (this.isStatefulConfiguration) {
2186
2227
  return this.flowStateApiService
2187
2228
  .saveConfiguration((_a = this.flowStateService.stateId) !== null && _a !== void 0 ? _a : '', (_b = this.stateId) !== null && _b !== void 0 ? _b : '')
2188
- .pipe(switchMap(r => this.flowStateService.executeRequest$({}, true).pipe(map$1(() => r))));
2229
+ .pipe(switchMap$1(r => this.flowStateService.executeRequest$({}, true).pipe(map(() => r))));
2189
2230
  }
2190
2231
  else {
2191
2232
  if (!flow) {
@@ -2222,7 +2263,7 @@ class ConfigurationStateService {
2222
2263
  }
2223
2264
  return this.flowConfigurationService
2224
2265
  .calculate$(Object.assign(Object.assign({}, quoteDraft), { currentState, initialState }))
2225
- .pipe(map$1(() => ({ quoteId: '' })));
2266
+ .pipe(map(() => ({ quoteId: '' })));
2226
2267
  }
2227
2268
  }
2228
2269
  }
@@ -2268,13 +2309,13 @@ class ConfigurationStateService {
2268
2309
  selectorsOverride: (_k = container === null || container === void 0 ? void 0 : container.selectors) === null || _k === void 0 ? void 0 : _k.map(processor => (Object.assign(Object.assign({}, processor), { ownerId: this.ownerId }))),
2269
2310
  });
2270
2311
  }
2271
- return request$.pipe(map$1(r => {
2312
+ return request$.pipe(map(r => {
2272
2313
  this.stateId = r.stateId;
2273
2314
  return undefined;
2274
2315
  }));
2275
2316
  }
2276
2317
  initStateless$() {
2277
- return this.configurationService.configure().pipe(map$1(() => undefined));
2318
+ return this.configurationService.configure().pipe(map(() => undefined));
2278
2319
  }
2279
2320
  execToRequest(exec) {
2280
2321
  var _a;
@@ -2321,11 +2362,11 @@ class ConfigurationStateService {
2321
2362
  else {
2322
2363
  execution$ = this.executeStateless$(fullRequest);
2323
2364
  }
2324
- return execution$.pipe(tap$1(result => this.handleSelectorsResponse(result.selectors)));
2365
+ return execution$.pipe(tap(result => this.handleSelectorsResponse(result.selectors)));
2325
2366
  }
2326
2367
  executeStateless$(request) {
2327
2368
  this.executionInProgress$.next(true);
2328
- return of(undefined).pipe(switchMap(() => {
2369
+ return of(undefined).pipe(switchMap$1(() => {
2329
2370
  var _a;
2330
2371
  // Apply actions and execute configuration/price call
2331
2372
  // No need to run configuration if no actions in the request
@@ -2339,14 +2380,14 @@ class ConfigurationStateService {
2339
2380
  });
2340
2381
  configurationRequest = ConfigurationTranslatorUtils.lightenConfigurationRequest(configurationRequest);
2341
2382
  return this.configurationService.configureRequest$(configurationRequest);
2342
- }), map$1(() => {
2383
+ }), map(() => {
2343
2384
  // Run selectors and apply them to the state
2344
2385
  const configurationState = this.configurationService.stateSnapshot;
2345
2386
  if (!configurationState) {
2346
2387
  return { stateId: '', selectors: {} };
2347
2388
  }
2348
2389
  return this.runStatelessSelectors(request, configurationState);
2349
- }), tap$1(() => this.executionInProgress$.next(false)), catchError(error => {
2390
+ }), tap(() => this.executionInProgress$.next(false)), catchError(error => {
2350
2391
  const configurationState = this.configurationService.previousStateSnapshot;
2351
2392
  if (configurationState) {
2352
2393
  const selectorsResult = this.runStatelessSelectors(request, configurationState);
@@ -2360,7 +2401,7 @@ class ConfigurationStateService {
2360
2401
  }));
2361
2402
  }
2362
2403
  initBufferedRequest$() {
2363
- return this.statefulRequestStream$.pipe(buffer(this.statefulRequestStream$.pipe(debounceTime(this.EXECUTION_BUFFER_TIME))), switchMap(requests => {
2404
+ return this.statefulRequestStream$.pipe(buffer(this.statefulRequestStream$.pipe(debounceTime(this.EXECUTION_BUFFER_TIME))), switchMap$1(requests => {
2364
2405
  if (!this.flowStateService.stateId || !this.stateId) {
2365
2406
  throw 'Stateful session is not initialized';
2366
2407
  }
@@ -2374,18 +2415,18 @@ class ConfigurationStateService {
2374
2415
  };
2375
2416
  this.executionInProgress$.next(true);
2376
2417
  return this.flowStateApiService.executeConfiguration(this.flowStateService.stateId, this.stateId, request);
2377
- }), tap$1(({ stateId }) => (this.stateId = stateId)), share(), tap$1(() => this.executionInProgress$.next(false)), catchError(e => {
2418
+ }), tap(({ stateId }) => (this.stateId = stateId)), share(), tap(() => this.executionInProgress$.next(false)), catchError(e => {
2378
2419
  this.executionInProgress$.next(false);
2379
2420
  return throwError(() => e);
2380
2421
  }));
2381
2422
  }
2382
2423
  executeStateful$(request) {
2383
- return this.executionInProgress$.pipe(filter$1(inProgress => !inProgress), take$1(1), switchMap(() =>
2424
+ return this.executionInProgress$.pipe(filter$1(inProgress => !inProgress), take$1(1), switchMap$1(() =>
2384
2425
  // make sure stream switches to statefulExecutionRequest$ before pushing an execution request
2385
2426
  combineLatest([
2386
2427
  this.statefulExecutionRequest$,
2387
- of(undefined).pipe(tap$1(() => this.statefulRequestStream$.next(request))),
2388
- ])), map$1(([response]) => response), take$1(1));
2428
+ of(undefined).pipe(tap(() => this.statefulRequestStream$.next(request))),
2429
+ ])), map(([response]) => response), take$1(1));
2389
2430
  }
2390
2431
  executeActionScript(request, processor) {
2391
2432
  var _a, _b;