@veloceapps/sdk 8.0.0-8 → 8.0.0-80

Sign up to get free protection for your applications and to get access to all the features.
Files changed (239) hide show
  1. package/README.md +0 -1
  2. package/cms/utils/element.utils.d.ts +1 -0
  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 +6 -1
  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/services/runtime-settings.service.d.ts +4 -1
  12. package/core/types/formatting-settings.types.d.ts +2 -0
  13. package/esm2020/cms/components/element-children/element-children.component.mjs +3 -3
  14. package/esm2020/cms/components/element-children/element-children.module.mjs +4 -4
  15. package/esm2020/cms/components/element-drop-handle/element-drop-handle.component.mjs +3 -3
  16. package/esm2020/cms/components/element-drop-handle/element-drop-handle.module.mjs +4 -4
  17. package/esm2020/cms/components/element-renderer/element-renderer.component.mjs +3 -3
  18. package/esm2020/cms/components/element-renderer/element-renderer.module.mjs +4 -4
  19. package/esm2020/cms/components/element-tools-panel/element-tools-panel.component.mjs +5 -5
  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 +8 -7
  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 +10 -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 +11 -14
  53. package/esm2020/core/modules/configuration/services/configuration.service.mjs +28 -9
  54. package/esm2020/core/modules/configuration/services/configuration.state.mjs +3 -3
  55. package/esm2020/core/modules/configuration/services/runtime-context.service.mjs +9 -9
  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 +20 -5
  71. package/esm2020/core/types/formatting-settings.types.mjs +1 -1
  72. package/esm2020/src/components/dialog/dialog.component.mjs +3 -3
  73. package/esm2020/src/components/dialog/dialog.module.mjs +4 -4
  74. package/esm2020/src/components/doc-gen/doc-gen.component.mjs +11 -15
  75. package/esm2020/src/components/doc-gen/doc-gen.module.mjs +4 -4
  76. package/esm2020/src/components/guided-selling/guided-selling.component.mjs +10 -13
  77. package/esm2020/src/components/guided-selling/guided-selling.module.mjs +4 -4
  78. package/esm2020/src/components/header/cart-overlay/cart-preview.component.mjs +3 -3
  79. package/esm2020/src/components/header/cart-overlay/cart-preview.module.mjs +4 -4
  80. package/esm2020/src/components/header/header.component.mjs +4 -4
  81. package/esm2020/src/components/header/header.module.mjs +4 -4
  82. package/esm2020/src/components/header/metrics/metrics.component.mjs +4 -4
  83. package/esm2020/src/components/header/metrics/metrics.module.mjs +4 -4
  84. package/esm2020/src/flow-routing.module.mjs +5 -22
  85. package/esm2020/src/flow.component.mjs +3 -3
  86. package/esm2020/src/flow.module.mjs +4 -4
  87. package/esm2020/src/guards/context.guard.mjs +3 -3
  88. package/esm2020/src/guards/product-unload.guard.mjs +7 -4
  89. package/esm2020/src/guards/root.guard.mjs +3 -3
  90. package/esm2020/src/pages/assets/assets.component.mjs +3 -3
  91. package/esm2020/src/pages/assets/assets.module.mjs +4 -4
  92. package/esm2020/src/pages/catalog/catalog.component.mjs +3 -3
  93. package/esm2020/src/pages/catalog/catalog.module.mjs +4 -4
  94. package/esm2020/src/pages/debug/debug.component.mjs +3 -3
  95. package/esm2020/src/pages/debug/debug.module.mjs +4 -4
  96. package/esm2020/src/pages/empty-account/empty-account.component.mjs +3 -3
  97. package/esm2020/src/pages/empty-account/empty-account.module.mjs +4 -4
  98. package/esm2020/src/pages/product/product.component.mjs +5 -6
  99. package/esm2020/src/pages/product/product.module.mjs +4 -4
  100. package/esm2020/src/pages/record-not-found/record-not-found.component.mjs +3 -3
  101. package/esm2020/src/pages/record-not-found/record-not-found.module.mjs +4 -4
  102. package/esm2020/src/pages/remote/remote.component.mjs +8 -9
  103. package/esm2020/src/pages/remote/remote.module.mjs +4 -4
  104. package/esm2020/src/pages/shopping-cart/shopping-cart.component.mjs +3 -3
  105. package/esm2020/src/pages/shopping-cart/shopping-cart.module.mjs +4 -4
  106. package/esm2020/src/resolvers/flow.resolver.mjs +3 -3
  107. package/esm2020/src/resolvers/quote.resolver.mjs +3 -3
  108. package/esm2020/src/services/doc-gen.service.mjs +3 -3
  109. package/esm2020/src/services/flow-dialog.service.mjs +3 -3
  110. package/esm2020/src/services/flow-router.service.mjs +5 -5
  111. package/esm2020/src/services/flow.service.mjs +13 -5
  112. package/esm2020/src/services/guided-selling.service.mjs +3 -3
  113. package/fesm2015/veloceapps-sdk-cms.mjs +123 -114
  114. package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
  115. package/fesm2015/veloceapps-sdk-core.mjs +1053 -1000
  116. package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
  117. package/fesm2015/veloceapps-sdk.mjs +221 -364
  118. package/fesm2015/veloceapps-sdk.mjs.map +1 -1
  119. package/fesm2020/veloceapps-sdk-cms.mjs +123 -114
  120. package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
  121. package/fesm2020/veloceapps-sdk-core.mjs +578 -527
  122. package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
  123. package/fesm2020/veloceapps-sdk.mjs +218 -365
  124. package/fesm2020/veloceapps-sdk.mjs.map +1 -1
  125. package/package.json +3 -11
  126. package/src/components/doc-gen/doc-gen.component.d.ts +3 -6
  127. package/src/components/guided-selling/guided-selling.component.d.ts +2 -4
  128. package/src/flow-routing.module.d.ts +6 -7
  129. package/src/guards/product-unload.guard.d.ts +2 -2
  130. package/esm2020/runtime/components/component-preview/component-preview.component.mjs +0 -125
  131. package/esm2020/runtime/components/index.mjs +0 -5
  132. package/esm2020/runtime/components/section-renderer/section-renderer.component.mjs +0 -67
  133. package/esm2020/runtime/components/ui-runtime/runtime.component.mjs +0 -440
  134. package/esm2020/runtime/components/ui-runtime-preview/runtime-preview.component.mjs +0 -108
  135. package/esm2020/runtime/execution/components/children-placeholder/children-placeholder.component.mjs +0 -60
  136. package/esm2020/runtime/execution/components/context-provider/context-provider.component.mjs +0 -39
  137. package/esm2020/runtime/execution/components/execution-section-renderer/execution-section-renderer.component.mjs +0 -67
  138. package/esm2020/runtime/execution/components/federated/federated.component.mjs +0 -74
  139. package/esm2020/runtime/execution/components/velo-attribute/velo-attribute.component.mjs +0 -60
  140. package/esm2020/runtime/execution/components/velo-multiselect/velo-multiselect.component.mjs +0 -130
  141. package/esm2020/runtime/execution/components/velo-port-checkbox/velo-port-checkbox.component.mjs +0 -72
  142. package/esm2020/runtime/execution/components/velo-port-dropdown/velo-port-dropdown.component.mjs +0 -97
  143. package/esm2020/runtime/execution/components/velo-port-radio/velo-port-radio.component.mjs +0 -142
  144. package/esm2020/runtime/execution/components/velo-type/velo-type.component.mjs +0 -119
  145. package/esm2020/runtime/execution/directives/section-script.directive.mjs +0 -247
  146. package/esm2020/runtime/execution/directives/sf-query.directive.mjs +0 -35
  147. package/esm2020/runtime/execution/directives/velo-attribute.directive.mjs +0 -88
  148. package/esm2020/runtime/execution/directives/velo-port.directive.mjs +0 -376
  149. package/esm2020/runtime/execution/directives/vl-approval.directive.mjs +0 -23
  150. package/esm2020/runtime/execution/directives/vl-document-attachments.directive.mjs +0 -36
  151. package/esm2020/runtime/execution/directives/vl-document-templates.directive.mjs +0 -60
  152. package/esm2020/runtime/execution/directives/vl-quote.directive.mjs +0 -42
  153. package/esm2020/runtime/execution/directives/vl-ramp.directive.mjs +0 -55
  154. package/esm2020/runtime/execution/runtime-execution.module.mjs +0 -133
  155. package/esm2020/runtime/execution/utils/federated.util.mjs +0 -32
  156. package/esm2020/runtime/index.mjs +0 -5
  157. package/esm2020/runtime/runtime.module.mjs +0 -74
  158. package/esm2020/runtime/services/cart.service.mjs +0 -29
  159. package/esm2020/runtime/services/collapsible-state.service.mjs +0 -34
  160. package/esm2020/runtime/services/configuration.service.mjs +0 -119
  161. package/esm2020/runtime/services/current-state.service.mjs +0 -17
  162. package/esm2020/runtime/services/form-scope.service.mjs +0 -30
  163. package/esm2020/runtime/services/index.mjs +0 -4
  164. package/esm2020/runtime/services/product-model-cache.service.mjs +0 -31
  165. package/esm2020/runtime/services/runtime-context.service.mjs +0 -60
  166. package/esm2020/runtime/services/runtime-form.service.mjs +0 -219
  167. package/esm2020/runtime/services/runtime.service.mjs +0 -115
  168. package/esm2020/runtime/services/section-helper.service.mjs +0 -27
  169. package/esm2020/runtime/services/section-scope.service.mjs +0 -36
  170. package/esm2020/runtime/services/section-store.service.mjs +0 -22
  171. package/esm2020/runtime/services/section.service.mjs +0 -117
  172. package/esm2020/runtime/types/bound-data.types.mjs +0 -7
  173. package/esm2020/runtime/types/index.mjs +0 -3
  174. package/esm2020/runtime/types/quote-states.types.mjs +0 -2
  175. package/esm2020/runtime/types/runtime.types.mjs +0 -2
  176. package/esm2020/runtime/types/script-registry.types.mjs +0 -51
  177. package/esm2020/runtime/utils/line-item.util.mjs +0 -270
  178. package/esm2020/runtime/utils/section.utils.mjs +0 -26
  179. package/esm2020/runtime/utils/sections-binder.helper.mjs +0 -105
  180. package/esm2020/runtime/veloceapps-sdk-runtime.mjs +0 -5
  181. package/esm2020/src/pages/legacy-product/legacy-product.component.mjs +0 -137
  182. package/esm2020/src/pages/legacy-product/legacy-product.module.mjs +0 -19
  183. package/fesm2015/veloceapps-sdk-runtime.mjs +0 -3770
  184. package/fesm2015/veloceapps-sdk-runtime.mjs.map +0 -1
  185. package/fesm2020/veloceapps-sdk-runtime.mjs +0 -3767
  186. package/fesm2020/veloceapps-sdk-runtime.mjs.map +0 -1
  187. package/runtime/README.md +0 -5
  188. package/runtime/components/component-preview/component-preview.component.d.ts +0 -27
  189. package/runtime/components/index.d.ts +0 -4
  190. package/runtime/components/section-renderer/section-renderer.component.d.ts +0 -25
  191. package/runtime/components/ui-runtime/runtime.component.d.ts +0 -53
  192. package/runtime/components/ui-runtime-preview/runtime-preview.component.d.ts +0 -27
  193. package/runtime/execution/components/children-placeholder/children-placeholder.component.d.ts +0 -30
  194. package/runtime/execution/components/context-provider/context-provider.component.d.ts +0 -14
  195. package/runtime/execution/components/execution-section-renderer/execution-section-renderer.component.d.ts +0 -25
  196. package/runtime/execution/components/federated/federated.component.d.ts +0 -36
  197. package/runtime/execution/components/velo-attribute/velo-attribute.component.d.ts +0 -19
  198. package/runtime/execution/components/velo-multiselect/velo-multiselect.component.d.ts +0 -35
  199. package/runtime/execution/components/velo-port-checkbox/velo-port-checkbox.component.d.ts +0 -22
  200. package/runtime/execution/components/velo-port-dropdown/velo-port-dropdown.component.d.ts +0 -22
  201. package/runtime/execution/components/velo-port-radio/velo-port-radio.component.d.ts +0 -28
  202. package/runtime/execution/components/velo-type/velo-type.component.d.ts +0 -31
  203. package/runtime/execution/directives/section-script.directive.d.ts +0 -59
  204. package/runtime/execution/directives/sf-query.directive.d.ts +0 -15
  205. package/runtime/execution/directives/velo-attribute.directive.d.ts +0 -26
  206. package/runtime/execution/directives/velo-port.directive.d.ts +0 -74
  207. package/runtime/execution/directives/vl-approval.directive.d.ts +0 -10
  208. package/runtime/execution/directives/vl-document-attachments.directive.d.ts +0 -15
  209. package/runtime/execution/directives/vl-document-templates.directive.d.ts +0 -33
  210. package/runtime/execution/directives/vl-quote.directive.d.ts +0 -14
  211. package/runtime/execution/directives/vl-ramp.directive.d.ts +0 -15
  212. package/runtime/execution/runtime-execution.module.d.ts +0 -25
  213. package/runtime/execution/utils/federated.util.d.ts +0 -6
  214. package/runtime/index.d.ts +0 -4
  215. package/runtime/runtime.module.d.ts +0 -16
  216. package/runtime/services/cart.service.d.ts +0 -15
  217. package/runtime/services/collapsible-state.service.d.ts +0 -15
  218. package/runtime/services/configuration.service.d.ts +0 -20
  219. package/runtime/services/current-state.service.d.ts +0 -8
  220. package/runtime/services/form-scope.service.d.ts +0 -20
  221. package/runtime/services/index.d.ts +0 -3
  222. package/runtime/services/product-model-cache.service.d.ts +0 -14
  223. package/runtime/services/runtime-context.service.d.ts +0 -16
  224. package/runtime/services/runtime-form.service.d.ts +0 -24
  225. package/runtime/services/runtime.service.d.ts +0 -44
  226. package/runtime/services/section-helper.service.d.ts +0 -8
  227. package/runtime/services/section-scope.service.d.ts +0 -14
  228. package/runtime/services/section-store.service.d.ts +0 -11
  229. package/runtime/services/section.service.d.ts +0 -30
  230. package/runtime/types/bound-data.types.d.ts +0 -13
  231. package/runtime/types/index.d.ts +0 -2
  232. package/runtime/types/quote-states.types.d.ts +0 -6
  233. package/runtime/types/runtime.types.d.ts +0 -19
  234. package/runtime/types/script-registry.types.d.ts +0 -13
  235. package/runtime/utils/line-item.util.d.ts +0 -34
  236. package/runtime/utils/section.utils.d.ts +0 -2
  237. package/runtime/utils/sections-binder.helper.d.ts +0 -16
  238. package/src/pages/legacy-product/legacy-product.component.d.ts +0 -37
  239. package/src/pages/legacy-product/legacy-product.module.d.ts +0 -9
