@veloceapps/sdk 8.0.0-5 → 8.0.0-51

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. package/cms/components/element.component.d.ts +0 -1
  2. package/cms/utils/element.utils.d.ts +3 -1
  3. package/cms/vendor-map.d.ts +2 -1
  4. package/core/modules/configuration/services/configuration-runtime.service.d.ts +1 -1
  5. package/core/modules/configuration/services/configuration.service.d.ts +3 -0
  6. package/core/modules/flow-configuration/types/update.types.d.ts +1 -1
  7. package/core/pipes/action-code.pipe.d.ts +8 -0
  8. package/core/pipes/index.d.ts +1 -0
  9. package/core/pipes/pipes.module.d.ts +2 -1
  10. package/core/services/context.service.d.ts +1 -0
  11. package/core/types/formatting-settings.types.d.ts +2 -0
  12. package/esm2020/cms/components/element-children/element-children.component.mjs +3 -3
  13. package/esm2020/cms/components/element-children/element-children.module.mjs +4 -4
  14. package/esm2020/cms/components/element-drop-handle/element-drop-handle.component.mjs +3 -3
  15. package/esm2020/cms/components/element-drop-handle/element-drop-handle.module.mjs +4 -4
  16. package/esm2020/cms/components/element-renderer/element-renderer.component.mjs +3 -3
  17. package/esm2020/cms/components/element-renderer/element-renderer.module.mjs +4 -4
  18. package/esm2020/cms/components/element-tools-panel/element-tools-panel.component.mjs +5 -5
  19. package/esm2020/cms/components/element.component.mjs +2 -11
  20. package/esm2020/cms/components/plugin.component.mjs +3 -3
  21. package/esm2020/cms/components/preview/preview.component.mjs +3 -3
  22. package/esm2020/cms/components/preview/preview.module.mjs +4 -4
  23. package/esm2020/cms/directives/custom-template.directive.mjs +7 -7
  24. package/esm2020/cms/launcher.module.mjs +4 -4
  25. package/esm2020/cms/modules/federated/federated-host.directive.mjs +3 -3
  26. package/esm2020/cms/modules/federated/federated.component.mjs +3 -3
  27. package/esm2020/cms/modules/federated/federated.module.mjs +4 -4
  28. package/esm2020/cms/modules/migrations/migrations.module.mjs +4 -4
  29. package/esm2020/cms/modules/migrations/services/migrations.service.mjs +3 -3
  30. package/esm2020/cms/modules/runtime/runtime.module.mjs +4 -4
  31. package/esm2020/cms/modules/runtime/services/compilation.service.mjs +3 -3
  32. package/esm2020/cms/modules/runtime/services/runtime-editor.service.mjs +3 -3
  33. package/esm2020/cms/modules/runtime/services/runtime.service.mjs +3 -3
  34. package/esm2020/cms/plugins/configuration.plugin.mjs +3 -3
  35. package/esm2020/cms/plugins/element-hover.plugin.mjs +3 -3
  36. package/esm2020/cms/plugins/io.plugin.mjs +14 -5
  37. package/esm2020/cms/plugins/page.plugin.mjs +3 -3
  38. package/esm2020/cms/plugins/region.plugin.mjs +3 -3
  39. package/esm2020/cms/plugins/script.plugin.mjs +3 -3
  40. package/esm2020/cms/services/element-context.service.mjs +3 -3
  41. package/esm2020/cms/services/integration.state.mjs +3 -3
  42. package/esm2020/cms/services/io-provider.service.mjs +3 -3
  43. package/esm2020/cms/services/resources.service.mjs +3 -3
  44. package/esm2020/cms/services/templates.service.mjs +3 -3
  45. package/esm2020/cms/utils/element.utils.mjs +13 -3
  46. package/esm2020/cms/utils/elements-resolver.mjs +2 -2
  47. package/esm2020/cms/vendor-map.mjs +3 -2
  48. package/esm2020/core/core.module.mjs +7 -6
  49. package/esm2020/core/directives/directives.module.mjs +4 -4
  50. package/esm2020/core/directives/primeng-calendar.directive.mjs +3 -3
  51. package/esm2020/core/modules/configuration/configuration.module.mjs +4 -4
  52. package/esm2020/core/modules/configuration/services/configuration-runtime.service.mjs +8 -11
  53. package/esm2020/core/modules/configuration/services/configuration.service.mjs +13 -5
  54. package/esm2020/core/modules/configuration/services/configuration.state.mjs +3 -3
  55. package/esm2020/core/modules/configuration/services/runtime-context.service.mjs +3 -3
  56. package/esm2020/core/modules/flow-configuration/flow-configuration.module.mjs +4 -4
  57. package/esm2020/core/modules/flow-configuration/services/flow-configuration.service.mjs +3 -3
  58. package/esm2020/core/modules/flow-configuration/services/flow-update.service.mjs +7 -14
  59. package/esm2020/core/modules/flow-configuration/types/update.types.mjs +1 -1
  60. package/esm2020/core/pipes/action-code.pipe.mjs +20 -0
  61. package/esm2020/core/pipes/date.pipe.mjs +3 -3
  62. package/esm2020/core/pipes/index.mjs +2 -1
  63. package/esm2020/core/pipes/number.pipe.mjs +3 -3
  64. package/esm2020/core/pipes/pipes.module.mjs +8 -7
  65. package/esm2020/core/pipes/price.pipe.mjs +3 -3
  66. package/esm2020/core/services/context.service.mjs +17 -5
  67. package/esm2020/core/services/metric-calculation/metric-calculation.service.mjs +3 -3
  68. package/esm2020/core/services/product-images.service.mjs +3 -3
  69. package/esm2020/core/services/quote-draft.service.mjs +3 -3
  70. package/esm2020/core/services/runtime-settings.service.mjs +9 -5
  71. package/esm2020/core/types/formatting-settings.types.mjs +1 -1
  72. package/esm2020/runtime/components/component-preview/component-preview.component.mjs +3 -3
  73. package/esm2020/runtime/components/section-renderer/section-renderer.component.mjs +3 -3
  74. package/esm2020/runtime/components/ui-runtime/runtime.component.mjs +3 -3
  75. package/esm2020/runtime/components/ui-runtime-preview/runtime-preview.component.mjs +3 -3
  76. package/esm2020/runtime/execution/components/children-placeholder/children-placeholder.component.mjs +6 -6
  77. package/esm2020/runtime/execution/components/context-provider/context-provider.component.mjs +3 -3
  78. package/esm2020/runtime/execution/components/execution-section-renderer/execution-section-renderer.component.mjs +3 -3
  79. package/esm2020/runtime/execution/components/federated/federated.component.mjs +3 -3
  80. package/esm2020/runtime/execution/components/velo-attribute/velo-attribute.component.mjs +3 -3
  81. package/esm2020/runtime/execution/components/velo-multiselect/velo-multiselect.component.mjs +3 -3
  82. package/esm2020/runtime/execution/components/velo-port-checkbox/velo-port-checkbox.component.mjs +3 -3
  83. package/esm2020/runtime/execution/components/velo-port-dropdown/velo-port-dropdown.component.mjs +3 -3
  84. package/esm2020/runtime/execution/components/velo-port-radio/velo-port-radio.component.mjs +3 -3
  85. package/esm2020/runtime/execution/components/velo-type/velo-type.component.mjs +3 -3
  86. package/esm2020/runtime/execution/directives/section-script.directive.mjs +3 -3
  87. package/esm2020/runtime/execution/directives/sf-query.directive.mjs +3 -3
  88. package/esm2020/runtime/execution/directives/velo-attribute.directive.mjs +3 -3
  89. package/esm2020/runtime/execution/directives/velo-port.directive.mjs +18 -18
  90. package/esm2020/runtime/execution/directives/vl-approval.directive.mjs +3 -3
  91. package/esm2020/runtime/execution/directives/vl-document-attachments.directive.mjs +3 -3
  92. package/esm2020/runtime/execution/directives/vl-document-templates.directive.mjs +3 -3
  93. package/esm2020/runtime/execution/directives/vl-quote.directive.mjs +3 -3
  94. package/esm2020/runtime/execution/directives/vl-ramp.directive.mjs +3 -3
  95. package/esm2020/runtime/execution/runtime-execution.module.mjs +4 -4
  96. package/esm2020/runtime/runtime.module.mjs +4 -4
  97. package/esm2020/runtime/services/cart.service.mjs +3 -3
  98. package/esm2020/runtime/services/collapsible-state.service.mjs +3 -3
  99. package/esm2020/runtime/services/configuration.service.mjs +3 -3
  100. package/esm2020/runtime/services/current-state.service.mjs +3 -3
  101. package/esm2020/runtime/services/form-scope.service.mjs +3 -3
  102. package/esm2020/runtime/services/product-model-cache.service.mjs +3 -3
  103. package/esm2020/runtime/services/runtime-context.service.mjs +3 -3
  104. package/esm2020/runtime/services/runtime-form.service.mjs +3 -3
  105. package/esm2020/runtime/services/runtime.service.mjs +3 -3
  106. package/esm2020/runtime/services/section-helper.service.mjs +3 -3
  107. package/esm2020/runtime/services/section-scope.service.mjs +3 -3
  108. package/esm2020/runtime/services/section-store.service.mjs +3 -3
  109. package/esm2020/runtime/services/section.service.mjs +6 -6
  110. package/esm2020/src/components/dialog/dialog.component.mjs +3 -3
  111. package/esm2020/src/components/dialog/dialog.module.mjs +4 -4
  112. package/esm2020/src/components/doc-gen/doc-gen.component.mjs +11 -15
  113. package/esm2020/src/components/doc-gen/doc-gen.module.mjs +4 -4
  114. package/esm2020/src/components/guided-selling/guided-selling.component.mjs +10 -13
  115. package/esm2020/src/components/guided-selling/guided-selling.module.mjs +4 -4
  116. package/esm2020/src/components/header/cart-overlay/cart-preview.component.mjs +3 -3
  117. package/esm2020/src/components/header/cart-overlay/cart-preview.module.mjs +4 -4
  118. package/esm2020/src/components/header/header.component.mjs +4 -4
  119. package/esm2020/src/components/header/header.module.mjs +4 -4
  120. package/esm2020/src/components/header/metrics/metrics.component.mjs +4 -4
  121. package/esm2020/src/components/header/metrics/metrics.module.mjs +4 -4
  122. package/esm2020/src/flow-routing.module.mjs +4 -4
  123. package/esm2020/src/flow.component.mjs +3 -3
  124. package/esm2020/src/flow.module.mjs +4 -4
  125. package/esm2020/src/guards/context.guard.mjs +3 -3
  126. package/esm2020/src/guards/product-unload.guard.mjs +3 -3
  127. package/esm2020/src/guards/root.guard.mjs +3 -3
  128. package/esm2020/src/pages/assets/assets.component.mjs +3 -3
  129. package/esm2020/src/pages/assets/assets.module.mjs +4 -4
  130. package/esm2020/src/pages/catalog/catalog.component.mjs +3 -3
  131. package/esm2020/src/pages/catalog/catalog.module.mjs +4 -4
  132. package/esm2020/src/pages/debug/debug.component.mjs +3 -3
  133. package/esm2020/src/pages/debug/debug.module.mjs +4 -4
  134. package/esm2020/src/pages/empty-account/empty-account.component.mjs +3 -3
  135. package/esm2020/src/pages/empty-account/empty-account.module.mjs +4 -4
  136. package/esm2020/src/pages/legacy-product/legacy-product.component.mjs +3 -3
  137. package/esm2020/src/pages/legacy-product/legacy-product.module.mjs +4 -4
  138. package/esm2020/src/pages/product/product.component.mjs +3 -3
  139. package/esm2020/src/pages/product/product.module.mjs +4 -4
  140. package/esm2020/src/pages/record-not-found/record-not-found.component.mjs +3 -3
  141. package/esm2020/src/pages/record-not-found/record-not-found.module.mjs +4 -4
  142. package/esm2020/src/pages/remote/remote.component.mjs +3 -3
  143. package/esm2020/src/pages/remote/remote.module.mjs +4 -4
  144. package/esm2020/src/pages/shopping-cart/shopping-cart.component.mjs +3 -3
  145. package/esm2020/src/pages/shopping-cart/shopping-cart.module.mjs +4 -4
  146. package/esm2020/src/resolvers/flow.resolver.mjs +3 -3
  147. package/esm2020/src/resolvers/quote.resolver.mjs +3 -3
  148. package/esm2020/src/services/doc-gen.service.mjs +3 -3
  149. package/esm2020/src/services/flow-dialog.service.mjs +3 -3
  150. package/esm2020/src/services/flow-router.service.mjs +5 -5
  151. package/esm2020/src/services/flow.service.mjs +13 -5
  152. package/esm2020/src/services/guided-selling.service.mjs +3 -3
  153. package/fesm2015/veloceapps-sdk-cms.mjs +1192 -1181
  154. package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
  155. package/fesm2015/veloceapps-sdk-core.mjs +1011 -979
  156. package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
  157. package/fesm2015/veloceapps-sdk-runtime.mjs +137 -137
  158. package/fesm2015/veloceapps-sdk.mjs +217 -211
  159. package/fesm2015/veloceapps-sdk.mjs.map +1 -1
  160. package/fesm2020/veloceapps-sdk-cms.mjs +1016 -1004
  161. package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
  162. package/fesm2020/veloceapps-sdk-core.mjs +464 -432
  163. package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
  164. package/fesm2020/veloceapps-sdk-runtime.mjs +137 -137
  165. package/fesm2020/veloceapps-sdk.mjs +216 -211
  166. package/fesm2020/veloceapps-sdk.mjs.map +1 -1
  167. package/package.json +3 -3
  168. package/src/components/doc-gen/doc-gen.component.d.ts +3 -6
  169. package/src/components/guided-selling/guided-selling.component.d.ts +2 -4
