@veloceapps/sdk 7.0.2-72 → 7.0.2-74

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. package/cms/components/preview/preview.component.d.ts +6 -9
  2. package/cms/components/preview/preview.types.d.ts +5 -0
  3. package/cms/services/resources.service.d.ts +9 -0
  4. package/cms/utils/encoding.utils.d.ts +2 -0
  5. package/cms/vendor-map.d.ts +2 -1
  6. package/core/modules/configuration/index.d.ts +1 -0
  7. package/core/modules/configuration/services/configuration-runtime.service.d.ts +4 -3
  8. package/core/modules/configuration/services/configuration.service.d.ts +6 -4
  9. package/core/modules/configuration/services/configuration.state.d.ts +30 -0
  10. package/core/modules/configuration/services/runtime-context.service.d.ts +1 -1
  11. package/core/types/runtime.types.d.ts +2 -2
  12. package/esm2020/cms/components/preview/preview.component.mjs +17 -37
  13. package/esm2020/cms/components/preview/preview.types.mjs +1 -1
  14. package/esm2020/cms/services/resources.service.mjs +19 -1
  15. package/esm2020/cms/utils/element.utils.mjs +8 -8
  16. package/esm2020/cms/utils/encoding.utils.mjs +28 -0
  17. package/esm2020/cms/vendor-map.mjs +3 -2
  18. package/esm2020/core/modules/configuration/configuration.module.mjs +4 -1
  19. package/esm2020/core/modules/configuration/index.mjs +2 -1
  20. package/esm2020/core/modules/configuration/services/configuration-runtime.service.mjs +27 -19
  21. package/esm2020/core/modules/configuration/services/configuration.service.mjs +41 -29
  22. package/esm2020/core/modules/configuration/services/configuration.state.mjs +142 -0
  23. package/esm2020/core/modules/configuration/services/runtime-context.service.mjs +10 -11
  24. package/esm2020/core/services/quote-draft.service.mjs +1 -1
  25. package/esm2020/core/types/runtime.types.mjs +1 -1
  26. package/esm2020/src/components/doc-gen/doc-gen.component.mjs +1 -1
  27. package/esm2020/src/components/guided-selling/guided-selling.component.mjs +1 -1
  28. package/esm2020/src/pages/assets/assets.component.mjs +1 -1
  29. package/esm2020/src/pages/catalog/catalog.component.mjs +1 -1
  30. package/esm2020/src/pages/legacy-product/legacy-product.component.mjs +4 -4
  31. package/esm2020/src/pages/product/product.component.mjs +50 -66
  32. package/esm2020/src/pages/remote/remote.component.mjs +19 -19
  33. package/esm2020/src/pages/shopping-cart/shopping-cart.component.mjs +1 -1
  34. package/esm2020/src/types/flow-customization.types.mjs +1 -1
  35. package/fesm2015/veloceapps-sdk-cms.mjs +79 -50
  36. package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
  37. package/fesm2015/veloceapps-sdk-core.mjs +214 -59
  38. package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
  39. package/fesm2015/veloceapps-sdk.mjs +67 -80
  40. package/fesm2015/veloceapps-sdk.mjs.map +1 -1
  41. package/fesm2020/veloceapps-sdk-cms.mjs +76 -50
  42. package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
  43. package/fesm2020/veloceapps-sdk-core.mjs +206 -55
  44. package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
  45. package/fesm2020/veloceapps-sdk.mjs +64 -76
  46. package/fesm2020/veloceapps-sdk.mjs.map +1 -1
  47. package/package.json +1 -1
  48. package/src/pages/product/product.component.d.ts +10 -21
  49. package/src/pages/remote/remote.component.d.ts +3 -4
  50. package/src/types/flow-customization.types.d.ts +3 -3