@@ -1,11 +1,11 @@
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, DEFAULT_CURRENCY_ISO_CODE, DEFAULT_CURRENCY_SYMBOL, validateDateFormat, DEFAULT_DATE_FORMAT, DEFAULT_DECIMALS_COUNT, getSupportedDateFormats, DEFAULT_DECIMAL_SEPARATOR, DEFAULT_THOUSANDS_SEPARATOR, DEFAULT_ACTION_CODE_LABELS, parseJsonSafely, ConfigurationMode, ConfigurationTranslatorUtils, ChargeGroupUtils, RuntimeModel, isNotLegacyUIDefinition, 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';
8
- import { merge, isEqual, flatten, sortBy, map as map$1, transform, omit, cloneDeep, uniq } from 'lodash';
6
+ import { BehaviorSubject, zip, noop, combineLatest, map as map$2, tap as tap$1, throwError, shareReplay as shareReplay$1, 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
+ import { merge, isEqual, flatten, sortBy, map as map$1, uniqBy, transform, omit, cloneDeep, uniq } from 'lodash';
9
9
  import { HttpErrorResponse } from '@angular/common/http';
10
10
  import * as i4 from '@veloceapps/components';
11
11
  import { ToastType, ConfirmationComponent, ConfirmationDialogModule } 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,59 +561,184 @@ var lineItem_utils = /*#__PURE__*/Object.freeze({
708
561
  upsertAttributes: upsertAttributes
709
562
  });
710
563
 
711
- class LineItemWorker {
712
- constructor(src) {
713
- this.li = { ...src };
564
+ class RuntimeSettingsService {
565
+ constructor(configurationSettingsApiService) {
566
+ this.configurationSettingsApiService = configurationSettingsApiService;
567
+ this.configurationSettings$ = new BehaviorSubject({});
568
+ this.currencySettings$ = new BehaviorSubject({
569
+ iso: DEFAULT_CURRENCY_ISO_CODE,
570
+ symbol: DEFAULT_CURRENCY_SYMBOL,
571
+ });
572
+ this.shoppingCartSettings$ = new BehaviorSubject([]);
573
+ this.getCurrencySymbol = (locale, currency) => {
574
+ return (0)
575
+ .toLocaleString(locale, { style: 'currency', currency, minimumFractionDigits: 0, maximumFractionDigits: 0 })
576
+ .replace(/\d/g, '')
577
+ .trim();
578
+ };
714
579
  }
715
- insert(parentId, toInsert) {
716
- return new LineItemWorker(insertLineItem(this.li, parentId, toInsert));
580
+ create() {
581
+ return this.configurationSettingsApiService.fetchSettings().pipe(map$2(settings => this.parseConfigurationSettings(settings)), tap$1(configurationSettings => {
582
+ this.configurationSettings$.next(configurationSettings);
583
+ this.addShoppingCartSettings(configurationSettings['shopping-cart'] ?? []);
584
+ this.formattingSettings = this.getFormattingSettings();
585
+ }), map$2(() => undefined));
717
586
  }
718
- remove(id) {
719
- return new LineItemWorker(removeLineItem(this.li, id));
587
+ initCurrency(iso) {
588
+ if (iso) {
589
+ const symbol = this.getCurrencySymbol('en-US', iso);
590
+ this.currencySettings$.next({ iso, symbol });
591
+ }
720
592
  }
721
- replace(toReplace, skipCardinalityCalculation = false) {
722
- return new LineItemWorker(replaceLineItem(this.li, toReplace, skipCardinalityCalculation));
593
+ getFormattingSettings() {
594
+ if (this.formattingSettings) {
595
+ return this.formattingSettings;
596
+ }
597
+ const shoppingCartSettings = this.getConfigurationSettings()['shopping-cart']?.reduce((acc, setting) => {
598
+ return { ...acc, [setting.id]: setting.properties };
599
+ }, {});
600
+ const currencySettings = this.getCurrencySettings();
601
+ const dateFormat = (validateDateFormat(shoppingCartSettings?.DATE_FORMAT ?? '') && shoppingCartSettings?.DATE_FORMAT) ||
602
+ DEFAULT_DATE_FORMAT;
603
+ const decimalSeparator = shoppingCartSettings?.DECIMAL_SEPARATOR;
604
+ const thousandsSeparator = shoppingCartSettings?.THOUSANDS_SEPARATOR;
605
+ // the number of decimal places can be 0
606
+ const priceScale = shoppingCartSettings?.PRICE_SCALE;
607
+ const decimalsCount = priceScale !== null && priceScale !== '' && !isNaN(Number(priceScale)) && Number(priceScale) >= 0
608
+ ? Number(priceScale)
609
+ : DEFAULT_DECIMALS_COUNT;
610
+ const actionCodeSettings = shoppingCartSettings?.STATUS_LABEL;
611
+ return {
612
+ currencySymbol: currencySettings.symbol,
613
+ dateFormats: getSupportedDateFormats(dateFormat),
614
+ decimalsCount,
615
+ decimalSeparator: decimalSeparator !== undefined && ['.', ','].includes(decimalSeparator)
616
+ ? decimalSeparator
617
+ : DEFAULT_DECIMAL_SEPARATOR,
618
+ // thousands separator can be a blank value, so it can also be null
619
+ thousandsSeparator: thousandsSeparator !== undefined && ['.', ',', '', null].includes(thousandsSeparator)
620
+ ? thousandsSeparator || ''
621
+ : DEFAULT_THOUSANDS_SEPARATOR,
622
+ actionCodeLabels: actionCodeSettings?.length
623
+ ? actionCodeSettings.reduce((result, setting) => ({ ...result, [setting.status_label]: setting.custom_label }), {})
624
+ : DEFAULT_ACTION_CODE_LABELS,
625
+ };
723
626
  }
724
- patchAttribute(attrs, id, skipCardinalityCalculation = false) {
725
- return new LineItemWorker(patchAttributes(this.li, id ?? this.li.id, attrs, skipCardinalityCalculation));
627
+ getConfigurationSettings() {
628
+ return this.configurationSettings$.value;
726
629
  }
727
- }
728
-
729
- class ConfigurationService {
730
- constructor(quoteDraftService, runtimeService, contextService, configurationApiService, messageService, dialogService) {
731
- this.quoteDraftService = quoteDraftService;
732
- this.runtimeService = runtimeService;
733
- this.contextService = contextService;
734
- this.configurationApiService = configurationApiService;
735
- this.messageService = messageService;
736
- this.dialogService = dialogService;
737
- this.mode = ConfigurationMode.SEARCH;
738
- this.lineItem = new BehaviorSubject(undefined);
739
- this.charges = new BehaviorSubject({});
740
- this.pricePlans = new BehaviorSubject({});
741
- this.isLoadingSubj$ = new BehaviorSubject(false);
742
- this.isLoading$ = this.isLoadingSubj$.asObservable();
743
- this.hasUnsavedChanges = false;
630
+ getShoppingCartSettings() {
631
+ return this.shoppingCartSettings$.value;
744
632
  }
745
- reset() {
746
- this.hasUnsavedChanges = false;
747
- this.runtimeService.reset();
748
- this.configurableRamp = undefined;
749
- this.lineItem.next(undefined);
750
- this.charges.next({});
751
- this.pricePlans.next({});
633
+ getCurrencySettings() {
634
+ return this.currencySettings$.value;
752
635
  }
753
- patch$(lineItem, options) {
754
- if (!this.lineItem.value) {
755
- return throwError(() => new Error(`Source LineItem not found`));
756
- }
757
- const skipCardinalityCalculation = options?.skipCardinalityCalculation || this.contextSnapshot.properties['#skipCardinalityCalculation'] === 'true';
758
- this.configurableRamp = new LineItemWorker(this.lineItem.value).replace(lineItem, skipCardinalityCalculation).li;
759
- return this.configure().pipe(catchError(error => {
760
- console.error(error);
761
- if (!this.runtimeService.uiDefinitionProperties.suppressToastMessages) {
762
- this.messageService.add({ severity: 'error', summary: error });
763
- }
636
+ parseConfigurationSettings(settings) {
637
+ return settings.reduce((acc, setting) => {
638
+ switch (setting.key) {
639
+ case 'shopping-cart':
640
+ acc['shopping-cart'] = parseJsonSafely(setting.value, []);
641
+ break;
642
+ case 'navigation':
643
+ acc.navigation = parseJsonSafely(setting.value, {});
644
+ break;
645
+ case 'flows':
646
+ acc.flows = parseJsonSafely(setting.value, []);
647
+ break;
648
+ default:
649
+ acc[setting.key] = setting.value;
650
+ }
651
+ return acc;
652
+ }, {});
653
+ }
654
+ addShoppingCartSettings(settings) {
655
+ // uniqBy removes items with the biggest index
656
+ const newSettings = uniqBy([...settings, ...this.shoppingCartSettings$.value], 'id');
657
+ this.shoppingCartSettings$.next(newSettings);
658
+ }
659
+ }
660
+ RuntimeSettingsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeSettingsService, deps: [{ token: i1.ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
661
+ RuntimeSettingsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeSettingsService, providedIn: 'root' });
662
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeSettingsService, decorators: [{
663
+ type: Injectable,
664
+ args: [{ providedIn: 'root' }]
665
+ }], ctorParameters: function () { return [{ type: i1.ConfigurationSettingsApiService }]; } });
666
+
667
+ const FORMATTING_SETTINGS_TOKEN = new InjectionToken('Summary of formatting settings for variant types of data, e.g. numbers, text, dates, etc');
668
+
669
+ var RuntimeMode;
670
+ (function (RuntimeMode) {
671
+ RuntimeMode[RuntimeMode["TEST"] = 0] = "TEST";
672
+ RuntimeMode[RuntimeMode["PROD"] = 1] = "PROD";
673
+ })(RuntimeMode || (RuntimeMode = {}));
674
+ var RuntimeOperation;
675
+ (function (RuntimeOperation) {
676
+ RuntimeOperation["INIT"] = "INIT";
677
+ RuntimeOperation["UPDATE"] = "UPDATE";
678
+ })(RuntimeOperation || (RuntimeOperation = {}));
679
+ var RuntimeStep;
680
+ (function (RuntimeStep) {
681
+ RuntimeStep["START"] = "START";
682
+ RuntimeStep["UPDATE"] = "UPDATE";
683
+ })(RuntimeStep || (RuntimeStep = {}));
684
+
685
+ const UI_DEFINITION_VERSION = 3;
686
+
687
+ class LineItemWorker {
688
+ constructor(src) {
689
+ this.li = { ...src };
690
+ }
691
+ insert(parentId, toInsert) {
692
+ return new LineItemWorker(insertLineItem(this.li, parentId, toInsert));
693
+ }
694
+ remove(id) {
695
+ return new LineItemWorker(removeLineItem(this.li, id));
696
+ }
697
+ replace(toReplace, skipCardinalityCalculation = false) {
698
+ return new LineItemWorker(replaceLineItem(this.li, toReplace, skipCardinalityCalculation));
699
+ }
700
+ patchAttribute(attrs, id, skipCardinalityCalculation = false) {
701
+ return new LineItemWorker(patchAttributes(this.li, id ?? this.li.id, attrs, skipCardinalityCalculation));
702
+ }
703
+ }
704
+
705
+ class ConfigurationService {
706
+ constructor(quoteDraftService, runtimeService, contextService, configurationApiService, messageService, dialogService, runtimeSettings) {
707
+ this.quoteDraftService = quoteDraftService;
708
+ this.runtimeService = runtimeService;
709
+ this.contextService = contextService;
710
+ this.configurationApiService = configurationApiService;
711
+ this.messageService = messageService;
712
+ this.dialogService = dialogService;
713
+ this.runtimeSettings = runtimeSettings;
714
+ this.mode = ConfigurationMode.SEARCH;
715
+ this.lineItem = new BehaviorSubject(undefined);
716
+ this.charges = new BehaviorSubject({});
717
+ this.pricePlans = new BehaviorSubject({});
718
+ this.procedureContext = new BehaviorSubject({});
719
+ this.isLoadingSubj$ = new BehaviorSubject(false);
720
+ this.isLoading$ = this.isLoadingSubj$.asObservable();
721
+ this.hasUnsavedChanges = false;
722
+ }
723
+ reset() {
724
+ this.hasUnsavedChanges = false;
725
+ this.runtimeService.reset();
726
+ this.configurableRamp = undefined;
727
+ this.lineItem.next(undefined);
728
+ this.charges.next({});
729
+ this.pricePlans.next({});
730
+ }
731
+ patch$(lineItem, options) {
732
+ if (!this.lineItem.value) {
733
+ return throwError(() => new Error(`Source LineItem not found`));
734
+ }
735
+ const skipCardinalityCalculation = options?.skipCardinalityCalculation || this.contextSnapshot.properties['#skipCardinalityCalculation'] === 'true';
736
+ this.configurableRamp = new LineItemWorker(this.lineItem.value).replace(lineItem, skipCardinalityCalculation).li;
737
+ return this.configure().pipe(catchError(error => {
738
+ console.error(error);
739
+ if (!this.runtimeService.uiDefinitionProperties.suppressToastMessages) {
740
+ this.messageService.add({ severity: 'error', summary: error });
741
+ }
764
742
  // bounce back if configuration call has failed
765
743
  this.lineItem.next(this.lineItem.value ? { ...this.lineItem.value } : undefined);
766
744
  return throwError(() => error);
@@ -814,6 +792,12 @@ class ConfigurationService {
814
792
  get pricePlansSnapshot() {
815
793
  return this.pricePlans.value;
816
794
  }
795
+ get procedureContext$() {
796
+ return this.procedureContext.asObservable();
797
+ }
798
+ get procedureContextSnapshot() {
799
+ return this.procedureContext.value;
800
+ }
817
801
  configure() {
818
802
  return this.configureRequest$(this.generateRequest());
819
803
  }
@@ -823,11 +807,20 @@ class ConfigurationService {
823
807
  const uiDefinitionProperties = this.getUIDefinitionProperties();
824
808
  const mainPricingEnabled = runtimeContext.properties?.PricingEnabled;
825
809
  const pricingEnabled = mainPricingEnabled ? mainPricingEnabled === 'true' : uiDefinitionProperties.pricingEnabled;
810
+ const customPriceApi = this.runtimeSettings.getConfigurationSettings()['CUSTOM_PRICE_API'];
826
811
  this.isLoadingSubj$.next(true);
827
- return this.configurationApiService.configureLineItem({ configurationRequest, runtimeModel, pricingEnabled }).pipe(tap(({ lineItem, context, charges, pricePlans, deletedLineItems }) => {
812
+ const configure$ = pricingEnabled && customPriceApi
813
+ ? this.configurationApiService.customConfigurePrice({ url: customPriceApi, configurationRequest, runtimeModel })
814
+ : this.configurationApiService.configureLineItem({
815
+ configurationRequest,
816
+ runtimeModel,
817
+ pricingEnabled,
818
+ });
819
+ return configure$.pipe(tap(({ lineItem, context, charges, pricePlans, deletedLineItems, procedureContext }) => {
828
820
  this.contextService.update(context ?? {});
829
821
  this.charges.next(charges ?? {});
830
822
  this.pricePlans.next(pricePlans ?? {});
823
+ this.procedureContext.next(procedureContext ?? {});
831
824
  if (lineItem) {
832
825
  this.lineItem.next(lineItem);
833
826
  }
@@ -884,7 +877,7 @@ class ConfigurationService {
884
877
  }
885
878
  getUIDefinitionProperties() {
886
879
  return {
887
- ...getUIDefinitionProperties(this.getRuntimeContext().uiDefinitionContainer),
880
+ ...(this.getRuntimeContext().uiDefinitionContainer?.source.properties ?? {}),
888
881
  ...(this.runtimeService.uiDefinitionProperties ?? {}),
889
882
  };
890
883
  }
@@ -920,140 +913,11 @@ class ConfigurationService {
920
913
  return this.quoteDraftService.quoteDraft?.initialState.find(a => a.id === lineItem.openOrderLineItemId || a.id === lineItem.assetId);
921
914
  }
922
915
  }
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: [{
926
- type: Injectable
927
- }], ctorParameters: function () { return [{ type: QuoteDraftService }, { type: ConfigurationRuntimeService }, { type: ContextService }, { type: i1.ConfigurationApiService }, { type: i5.MessageService }, { type: i6.DialogService }]; } });
928
-
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 })),
949
- });
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: [{
916
+ 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 }, { token: RuntimeSettingsService }], target: i0.ɵɵFactoryTarget.Injectable });
917
+ ConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationService });
918
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationService, decorators: [{
1055
919
  type: Injectable
1056
- }], ctorParameters: function () { return [{ type: i1.StatefulConfigurationApiService }, { type: ConfigurationRuntimeService }, { type: ConfigurationService }, { type: i4.ToastService }]; } });
920
+ }], ctorParameters: function () { return [{ type: QuoteDraftService }, { type: ConfigurationRuntimeService }, { type: ContextService }, { type: i1.ConfigurationApiService }, { type: i5.MessageService }, { type: i6.DialogService }, { type: RuntimeSettingsService }]; } });
1057
921
 
1058
922
  function extractMetadata(uiDefinition) {
1059
923
  return omit(uiDefinition, [
@@ -1135,6 +999,7 @@ class FlowUpdateService {
1135
999
  }
1136
1000
  break;
1137
1001
  case 'LIST_PRICE_ADJUSTMENT':
1002
+ case 'MARGIN_ADJUSTMENT':
1138
1003
  {
1139
1004
  const charge = lineItem.chargeItems.find(charge => (charges || {})[charge.chargeId]?.main);
1140
1005
  if (charge) {
@@ -1142,19 +1007,11 @@ class FlowUpdateService {
1142
1007
  }
1143
1008
  }
1144
1009
  break;
1145
- case 'COST':
1146
- {
1147
- const charge = lineItem.chargeItems.find(charge => (charges || {})[charge.chargeId]?.main);
1148
- if (charge) {
1149
- charge.netCost = update.newValue;
1150
- }
1151
- }
1152
- break;
1153
- case 'MARGIN_PERCENT':
1010
+ case 'COST_ADJUSTMENT':
1154
1011
  {
1155
1012
  const charge = lineItem.chargeItems.find(charge => (charges || {})[charge.chargeId]?.main);
1156
1013
  if (charge) {
1157
- charge.marginPercent = update.newValue;
1014
+ charge.costAdjustment = update.newValue;
1158
1015
  }
1159
1016
  }
1160
1017
  break;
@@ -1196,9 +1053,9 @@ class FlowUpdateService {
1196
1053
  return true;
1197
1054
  }
1198
1055
  }
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: [{
1056
+ FlowUpdateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowUpdateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1057
+ FlowUpdateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowUpdateService });
1058
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowUpdateService, decorators: [{
1202
1059
  type: Injectable
1203
1060
  }] });
1204
1061
 
@@ -1331,63 +1188,21 @@ class FlowConfigurationService {
1331
1188
  };
1332
1189
  }
1333
1190
  }
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: [{
1191
+ 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 });
1192
+ FlowConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowConfigurationService });
1193
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowConfigurationService, decorators: [{
1337
1194
  type: Injectable
1338
1195
  }], ctorParameters: function () { return [{ type: i1.ProceduresApiService }, { type: ContextService }, { type: QuoteDraftService }, { type: FlowUpdateService }, { type: ConfigurationService }]; } });
1339
1196
 
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
- function calculateMetricByMethod(lineItems, metric, method) {
1383
- const items = getLineItemsByMethod(lineItems, method);
1384
- return items.reduce((acc, li) => {
1385
- let value = li.reduce((accProduct, item) => accProduct + ((item.totalMetrics && item.totalMetrics[metric]) || 0), 0);
1386
- if (method === 'avg' && li.length > 0) {
1387
- value /= li.length;
1388
- }
1389
- return acc + value;
1390
- }, 0);
1197
+ function calculateMetricByMethod(lineItems, metric, method) {
1198
+ const items = getLineItemsByMethod(lineItems, method);
1199
+ return items.reduce((acc, li) => {
1200
+ let value = li.reduce((accProduct, item) => accProduct + ((item.totalMetrics && item.totalMetrics[metric]) || 0), 0);
1201
+ if (method === 'avg' && li.length > 0) {
1202
+ value /= li.length;
1203
+ }
1204
+ return acc + value;
1205
+ }, 0);
1391
1206
  }
1392
1207
  function getLineItemsByMethod(lineItems, method) {
1393
1208
  switch (method) {
@@ -1488,9 +1303,9 @@ class MetricsCalculationService {
1488
1303
  return this.activeMetricRules.find(metricRule => metricRule.metrics.find(metric => metric.totalName === name));
1489
1304
  }
1490
1305
  }
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: [{
1306
+ 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 });
1307
+ MetricsCalculationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MetricsCalculationService, providedIn: 'root' });
1308
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MetricsCalculationService, decorators: [{
1494
1309
  type: Injectable,
1495
1310
  args: [{ providedIn: 'root' }]
1496
1311
  }], ctorParameters: function () { return [{ type: QuoteDraftService }, { type: FlowConfigurationService }, { type: i1.ConfigurationSettingsApiService }]; } });