@@ -1,10 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, InjectionToken, NgModule, inject, Directive, Input, LOCALE_ID, Pipe } from '@angular/core';
3
- import { UUID, ConfigurationContextMode, ConfigurationContext, RuntimeModel, getUIDefinitionProperties, isLegacyUIDefinition, SalesforceIdUtils, ConfigurationMode, ConfigurationTranslatorUtils, EntityUtil, ChargeGroupUtils, DEFAULT_CURRENCY_ISO_CODE, DEFAULT_CURRENCY_SYMBOL, validateDateFormat, DEFAULT_DATE_FORMAT, DEFAULT_DECIMALS_COUNT, getSupportedDateFormats, DEFAULT_DECIMAL_SEPARATOR, DEFAULT_THOUSANDS_SEPARATOR, parseJsonSafely, formatNumber } from '@veloceapps/core';
3
+ import { UUID, ConfigurationContextMode, ConfigurationContext, ConfigurationMode, ConfigurationTranslatorUtils, getUIDefinitionProperties, 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, RuntimeModel, isLegacyUIDefinition, SalesforceIdUtils, EntityUtil, formatNumber } from '@veloceapps/core';
4
4
  import * as i1 from '@veloceapps/api';
5
5
  import { PriceApiService, ContextApiService, ProductModelApiService, ConfigurationApiService } from '@veloceapps/api';
6
- import { BehaviorSubject, combineLatest, zip, noop, throwError, shareReplay as shareReplay$1, switchMap as switchMap$1, of, tap as tap$1, map as map$2, catchError as catchError$1, Subject, take as take$1, distinctUntilChanged } from 'rxjs';
7
- import { filter, tap, map, first, switchMap, skip, take, shareReplay, catchError, finalize } from 'rxjs/operators';
6
+ import { BehaviorSubject, zip, noop, combineLatest, throwError, shareReplay as shareReplay$1, tap as tap$1, map as map$2, of, switchMap as switchMap$1, catchError as catchError$1, Subject, take as take$1, distinctUntilChanged } from 'rxjs';
7
+ import { filter, tap, map, switchMap, skip, take, shareReplay, catchError, finalize, first } from 'rxjs/operators';
8
8
  import { merge, isEqual, flatten, sortBy, map as map$1, transform, omit, cloneDeep, uniq } from 'lodash';
9
9
  import { HttpErrorResponse } from '@angular/common/http';
10
10
  import * as i4 from '@veloceapps/components';
@@ -86,6 +86,18 @@ class ContextService {
86
86
  create(headerId, mode) {
87
87
  return this.contextApiService.getContext(headerId, mode).pipe(tap(context => this.context.next(merge(new ConfigurationContext(headerId, mode), context))), map(() => this.resolve()));
88
88
  }
89
+ initTestMode() {
90
+ return this.create('TestId', ConfigurationContextMode.TEST).pipe(map(context => {
91
+ return this.update({
92
+ properties: {
93
+ ...context.properties,
94
+ RuntimeMode: ConfigurationContextMode.TEST,
95
+ StartDate: new Date().toISOString().substring(0, 10),
96
+ standalone: 'true',
97
+ },
98
+ });
99
+ }));
100
+ }
89
101
  update(partialContext) {
90
102
  const originalContext = this.resolve();
91
103
  const updatedContext = {
@@ -112,172 +124,13 @@ class ContextService {
112
124
  this.context.next(null);
113
125
  }
114
126
  }
115
- ContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ContextService, deps: [{ token: i1.ContextApiService }], target: i0.ɵɵFactoryTarget.Injectable });
116
- ContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ContextService, providedIn: 'root' });
117
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ContextService, decorators: [{
127
+ ContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextService, deps: [{ token: i1.ContextApiService }], target: i0.ɵɵFactoryTarget.Injectable });
128
+ ContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextService, providedIn: 'root' });
129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextService, decorators: [{
118
130
  type: Injectable,
119
131
  args: [{ providedIn: 'root' }]
120
132
  }], ctorParameters: function () { return [{ type: i1.ContextApiService }]; } });
121
133
 