@@ -13,7 +13,7 @@ import { isLineItemModified, getOriginParent, SdkPipesModule, RuntimeOperation,
13
13
  import * as i3 from 'primeng/button';
14
14
  import { ButtonModule } from 'primeng/button';
15
15
  import * as i1 from 'primeng/dynamicdialog';
16
- import { UITemplateComponentType, UITemplateType, SalesforceIdUtils, ConfigurationContextMode, EntityUtil, UUID } from '@veloceapps/core';
16
+ import { UITemplateComponentType, UITemplateType, SalesforceIdUtils, ConfigurationContextMode, EntityUtil, isLegacyUIDefinition, getUIDefinitionProperties, UUID } from '@veloceapps/core';
17
17
  import { Subject, BehaviorSubject, tap, takeUntil, first, catchError, of, map, switchMap, filter, shareReplay, startWith, distinctUntilChanged, combineLatest, finalize, noop, forkJoin, from, throwError } from 'rxjs';
18
18
  import * as i7 from 'primeng/overlaypanel';
19
19
  import { OverlayPanel, OverlayPanelModule } from 'primeng/overlaypanel';
@@ -227,7 +227,7 @@ class DocGenComponent {
227
227
  }
228
228
  }
229
229
  DocGenComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: DocGenComponent, deps: [{ token: i1$1.QuoteDraftService }, { token: i1$1.ContextService }, { token: i2.UITemplatesApiService }, { token: FlowDocGenService }, { token: i3$1.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
230
- DocGenComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: DocGenComponent, selector: "vl-flow-doc-gen", ngImport: i0, template: "<ng-container *ngIf=\"isVisible$ | async\">\n <ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
230
+ DocGenComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: DocGenComponent, selector: "vl-flow-doc-gen", ngImport: i0, template: "<ng-container *ngIf=\"isVisible$ | async\">\n <ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
231
231
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: DocGenComponent, decorators: [{
232
232
  type: Component,
233
233
  args: [{ selector: 'vl-flow-doc-gen', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"isVisible$ | async\">\n <ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"] }]
@@ -376,7 +376,7 @@ class GuidedSellingComponent {
376
376
  }
377
377
  }
378
378
  GuidedSellingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: GuidedSellingComponent, deps: [{ token: i1$1.QuoteDraftService }, { token: i1$1.ContextService }, { token: i2.UITemplatesApiService }, { token: FlowGuidedSellingService }, { token: i3$1.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
379
- GuidedSellingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: GuidedSellingComponent, selector: "vl-flow-guided-selling", ngImport: i0, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
379
+ GuidedSellingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: GuidedSellingComponent, selector: "vl-flow-guided-selling", ngImport: i0, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
380
380
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: GuidedSellingComponent, decorators: [{
381
381
  type: Component,
382
382
  args: [{ selector: 'vl-flow-guided-selling', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"] }]
@@ -1833,7 +1833,7 @@ class AssetsComponent {
1833
1833
  }
1834
1834
  }
1835
1835
  AssetsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: AssetsComponent, deps: [{ token: i2.UITemplatesApiService }, { token: i1$1.ContextService }, { token: i0.ChangeDetectorRef }, { token: i3$1.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1836
- AssetsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: AssetsComponent, selector: "vl-flow-assets", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "config"] }, { kind: "component", type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1836
+ AssetsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: AssetsComponent, selector: "vl-flow-assets", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1837
1837
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: AssetsComponent, decorators: [{
1838
1838
  type: Component,
1839
1839
  args: [{ selector: 'vl-flow-assets', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
@@ -1950,7 +1950,7 @@ class CatalogComponent {
1950
1950
  }
1951
1951
  }
1952
1952
  CatalogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: CatalogComponent, deps: [{ token: i2.UITemplatesApiService }, { token: i1$1.ContextService }, { token: i0.ChangeDetectorRef }, { token: i3$1.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1953
- CatalogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: CatalogComponent, selector: "vl-flow-catalog", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "config"] }, { kind: "component", type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1953
+ CatalogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: CatalogComponent, selector: "vl-flow-catalog", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1954
1954
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: CatalogComponent, decorators: [{
1955
1955
  type: Component,
1956
1956
  args: [{ selector: 'vl-flow-catalog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
@@ -2175,7 +2175,7 @@ class LegacyProductComponent {
2175
2175
  if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getLegacyUiDefinition)) {
2176
2176
  return of(context);
2177
2177
  }
2178
- return this.customizationService.getLegacyUiDefinition(productId).pipe(map$1(uiDef => (Object.assign(Object.assign({}, context), { uiDefinition: uiDef !== null && uiDef !== void 0 ? uiDef : context.uiDefinition }))));
2178
+ return this.customizationService.getLegacyUiDefinition(productId).pipe(map$1(uiDefinitionContainer => (Object.assign(Object.assign({}, context), { uiDefinitionContainer: uiDefinitionContainer !== null && uiDefinitionContainer !== void 0 ? uiDefinitionContainer : undefined }))));
2179
2179
  }
2180
2180
  getRuntimeContext(productId, offeringId, runtimeOperation) {
2181
2181
  return this.runtimeContextService.getRuntimeContext(productId, offeringId).pipe(map$1(runtimeContext => {
@@ -2213,75 +2213,60 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
2213
2213
  }] });
2214
2214
 
2215
2215
  class ProductComponent {
2216
- constructor(contextService, runtimeService, configurationService, quoteDraftService, messageService, integrationState, customizationService) {
2216
+ constructor(contextService, configurationRuntimeService, configurationService, configurationState, quoteDraftService, integrationState, customizationService) {
2217
2217
  this.contextService = contextService;
2218
- this.runtimeService = runtimeService;
2218
+ this.configurationRuntimeService = configurationRuntimeService;
2219
2219
  this.configurationService = configurationService;
2220
+ this.configurationState = configurationState;
2220
2221
  this.quoteDraftService = quoteDraftService;
2221
- this.messageService = messageService;
2222
2222
  this.integrationState = integrationState;
2223
2223
  this.customizationService = customizationService;
2224
- this.destroy$ = new Subject();
2225
- this.state$ = new BehaviorSubject({ loading: true, failure: false });
2226
- }
2227
- ngOnInit() {
2228
- this.quoteDraftService.quoteDraft$.pipe(first(), takeUntil(this.destroy$)).subscribe(quote => this.init(quote));
2229
- }
2230
- ngOnDestroy() {
2231
- this.destroy$.next();
2232
- this.destroy$.complete();
2224
+ this.uiDefinition$ = new BehaviorSubject(undefined);
2225
+ this.config = {
2226
+ init$: () => this.init$(),
2227
+ };
2233
2228
  }
2234
- customize(productId) {
2235
- var _a;
2236
- if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getUiDefinition)) {
2237
- return of(null);
2229
+ customizeUI$() {
2230
+ var _a, _b;
2231
+ const { productId } = (_a = this.configurationRuntimeService.runtimeContext) !== null && _a !== void 0 ? _a : {};
2232
+ if (!productId || !((_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getUiDefinition)) {
2233
+ return of(undefined);
2238
2234
  }
2239
- return this.customizationService.getUiDefinition(productId).pipe(tap(uiDef => {
2240
- var _a;
2241
- if (uiDef) {
2242
- this.uiDefinition = uiDef;
2243
- this.runtimeService.uiDefinitionProperties = (_a = uiDef.properties) !== null && _a !== void 0 ? _a : {};
2235
+ return this.customizationService.getUiDefinition(productId).pipe(map(uiDefinitionContainer => {
2236
+ if (uiDefinitionContainer) {
2237
+ this.configurationRuntimeService.overrideUIDefinition(uiDefinitionContainer);
2244
2238
  }
2245
2239
  }));
2246
2240
  }
2247
- init(quote) {
2248
- const contextProperties = this.contextService.resolve().properties;
2249
- const productId = contextProperties.productId;
2250
- if (!productId) {
2251
- return;
2252
- }
2253
- const lineItemId = this.getLineItemId(quote, productId, contextProperties.lineItemId);
2254
- const currentStateItem = quote.currentState.find(({ id }) => id === lineItemId);
2255
- if (currentStateItem) {
2256
- this.configurationService.setConfigurableRamp(currentStateItem);
2257
- }
2258
- const { offeringId } = currentStateItem !== null && currentStateItem !== void 0 ? currentStateItem : {};
2259
- this.runtimeService
2260
- .init({ productId, offeringId })
2261
- .pipe(tap(context => (this.uiDefinition = context === null || context === void 0 ? void 0 : context.uiDefinition)), switchMap(() => this.customize(productId)), this.throwIfNoUIDefinition(), switchMap(() => {
2262
- if (this.runtimeService.initializationProps) {
2263
- this.runtimeService.initializationProps.attributesMap = this.integrationState.state.guidedSelling;
2264
- }
2265
- return this.configurationService.configure();
2266
- }), tap(() => this.state$.next({ loading: false, failure: false })), catchError(error => {
2241
+ init$() {
2242
+ return this.quoteDraftService.quoteDraft$.pipe(first(), switchMap(quote => {
2243
+ const contextProperties = this.contextService.resolve().properties;
2244
+ const productId = contextProperties.productId;
2245
+ if (!productId) {
2246
+ throw new Error(`Unable to start configuration for 'productId == null'`);
2247
+ }
2248
+ const lineItemId = this.getLineItemId(quote, productId, contextProperties.lineItemId);
2249
+ const currentStateItem = quote.currentState.find(({ id }) => id === lineItemId);
2250
+ if (currentStateItem) {
2251
+ this.configurationService.setConfigurableRamp(currentStateItem);
2252
+ }
2253
+ const { offeringId } = currentStateItem !== null && currentStateItem !== void 0 ? currentStateItem : {};
2254
+ return this.configurationRuntimeService.init({ productId, offeringId });
2255
+ }), switchMap(() => this.customizeUI$()), tap(() => {
2267
2256
  var _a, _b;
2268
- if (!((_b = (_a = this.uiDefinition) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.suppressToastMessages)) {
2269
- this.messageService.add({ severity: 'error', summary: error });
2257
+ const uiDefinition = (_b = (_a = this.configurationRuntimeService.runtimeContext) === null || _a === void 0 ? void 0 : _a.uiDefinitionContainer) === null || _b === void 0 ? void 0 : _b.source;
2258
+ if (uiDefinition && !isLegacyUIDefinition(uiDefinition)) {
2259
+ this.uiDefinition$.next(uiDefinition);
2270
2260
  }
2271
- this.state$.next({ loading: false, failure: true });
2272
- return of();
2273
- }), takeUntil(this.destroy$))
2274
- .subscribe();
2275
- }
2276
- throwIfNoUIDefinition() {
2277
- return (source$) => {
2278
- return source$.pipe(switchMap(() => {
2279
- if (!this.uiDefinition) {
2280
- return throwError(() => 'Product does not have Configuration UI');
2281
- }
2282
- return source$;
2283
- }));
2284
- };
2261
+ else {
2262
+ throw new Error('Product does not have Configuration UI');
2263
+ }
2264
+ }), tap(() => {
2265
+ if (this.configurationRuntimeService.initializationProps) {
2266
+ this.configurationRuntimeService.initializationProps.attributesMap =
2267
+ this.integrationState.state.guidedSelling;
2268
+ }
2269
+ }), switchMap(() => this.configurationState.init$()));
2285
2270
  }
2286
2271
  getLineItemId(quote, productId, lineItemId) {
2287
2272
  var _a, _b;
@@ -2293,13 +2278,13 @@ class ProductComponent {
2293
2278
  return id;
2294
2279
  }
2295
2280
  }
2296
- ProductComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProductComponent, deps: [{ token: i1$1.ContextService }, { token: i1$1.ConfigurationRuntimeService }, { token: i1$1.ConfigurationService }, { token: i1$1.QuoteDraftService }, { token: i8.MessageService }, { token: i5.IntegrationState }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
2297
- ProductComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: ProductComponent, selector: "vl-flow-product", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "config"] }, { kind: "component", type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2281
+ ProductComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProductComponent, deps: [{ token: i1$1.ContextService }, { token: i1$1.ConfigurationRuntimeService }, { token: i1$1.ConfigurationService }, { token: i1$1.ConfigurationState }, { token: i1$1.QuoteDraftService }, { token: i5.IntegrationState }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
2282
+ ProductComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: ProductComponent, selector: "vl-flow-product", ngImport: i0, template: "<vl-cms-preview [uiDefinition]=\"$any(uiDefinition$ | async)\" [config]=\"config\"></vl-cms-preview>\n", styles: [""], dependencies: [{ kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2298
2283
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProductComponent, decorators: [{
2299
2284
  type: Component,
2300
- args: [{ selector: 'vl-flow-product', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
2285
+ args: [{ selector: 'vl-flow-product', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-cms-preview [uiDefinition]=\"$any(uiDefinition$ | async)\" [config]=\"config\"></vl-cms-preview>\n" }]
2301
2286
  }], ctorParameters: function () {
2302
- return [{ type: i1$1.ContextService }, { type: i1$1.ConfigurationRuntimeService }, { type: i1$1.ConfigurationService }, { type: i1$1.QuoteDraftService }, { type: i8.MessageService }, { type: i5.IntegrationState }, { type: undefined, decorators: [{
2287
+ return [{ type: i1$1.ContextService }, { type: i1$1.ConfigurationRuntimeService }, { type: i1$1.ConfigurationService }, { type: i1$1.ConfigurationState }, { type: i1$1.QuoteDraftService }, { type: i5.IntegrationState }, { type: undefined, decorators: [{
2303
2288
  type: Optional
2304
2289
  }, {
2305
2290
  type: Inject,
@@ -2356,12 +2341,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
2356
2341
  }] });
2357
2342
 
2358
2343
  class RemoteComponent {
2359
- constructor(contextService, quoteDraftService, quoteApiService, runtimeService, configurationService, messageService, integrationState, location) {
2344
+ constructor(contextService, quoteDraftService, runtimeService, configurationService, configurationState, messageService, integrationState, location) {
2360
2345
  this.contextService = contextService;
2361
2346
  this.quoteDraftService = quoteDraftService;
2362
- this.quoteApiService = quoteApiService;
2363
2347
  this.runtimeService = runtimeService;
2364
2348
  this.configurationService = configurationService;
2349
+ this.configurationState = configurationState;
2365
2350
  this.messageService = messageService;
2366
2351
  this.integrationState = integrationState;
2367
2352
  this.location = location;
@@ -2400,25 +2385,27 @@ class RemoteComponent {
2400
2385
  this.runtimeService
2401
2386
  .init({ productId })
2402
2387
  .pipe(first(), tap(context => {
2403
- var _a, _b, _c, _d, _e;
2404
- const pricingEnabled = ((_b = (_a = context === null || context === void 0 ? void 0 : context.uiDefinition) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.pricingEnabled) ? 'true' : 'false';
2405
- const priceListId = (_d = (_c = context === null || context === void 0 ? void 0 : context.uiDefinition) === null || _c === void 0 ? void 0 : _c.properties) === null || _d === void 0 ? void 0 : _d.priceList;
2406
- const runtimeContextProperties = (_e = this.runtimeService.runtimeContext) === null || _e === void 0 ? void 0 : _e.properties;
2388
+ var _a, _b;
2389
+ const uiDefinitionProperties = getUIDefinitionProperties(context.uiDefinitionContainer);
2390
+ const uiDefinition = (_a = context.uiDefinitionContainer) === null || _a === void 0 ? void 0 : _a.source;
2391
+ this.uiDefinition = uiDefinition && !isLegacyUIDefinition(uiDefinition) ? uiDefinition : undefined;
2392
+ const pricingEnabled = uiDefinitionProperties.pricingEnabled ? 'true' : 'false';
2393
+ const priceListId = uiDefinitionProperties.priceList;
2394
+ const runtimeContextProperties = (_b = this.runtimeService.runtimeContext) === null || _b === void 0 ? void 0 : _b.properties;
2407
2395
  if (runtimeContextProperties) {
2408
2396
  runtimeContextProperties.PriceListId = priceListId;
2409
2397
  runtimeContextProperties.PricingEnabled = pricingEnabled;
2410
2398
  }
2411
2399
  this.contextService.update({
2412
2400
  properties: {
2413
- ModelId: context === null || context === void 0 ? void 0 : context.modelId,
2401
+ ModelId: context.modelId,
2414
2402
  RuntimeMode: 'TEST',
2415
2403
  PricingEnabled: pricingEnabled,
2416
2404
  PriceListId: priceListId,
2417
2405
  },
2418
2406
  });
2419
- this.uiDefinition = context === null || context === void 0 ? void 0 : context.uiDefinition;
2420
2407
  this.configurationService.setConfigurableRamp(this.createLineItem());
2421
- }), this.throwIfNoUIDefinition(), switchMap(() => this.configurationService.configure()), tap(() => this.state$.next({ loading: false, failure: false })), catchError(error => {
2408
+ }), this.throwIfNoUIDefinition(), switchMap(() => this.configurationState.init$()), tap(() => this.state$.next({ loading: false, failure: false })), catchError(error => {
2422
2409
  var _a, _b;
2423
2410
  if (!((_b = (_a = this.uiDefinition) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.suppressToastMessages)) {
2424
2411
  this.messageService.add({ severity: 'error', summary: error });
@@ -2682,12 +2669,12 @@ class RemoteComponent {
2682
2669
  return optionConfigurations;
2683
2670
  }
2684
2671
  }
2685
- RemoteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RemoteComponent, deps: [{ token: i1$1.ContextService }, { token: i1$1.QuoteDraftService }, { token: i2.QuoteApiService }, { token: i1$1.ConfigurationRuntimeService }, { token: i1$1.ConfigurationService }, { token: i8.MessageService }, { token: i5.IntegrationState }, { token: i4.Location }], target: i0.ɵɵFactoryTarget.Component });
2686
- RemoteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: RemoteComponent, selector: "vl-flow-remote", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "config"] }, { kind: "component", type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2672
+ RemoteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RemoteComponent, deps: [{ token: i1$1.ContextService }, { token: i1$1.QuoteDraftService }, { token: i1$1.ConfigurationRuntimeService }, { token: i1$1.ConfigurationService }, { token: i1$1.ConfigurationState }, { token: i8.MessageService }, { token: i5.IntegrationState }, { token: i4.Location }], target: i0.ɵɵFactoryTarget.Component });
2673
+ RemoteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: RemoteComponent, selector: "vl-flow-remote", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2687
2674
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RemoteComponent, decorators: [{
2688
2675
  type: Component,
2689
2676
  args: [{ selector: 'vl-flow-remote', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
2690
- }], ctorParameters: function () { return [{ type: i1$1.ContextService }, { type: i1$1.QuoteDraftService }, { type: i2.QuoteApiService }, { type: i1$1.ConfigurationRuntimeService }, { type: i1$1.ConfigurationService }, { type: i8.MessageService }, { type: i5.IntegrationState }, { type: i4.Location }]; } });
2677
+ }], ctorParameters: function () { return [{ type: i1$1.ContextService }, { type: i1$1.QuoteDraftService }, { type: i1$1.ConfigurationRuntimeService }, { type: i1$1.ConfigurationService }, { type: i1$1.ConfigurationState }, { type: i8.MessageService }, { type: i5.IntegrationState }, { type: i4.Location }]; } });
2691
2678
 
2692
2679
  class RemoteModule {
2693
2680
  }
@@ -2793,7 +2780,7 @@ class ShoppingCartComponent {
2793
2780
  }
2794
2781
  }
2795
2782
  ShoppingCartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ShoppingCartComponent, deps: [{ token: i2.UITemplatesApiService }, { token: i1$1.ContextService }, { token: i0.ChangeDetectorRef }, { token: i3$1.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
2796
- ShoppingCartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: ShoppingCartComponent, selector: "vl-flow-shopping-cart", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "config"] }, { kind: "component", type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2783
+ ShoppingCartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: ShoppingCartComponent, selector: "vl-flow-shopping-cart", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2797
2784
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ShoppingCartComponent, decorators: [{
2798
2785
  type: Component,
2799
2786
  args: [{ selector: 'vl-flow-shopping-cart', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]