@@ -1514,101 +1329,319 @@ class ProductImagesService {
1514
1329
  .subscribe();
1515
1330
  }
1516
1331
  }
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: [{
1332
+ ProductImagesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductImagesService, deps: [{ token: i1.ProductApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1333
+ ProductImagesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductImagesService, providedIn: 'root' });
1334
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductImagesService, decorators: [{
1520
1335
  type: Injectable,
1521
1336
  args: [{ providedIn: 'root' }]
1522
1337
  }], ctorParameters: function () { return [{ type: i1.ProductApiService }]; } });
1523
1338
 
1524
- class RuntimeSettingsService {
1525
- constructor(configurationSettingsApiService) {
1526
- this.configurationSettingsApiService = configurationSettingsApiService;
1527
- this.configurationSettings$ = new BehaviorSubject({});
1528
- this.currencySettings$ = new BehaviorSubject({
1529
- iso: DEFAULT_CURRENCY_ISO_CODE,
1530
- symbol: DEFAULT_CURRENCY_SYMBOL,
1531
- });
1532
- this.getCurrencySymbol = (locale, currency) => {
1533
- return (0)
1534
- .toLocaleString(locale, { style: 'currency', currency, minimumFractionDigits: 0, maximumFractionDigits: 0 })
1535
- .replace(/\d/g, '')
1536
- .trim();
1537
- };
1339
+ class RuntimeContextService {
1340
+ constructor(configurationApiService) {
1341
+ this.configurationApiService = configurationApiService;
1538
1342
  }
1539
- create() {
1540
- return this.configurationSettingsApiService.fetchSettings().pipe(map$2(settings => this.parseConfigurationSettings(settings)), tap$1(configurationSettings => {
1541
- this.configurationSettings$.next(configurationSettings);
1542
- this.formattingSettings = this.getFormattingSettings();
1543
- }), map$2(() => undefined));
1343
+ getRuntimeContext(productId, offeringId) {
1344
+ return this.configurationApiService.getRuntimeDataByProductId(productId, offeringId).pipe(map(runtimeData => {
1345
+ const uiDefinitionContainer = this.getUIDefinitionContainer(runtimeData);
1346
+ const runtimeModel = RuntimeModel.create(runtimeData.types, runtimeData.products);
1347
+ const { productName, properties } = Array.from(runtimeModel.components.values()).find(c => c.productId === productId) ?? {};
1348
+ const uiDefinitionProperties = uiDefinitionContainer?.source.properties;
1349
+ return {
1350
+ modelId: runtimeData.modelId,
1351
+ uiDefinitionContainer: uiDefinitionContainer,
1352
+ runtimeModel: runtimeModel,
1353
+ runtimeMode: RuntimeMode.PROD,
1354
+ productId: productId,
1355
+ productType: properties?.['displayName'] || productName,
1356
+ offeringId: offeringId,
1357
+ properties: {
1358
+ PricingEnabled: uiDefinitionProperties?.pricingEnabled ? 'true' : 'false',
1359
+ PriceListId: uiDefinitionProperties?.priceList,
1360
+ },
1361
+ };
1362
+ }));
1544
1363
  }
1545
- initCurrency(iso) {
1546
- if (iso) {
1547
- const symbol = this.getCurrencySymbol('en-US', iso);
1548
- this.currencySettings$.next({ iso, symbol });
1364
+ getUIDefinitionContainer(runtimeData) {
1365
+ const containers = runtimeData.uiDefinitions.filter(container => isNotLegacyUIDefinition(container.source));
1366
+ return containers.find(container => container.source.primary) ?? containers[0];
1367
+ }
1368
+ }
1369
+ RuntimeContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeContextService, deps: [{ token: i1.ConfigurationApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1370
+ RuntimeContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeContextService });
1371
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuntimeContextService, decorators: [{
1372
+ type: Injectable
1373
+ }], ctorParameters: function () { return [{ type: i1.ConfigurationApiService }]; } });
1374
+
1375
+ class ConfigurationRuntimeService {
1376
+ constructor(apiService, contextService, runtimeContextService) {
1377
+ this.apiService = apiService;
1378
+ this.contextService = contextService;
1379
+ this.runtimeContextService = runtimeContextService;
1380
+ this._isInitialized = false;
1381
+ this.uiDefinitionProperties = {};
1382
+ }
1383
+ reset() {
1384
+ this._isInitialized = false;
1385
+ this._runtimeContext = undefined;
1386
+ this.initializationProps = undefined;
1387
+ this.uiDefinitionProperties = {};
1388
+ }
1389
+ initTestMode(uiDefinitionContainer) {
1390
+ this.uiDefinitionProperties = uiDefinitionContainer.source.properties ?? {};
1391
+ const uiDefinitionExternals = uiDefinitionContainer.source.externals ?? {};
1392
+ return combineLatest([
1393
+ this.apiService.getRuntimeDataByModelId(uiDefinitionContainer.modelId),
1394
+ this.contextService.initTestMode(),
1395
+ ]).pipe(first(), map(([runtimeData, context]) => {
1396
+ this.contextService.update({
1397
+ properties: {
1398
+ ...this.runtimeContext?.properties,
1399
+ ...context.properties,
1400
+ ModelId: uiDefinitionContainer.modelId,
1401
+ PricingEnabled: this.uiDefinitionProperties.pricingEnabled ? 'true' : 'false',
1402
+ PriceListId: this.uiDefinitionProperties.priceList,
1403
+ offeringId: this.uiDefinitionProperties.offeringId,
1404
+ ...uiDefinitionExternals,
1405
+ },
1406
+ });
1407
+ this._runtimeContext = {
1408
+ modelId: uiDefinitionContainer.modelId,
1409
+ runtimeModel: RuntimeModel.create(runtimeData.types, runtimeData.products),
1410
+ runtimeMode: RuntimeMode.TEST,
1411
+ uiDefinitionContainer,
1412
+ };
1413
+ return this._runtimeContext;
1414
+ }), tap(() => (this._isInitialized = true)));
1415
+ }
1416
+ init(props) {
1417
+ this.initializationProps = props;
1418
+ const context = this.contextService.resolve();
1419
+ return this.runtimeContextService.getRuntimeContext(props.productId, props.offeringId).pipe(tap(runtimeContext => {
1420
+ this.uiDefinitionProperties = runtimeContext.uiDefinitionContainer?.source.properties ?? {};
1421
+ const { PriceListId } = context.properties ?? {};
1422
+ const mergeContext = {
1423
+ ...runtimeContext,
1424
+ properties: {
1425
+ ...runtimeContext.properties,
1426
+ ...context.properties,
1427
+ PricingEnabled: PriceListId ? 'true' : 'false',
1428
+ },
1429
+ };
1430
+ this.id15to18('AccountId', mergeContext.properties);
1431
+ this._runtimeContext = mergeContext;
1432
+ if (context.properties && this._runtimeContext.properties?.StartDate) {
1433
+ this.contextService.update({
1434
+ properties: {
1435
+ ...this._runtimeContext.properties,
1436
+ ...context.properties,
1437
+ },
1438
+ });
1439
+ }
1440
+ return this._runtimeContext;
1441
+ }), tap(() => (this._isInitialized = true)));
1442
+ }
1443
+ overrideUIDefinition(uiDefinitionContainer) {
1444
+ if (!this._runtimeContext) {
1445
+ return;
1549
1446
  }
1447
+ this._runtimeContext.uiDefinitionContainer = uiDefinitionContainer;
1448
+ this.uiDefinitionProperties = uiDefinitionContainer.source.properties ?? {};
1550
1449
  }
1551
- getFormattingSettings() {
1552
- if (this.formattingSettings) {
1553
- return this.formattingSettings;
1450
+ id15to18(propertyName, source) {
1451
+ if (!source) {
1452
+ return;
1453
+ }
1454
+ const value = source[propertyName];
1455
+ if (typeof value === 'string' && value.length === 15) {
1456
+ source[propertyName] = SalesforceIdUtils.generateId18FromId15(value);
1554
1457
  }
1555
- const shoppingCartSettings = this.getConfigurationSettings()['shopping-cart']?.reduce((acc, setting) => {
1556
- return { ...acc, [setting.id]: setting.properties };
1557
- }, {});
1558
- const currencySettings = this.getCurrencySettings();
1559
- const dateFormat = (validateDateFormat(shoppingCartSettings?.DATE_FORMAT ?? '') && shoppingCartSettings?.DATE_FORMAT) ||
1560
- DEFAULT_DATE_FORMAT;
1561
- const decimalSeparator = shoppingCartSettings?.DECIMAL_SEPARATOR;
1562
- const thousandsSeparator = shoppingCartSettings?.THOUSANDS_SEPARATOR;
1563
- // the number of decimal places can be 0
1564
- const priceScale = shoppingCartSettings?.PRICE_SCALE;
1565
- const decimalsCount = priceScale !== null && priceScale !== '' && !isNaN(Number(priceScale)) && Number(priceScale) >= 0
1566
- ? Number(priceScale)
1567
- : DEFAULT_DECIMALS_COUNT;
1568
- return {
1569
- currencySymbol: currencySettings.symbol,
1570
- dateFormats: getSupportedDateFormats(dateFormat),
1571
- decimalsCount,
1572
- decimalSeparator: decimalSeparator !== undefined && ['.', ','].includes(decimalSeparator)
1573
- ? decimalSeparator
1574
- : DEFAULT_DECIMAL_SEPARATOR,
1575
- // thousands separator can be a blank value, so it can also be null
1576
- thousandsSeparator: thousandsSeparator !== undefined && ['.', ',', '', null].includes(thousandsSeparator)
1577
- ? thousandsSeparator || ''
1578
- : DEFAULT_THOUSANDS_SEPARATOR,
1579
- };
1580
1458
  }
1581
- getConfigurationSettings() {
1582
- return this.configurationSettings$.value;
1459
+ get isInitialized() {
1460
+ return this._isInitialized;
1583
1461
  }
1584
- getCurrencySettings() {
1585
- return this.currencySettings$.value;
1462
+ get runtimeModel() {
1463
+ return this.runtimeContext?.runtimeModel;
1586
1464
  }
1587
- parseConfigurationSettings(settings) {
1588
- return settings.reduce((acc, setting) => {
1589
- switch (setting.key) {
1590
- case 'shopping-cart':
1591
- acc['shopping-cart'] = parseJsonSafely(setting.value, []);
1592
- break;
1593
- case 'navigation':
1594
- acc.navigation = parseJsonSafely(setting.value, {});
1595
- break;
1596
- case 'flows':
1597
- acc.flows = parseJsonSafely(setting.value, []);
1598
- break;
1599
- default:
1600
- acc[setting.key] = setting.value;
1465
+ get runtimeContext() {
1466
+ return this._runtimeContext;
1467
+ }
1468
+ }
1469
+ 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 });
1470
+ ConfigurationRuntimeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationRuntimeService });
1471
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationRuntimeService, decorators: [{
1472
+ type: Injectable
1473
+ }], ctorParameters: function () { return [{ type: i1.ConfigurationApiService }, { type: ContextService }, { type: RuntimeContextService }]; } });
1474
+
1475
+ class ConfigurationState {
1476
+ constructor(statefulConfigurationApiService, runtimeService, configurationService, toastService) {
1477
+ this.statefulConfigurationApiService = statefulConfigurationApiService;
1478
+ this.runtimeService = runtimeService;
1479
+ this.configurationService = configurationService;
1480
+ this.toastService = toastService;
1481
+ this.stateSubj$ = new BehaviorSubject({});
1482
+ this.state$ = this.stateSubj$.asObservable();
1483
+ this.stateId = null;
1484
+ }
1485
+ init$() {
1486
+ return this.configurationService.configure().pipe(switchMap$1(() => {
1487
+ if (!this.isStatefulConfiguration) {
1488
+ return of(undefined);
1601
1489
  }
1602
- return acc;
1603
- }, {});
1490
+ const { actions, selectors } = this.runtimeService.runtimeContext?.uiDefinitionContainer ?? {};
1491
+ return this.statefulConfigurationApiService.init({
1492
+ request: this.configurationService.generateRequest(),
1493
+ actions: actions?.map(action => ({ name: action.apiName, script: action.script })),
1494
+ selectors: selectors?.map(selector => ({ name: selector.apiName, script: selector.script })),
1495
+ });
1496
+ }), tap$1(stateId => (this.stateId = stateId || null)), map$2(() => undefined));
1497
+ }
1498
+ cleanup() {
1499
+ this.stateId = null;
1500
+ this.configurationService.reset();
1501
+ this.stateSubj$.next({});
1502
+ }
1503
+ execute$(req) {
1504
+ if (this.isStatefulConfiguration) {
1505
+ return this.executeStateful$(req);
1506
+ }
1507
+ else {
1508
+ return this.executeStateless$(req);
1509
+ }
1510
+ }
1511
+ dispatch$(actionName, inputData) {
1512
+ return this.execute$({ actions: [{ name: actionName, inputData }] });
1513
+ }
1514
+ select$(selectorName, inputData) {
1515
+ const requestId = UUID.UUID();
1516
+ return this.execute$({
1517
+ selectors: {
1518
+ [requestId]: {
1519
+ name: selectorName,
1520
+ inputData,
1521
+ },
1522
+ },
1523
+ }).pipe(map$2(() => this.stateSubj$.value[requestId]), tap$1(() => this.stateSubj$.next(omit(this.stateSubj$.value, requestId))));
1524
+ }
1525
+ get isStatefulConfiguration() {
1526
+ return this.runtimeService.uiDefinitionProperties.statefulConfigurationEnabled ?? false;
1527
+ }
1528
+ executeStateless$(request) {
1529
+ return of(undefined).pipe(switchMap$1(() => {
1530
+ // Apply actions and execute configuration/price call
1531
+ // No need to run configuration if no actions in the request
1532
+ if (!request.actions?.length) {
1533
+ return of(undefined);
1534
+ }
1535
+ let configurationRequest = this.configurationService.generateRequest();
1536
+ request.actions.forEach(action => {
1537
+ configurationRequest = this.executeActionScript(configurationRequest, action) ?? configurationRequest;
1538
+ });
1539
+ return this.configurationService.configureRequest$(configurationRequest);
1540
+ }), tap$1(() => {
1541
+ if (!request.selectors) {
1542
+ return;
1543
+ }
1544
+ // Run selectors and apply them to the state
1545
+ const finalConfigurationRequest = this.configurationService.generateRequest();
1546
+ const selectorsResult = EntityUtil.entries(request.selectors).reduce((trunk, [key, selector]) => {
1547
+ trunk[key] = this.executeSelectorScript(finalConfigurationRequest, selector);
1548
+ return trunk;
1549
+ }, {});
1550
+ this.stateSubj$.next({
1551
+ ...this.stateSubj$.value,
1552
+ ...selectorsResult,
1553
+ });
1554
+ }), map$2(() => undefined));
1555
+ }
1556
+ executeStateful$(request) {
1557
+ if (!this.stateId) {
1558
+ return of(undefined);
1559
+ }
1560
+ return this.statefulConfigurationApiService.execute(this.stateId, request).pipe(tap$1(response => {
1561
+ this.stateId = response.stateId;
1562
+ const updatedState = this.stateSubj$.value;
1563
+ EntityUtil.entries(response.selectors).forEach(([key, value]) => {
1564
+ if (!value.success) {
1565
+ if (!this.runtimeService.uiDefinitionProperties.suppressToastMessages) {
1566
+ this.toastService.add({ summary: value.errorMessage, severity: ToastType.error });
1567
+ }
1568
+ return;
1569
+ }
1570
+ updatedState[key] = value.result;
1571
+ });
1572
+ this.stateSubj$.next(updatedState);
1573
+ }), map$2(() => undefined));
1574
+ }
1575
+ executeActionScript(request, processor) {
1576
+ const { actions } = this.runtimeService.runtimeContext?.uiDefinitionContainer ?? {};
1577
+ const script = actions?.find(action => action.apiName === processor.name)?.script;
1578
+ if (!script) {
1579
+ return null;
1580
+ }
1581
+ return this.executeProcessorScript(request, script, processor.inputData);
1582
+ }
1583
+ executeSelectorScript(request, processor) {
1584
+ const { selectors } = this.runtimeService.runtimeContext?.uiDefinitionContainer ?? {};
1585
+ const script = selectors?.find(selector => selector.apiName === processor.name)?.script;
1586
+ if (!script) {
1587
+ return null;
1588
+ }
1589
+ return this.executeProcessorScript(request, script, processor.inputData);
1590
+ }
1591
+ executeProcessorScript(request, script, inputData) {
1592
+ return new Function(`${script}\nreturn transform;`)()({
1593
+ request,
1594
+ inputData: inputData,
1595
+ });
1604
1596
  }
1605
1597
  }
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: [{
1609
- type: Injectable,
1610
- args: [{ providedIn: 'root' }]
1611
- }], ctorParameters: function () { return [{ type: i1.ConfigurationSettingsApiService }]; } });
1598
+ 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 });
1599
+ ConfigurationState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationState });
1600
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationState, decorators: [{
1601
+ type: Injectable
1602
+ }], ctorParameters: function () { return [{ type: i1.StatefulConfigurationApiService }, { type: ConfigurationRuntimeService }, { type: ConfigurationService }, { type: i4.ToastService }]; } });
1603
+
1604
+ class FlowConfigurationModule {
1605
+ }
1606
+ FlowConfigurationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowConfigurationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1607
+ FlowConfigurationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: FlowConfigurationModule });
1608
+ FlowConfigurationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowConfigurationModule, providers: [FlowConfigurationService, FlowUpdateService, PriceApiService] });
1609
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowConfigurationModule, decorators: [{
1610
+ type: NgModule,
1611
+ args: [{
1612
+ imports: [],
1613
+ providers: [FlowConfigurationService, FlowUpdateService, PriceApiService],
1614
+ }]
1615
+ }] });
1616
+
1617
+ class ConfigurationModule {
1618
+ }
1619
+ ConfigurationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1620
+ ConfigurationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationModule, imports: [ConfirmationDialogModule] });
1621
+ ConfigurationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationModule, providers: [
1622
+ ContextApiService,
1623
+ ProductModelApiService,
1624
+ ConfigurationApiService,
1625
+ ConfigurationRuntimeService,
1626
+ RuntimeContextService,
1627
+ ConfigurationService,
1628
+ ConfigurationState,
1629
+ ], imports: [ConfirmationDialogModule] });
1630
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationModule, decorators: [{
1631
+ type: NgModule,
1632
+ args: [{
1633
+ imports: [ConfirmationDialogModule],
1634
+ providers: [
1635
+ ContextApiService,
1636
+ ProductModelApiService,
1637
+ ConfigurationApiService,
1638
+ ConfigurationRuntimeService,
1639
+ RuntimeContextService,
1640
+ ConfigurationService,
1641
+ ConfigurationState,
1642
+ ],
1643
+ }]
1644
+ }] });
1612
1645
 