122
- const FORMATTING_SETTINGS_TOKEN = new InjectionToken('Summary of formatting settings for variant types of data, e.g. numbers, text, dates, etc');
123
-
124
- var RuntimeMode;
125
- (function (RuntimeMode) {
126
- RuntimeMode[RuntimeMode["TEST"] = 0] = "TEST";
127
- RuntimeMode[RuntimeMode["PROD"] = 1] = "PROD";
128
- })(RuntimeMode || (RuntimeMode = {}));
129
- var RuntimeOperation;
130
- (function (RuntimeOperation) {
131
- RuntimeOperation["INIT"] = "INIT";
132
- RuntimeOperation["UPDATE"] = "UPDATE";
133
- })(RuntimeOperation || (RuntimeOperation = {}));
134
- var RuntimeStep;
135
- (function (RuntimeStep) {
136
- RuntimeStep["START"] = "START";
137
- RuntimeStep["UPDATE"] = "UPDATE";
138
- })(RuntimeStep || (RuntimeStep = {}));
139
-
140
- const UI_DEFINITION_VERSION = 3;
141
-
142
- class RuntimeContextService {
143
- constructor(configurationApiService) {
144
- this.configurationApiService = configurationApiService;
145
- }
146
- getRuntimeContext(productId, offeringId) {
147
- return this.configurationApiService.getRuntimeDataByProductId(productId, offeringId).pipe(map(runtimeData => {
148
- const uiDefinitionContainer = this.getUIDefinitionContainer(runtimeData);
149
- const runtimeModel = RuntimeModel.create(runtimeData.types, runtimeData.products);
150
- const { productName, properties } = Array.from(runtimeModel.components.values()).find(c => c.productId === productId) ?? {};
151
- const uiDefinitionProperties = getUIDefinitionProperties(uiDefinitionContainer);
152
- return {
153
- modelId: runtimeData.modelId,
154
- uiDefinitionContainer: uiDefinitionContainer,
155
- runtimeModel: runtimeModel,
156
- runtimeMode: RuntimeMode.PROD,
157
- productId: productId,
158
- productType: properties?.['displayName'] || productName,
159
- offeringId: offeringId,
160
- properties: {
161
- PricingEnabled: uiDefinitionProperties.pricingEnabled ? 'true' : 'false',
162
- PriceListId: uiDefinitionProperties.priceList,
163
- },
164
- };
165
- }));
166
- }
167
- getUIDefinitionContainer(runtimeData) {
168
- const containers = runtimeData.uiDefinitions.filter(container => !isLegacyUIDefinition(container.source));
169
- return containers.find(container => container.source.primary) ?? containers[0];
170
- }
171
- }
172
- RuntimeContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RuntimeContextService, deps: [{ token: i1.ConfigurationApiService }], target: i0.ɵɵFactoryTarget.Injectable });
173
- RuntimeContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RuntimeContextService });
174
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RuntimeContextService, decorators: [{
175
- type: Injectable
176
- }], ctorParameters: function () { return [{ type: i1.ConfigurationApiService }]; } });
177
-
178
- class ConfigurationRuntimeService {
179
- constructor(apiService, contextService, runtimeContextService) {
180
- this.apiService = apiService;
181
- this.contextService = contextService;
182
- this.runtimeContextService = runtimeContextService;
183
- this._isInitialized = false;
184
- this.uiDefinitionProperties = {};
185
- }
186
- reset() {
187
- this._isInitialized = false;
188
- this._runtimeContext = undefined;
189
- this.initializationProps = undefined;
190
- this.uiDefinitionProperties = {};
191
- }
192
- initTestMode(uiDefinitionContainer) {
193
- this.uiDefinitionProperties = getUIDefinitionProperties(uiDefinitionContainer);
194
- const uiDefinitionExternals = uiDefinitionContainer.source.externals ?? {};
195
- return combineLatest([
196
- this.apiService.getRuntimeDataByModelId(uiDefinitionContainer.modelId),
197
- this.contextService.create('TestId', ConfigurationContextMode.TEST),
198
- ]).pipe(first(), map(([runtimeData, context]) => {
199
- this.contextService.update({
200
- properties: {
201
- ...this.runtimeContext?.properties,
202
- ...context.properties,
203
- ModelId: uiDefinitionContainer.modelId,
204
- RuntimeMode: ConfigurationContextMode.TEST,
205
- PricingEnabled: this.uiDefinitionProperties.pricingEnabled ? 'true' : 'false',
206
- StartDate: new Date().toISOString().substring(0, 10),
207
- PriceListId: this.uiDefinitionProperties.priceList,
208
- offeringId: this.uiDefinitionProperties.offeringId,
209
- standalone: 'true',
210
- ...uiDefinitionExternals,
211
- },
212
- });
213
- this._runtimeContext = {
214
- modelId: uiDefinitionContainer.modelId,
215
- runtimeModel: RuntimeModel.create(runtimeData.types, runtimeData.products),
216
- runtimeMode: RuntimeMode.TEST,
217
- uiDefinitionContainer,
218
- };
219
- return this._runtimeContext;
220
- }), tap(() => (this._isInitialized = true)));
221
- }
222
- init(props) {
223
- this.initializationProps = props;
224
- const context = this.contextService.resolve();
225
- return this.runtimeContextService.getRuntimeContext(props.productId, props.offeringId).pipe(tap(runtimeContext => {
226
- this.uiDefinitionProperties = getUIDefinitionProperties(runtimeContext.uiDefinitionContainer);
227
- const { PriceListId } = context.properties ?? {};
228
- const mergeContext = {
229
- ...runtimeContext,
230
- properties: {
231
- ...runtimeContext.properties,
232
- ...context.properties,
233
- PricingEnabled: PriceListId ? 'true' : 'false',
234
- },
235
- };
236
- this.id15to18('AccountId', mergeContext.properties);
237
- this._runtimeContext = mergeContext;
238
- if (context.properties && this._runtimeContext.properties?.StartDate) {
239
- this.contextService.update({
240
- properties: {
241
- ...this._runtimeContext.properties,
242
- ...context.properties,
243
- },
244
- });
245
- }
246
- return this._runtimeContext;
247
- }), tap(() => (this._isInitialized = true)));
248
- }
249
- overrideUIDefinition(uiDefinitionContainer) {
250
- if (!this._runtimeContext) {
251
- return;
252
- }
253
- this._runtimeContext.uiDefinitionContainer = uiDefinitionContainer;
254
- this.uiDefinitionProperties = getUIDefinitionProperties(uiDefinitionContainer);
255
- }
256
- id15to18(propertyName, source) {
257
- if (!source) {
258
- return;
259
- }
260
- const value = source[propertyName];
261
- if (typeof value === 'string' && value.length === 15) {
262
- source[propertyName] = SalesforceIdUtils.generateId18FromId15(value);
263
- }
264
- }
265
- get isInitialized() {
266
- return this._isInitialized;
267
- }
268
- get runtimeModel() {
269
- return this.runtimeContext?.runtimeModel;
270
- }
271
- get runtimeContext() {
272
- return this._runtimeContext;
273
- }
274
- }
275
- ConfigurationRuntimeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfigurationRuntimeService, deps: [{ token: i1.ConfigurationApiService }, { token: ContextService }, { token: RuntimeContextService }], target: i0.ɵɵFactoryTarget.Injectable });
276
- ConfigurationRuntimeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfigurationRuntimeService });
277
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfigurationRuntimeService, decorators: [{
278
- type: Injectable
279
- }], ctorParameters: function () { return [{ type: i1.ConfigurationApiService }, { type: ContextService }, { type: RuntimeContextService }]; } });
280
-
281
134
  class QuoteDraftService {
282
135
  get isInitialized() {
283
136
  return this.isInitializedSubj$.getValue();
@@ -493,9 +346,9 @@ class QuoteDraftService {
493
346
  }
494
347
  }
495
348
  }
496
- QuoteDraftService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: QuoteDraftService, deps: [{ token: ContextService }, { token: i1.QuoteApiService }, { token: i1.PriceApiService }], target: i0.ɵɵFactoryTarget.Injectable });
497
- QuoteDraftService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: QuoteDraftService, providedIn: 'root' });
498
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: QuoteDraftService, decorators: [{
349
+ QuoteDraftService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteDraftService, deps: [{ token: ContextService }, { token: i1.QuoteApiService }, { token: i1.PriceApiService }], target: i0.ɵɵFactoryTarget.Injectable });
350
+ QuoteDraftService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteDraftService, providedIn: 'root' });
351
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteDraftService, decorators: [{
499
352
  type: Injectable,
500
353
  args: [{ providedIn: 'root' }]
501
354
  }], ctorParameters: function () { return [{ type: ContextService }, { type: i1.QuoteApiService }, { type: i1.PriceApiService }]; } });
@@ -708,6 +561,26 @@ var lineItem_utils = /*#__PURE__*/Object.freeze({
708
561
  upsertAttributes: upsertAttributes
709
562
  });
710
563
 
564
+ const FORMATTING_SETTINGS_TOKEN = new InjectionToken('Summary of formatting settings for variant types of data, e.g. numbers, text, dates, etc');
565
+
566
+ var RuntimeMode;
567
+ (function (RuntimeMode) {
568
+ RuntimeMode[RuntimeMode["TEST"] = 0] = "TEST";
569
+ RuntimeMode[RuntimeMode["PROD"] = 1] = "PROD";
570
+ })(RuntimeMode || (RuntimeMode = {}));
571
+ var RuntimeOperation;
572
+ (function (RuntimeOperation) {
573
+ RuntimeOperation["INIT"] = "INIT";
574
+ RuntimeOperation["UPDATE"] = "UPDATE";
575
+ })(RuntimeOperation || (RuntimeOperation = {}));
576
+ var RuntimeStep;
577
+ (function (RuntimeStep) {
578
+ RuntimeStep["START"] = "START";
579
+ RuntimeStep["UPDATE"] = "UPDATE";
580
+ })(RuntimeStep || (RuntimeStep = {}));
581
+
582
+ const UI_DEFINITION_VERSION = 3;
583
+
711
584
  class LineItemWorker {
712
585
  constructor(src) {
713
586
  this.li = { ...src };
@@ -738,6 +611,7 @@ class ConfigurationService {
738
611
  this.lineItem = new BehaviorSubject(undefined);
739
612
  this.charges = new BehaviorSubject({});
740
613
  this.pricePlans = new BehaviorSubject({});
614
+ this.procedureContext = new BehaviorSubject({});
741
615
  this.isLoadingSubj$ = new BehaviorSubject(false);
742
616
  this.isLoading$ = this.isLoadingSubj$.asObservable();
743
617
  this.hasUnsavedChanges = false;
@@ -814,6 +688,12 @@ class ConfigurationService {
814
688
  get pricePlansSnapshot() {
815
689
  return this.pricePlans.value;
816
690
  }
691
+ get procedureContext$() {
692
+ return this.procedureContext.asObservable();
693
+ }
694
+ get procedureContextSnapshot() {
695
+ return this.procedureContext.value;
696
+ }
817
697
  configure() {
818
698
  return this.configureRequest$(this.generateRequest());
819
699
  }
@@ -824,10 +704,11 @@ class ConfigurationService {
824
704
  const mainPricingEnabled = runtimeContext.properties?.PricingEnabled;
825
705
  const pricingEnabled = mainPricingEnabled ? mainPricingEnabled === 'true' : uiDefinitionProperties.pricingEnabled;
826
706
  this.isLoadingSubj$.next(true);
827
- return this.configurationApiService.configureLineItem({ configurationRequest, runtimeModel, pricingEnabled }).pipe(tap(({ lineItem, context, charges, pricePlans, deletedLineItems }) => {
707
+ return this.configurationApiService.configureLineItem({ configurationRequest, runtimeModel, pricingEnabled }).pipe(tap(({ lineItem, context, charges, pricePlans, deletedLineItems, procedureContext }) => {
828
708
  this.contextService.update(context ?? {});
829
709
  this.charges.next(charges ?? {});
830
710
  this.pricePlans.next(pricePlans ?? {});
711
+ this.procedureContext.next(procedureContext ?? {});
831
712
  if (lineItem) {
832
713
  this.lineItem.next(lineItem);
833
714
  }
@@ -920,179 +801,50 @@ class ConfigurationService {
920
801
  return this.quoteDraftService.quoteDraft?.initialState.find(a => a.id === lineItem.openOrderLineItemId || a.id === lineItem.assetId);
921
802
  }
922
803
  }
923
- ConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfigurationService, deps: [{ token: QuoteDraftService }, { token: ConfigurationRuntimeService }, { token: ContextService }, { token: i1.ConfigurationApiService }, { token: i5.MessageService }, { token: i6.DialogService }], target: i0.ɵɵFactoryTarget.Injectable });
924
- ConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfigurationService });
925
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfigurationService, decorators: [{
804
+ ConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationService, deps: [{ token: QuoteDraftService }, { token: ConfigurationRuntimeService }, { token: ContextService }, { token: i1.ConfigurationApiService }, { token: i5.MessageService }, { token: i6.DialogService }], target: i0.ɵɵFactoryTarget.Injectable });
805
+ ConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationService });
806
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationService, decorators: [{
926
807
  type: Injectable
927
808
  }], ctorParameters: function () { return [{ type: QuoteDraftService }, { type: ConfigurationRuntimeService }, { type: ContextService }, { type: i1.ConfigurationApiService }, { type: i5.MessageService }, { type: i6.DialogService }]; } });
928
809
 
929
- class ConfigurationState {
930
- constructor(statefulConfigurationApiService, runtimeService, configurationService, toastService) {
931
- this.statefulConfigurationApiService = statefulConfigurationApiService;
932
- this.runtimeService = runtimeService;
933
- this.configurationService = configurationService;
934
- this.toastService = toastService;
935
- this.stateSubj$ = new BehaviorSubject({});
936
- this.state$ = this.stateSubj$.asObservable();
937
- this.stateId = null;
938
- }
939
- init$() {
940
- return this.configurationService.configure().pipe(switchMap$1(() => {
941
- if (!this.isStatefulConfiguration) {
942
- return of(undefined);
943
- }
944
- const { actions, selectors } = this.runtimeService.runtimeContext?.uiDefinitionContainer ?? {};
945
- return this.statefulConfigurationApiService.init({
946
- request: this.configurationService.generateRequest(),
947
- actions: actions?.map(action => ({ name: action.apiName, script: action.script })),
948
- selectors: selectors?.map(selector => ({ name: selector.apiName, script: selector.script })),
810
+ function extractMetadata(uiDefinition) {
811
+ return omit(uiDefinition, [
812
+ 'children',
813
+ 'pages',
814
+ 'components',
815
+ ]);
816
+ }
817
+
818
+ class FlowUpdateService {
819
+ update(rootLineItems, updates, charges) {
820
+ let remainingUpdates = [...updates];
821
+ let currentLevel = rootLineItems;
822
+ while (currentLevel.length && remainingUpdates.length) {
823
+ currentLevel.forEach(li => {
824
+ const unhandledUpdates = [];
825
+ remainingUpdates.forEach(update => {
826
+ let updated = false;
827
+ switch (update.dataType) {
828
+ case 'LINEITEM':
829
+ updated = this.applyLineItemUpdate(li, update, charges);
830
+ break;
831
+ case 'CHARGE':
832
+ updated = this.applyChargeUpdate(li, update);
833
+ break;
834
+ case 'GROUP_CHARGE':
835
+ updated = this.applyChargeGroupUpdate(li, update);
836
+ break;
837
+ default:
838
+ // Unknown dataType. Do not try to handle it anymore
839
+ updated = true;
840
+ }
841
+ if (!updated) {
842
+ unhandledUpdates.push(update);
843
+ }
844
+ });
845
+ remainingUpdates = unhandledUpdates;
949
846
  });
950
- }), tap$1(stateId => (this.stateId = stateId || null)), map$2(() => undefined));
951
- }
952
- cleanup() {
953
- this.stateId = null;
954
- this.configurationService.reset();
955
- this.stateSubj$.next({});
956
- }
957
- execute$(req) {
958
- if (this.isStatefulConfiguration) {
959
- return this.executeStateful$(req);
960
- }
961
- else {
962
- return this.executeStateless$(req);
963
- }
964
- }
965
- dispatch$(actionName, inputData) {
966
- return this.execute$({ actions: [{ name: actionName, inputData }] });
967
- }
968
- select$(selectorName, inputData) {
969
- const requestId = UUID.UUID();
970
- return this.execute$({
971
- selectors: {
972
- [requestId]: {
973
- name: selectorName,
974
- inputData,
975
- },
976
- },
977
- }).pipe(map$2(() => this.stateSubj$.value[requestId]), tap$1(() => this.stateSubj$.next(omit(this.stateSubj$.value, requestId))));
978
- }
979
- get isStatefulConfiguration() {
980
- return this.runtimeService.uiDefinitionProperties.statefulConfigurationEnabled ?? false;
981
- }
982
- executeStateless$(request) {
983
- return of(undefined).pipe(switchMap$1(() => {
984
- // Apply actions and execute configuration/price call
985
- // No need to run configuration if no actions in the request
986
- if (!request.actions?.length) {
987
- return of(undefined);
988
- }
989
- let configurationRequest = this.configurationService.generateRequest();
990
- request.actions.forEach(action => {
991
- configurationRequest = this.executeActionScript(configurationRequest, action) ?? configurationRequest;
992
- });
993
- return this.configurationService.configureRequest$(configurationRequest);
994
- }), tap$1(() => {
995
- if (!request.selectors) {
996
- return;
997
- }
998
- // Run selectors and apply them to the state
999
- const finalConfigurationRequest = this.configurationService.generateRequest();
1000
- const selectorsResult = EntityUtil.entries(request.selectors).reduce((trunk, [key, selector]) => {
1001
- trunk[key] = this.executeSelectorScript(finalConfigurationRequest, selector);
1002
- return trunk;
1003
- }, {});
1004
- this.stateSubj$.next({
1005
- ...this.stateSubj$.value,
1006
- ...selectorsResult,
1007
- });
1008
- }), map$2(() => undefined));
1009
- }
1010
- executeStateful$(request) {
1011
- if (!this.stateId) {
1012
- return of(undefined);
1013
- }
1014
- return this.statefulConfigurationApiService.execute(this.stateId, request).pipe(tap$1(response => {
1015
- this.stateId = response.stateId;
1016
- const updatedState = this.stateSubj$.value;
1017
- EntityUtil.entries(response.selectors).forEach(([key, value]) => {
1018
- if (!value.success) {
1019
- if (!this.runtimeService.uiDefinitionProperties.suppressToastMessages) {
1020
- this.toastService.add({ summary: value.errorMessage, severity: ToastType.error });
1021
- }
1022
- return;
1023
- }
1024
- updatedState[key] = value.result;
1025
- });
1026
- this.stateSubj$.next(updatedState);
1027
- }), map$2(() => undefined));
1028
- }
1029
- executeActionScript(request, processor) {
1030
- const { actions } = this.runtimeService.runtimeContext?.uiDefinitionContainer ?? {};
1031
- const script = actions?.find(action => action.apiName === processor.name)?.script;
1032
- if (!script) {
1033
- return null;
1034
- }
1035
- return this.executeProcessorScript(request, script, processor.inputData);
1036
- }
1037
- executeSelectorScript(request, processor) {
1038
- const { selectors } = this.runtimeService.runtimeContext?.uiDefinitionContainer ?? {};
1039
- const script = selectors?.find(selector => selector.apiName === processor.name)?.script;
1040
- if (!script) {
1041
- return null;
1042
- }
1043
- return this.executeProcessorScript(request, script, processor.inputData);
1044
- }
1045
- executeProcessorScript(request, script, inputData) {
1046
- return new Function(`${script}\nreturn transform;`)()({
1047
- request,
1048
- inputData: inputData,
1049
- });
1050
- }
1051
- }
1052
- ConfigurationState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfigurationState, deps: [{ token: i1.StatefulConfigurationApiService }, { token: ConfigurationRuntimeService }, { token: ConfigurationService }, { token: i4.ToastService }], target: i0.ɵɵFactoryTarget.Injectable });
1053
- ConfigurationState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfigurationState });
1054
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfigurationState, decorators: [{
1055
- type: Injectable
1056
- }], ctorParameters: function () { return [{ type: i1.StatefulConfigurationApiService }, { type: ConfigurationRuntimeService }, { type: ConfigurationService }, { type: i4.ToastService }]; } });
1057
-
1058
- function extractMetadata(uiDefinition) {
1059
- return omit(uiDefinition, [
1060
- 'children',
1061
- 'pages',
1062
- 'components',
1063
- ]);
1064
- }
1065
-
1066
- class FlowUpdateService {
1067
- update(rootLineItems, updates, charges) {
1068
- let remainingUpdates = [...updates];
1069
- let currentLevel = rootLineItems;
1070
- while (currentLevel.length && remainingUpdates.length) {
1071
- currentLevel.forEach(li => {
1072
- const unhandledUpdates = [];
1073
- remainingUpdates.forEach(update => {
1074
- let updated = false;
1075
- switch (update.dataType) {
1076
- case 'LINEITEM':
1077
- updated = this.applyLineItemUpdate(li, update, charges);
1078
- break;
1079
- case 'CHARGE':
1080
- updated = this.applyChargeUpdate(li, update);
1081
- break;
1082
- case 'GROUP_CHARGE':
1083
- updated = this.applyChargeGroupUpdate(li, update);
1084
- break;
1085
- default:
1086
- // Unknown dataType. Do not try to handle it anymore
1087
- updated = true;
1088
- }
1089
- if (!updated) {
1090
- unhandledUpdates.push(update);
1091
- }
1092
- });
1093
- remainingUpdates = unhandledUpdates;
1094
- });
1095
- currentLevel = flatten(currentLevel.map(parent => parent.lineItems));
847
+ currentLevel = flatten(currentLevel.map(parent => parent.lineItems));
1096
848
  }
1097
849
  }
1098
850
  delete(lineItems, id) {
@@ -1135,6 +887,7 @@ class FlowUpdateService {
1135
887
  }
1136
888
  break;
1137
889
  case 'LIST_PRICE_ADJUSTMENT':
890
+ case 'MARGIN_ADJUSTMENT':
1138
891
  {
1139
892
  const charge = lineItem.chargeItems.find(charge => (charges || {})[charge.chargeId]?.main);
1140
893
  if (charge) {
@@ -1142,19 +895,11 @@ class FlowUpdateService {
1142
895
  }
1143
896
  }
1144
897
  break;
1145
- case 'COST':
898
+ case 'COST_ADJUSTMENT':
1146
899
  {
1147
900
  const charge = lineItem.chargeItems.find(charge => (charges || {})[charge.chargeId]?.main);
1148
901
  if (charge) {
1149
- charge.netCost = update.newValue;
1150
- }
1151
- }
1152
- break;
1153
- case 'MARGIN_PERCENT':
1154
- {
1155
- const charge = lineItem.chargeItems.find(charge => (charges || {})[charge.chargeId]?.main);
1156
- if (charge) {
1157
- charge.marginPercent = update.newValue;
902
+ charge.costAdjustment = update.newValue;
1158
903
  }
1159
904
  }
1160
905
  break;
@@ -1196,9 +941,9 @@ class FlowUpdateService {
1196
941
  return true;
1197
942
  }
1198
943
  }
1199
- FlowUpdateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FlowUpdateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1200
- FlowUpdateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FlowUpdateService });
1201
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FlowUpdateService, decorators: [{
944
+ FlowUpdateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowUpdateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
945
+ FlowUpdateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowUpdateService });
946
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowUpdateService, decorators: [{
1202
947
  type: Injectable
1203
948
  }] });