1613
1646
  const DEFAULT_FORMATTING_SETTINGS = {
1614
1647
  currencySymbol: DEFAULT_CURRENCY_SYMBOL,
@@ -1616,12 +1649,13 @@ const DEFAULT_FORMATTING_SETTINGS = {
1616
1649
  dateFormats: getSupportedDateFormats(DEFAULT_DATE_FORMAT),
1617
1650
  decimalSeparator: DEFAULT_DECIMAL_SEPARATOR,
1618
1651
  thousandsSeparator: DEFAULT_THOUSANDS_SEPARATOR,
1652
+ actionCodeLabels: DEFAULT_ACTION_CODE_LABELS,
1619
1653
  };
1620
1654
  class SdkCoreModule {
1621
1655
  }
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: [
1656
+ SdkCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1657
+ SdkCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: SdkCoreModule, imports: [ConfigurationModule, FlowConfigurationModule] });
1658
+ SdkCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkCoreModule, providers: [
1625
1659
  ContextService,
1626
1660
  QuoteDraftService,
1627
1661
  ProductImagesService,
@@ -1632,7 +1666,7 @@ SdkCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
1632
1666
  useExisting: RuntimeSettingsService,
1633
1667
  },
1634
1668
  ], imports: [ConfigurationModule, FlowConfigurationModule] });