1204
949
 
@@ -1331,54 +1076,12 @@ class FlowConfigurationService {
1331
1076
  };
1332
1077
  }
1333
1078
  }
1334
- FlowConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FlowConfigurationService, deps: [{ token: i1.ProceduresApiService }, { token: ContextService }, { token: QuoteDraftService }, { token: FlowUpdateService }, { token: ConfigurationService }], target: i0.ɵɵFactoryTarget.Injectable });
1335
- FlowConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FlowConfigurationService });
1336
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FlowConfigurationService, decorators: [{
1079
+ FlowConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowConfigurationService, deps: [{ token: i1.ProceduresApiService }, { token: ContextService }, { token: QuoteDraftService }, { token: FlowUpdateService }, { token: ConfigurationService }], target: i0.ɵɵFactoryTarget.Injectable });
1080
+ FlowConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowConfigurationService });
1081
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowConfigurationService, decorators: [{
1337
1082
  type: Injectable
1338
1083
  }], ctorParameters: function () { return [{ type: i1.ProceduresApiService }, { type: ContextService }, { type: QuoteDraftService }, { type: FlowUpdateService }, { type: ConfigurationService }]; } });
1339
1084
 
1340
- class FlowConfigurationModule {
1341
- }
1342
- FlowConfigurationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FlowConfigurationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1343
- FlowConfigurationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.8", ngImport: i0, type: FlowConfigurationModule });
1344
- FlowConfigurationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FlowConfigurationModule, providers: [FlowConfigurationService, FlowUpdateService, PriceApiService] });
1345
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FlowConfigurationModule, decorators: [{
1346
- type: NgModule,
1347
- args: [{
1348
- imports: [],
1349
- providers: [FlowConfigurationService, FlowUpdateService, PriceApiService],
1350
- }]
1351
- }] });
1352
-
1353
- class ConfigurationModule {
1354
- }
1355
- ConfigurationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfigurationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1356
- ConfigurationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.8", ngImport: i0, type: ConfigurationModule, imports: [ConfirmationDialogModule] });
1357
- ConfigurationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfigurationModule, providers: [
1358
- ContextApiService,
1359
- ProductModelApiService,
1360
- ConfigurationApiService,
1361
- ConfigurationRuntimeService,
1362
- RuntimeContextService,
1363
- ConfigurationService,
1364
- ConfigurationState,
1365
- ], imports: [ConfirmationDialogModule] });
1366
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfigurationModule, decorators: [{
1367
- type: NgModule,
1368
- args: [{
1369
- imports: [ConfirmationDialogModule],
1370
- providers: [
1371
- ContextApiService,
1372
- ProductModelApiService,
1373
- ConfigurationApiService,
1374
- ConfigurationRuntimeService,
1375
- RuntimeContextService,
1376
- ConfigurationService,
1377
- ConfigurationState,
1378
- ],
1379
- }]
1380
- }] });
1381
-
1382
1085
  function calculateMetricByMethod(lineItems, metric, method) {
1383
1086
  const items = getLineItemsByMethod(lineItems, method);
1384
1087
  return items.reduce((acc, li) => {
@@ -1488,9 +1191,9 @@ class MetricsCalculationService {
1488
1191
  return this.activeMetricRules.find(metricRule => metricRule.metrics.find(metric => metric.totalName === name));
1489
1192
  }
1490
1193
  }
1491
- MetricsCalculationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: MetricsCalculationService, deps: [{ token: QuoteDraftService }, { token: FlowConfigurationService }, { token: i1.ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1492
- MetricsCalculationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: MetricsCalculationService, providedIn: 'root' });
1493
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: MetricsCalculationService, decorators: [{
1194
+ MetricsCalculationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MetricsCalculationService, deps: [{ token: QuoteDraftService }, { token: FlowConfigurationService }, { token: i1.ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1195
+ MetricsCalculationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MetricsCalculationService, providedIn: 'root' });
1196
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MetricsCalculationService, decorators: [{
1494
1197
  type: Injectable,
1495
1198
  args: [{ providedIn: 'root' }]
1496
1199
  }], ctorParameters: function () { return [{ type: QuoteDraftService }, { type: FlowConfigurationService }, { type: i1.ConfigurationSettingsApiService }]; } });
@@ -1514,9 +1217,9 @@ class ProductImagesService {
1514
1217
  .subscribe();
1515
1218
  }
1516
1219
  }
1517
- ProductImagesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProductImagesService, deps: [{ token: i1.ProductApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1518
- ProductImagesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProductImagesService, providedIn: 'root' });
1519
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProductImagesService, decorators: [{
1220
+ ProductImagesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductImagesService, deps: [{ token: i1.ProductApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1221
+ ProductImagesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductImagesService, providedIn: 'root' });
1222
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductImagesService, decorators: [{
1520
1223
  type: Injectable,
1521
1224
  args: [{ providedIn: 'root' }]
1522
1225
  }], ctorParameters: function () { return [{ type: i1.ProductApiService }]; } });
@@ -1565,6 +1268,7 @@ class RuntimeSettingsService {
1565
1268
  const decimalsCount = priceScale !== null && priceScale !== '' && !isNaN(Number(priceScale)) && Number(priceScale) >= 0
1566
1269
  ? Number(priceScale)
1567
1270
  : DEFAULT_DECIMALS_COUNT;
1271
+ const actionCodeSettings = shoppingCartSettings?.STATUS_LABEL;
1568
1272
  return {
1569
1273
  currencySymbol: currencySettings.symbol,
1570
1274
  dateFormats: getSupportedDateFormats(dateFormat),
@@ -1576,6 +1280,9 @@ class RuntimeSettingsService {
1576
1280
  thousandsSeparator: thousandsSeparator !== undefined && ['.', ',', '', null].includes(thousandsSeparator)
1577
1281
  ? thousandsSeparator || ''
1578
1282
  : DEFAULT_THOUSANDS_SEPARATOR,
1283
+ actionCodeLabels: actionCodeSettings?.length
1284
+ ? actionCodeSettings.reduce((result, setting) => ({ ...result, [setting.status_label]: setting.custom_label }), {})
1285
+ : DEFAULT_ACTION_CODE_LABELS,
1579
1286
  };
1580
1287
  }
1581
1288
  getConfigurationSettings() {
@@ -1603,25 +1310,333 @@ class RuntimeSettingsService {
1603
1310
  }, {});
1604
1311
  }
1605
1312
  }
1606
- RuntimeSettingsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RuntimeSettingsService, deps: [{ token: i1.ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1607
- RuntimeSettingsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RuntimeSettingsService, providedIn: 'root' });
1608
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RuntimeSettingsService, decorators: [{
1313
+ RuntimeSettingsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeSettingsService, deps: [{ token: i1.ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1314
+ RuntimeSettingsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeSettingsService, providedIn: 'root' });
1315
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeSettingsService, decorators: [{
1609
1316
  type: Injectable,
1610
1317
  args: [{ providedIn: 'root' }]
1611
1318
  }], ctorParameters: function () { return [{ type: i1.ConfigurationSettingsApiService }]; } });
1612
1319
 
1320
+ class RuntimeContextService {
1321
+ constructor(configurationApiService) {
1322
+ this.configurationApiService = configurationApiService;
1323
+ }
1324
+ getRuntimeContext(productId, offeringId) {
1325
+ return this.configurationApiService.getRuntimeDataByProductId(productId, offeringId).pipe(map(runtimeData => {
1326
+ const uiDefinitionContainer = this.getUIDefinitionContainer(runtimeData);
1327
+ const runtimeModel = RuntimeModel.create(runtimeData.types, runtimeData.products);
1328
+ const { productName, properties } = Array.from(runtimeModel.components.values()).find(c => c.productId === productId) ?? {};
1329
+ const uiDefinitionProperties = getUIDefinitionProperties(uiDefinitionContainer);
1330
+ return {
1331
+ modelId: runtimeData.modelId,
1332
+ uiDefinitionContainer: uiDefinitionContainer,
1333
+ runtimeModel: runtimeModel,
1334
+ runtimeMode: RuntimeMode.PROD,
1335
+ productId: productId,
1336
+ productType: properties?.['displayName'] || productName,
1337
+ offeringId: offeringId,
1338
+ properties: {
1339
+ PricingEnabled: uiDefinitionProperties.pricingEnabled ? 'true' : 'false',
1340
+ PriceListId: uiDefinitionProperties.priceList,
1341
+ },
1342
+ };
1343
+ }));
1344
+ }
1345
+ getUIDefinitionContainer(runtimeData) {
1346
+ const containers = runtimeData.uiDefinitions.filter(container => !isLegacyUIDefinition(container.source));
1347
+ return containers.find(container => container.source.primary) ?? containers[0];
1348
+ }
1349
+ }
1350
+ RuntimeContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeContextService, deps: [{ token: i1.ConfigurationApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1351
+ RuntimeContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeContextService });
1352
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeContextService, decorators: [{
1353
+ type: Injectable
1354
+ }], ctorParameters: function () { return [{ type: i1.ConfigurationApiService }]; } });
1355
+
1356
+ class ConfigurationRuntimeService {
1357
+ constructor(apiService, contextService, runtimeContextService) {
1358
+ this.apiService = apiService;
1359
+ this.contextService = contextService;
1360
+ this.runtimeContextService = runtimeContextService;
1361
+ this._isInitialized = false;
1362
+ this.uiDefinitionProperties = {};
1363
+ }
1364
+ reset() {
1365
+ this._isInitialized = false;
1366
+ this._runtimeContext = undefined;
1367
+ this.initializationProps = undefined;
1368
+ this.uiDefinitionProperties = {};
1369
+ }
1370
+ initTestMode(uiDefinitionContainer) {
1371
+ this.uiDefinitionProperties = getUIDefinitionProperties(uiDefinitionContainer);
1372
+ const uiDefinitionExternals = uiDefinitionContainer.source.externals ?? {};
1373
+ return combineLatest([
1374
+ this.apiService.getRuntimeDataByModelId(uiDefinitionContainer.modelId),
1375
+ this.contextService.initTestMode(),
1376
+ ]).pipe(first(), map(([runtimeData, context]) => {
1377
+ this.contextService.update({
1378
+ properties: {
1379
+ ...this.runtimeContext?.properties,
1380
+ ...context.properties,
1381
+ ModelId: uiDefinitionContainer.modelId,
1382
+ PricingEnabled: this.uiDefinitionProperties.pricingEnabled ? 'true' : 'false',
1383
+ PriceListId: this.uiDefinitionProperties.priceList,
1384
+ offeringId: this.uiDefinitionProperties.offeringId,
1385
+ ...uiDefinitionExternals,
1386
+ },
1387
+ });
1388
+ this._runtimeContext = {
1389
+ modelId: uiDefinitionContainer.modelId,
1390
+ runtimeModel: RuntimeModel.create(runtimeData.types, runtimeData.products),
1391
+ runtimeMode: RuntimeMode.TEST,
1392
+ uiDefinitionContainer,
1393
+ };
1394
+ return this._runtimeContext;
1395
+ }), tap(() => (this._isInitialized = true)));
1396
+ }
1397
+ init(props) {
1398
+ this.initializationProps = props;
1399
+ const context = this.contextService.resolve();
1400
+ return this.runtimeContextService.getRuntimeContext(props.productId, props.offeringId).pipe(tap(runtimeContext => {
1401
+ this.uiDefinitionProperties = getUIDefinitionProperties(runtimeContext.uiDefinitionContainer);
1402
+ const { PriceListId } = context.properties ?? {};
1403
+ const mergeContext = {
1404
+ ...runtimeContext,
1405
+ properties: {
1406
+ ...runtimeContext.properties,
1407
+ ...context.properties,
1408
+ PricingEnabled: PriceListId ? 'true' : 'false',
1409
+ },
1410
+ };
1411
+ this.id15to18('AccountId', mergeContext.properties);
1412
+ this._runtimeContext = mergeContext;
1413
+ if (context.properties && this._runtimeContext.properties?.StartDate) {
1414
+ this.contextService.update({
1415
+ properties: {
1416
+ ...this._runtimeContext.properties,
1417
+ ...context.properties,
1418
+ },
1419
+ });
1420
+ }
1421
+ return this._runtimeContext;
1422
+ }), tap(() => (this._isInitialized = true)));
1423
+ }
1424
+ overrideUIDefinition(uiDefinitionContainer) {
1425
+ if (!this._runtimeContext) {
1426
+ return;
1427
+ }
1428
+ this._runtimeContext.uiDefinitionContainer = uiDefinitionContainer;
1429
+ this.uiDefinitionProperties = getUIDefinitionProperties(uiDefinitionContainer);
1430
+ }
1431
+ id15to18(propertyName, source) {
1432
+ if (!source) {
1433
+ return;
1434
+ }
1435
+ const value = source[propertyName];
1436
+ if (typeof value === 'string' && value.length === 15) {
1437
+ source[propertyName] = SalesforceIdUtils.generateId18FromId15(value);
1438
+ }
1439
+ }
1440
+ get isInitialized() {
1441
+ return this._isInitialized;
1442
+ }
1443
+ get runtimeModel() {
1444
+ return this.runtimeContext?.runtimeModel;
1445
+ }
1446
+ get runtimeContext() {
1447
+ return this._runtimeContext;
1448
+ }
1449
+ }
1450
+ ConfigurationRuntimeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationRuntimeService, deps: [{ token: i1.ConfigurationApiService }, { token: ContextService }, { token: RuntimeContextService }], target: i0.ɵɵFactoryTarget.Injectable });
1451
+ ConfigurationRuntimeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationRuntimeService });
1452
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationRuntimeService, decorators: [{
1453
+ type: Injectable
1454
+ }], ctorParameters: function () { return [{ type: i1.ConfigurationApiService }, { type: ContextService }, { type: RuntimeContextService }]; } });
1455
+
1456
+ class ConfigurationState {
1457
+ constructor(statefulConfigurationApiService, runtimeService, configurationService, toastService) {
1458
+ this.statefulConfigurationApiService = statefulConfigurationApiService;
1459
+ this.runtimeService = runtimeService;
1460
+ this.configurationService = configurationService;
1461
+ this.toastService = toastService;
1462
+ this.stateSubj$ = new BehaviorSubject({});
1463
+ this.state$ = this.stateSubj$.asObservable();
1464
+ this.stateId = null;
1465
+ }
1466
+ init$() {
1467
+ return this.configurationService.configure().pipe(switchMap$1(() => {
1468
+ if (!this.isStatefulConfiguration) {
1469
+ return of(undefined);
1470
+ }
1471
+ const { actions, selectors } = this.runtimeService.runtimeContext?.uiDefinitionContainer ?? {};
1472
+ return this.statefulConfigurationApiService.init({
1473
+ request: this.configurationService.generateRequest(),
1474
+ actions: actions?.map(action => ({ name: action.apiName, script: action.script })),
1475
+ selectors: selectors?.map(selector => ({ name: selector.apiName, script: selector.script })),
1476
+ });
1477
+ }), tap$1(stateId => (this.stateId = stateId || null)), map$2(() => undefined));
1478
+ }
1479
+ cleanup() {
1480
+ this.stateId = null;
1481
+ this.configurationService.reset();
1482
+ this.stateSubj$.next({});
1483
+ }
1484
+ execute$(req) {
1485
+ if (this.isStatefulConfiguration) {
1486
+ return this.executeStateful$(req);
1487
+ }
1488
+ else {
1489
+ return this.executeStateless$(req);
1490
+ }
1491
+ }
1492
+ dispatch$(actionName, inputData) {
1493
+ return this.execute$({ actions: [{ name: actionName, inputData }] });
1494
+ }
1495
+ select$(selectorName, inputData) {
1496
+ const requestId = UUID.UUID();
1497
+ return this.execute$({
1498
+ selectors: {
1499
+ [requestId]: {
1500
+ name: selectorName,
1501
+ inputData,
1502
+ },
1503
+ },
1504
+ }).pipe(map$2(() => this.stateSubj$.value[requestId]), tap$1(() => this.stateSubj$.next(omit(this.stateSubj$.value, requestId))));
1505
+ }
1506
+ get isStatefulConfiguration() {
1507
+ return this.runtimeService.uiDefinitionProperties.statefulConfigurationEnabled ?? false;
1508
+ }
1509
+ executeStateless$(request) {
1510
+ return of(undefined).pipe(switchMap$1(() => {
1511
+ // Apply actions and execute configuration/price call
1512
+ // No need to run configuration if no actions in the request
1513
+ if (!request.actions?.length) {
1514
+ return of(undefined);
1515
+ }
1516
+ let configurationRequest = this.configurationService.generateRequest();
1517
+ request.actions.forEach(action => {
1518
+ configurationRequest = this.executeActionScript(configurationRequest, action) ?? configurationRequest;
1519
+ });
1520
+ return this.configurationService.configureRequest$(configurationRequest);
1521
+ }), tap$1(() => {
1522
+ if (!request.selectors) {
1523
+ return;
1524
+ }
1525
+ // Run selectors and apply them to the state
1526
+ const finalConfigurationRequest = this.configurationService.generateRequest();
1527
+ const selectorsResult = EntityUtil.entries(request.selectors).reduce((trunk, [key, selector]) => {
1528
+ trunk[key] = this.executeSelectorScript(finalConfigurationRequest, selector);
1529
+ return trunk;
1530
+ }, {});
1531
+ this.stateSubj$.next({
1532
+ ...this.stateSubj$.value,
1533
+ ...selectorsResult,
1534
+ });
1535
+ }), map$2(() => undefined));
1536
+ }
1537
+ executeStateful$(request) {
1538
+ if (!this.stateId) {
1539
+ return of(undefined);
1540
+ }
1541
+ return this.statefulConfigurationApiService.execute(this.stateId, request).pipe(tap$1(response => {
1542
+ this.stateId = response.stateId;
1543
+ const updatedState = this.stateSubj$.value;
1544
+ EntityUtil.entries(response.selectors).forEach(([key, value]) => {
1545
+ if (!value.success) {
1546
+ if (!this.runtimeService.uiDefinitionProperties.suppressToastMessages) {
1547
+ this.toastService.add({ summary: value.errorMessage, severity: ToastType.error });
1548
+ }
1549
+ return;
1550
+ }
1551
+ updatedState[key] = value.result;
1552
+ });
1553
+ this.stateSubj$.next(updatedState);
1554
+ }), map$2(() => undefined));
1555
+ }
1556
+ executeActionScript(request, processor) {
1557
+ const { actions } = this.runtimeService.runtimeContext?.uiDefinitionContainer ?? {};
1558
+ const script = actions?.find(action => action.apiName === processor.name)?.script;
1559
+ if (!script) {
1560
+ return null;
1561
+ }
1562
+ return this.executeProcessorScript(request, script, processor.inputData);
1563
+ }
1564
+ executeSelectorScript(request, processor) {
1565
+ const { selectors } = this.runtimeService.runtimeContext?.uiDefinitionContainer ?? {};
1566
+ const script = selectors?.find(selector => selector.apiName === processor.name)?.script;
1567
+ if (!script) {
1568
+ return null;
1569
+ }
1570
+ return this.executeProcessorScript(request, script, processor.inputData);
1571
+ }
1572
+ executeProcessorScript(request, script, inputData) {
1573
+ return new Function(`${script}\nreturn transform;`)()({
1574
+ request,
1575
+ inputData: inputData,
1576
+ });
1577
+ }
1578
+ }
1579
+ ConfigurationState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationState, deps: [{ token: i1.StatefulConfigurationApiService }, { token: ConfigurationRuntimeService }, { token: ConfigurationService }, { token: i4.ToastService }], target: i0.ɵɵFactoryTarget.Injectable });
1580
+ ConfigurationState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationState });
1581
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationState, decorators: [{
1582
+ type: Injectable
1583
+ }], ctorParameters: function () { return [{ type: i1.StatefulConfigurationApiService }, { type: ConfigurationRuntimeService }, { type: ConfigurationService }, { type: i4.ToastService }]; } });
1584
+
1585
+ class FlowConfigurationModule {
1586
+ }
1587
+ FlowConfigurationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowConfigurationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1588
+ FlowConfigurationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: FlowConfigurationModule });
1589
+ FlowConfigurationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowConfigurationModule, providers: [FlowConfigurationService, FlowUpdateService, PriceApiService] });
1590
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowConfigurationModule, decorators: [{
1591
+ type: NgModule,
1592
+ args: [{
1593
+ imports: [],
1594
+ providers: [FlowConfigurationService, FlowUpdateService, PriceApiService],
1595
+ }]
1596
+ }] });
1597
+
1598
+ class ConfigurationModule {
1599
+ }
1600
+ ConfigurationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1601
+ ConfigurationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationModule, imports: [ConfirmationDialogModule] });
1602
+ ConfigurationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationModule, providers: [
1603
+ ContextApiService,
1604
+ ProductModelApiService,
1605
+ ConfigurationApiService,
1606
+ ConfigurationRuntimeService,
1607
+ RuntimeContextService,
1608
+ ConfigurationService,
1609
+ ConfigurationState,
1610
+ ], imports: [ConfirmationDialogModule] });
1611
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationModule, decorators: [{
1612
+ type: NgModule,
1613
+ args: [{
1614
+ imports: [ConfirmationDialogModule],
1615
+ providers: [
1616
+ ContextApiService,
1617
+ ProductModelApiService,
1618
+ ConfigurationApiService,
1619
+ ConfigurationRuntimeService,
1620
+ RuntimeContextService,
1621
+ ConfigurationService,
1622
+ ConfigurationState,
1623
+ ],
1624
+ }]
1625
+ }] });
1626
+
1613
1627
  const DEFAULT_FORMATTING_SETTINGS = {
1614
1628
  currencySymbol: DEFAULT_CURRENCY_SYMBOL,
1615
1629
  decimalsCount: DEFAULT_DECIMALS_COUNT,
1616
1630
  dateFormats: getSupportedDateFormats(DEFAULT_DATE_FORMAT),
1617
1631
  decimalSeparator: DEFAULT_DECIMAL_SEPARATOR,
1618
1632
  thousandsSeparator: DEFAULT_THOUSANDS_SEPARATOR,
1633
+ actionCodeLabels: DEFAULT_ACTION_CODE_LABELS,
1619
1634
  };