1635
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: SdkCoreModule, decorators: [{
1669
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkCoreModule, decorators: [{
1636
1670
  type: NgModule,
1637
1671
  args: [{
1638
1672
  imports: [ConfigurationModule, FlowConfigurationModule],
@@ -1673,9 +1707,9 @@ class CalendarDirective {
1673
1707
  }
1674
1708
  }
1675
1709
  }
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: [{
1710
+ CalendarDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CalendarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1711
+ CalendarDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: CalendarDirective, selector: "[vlCalendar]", inputs: { vlCalendar: "vlCalendar" }, ngImport: i0 });
1712
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CalendarDirective, decorators: [{
1679
1713
  type: Directive,
1680
1714
  args: [{
1681
1715
  selector: '[vlCalendar]',
@@ -1686,10 +1720,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
1686
1720
 
1687
1721
  class SdkDirectivesModule {
1688
1722
  }
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: [{
1723
+ SdkDirectivesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkDirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1724
+ SdkDirectivesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: SdkDirectivesModule, declarations: [CalendarDirective], exports: [CalendarDirective] });
1725
+ SdkDirectivesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkDirectivesModule });
1726
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkDirectivesModule, decorators: [{
1693
1727
  type: NgModule,
1694
1728
  args: [{
1695
1729
  declarations: [CalendarDirective],
@@ -1720,9 +1754,9 @@ class DatePipe {
1720
1754
  }
1721
1755
  }
1722
1756
  }
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: [{
1757
+ DatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1758
+ DatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DatePipe, name: "vlDate" });
1759
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DatePipe, decorators: [{
1726
1760
  type: Pipe,
1727
1761
  args: [{
1728
1762
  name: 'vlDate',
@@ -1742,9 +1776,9 @@ class NumberPipe {
1742
1776
  return formatNumber(price, this.formattingSettings?.thousandsSeparator, this.formattingSettings?.decimalSeparator, this.formattingSettings?.decimalsCount);
1743
1777
  }
1744
1778
  }
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: [{
1779
+ NumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1780
+ NumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: NumberPipe, name: "vlNumber" });
1781
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NumberPipe, decorators: [{
1748
1782
  type: Pipe,
1749
1783
  args: [{
1750
1784
  name: 'vlNumber',
@@ -1767,25 +1801,42 @@ class PricePipe {
1767
1801
  return `${this.formattingSettings?.currencySymbol || DEFAULT_CURRENCY_SYMBOL}${formatNumber(price, this.formattingSettings?.thousandsSeparator, this.formattingSettings?.decimalSeparator, this.formattingSettings?.decimalsCount)}`;
1768
1802
  }
1769
1803
  }
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: [{
1804
+ PricePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PricePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1805
+ PricePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: PricePipe, name: "vlPrice" });
1806
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PricePipe, decorators: [{
1773
1807
  type: Pipe,
1774
1808
  args: [{
1775
1809
  name: 'vlPrice',
1776
1810
  }]
1777
1811
  }] });
1778
1812
 
1813
+ class ActionCodePipe {
1814
+ constructor() {
1815
+ this.formattingSettings = inject(FORMATTING_SETTINGS_TOKEN, { optional: true })?.getFormattingSettings();
1816
+ }
1817
+ transform(actionCode) {
1818
+ return this.formattingSettings?.actionCodeLabels[actionCode] ?? actionCode;
1819
+ }
1820
+ }
1821
+ ActionCodePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ActionCodePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1822
+ ActionCodePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ActionCodePipe, name: "vlActionCode" });
1823
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ActionCodePipe, decorators: [{
1824
+ type: Pipe,
1825
+ args: [{
1826
+ name: 'vlActionCode',
1827
+ }]
1828
+ }] });
1829
+
1779
1830
  class SdkPipesModule {
1780
1831
  }
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: [{
1832
+ SdkPipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkPipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1833
+ 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] });
1834
+ SdkPipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkPipesModule });
1835
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkPipesModule, decorators: [{
1785
1836
  type: NgModule,
1786
1837
  args: [{
1787
- declarations: [NumberPipe, PricePipe, DatePipe],
1788
- exports: [NumberPipe, PricePipe, DatePipe],
1838
+ declarations: [NumberPipe, PricePipe, DatePipe, ActionCodePipe],
1839
+ exports: [NumberPipe, PricePipe, DatePipe, ActionCodePipe],
1789
1840
  }]
1790
1841
  }] });
1791
1842
 
@@ -1793,5 +1844,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
1793
1844
  * Generated bundle index. Do not edit.
1794
1845
  */
1795
1846
 
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 };
1847
+ 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
1848
  //# sourceMappingURL=veloceapps-sdk-core.mjs.map