1620
1635
  class SdkCoreModule {
1621
1636
  }
1622
- SdkCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: SdkCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1623
- SdkCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.8", ngImport: i0, type: SdkCoreModule, imports: [ConfigurationModule, FlowConfigurationModule] });
1624
- SdkCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: SdkCoreModule, providers: [
1637
+ SdkCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1638
+ SdkCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: SdkCoreModule, imports: [ConfigurationModule, FlowConfigurationModule] });
1639
+ SdkCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkCoreModule, providers: [
1625
1640
  ContextService,
1626
1641
  QuoteDraftService,
1627
1642
  ProductImagesService,
@@ -1632,7 +1647,7 @@ SdkCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
1632
1647
  useExisting: RuntimeSettingsService,
1633
1648
  },
1634
1649
  ], imports: [ConfigurationModule, FlowConfigurationModule] });
1635
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: SdkCoreModule, decorators: [{
1650
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkCoreModule, decorators: [{
1636
1651
  type: NgModule,
1637
1652
  args: [{
1638
1653
  imports: [ConfigurationModule, FlowConfigurationModule],
@@ -1673,9 +1688,9 @@ class CalendarDirective {
1673
1688
  }
1674
1689
  }
1675
1690
  }
1676
- CalendarDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: CalendarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1677
- CalendarDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.8", type: CalendarDirective, selector: "[vlCalendar]", inputs: { vlCalendar: "vlCalendar" }, ngImport: i0 });
1678
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: CalendarDirective, decorators: [{
1691
+ CalendarDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CalendarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1692
+ CalendarDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: CalendarDirective, selector: "[vlCalendar]", inputs: { vlCalendar: "vlCalendar" }, ngImport: i0 });
1693
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CalendarDirective, decorators: [{
1679
1694
  type: Directive,
1680
1695
  args: [{
1681
1696
  selector: '[vlCalendar]',
@@ -1686,10 +1701,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
1686
1701
 
1687
1702
  class SdkDirectivesModule {
1688
1703
  }
1689
- SdkDirectivesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: SdkDirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1690
- SdkDirectivesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.8", ngImport: i0, type: SdkDirectivesModule, declarations: [CalendarDirective], exports: [CalendarDirective] });
1691
- SdkDirectivesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: SdkDirectivesModule });
1692
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: SdkDirectivesModule, decorators: [{
1704
+ SdkDirectivesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkDirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1705
+ SdkDirectivesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: SdkDirectivesModule, declarations: [CalendarDirective], exports: [CalendarDirective] });
1706
+ SdkDirectivesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkDirectivesModule });
1707
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkDirectivesModule, decorators: [{
1693
1708
  type: NgModule,
1694
1709
  args: [{
1695
1710
  declarations: [CalendarDirective],
@@ -1720,9 +1735,9 @@ class DatePipe {
1720
1735
  }
1721
1736
  }
1722
1737
  }
1723
- DatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: DatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1724
- DatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.8", ngImport: i0, type: DatePipe, name: "vlDate" });
1725
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: DatePipe, decorators: [{
1738
+ DatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1739
+ DatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DatePipe, name: "vlDate" });
1740
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DatePipe, decorators: [{
1726
1741
  type: Pipe,
1727
1742
  args: [{
1728
1743
  name: 'vlDate',
@@ -1742,9 +1757,9 @@ class NumberPipe {
1742
1757
  return formatNumber(price, this.formattingSettings?.thousandsSeparator, this.formattingSettings?.decimalSeparator, this.formattingSettings?.decimalsCount);
1743
1758
  }
1744
1759
  }
1745
- NumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: NumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1746
- NumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.8", ngImport: i0, type: NumberPipe, name: "vlNumber" });
1747
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: NumberPipe, decorators: [{
1760
+ NumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1761
+ NumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: NumberPipe, name: "vlNumber" });
1762
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NumberPipe, decorators: [{
1748
1763
  type: Pipe,
1749
1764
  args: [{
1750
1765
  name: 'vlNumber',
@@ -1767,25 +1782,42 @@ class PricePipe {
1767
1782
  return `${this.formattingSettings?.currencySymbol || DEFAULT_CURRENCY_SYMBOL}${formatNumber(price, this.formattingSettings?.thousandsSeparator, this.formattingSettings?.decimalSeparator, this.formattingSettings?.decimalsCount)}`;
1768
1783
  }
1769
1784
  }
1770
- PricePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PricePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1771
- PricePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.8", ngImport: i0, type: PricePipe, name: "vlPrice" });
1772
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PricePipe, decorators: [{
1785
+ PricePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PricePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1786
+ PricePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: PricePipe, name: "vlPrice" });
1787
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PricePipe, decorators: [{
1773
1788
  type: Pipe,
1774
1789
  args: [{
1775
1790
  name: 'vlPrice',
1776
1791
  }]
1777
1792
  }] });
1778
1793
 
1794
+ class ActionCodePipe {
1795
+ constructor() {
1796
+ this.formattingSettings = inject(FORMATTING_SETTINGS_TOKEN, { optional: true })?.getFormattingSettings();
1797
+ }
1798
+ transform(actionCode) {
1799
+ return this.formattingSettings?.actionCodeLabels[actionCode] ?? actionCode;
1800
+ }
1801
+ }
1802
+ ActionCodePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ActionCodePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1803
+ ActionCodePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ActionCodePipe, name: "vlActionCode" });
1804
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ActionCodePipe, decorators: [{
1805
+ type: Pipe,
1806
+ args: [{
1807
+ name: 'vlActionCode',
1808
+ }]
1809
+ }] });
1810
+
1779
1811
  class SdkPipesModule {
1780
1812
  }
1781
- SdkPipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: SdkPipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1782
- SdkPipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.8", ngImport: i0, type: SdkPipesModule, declarations: [NumberPipe, PricePipe, DatePipe], exports: [NumberPipe, PricePipe, DatePipe] });
1783
- SdkPipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: SdkPipesModule });
1784
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: SdkPipesModule, decorators: [{
1813
+ SdkPipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkPipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1814
+ SdkPipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: SdkPipesModule, declarations: [NumberPipe, PricePipe, DatePipe, ActionCodePipe], exports: [NumberPipe, PricePipe, DatePipe, ActionCodePipe] });
1815
+ SdkPipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkPipesModule });
1816
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkPipesModule, decorators: [{
1785
1817
  type: NgModule,
1786
1818
  args: [{
1787
- declarations: [NumberPipe, PricePipe, DatePipe],
1788
- exports: [NumberPipe, PricePipe, DatePipe],
1819
+ declarations: [NumberPipe, PricePipe, DatePipe, ActionCodePipe],
1820
+ exports: [NumberPipe, PricePipe, DatePipe, ActionCodePipe],
1789
1821
  }]
1790
1822
  }] });
1791
1823
 
@@ -1793,5 +1825,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
1793
1825
  * Generated bundle index. Do not edit.
1794
1826
  */
1795
1827
 
1796
- export { CalendarDirective, ConfigurationRuntimeService, ConfigurationService, ConfigurationState, ContextService, DEFAULT_FORMATTING_SETTINGS, DatePipe, FORMATTING_SETTINGS_TOKEN, FlowConfigurationModule, FlowConfigurationService, FlowUpdateService, LineItemWorker, MetricsCalculationService, NumberPipe, PricePipe, ProductImagesService, QuoteDraftService, RuntimeMode, RuntimeOperation, RuntimeSettingsService, RuntimeStep, SdkCoreModule, SdkDirectivesModule, SdkPipesModule, UI_DEFINITION_VERSION, calculateCardinalityVariables, extractMetadata, filterOutTechnicalAttributes, findLineItem, findLineItemWithComparator, generateLineItem, generateModifiedAssetsMap, getAttributeValue, getAttributes, getDefaultLineItem, getGuidedSellingConfigurationRequest, getOriginParent, getRecommendedPrices, insertLineItem, isLineItemModified, isTechnicalAttribute, lineItem_utils as lineItemUtils, mapAttributes, multiplyLineItems, patchAttributes, recalculateCardinalityVariables, removeLineItem, replaceLineItem, upsertAttributes };
1828
+ export { ActionCodePipe, CalendarDirective, ConfigurationRuntimeService, ConfigurationService, ConfigurationState, ContextService, DEFAULT_FORMATTING_SETTINGS, DatePipe, FORMATTING_SETTINGS_TOKEN, FlowConfigurationModule, FlowConfigurationService, FlowUpdateService, LineItemWorker, MetricsCalculationService, NumberPipe, PricePipe, ProductImagesService, QuoteDraftService, RuntimeMode, RuntimeOperation, RuntimeSettingsService, RuntimeStep, SdkCoreModule, SdkDirectivesModule, SdkPipesModule, UI_DEFINITION_VERSION, calculateCardinalityVariables, extractMetadata, filterOutTechnicalAttributes, findLineItem, findLineItemWithComparator, generateLineItem, generateModifiedAssetsMap, getAttributeValue, getAttributes, getDefaultLineItem, getGuidedSellingConfigurationRequest, getOriginParent, getRecommendedPrices, insertLineItem, isLineItemModified, isTechnicalAttribute, lineItem_utils as lineItemUtils, mapAttributes, multiplyLineItems, patchAttributes, recalculateCardinalityVariables, removeLineItem, replaceLineItem, upsertAttributes };
1797
1829
  //# sourceMappingURL=veloceapps-sdk-core.mjs.map