@veloceapps/sdk 3.0.16 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/bundles/veloce-sdk-cms.umd.js +74 -836
  2. package/bundles/veloce-sdk-cms.umd.js.map +1 -1
  3. package/bundles/veloce-sdk-core.umd.js +1269 -0
  4. package/bundles/veloce-sdk-core.umd.js.map +1 -0
  5. package/bundles/veloce-sdk-runtime.umd.js +53 -166
  6. package/bundles/veloce-sdk-runtime.umd.js.map +1 -1
  7. package/bundles/veloce-sdk.umd.js +322 -155
  8. package/bundles/veloce-sdk.umd.js.map +1 -1
  9. package/cms/cms.default.d.ts +1 -1
  10. package/cms/components/element-renderer/element-renderer.component.d.ts +1 -1
  11. package/cms/components/preview/preview.component.d.ts +1 -3
  12. package/cms/decorators/element.decorator.d.ts +2 -2
  13. package/cms/index.d.ts +1 -1
  14. package/cms/injection-tokens.d.ts +1 -1
  15. package/cms/launcher.module.d.ts +2 -3
  16. package/cms/plugins/script.plugin.d.ts +1 -0
  17. package/cms/services/launcher.service.d.ts +1 -1
  18. package/cms/types/common.types.d.ts +4 -9
  19. package/cms/types/configuration.types.d.ts +0 -5
  20. package/cms/types/index.d.ts +1 -2
  21. package/cms/types/path.types.d.ts +11 -0
  22. package/cms/utils/element.utils.d.ts +6 -5
  23. package/cms/utils/elements-resolver.d.ts +2 -1
  24. package/cms/utils/index.d.ts +3 -1
  25. package/cms/utils/path.utils.d.ts +2 -1
  26. package/cms/vendor-map.d.ts +677 -2
  27. package/core/core.module.d.ts +8 -0
  28. package/core/index.d.ts +6 -0
  29. package/{cms → core}/modules/configuration/configuration.module.d.ts +0 -0
  30. package/{cms → core}/modules/configuration/helpers.d.ts +1 -2
  31. package/{cms → core}/modules/configuration/index.d.ts +0 -1
  32. package/{cms → core}/modules/configuration/services/configuration-runtime.service.d.ts +2 -3
  33. package/{cms → core}/modules/configuration/services/configuration.service.d.ts +2 -2
  34. package/{cms → core}/modules/configuration/services/runtime-context.service.d.ts +1 -1
  35. package/{cms → core}/modules/configuration/types/configuration-runtime.types.d.ts +0 -0
  36. package/{cms → core}/modules/flow-configuration/flow-configuration.module.d.ts +0 -0
  37. package/{cms → core}/modules/flow-configuration/index.d.ts +0 -0
  38. package/{cms → core}/modules/flow-configuration/services/flow-configuration.service.d.ts +7 -4
  39. package/{cms → core}/modules/flow-configuration/services/flow-update.service.d.ts +0 -0
  40. package/{cms → core}/modules/flow-configuration/types/update.types.d.ts +0 -0
  41. package/{cms → core}/modules/index.d.ts +0 -0
  42. package/core/package.json +10 -0
  43. package/{runtime → core}/services/context.service.d.ts +0 -0
  44. package/core/services/index.d.ts +2 -0
  45. package/{runtime/services/quote.service.d.ts → core/services/quote-draft.service.d.ts} +11 -6
  46. package/core/types/index.d.ts +3 -0
  47. package/core/types/quote-states.types.d.ts +6 -0
  48. package/{runtime/types/runtime-context.types.d.ts → core/types/runtime.types.d.ts} +4 -5
  49. package/{cms → core}/types/ui-definition.types.d.ts +0 -4
  50. package/core/utils/index.d.ts +2 -0
  51. package/{cms → core}/utils/line-item.utils.d.ts +0 -2
  52. package/{cms/types/line-item.types.d.ts → core/utils/line-item.worker.d.ts} +0 -0
  53. package/core/veloce-sdk-core.d.ts +5 -0
  54. package/esm2015/cms/cms.default.js +1 -1
  55. package/esm2015/cms/components/element-renderer/element-renderer.component.js +3 -3
  56. package/esm2015/cms/components/preview/preview.component.js +9 -10
  57. package/esm2015/cms/decorators/element.decorator.js +1 -1
  58. package/esm2015/cms/index.js +1 -2
  59. package/esm2015/cms/injection-tokens.js +1 -1
  60. package/esm2015/cms/launcher.module.js +5 -6
  61. package/esm2015/cms/plugins/configuration.plugin.js +3 -4
  62. package/esm2015/cms/plugins/script.plugin.js +27 -14
  63. package/esm2015/cms/services/launcher.service.js +1 -1
  64. package/esm2015/cms/types/common.types.js +1 -1
  65. package/esm2015/cms/types/configuration.types.js +1 -1
  66. package/esm2015/cms/types/index.js +2 -3
  67. package/esm2015/cms/types/path.types.js +2 -0
  68. package/esm2015/cms/utils/element.utils.js +1 -1
  69. package/esm2015/cms/utils/elements-resolver.js +1 -1
  70. package/esm2015/cms/utils/index.js +4 -2
  71. package/esm2015/cms/utils/path.utils.js +11 -1
  72. package/esm2015/cms/vendor-map.js +6 -5
  73. package/esm2015/core/core.module.js +18 -0
  74. package/esm2015/core/index.js +7 -0
  75. package/esm2015/core/modules/configuration/configuration.module.js +34 -0
  76. package/esm2015/core/modules/configuration/helpers.js +10 -0
  77. package/esm2015/core/modules/configuration/index.js +5 -0
  78. package/esm2015/core/modules/configuration/services/configuration-runtime.service.js +93 -0
  79. package/esm2015/core/modules/configuration/services/configuration.service.js +147 -0
  80. package/esm2015/core/modules/configuration/services/runtime-context.service.js +61 -0
  81. package/esm2015/core/modules/configuration/types/configuration-runtime.types.js +2 -0
  82. package/esm2015/core/modules/flow-configuration/flow-configuration.module.js +18 -0
  83. package/esm2015/core/modules/flow-configuration/index.js +5 -0
  84. package/esm2015/core/modules/flow-configuration/services/flow-configuration.service.js +90 -0
  85. package/esm2015/core/modules/flow-configuration/services/flow-update.service.js +114 -0
  86. package/esm2015/core/modules/flow-configuration/types/update.types.js +2 -0
  87. package/esm2015/core/modules/index.js +3 -0
  88. package/esm2015/core/services/context.service.js +41 -0
  89. package/esm2015/core/services/index.js +3 -0
  90. package/esm2015/core/services/quote-draft.service.js +67 -0
  91. package/esm2015/core/types/index.js +4 -0
  92. package/esm2015/core/types/quote-states.types.js +2 -0
  93. package/esm2015/core/types/runtime.types.js +16 -0
  94. package/esm2015/core/types/ui-definition.types.js +2 -0
  95. package/esm2015/core/utils/index.js +3 -0
  96. package/esm2015/core/utils/line-item.utils.js +98 -0
  97. package/esm2015/core/utils/line-item.worker.js +19 -0
  98. package/esm2015/core/veloce-sdk-core.js +5 -0
  99. package/esm2015/runtime/components/component-preview/component-preview.component.js +2 -2
  100. package/esm2015/runtime/components/ui-runtime/runtime.component.js +10 -9
  101. package/esm2015/runtime/components/ui-runtime-preview/runtime-preview.component.js +3 -3
  102. package/esm2015/runtime/execution/directives/section-script.directive.js +19 -20
  103. package/esm2015/runtime/execution/directives/velo-port.directive.js +1 -1
  104. package/esm2015/runtime/execution/directives/vl-quote.directive.js +1 -1
  105. package/esm2015/runtime/execution/directives/vl-ramp.directive.js +2 -2
  106. package/esm2015/runtime/execution/runtime-execution.module.js +6 -8
  107. package/esm2015/runtime/runtime.module.js +7 -9
  108. package/esm2015/runtime/services/cart.service.js +5 -6
  109. package/esm2015/runtime/services/configuration.service.js +9 -9
  110. package/esm2015/runtime/services/index.js +1 -3
  111. package/esm2015/runtime/services/runtime-context.service.js +4 -4
  112. package/esm2015/runtime/services/runtime.service.js +3 -3
  113. package/esm2015/runtime/types/index.js +1 -2
  114. package/esm2015/runtime/types/runtime.types.js +1 -1
  115. package/esm2015/src/components/dialog/dialog.component.js +30 -0
  116. package/esm2015/src/components/dialog/dialog.module.js +19 -0
  117. package/esm2015/src/components/dialog/dialog.types.js +2 -0
  118. package/esm2015/src/components/header/cart-overlay/cart-overlay.component.js +2 -2
  119. package/esm2015/src/components/header/header.component.js +51 -11
  120. package/esm2015/src/flow.component.js +2 -2
  121. package/esm2015/src/flow.module.js +33 -6
  122. package/esm2015/src/pages/debug/debug.component.js +14 -16
  123. package/esm2015/src/pages/legacy-product/legacy-product.component.js +12 -11
  124. package/esm2015/src/pages/product/product.component.js +12 -12
  125. package/esm2015/src/pages/shopping-cart/shopping-cart.component.js +1 -1
  126. package/esm2015/src/resolvers/context.resolver.js +2 -2
  127. package/esm2015/src/resolvers/quote.resolver.js +9 -16
  128. package/esm2015/src/services/flow-router.service.js +2 -2
  129. package/esm2015/src/services/fow-dialog.service.js +58 -0
  130. package/esm2015/src/types/flow-customization.types.js +1 -1
  131. package/esm2015/src/utils/flow.utils.js +11 -1
  132. package/fesm2015/veloce-sdk-cms.js +64 -714
  133. package/fesm2015/veloce-sdk-cms.js.map +1 -1
  134. package/fesm2015/veloce-sdk-core.js +785 -0
  135. package/fesm2015/veloce-sdk-core.js.map +1 -0
  136. package/fesm2015/veloce-sdk-runtime.js +48 -144
  137. package/fesm2015/veloce-sdk-runtime.js.map +1 -1
  138. package/fesm2015/veloce-sdk.js +260 -99
  139. package/fesm2015/veloce-sdk.js.map +1 -1
  140. package/package.json +2 -2
  141. package/runtime/components/ui-runtime/runtime.component.d.ts +3 -3
  142. package/runtime/components/ui-runtime-preview/runtime-preview.component.d.ts +1 -1
  143. package/runtime/execution/directives/section-script.directive.d.ts +2 -3
  144. package/runtime/execution/directives/velo-port.directive.d.ts +2 -2
  145. package/runtime/execution/directives/vl-ramp.directive.d.ts +1 -1
  146. package/runtime/execution/runtime-execution.module.d.ts +2 -1
  147. package/runtime/runtime.module.d.ts +2 -1
  148. package/runtime/services/cart.service.d.ts +2 -3
  149. package/runtime/services/configuration.service.d.ts +4 -5
  150. package/runtime/services/index.d.ts +0 -2
  151. package/runtime/services/runtime-context.service.d.ts +3 -3
  152. package/runtime/services/runtime.service.d.ts +5 -6
  153. package/runtime/types/index.d.ts +0 -1
  154. package/runtime/types/runtime.types.d.ts +5 -6
  155. package/src/components/dialog/dialog.component.d.ts +13 -0
  156. package/src/components/dialog/dialog.module.d.ts +9 -0
  157. package/src/components/dialog/dialog.types.d.ts +6 -0
  158. package/src/components/header/cart-overlay/cart-overlay.component.d.ts +1 -1
  159. package/src/components/header/header.component.d.ts +10 -5
  160. package/src/flow.component.d.ts +1 -1
  161. package/src/flow.module.d.ts +3 -1
  162. package/src/pages/debug/debug.component.d.ts +3 -4
  163. package/src/pages/legacy-product/legacy-product.component.d.ts +4 -3
  164. package/src/pages/product/product.component.d.ts +3 -4
  165. package/src/pages/shopping-cart/shopping-cart.component.d.ts +1 -1
  166. package/src/resolvers/context.resolver.d.ts +1 -1
  167. package/src/resolvers/quote.resolver.d.ts +3 -4
  168. package/src/services/flow-router.service.d.ts +1 -1
  169. package/src/services/fow-dialog.service.d.ts +17 -0
  170. package/src/types/flow-customization.types.d.ts +1 -1
  171. package/src/utils/flow.utils.d.ts +2 -0
  172. package/cms/modules/configuration/types/configuration.types.d.ts +0 -15
  173. package/esm2015/cms/modules/configuration/configuration.module.js +0 -37
  174. package/esm2015/cms/modules/configuration/helpers.js +0 -10
  175. package/esm2015/cms/modules/configuration/index.js +0 -6
  176. package/esm2015/cms/modules/configuration/services/configuration-runtime.service.js +0 -93
  177. package/esm2015/cms/modules/configuration/services/configuration.service.js +0 -147
  178. package/esm2015/cms/modules/configuration/services/runtime-context.service.js +0 -61
  179. package/esm2015/cms/modules/configuration/types/configuration-runtime.types.js +0 -2
  180. package/esm2015/cms/modules/configuration/types/configuration.types.js +0 -2
  181. package/esm2015/cms/modules/flow-configuration/flow-configuration.module.js +0 -18
  182. package/esm2015/cms/modules/flow-configuration/index.js +0 -5
  183. package/esm2015/cms/modules/flow-configuration/services/flow-configuration.service.js +0 -83
  184. package/esm2015/cms/modules/flow-configuration/services/flow-update.service.js +0 -114
  185. package/esm2015/cms/modules/flow-configuration/types/update.types.js +0 -2
  186. package/esm2015/cms/modules/index.js +0 -3
  187. package/esm2015/cms/types/line-item.types.js +0 -19
  188. package/esm2015/cms/types/ui-definition.types.js +0 -2
  189. package/esm2015/cms/utils/line-item.utils.js +0 -107
  190. package/esm2015/runtime/services/context.service.js +0 -41
  191. package/esm2015/runtime/services/quote.service.js +0 -53
  192. package/esm2015/runtime/types/runtime-context.types.js +0 -16
@@ -1,10 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@angular/common'), require('@veloce/core'), require('@angular/cdk/drag-drop'), require('@angular/forms'), require('lodash'), require('@veloce/components'), require('@veloce/sdk/runtime'), require('rxjs/operators'), require('@veloce/api'), require('primeng/api'), require('primeng/dynamicdialog'), require('@babel/standalone'), require('moment')) :
3
- typeof define === 'function' && define.amd ? define('@veloce/sdk/cms', ['exports', '@angular/core', 'rxjs', '@angular/common', '@veloce/core', '@angular/cdk/drag-drop', '@angular/forms', 'lodash', '@veloce/components', '@veloce/sdk/runtime', 'rxjs/operators', '@veloce/api', 'primeng/api', 'primeng/dynamicdialog', '@babel/standalone', 'moment'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.veloce = global.veloce || {}, global.veloce.sdk = global.veloce.sdk || {}, global.veloce.sdk.cms = {}), global.ng.core, global.rxjs, global.ng.common, global["@veloce/core"], global.ng.cdk.dragDrop, global.ng.forms, global.lodash, global["@veloce/components"], global.veloce.sdk.runtime, global.rxjs.operators, global["@veloce/api"], global["primeng/api"], global["primeng/dynamicdialog"], global["@babel/standalone"], global.moment));
5
- })(this, (function (exports, i0, rxjs, i8, core, dragDrop, angularForms, lodash, i6, i2, rxjsOperators, i1, i3, i5, standalone, moment) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('lodash'), require('@angular/common'), require('@veloce/core'), require('@angular/cdk/drag-drop'), require('@angular/forms'), require('@veloce/sdk/core'), require('@babel/standalone'), require('@veloce/api'), require('rxjs/operators'), require('primeng/api'), require('@veloce/components'), require('primeng/dynamicdialog')) :
3
+ typeof define === 'function' && define.amd ? define('@veloce/sdk/cms', ['exports', '@angular/core', 'rxjs', 'lodash', '@angular/common', '@veloce/core', '@angular/cdk/drag-drop', '@angular/forms', '@veloce/sdk/core', '@babel/standalone', '@veloce/api', 'rxjs/operators', 'primeng/api', '@veloce/components', 'primeng/dynamicdialog'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.veloce = global.veloce || {}, global.veloce.sdk = global.veloce.sdk || {}, global.veloce.sdk.cms = {}), global.ng.core, global.rxjs, global.lodash, global.ng.common, global["@veloce/core"], global.ng.cdk.dragDrop, global.ng.forms, global.veloce.sdk.core, global["@babel/standalone"], global["@veloce/api"], global.rxjs.operators, global["primeng/api"], global["@veloce/components"], global["primeng/dynamicdialog"]));
5
+ })(this, (function (exports, i0, rxjs, lodash, i7, core, dragDrop, angularForms, i2, standalone, api, rxjsOperators, i3, i5, dynamicdialog) { 'use strict';
8
6
 
9
7
  function _interopNamespace(e) {
10
8
  if (e && e.__esModule) return e;
@@ -26,16 +24,13 @@
26
24
 
27
25
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
26
  var rxjs__namespace = /*#__PURE__*/_interopNamespace(rxjs);
29
- var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
30
- var angularForms__namespace = /*#__PURE__*/_interopNamespace(angularForms);
31
27
  var lodash__namespace = /*#__PURE__*/_interopNamespace(lodash);
32
- var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
28
+ var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
29
+ var angularForms__namespace = /*#__PURE__*/_interopNamespace(angularForms);
33
30
  var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
34
31
  var rxjsOperators__namespace = /*#__PURE__*/_interopNamespace(rxjsOperators);
35
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
36
32
  var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
37
33
  var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
38
- var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
39
34
 
40
35
  /*! *****************************************************************************
41
36
  Copyright (c) Microsoft Corporation.
@@ -420,6 +415,15 @@
420
415
  __param(0, i0.Inject(i0.Injector))
421
416
  ], exports.ElementComponent);
422
417
 
418
+ var parseBoundPath = function (path) {
419
+ var _a, _b;
420
+ var regexp = new RegExp("(?:\\/)(?:\\w+)(?:\\/)(?:ports|attributes)(?:\\/)(?:\\w+)|(?:\\/)(?:\\w+)", 'g');
421
+ var blocks = (_b = (_a = path.match(regexp)) === null || _a === void 0 ? void 0 : _a.map(function (match) {
422
+ var _e = __read(lodash.compact(match.split('/')), 3), type = _e[0], property = _e[1], name = _e[2];
423
+ return { type: type, property: property, name: name };
424
+ })) !== null && _b !== void 0 ? _b : [];
425
+ return blocks;
426
+ };
423
427
  var parsePath = function (path) {
424
428
  var _a, _b, _c, _d;
425
429
  var segments = path.split('/');
@@ -630,30 +634,44 @@
630
634
  type: i0.Directive
631
635
  }], ctorParameters: function () { return [{ type: exports.ElementComponent }]; } });
632
636
 
633
- var normalizeImports = function (script) {
634
- var regexp = new RegExp("import([ \\n\\t]*(?:[^ \\n\\t\\{\\}]+[ \\n\\t]*,?)?(?:[ \\n\\t]*\\{(?:[ \\n\\t]*[^ \\n\\t\"'\\{\\}]+[ \\n\\t]*,?)+\\})?[ \\n\\t]*)from[ \\n\\t]*(['\"])([^'\"\\n]+)(?:['\"]);", 'g');
635
- var result = script.replace(regexp, function (match, g1, g2, src) { return "const " + g1 + " = vendor['" + src + "'];"; });
636
- return result;
637
- };
638
637
  var ScriptPlugin = /** @class */ (function () {
639
638
  function ScriptPlugin(host) {
639
+ var _this = this;
640
640
  this.host = host;
641
- this.document = this.host.injector.get(i8.DOCUMENT);
641
+ this.normalizeImports = function (script, elementPath) {
642
+ var regexp = new RegExp("import([ \\n\\t]*(?:[^ \\n\\t\\{\\}]+[ \\n\\t]*,?)?(?:[ \\n\\t]*\\{(?:[ \\n\\t]*[^ \\n\\t\"'\\{\\}]+[ \\n\\t]*,?)+\\})?[ \\n\\t]*)from[ \\n\\t]*(['\"])([^'\"\\n]+)(?:['\"]);", 'g');
643
+ var result = script.replace(regexp, function (match, g1, g2, src) {
644
+ var imports = g1
645
+ .trim()
646
+ .slice(1, -1)
647
+ .split(',')
648
+ .map(function (item) { return item.trim(); });
649
+ imports.forEach(function (item) {
650
+ var _a;
651
+ if (!((_a = _this.vendorMap[src]) === null || _a === void 0 ? void 0 : _a[item])) {
652
+ throw new Error("Failed to import " + item + " from '" + src + "' in " + elementPath + "/script.ts");
653
+ }
654
+ });
655
+ return "const " + g1 + " = vendor['" + src + "'];";
656
+ });
657
+ return result;
658
+ };
659
+ this.document = this.host.injector.get(i7.DOCUMENT);
642
660
  this.vendorMap = this.host.injector.get(VENDOR_MAP);
643
661
  var elementMetadata = this.host.injector.get(ELEMENT_METADATA);
644
662
  var sharedElementMetadata = this.host.injector.get(SHARED_ELEMENT_METADATA);
645
- if (sharedElementMetadata === null || sharedElementMetadata === void 0 ? void 0 : sharedElementMetadata.script) {
646
- this.addScript(sharedElementMetadata.script);
647
- }
648
- if (elementMetadata.script) {
649
- this.addScript(elementMetadata.script);
650
- }
663
+ this.addScript(sharedElementMetadata);
664
+ this.addScript(elementMetadata);
651
665
  }
652
- ScriptPlugin.prototype.addScript = function (scriptStr) {
666
+ ScriptPlugin.prototype.addScript = function (metadata) {
667
+ var _a;
668
+ if (!(metadata === null || metadata === void 0 ? void 0 : metadata.script)) {
669
+ return;
670
+ }
653
671
  var id = btoa(core.UUID.UUID());
654
672
  var script = this.document.createElement('script');
655
673
  script.type = "text/javascript";
656
- var scriptContent = normalizeImports(scriptStr);
674
+ var scriptContent = this.normalizeImports(metadata.script, (_a = metadata.path) !== null && _a !== void 0 ? _a : metadata.name);
657
675
  var classMatch = /export class (\S+)/.exec(scriptContent);
658
676
  var className = classMatch === null || classMatch === void 0 ? void 0 : classMatch[1];
659
677
  if (!classMatch || !className) {
@@ -871,474 +889,6 @@
871
889
  type: i0.Injectable
872
890
  }] });
873
891
 
874
- var parseBoundPath = function (path) {
875
- var _a, _b;
876
- var regexp = new RegExp("(?:\\/)(?:\\w+)(?:\\/)(?:ports|attributes)(?:\\/)(?:\\w+)|(?:\\/)(?:\\w+)", 'g');
877
- var blocks = (_b = (_a = path.match(regexp)) === null || _a === void 0 ? void 0 : _a.map(function (match) {
878
- var _c = __read(lodash.compact(match.split('/')), 3), type = _c[0], property = _c[1], name = _c[2];
879
- return { type: type, property: property, name: name };
880
- })) !== null && _b !== void 0 ? _b : [];
881
- return blocks;
882
- };
883
- var findLineItem = function (id, lineItems) {
884
- return findLineItemWithComparator(lineItems, function (li) { return li.id === id; });
885
- };
886
- var findLineItemWithComparator = function (lineItems, comparator) {
887
- var currentLevel = lineItems;
888
- while (currentLevel.length) {
889
- var found = currentLevel.find(comparator);
890
- if (found) {
891
- return found;
892
- }
893
- currentLevel = lodash.flatten(currentLevel.map(function (parent) { return parent.lineItems; }));
894
- }
895
- return;
896
- };
897
- var insertLineItem = function (lineItem, parentId, toInsert) {
898
- var insertData = lineItem.id === parentId ? [toInsert] : [];
899
- return Object.assign(Object.assign({}, lineItem), { lineItems: __spreadArray(__spreadArray([], __read(insertData)), __read(lineItem.lineItems.map(function (li) {
900
- return insertLineItem(li, parentId, toInsert);
901
- }))) });
902
- };
903
- var removeLineItem = function (lineItem, idToRemove) {
904
- return Object.assign(Object.assign({}, lineItem), { lineItems: lineItem.lineItems
905
- .map(function (li) {
906
- if (li.id === idToRemove) {
907
- return;
908
- }
909
- else if (li.lineItems.length) {
910
- return removeLineItem(li, idToRemove);
911
- }
912
- return li;
913
- })
914
- .filter(function (r) { return !!r; }) });
915
- };
916
- var replaceLineItem = function (lineItem, replaceTo) {
917
- if (lineItem.id === replaceTo.id) {
918
- return Object.assign({}, replaceTo);
919
- }
920
- return Object.assign(Object.assign({}, lineItem), { lineItems: lineItem.lineItems.map(function (li) {
921
- if (li.id === replaceTo.id) {
922
- return replaceTo;
923
- }
924
- else if (li.lineItems.length) {
925
- return replaceLineItem(li, replaceTo);
926
- }
927
- return li;
928
- }) });
929
- };
930
- var mapAttributes = function (attributes) {
931
- return attributes.reduce(function (acc, _c) {
932
- var _d;
933
- var name = _c.name, value = _c.value;
934
- return (Object.assign(Object.assign({}, acc), (_d = {}, _d[name] = value, _d)));
935
- }, {});
936
- };
937
- var getAttributes = function (attributes, names) {
938
- if (names === void 0) { names = []; }
939
- var filtered = attributes.filter(function (_c) {
940
- var name = _c.name;
941
- return names.includes(name);
942
- });
943
- return lodash.sortBy(filtered, [function (_c) {
944
- var name = _c.name;
945
- return names.indexOf(name);
946
- }]);
947
- };
948
- var upsertAttributes = function (originalAttributes, attributesToUpsert) {
949
- return attributesToUpsert.reduce(function (acc, _c) {
950
- var name = _c.name, value = _c.value;
951
- var _d = __read(getAttributes(acc, [name]), 1), origAttr = _d[0];
952
- return __spreadArray(__spreadArray([], __read(acc.filter(function (attr) { return attr.name !== name; }))), [
953
- Object.assign(Object.assign({}, (origAttr !== null && origAttr !== void 0 ? origAttr : { name: name })), { cfgStatus: 'User', value: value }),
954
- ]);
955
- }, originalAttributes);
956
- };
957
- var patchAttributes = function (rootLineItem, id, attrs) {
958
- var lineItem = findLineItem(id, [rootLineItem]);
959
- if (!lineItem) {
960
- return rootLineItem;
961
- }
962
- var attributes = upsertAttributes(lineItem.attributes, attrs);
963
- return replaceLineItem(rootLineItem, Object.assign(Object.assign({}, lineItem), { attributes: attributes }));
964
- };
965
- var getAttributeValue = function (attributes, name) { var _a; return (_a = attributes.find(function (attr) { return attr.name === name; })) === null || _a === void 0 ? void 0 : _a.value; };
966
- var generateLineItem = function (port, type, parentId, attributes, lineItems) {
967
- if (attributes === void 0) { attributes = []; }
968
- if (lineItems === void 0) { lineItems = []; }
969
- return {
970
- port: port,
971
- type: type,
972
- actionCode: 'ADD',
973
- cfgStatus: 'New',
974
- attributes: attributes.map(function (_c) {
975
- var name = _c.name, value = _c.value;
976
- return ({ cfgStatus: 'User', name: name, value: value });
977
- }),
978
- lineItems: lineItems,
979
- parentId: parentId,
980
- qty: 1,
981
- };
982
- };
983
- var getRecommendedPrices = function (portDomain, type) {
984
- var _a, _b;
985
- var domainType = portDomain.domainTypes.find(function (_c) {
986
- var name = _c.name;
987
- return name === type;
988
- });
989
- var _c = __read((_b = (_a = domainType === null || domainType === void 0 ? void 0 : domainType.recommendedPrices) === null || _a === void 0 ? void 0 : _a.filter(function (_c) {
990
- var chargeMethod = _c.chargeMethod;
991
- return chargeMethod === 'ONE_TIME';
992
- }).reduce(function (acc, rp) {
993
- var _c = __read(acc, 2), netPrice = _c[0], listPrice = _c[1];
994
- return [netPrice + rp.netPrice, listPrice + rp.listPrice];
995
- }, [0, 0])) !== null && _b !== void 0 ? _b : [0, 0], 2), net = _c[0], list = _c[1];
996
- return { net: net, list: list };
997
- };
998
-
999
- var LineItemWorker = /** @class */ (function () {
1000
- function LineItemWorker(src) {
1001
- this.li = Object.assign({}, src);
1002
- }
1003
- LineItemWorker.prototype.insert = function (parentId, toInsert) {
1004
- return new LineItemWorker(insertLineItem(this.li, parentId, toInsert));
1005
- };
1006
- LineItemWorker.prototype.remove = function (id) {
1007
- return new LineItemWorker(removeLineItem(this.li, id));
1008
- };
1009
- LineItemWorker.prototype.replace = function (toReplace) {
1010
- return new LineItemWorker(replaceLineItem(this.li, toReplace));
1011
- };
1012
- LineItemWorker.prototype.patchAttribute = function (attrs, id) {
1013
- return new LineItemWorker(patchAttributes(this.li, id !== null && id !== void 0 ? id : this.li.id, attrs));
1014
- };
1015
- return LineItemWorker;
1016
- }());
1017
-
1018
- var vlCmsLineItemTypes = /*#__PURE__*/Object.freeze({
1019
- __proto__: null,
1020
- LineItemWorker: LineItemWorker
1021
- });
1022
-
1023
- var getDefaultLineItem = function (context, uiDefinitionProperties) {
1024
- var _a, _b, _c;
1025
- var id = core.UUID.UUID();
1026
- var lineItem = Object.assign({ id: id, type: (_a = uiDefinitionProperties.rootType) !== null && _a !== void 0 ? _a : '', cfgStatus: 'Default', actionCode: 'ADD', qty: 1, productName: ((_b = context.properties) === null || _b === void 0 ? void 0 : _b.displayName) || context.productName, productId: (_c = context.productId) !== null && _c !== void 0 ? _c : '' }, (context.offeringId
1027
- ? { offeringId: context.offeringId, offeringInstanceId: context.offeringInstanceId || id }
1028
- : {}));
1029
- return lineItem;
1030
- };
1031
-
1032
- var RuntimeContextService = /** @class */ (function () {
1033
- function RuntimeContextService(configurationApiService, messageService) {
1034
- this.configurationApiService = configurationApiService;
1035
- this.messageService = messageService;
1036
- }
1037
- RuntimeContextService.prototype.getRuntimeContext = function (productId, offeringId) {
1038
- var _this = this;
1039
- return this.configurationApiService.getRuntimeDataByProductId(productId, offeringId).pipe(rxjsOperators.map(function (runtimeData) {
1040
- var _a, _b, _c;
1041
- var uiDefinition = _this.getUIDefinition(runtimeData);
1042
- var runtimeModel = core.RuntimeModel.create(runtimeData.types, runtimeData.products);
1043
- var _d = (_a = Array.from(runtimeModel.components.values()).find(function (c) { return c.productId === productId; })) !== null && _a !== void 0 ? _a : {}, productName = _d.productName, properties = _d.properties;
1044
- return {
1045
- modelId: runtimeData.modelId,
1046
- uiDefinition: uiDefinition,
1047
- runtimeModel: runtimeModel,
1048
- runtimeMode: i2.RuntimeMode.PROD,
1049
- productId: productId,
1050
- productType: (properties === null || properties === void 0 ? void 0 : properties.displayName) || productName,
1051
- offeringId: offeringId,
1052
- properties: {
1053
- PricingEnabled: ((_b = uiDefinition === null || uiDefinition === void 0 ? void 0 : uiDefinition.properties) === null || _b === void 0 ? void 0 : _b.pricingEnabled) ? 'true' : 'false',
1054
- PriceListId: (_c = uiDefinition === null || uiDefinition === void 0 ? void 0 : uiDefinition.properties) === null || _c === void 0 ? void 0 : _c.priceList,
1055
- },
1056
- };
1057
- }));
1058
- };
1059
- RuntimeContextService.prototype.getUIDefinition = function (runtimeData) {
1060
- var _a;
1061
- var rawUiDefinitions;
1062
- try {
1063
- rawUiDefinitions = JSON.parse(runtimeData.uiDefinitionsSource);
1064
- }
1065
- catch (e) {
1066
- return;
1067
- }
1068
- var uiDefinitions = rawUiDefinitions.filter(function (uiDef) { return uiDef.version; });
1069
- var uiDefinition = (_a = uiDefinitions.find(function (uiDef) { return uiDef.primary; })) !== null && _a !== void 0 ? _a : uiDefinitions[0];
1070
- if (!uiDefinition) {
1071
- var errMsg = "Unable to find Default UI";
1072
- this.messageService.add({
1073
- severity: 'error',
1074
- summary: 'ERROR',
1075
- });
1076
- throw new Error(errMsg);
1077
- }
1078
- return uiDefinition;
1079
- };
1080
- return RuntimeContextService;
1081
- }());
1082
- RuntimeContextService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: RuntimeContextService, deps: [{ token: i1__namespace.ConfigurationApiService }, { token: i3__namespace.MessageService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1083
- RuntimeContextService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: RuntimeContextService });
1084
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: RuntimeContextService, decorators: [{
1085
- type: i0.Injectable
1086
- }], ctorParameters: function () { return [{ type: i1__namespace.ConfigurationApiService }, { type: i3__namespace.MessageService }]; } });
1087
-
1088
- var ConfigurationRuntimeService = /** @class */ (function () {
1089
- function ConfigurationRuntimeService(apiService, contextService, runtimeContextService) {
1090
- this.apiService = apiService;
1091
- this.contextService = contextService;
1092
- this.runtimeContextService = runtimeContextService;
1093
- this._isInitialized = false;
1094
- this.uiDefinitionProperties = {};
1095
- }
1096
- ConfigurationRuntimeService.prototype.reset = function () {
1097
- this._isInitialized = false;
1098
- this._runtimeContext = undefined;
1099
- this._assets = undefined;
1100
- this.uiDefinitionProperties = {};
1101
- };
1102
- ConfigurationRuntimeService.prototype.initTestMode = function (modelId, uiDefinition) {
1103
- var _this = this;
1104
- var _a, _b;
1105
- this.uiDefinitionProperties = (_a = uiDefinition.properties) !== null && _a !== void 0 ? _a : {};
1106
- var uiDefinitionExternals = (_b = uiDefinition.externals) !== null && _b !== void 0 ? _b : {};
1107
- return rxjs.combineLatest([
1108
- this.apiService.getRuntimeDataByModelId(modelId),
1109
- this.contextService.create('TestId', core.ConfigurationContextMode.TEST),
1110
- ]).pipe(rxjsOperators.first(), rxjsOperators.tap(function (_e) {
1111
- var _f = __read(_e, 2), runtimeData = _f[0], context = _f[1];
1112
- var _a;
1113
- _this._runtimeContext = {
1114
- modelId: modelId,
1115
- runtimeModel: core.RuntimeModel.create(runtimeData.types, runtimeData.products),
1116
- runtimeMode: i2.RuntimeMode.TEST,
1117
- };
1118
- _this.contextService.update({
1119
- properties: Object.assign(Object.assign(Object.assign(Object.assign({}, (_a = _this.runtimeContext) === null || _a === void 0 ? void 0 : _a.properties), context.properties), { ModelId: modelId, RuntimeMode: core.ConfigurationContextMode.TEST, PricingEnabled: _this.uiDefinitionProperties.pricingEnabled ? 'true' : 'false', StartDate: new Date().toISOString().substring(0, 10), PriceListId: _this.uiDefinitionProperties.priceList }), uiDefinitionExternals),
1120
- });
1121
- _this._isInitialized = true;
1122
- }));
1123
- };
1124
- ConfigurationRuntimeService.prototype.init = function (props) {
1125
- var _this = this;
1126
- this._assets = props.assets;
1127
- var context = this.contextService.resolve();
1128
- if (!context) {
1129
- return rxjs.of();
1130
- }
1131
- return this.runtimeContextService.getRuntimeContext(props.productId, props.offeringId).pipe(rxjsOperators.tap(function (runtimeContext) {
1132
- var _a, _b, _c, _d;
1133
- _this.uiDefinitionProperties = (_b = (_a = runtimeContext.uiDefinition) === null || _a === void 0 ? void 0 : _a.properties) !== null && _b !== void 0 ? _b : {};
1134
- var PriceListId = ((_c = context.properties) !== null && _c !== void 0 ? _c : {}).PriceListId;
1135
- var mergeContext = Object.assign(Object.assign({}, runtimeContext), { properties: Object.assign(Object.assign(Object.assign({}, runtimeContext.properties), context.properties), { PricingEnabled: PriceListId ? 'true' : 'false' }) });
1136
- _this.id15to18('AccountId', mergeContext.properties);
1137
- _this._runtimeContext = mergeContext;
1138
- if (context.properties && ((_d = _this._runtimeContext.properties) === null || _d === void 0 ? void 0 : _d.StartDate)) {
1139
- _this.contextService.update({
1140
- properties: Object.assign(Object.assign({}, _this._runtimeContext.properties), context.properties),
1141
- });
1142
- }
1143
- _this._isInitialized = true;
1144
- }));
1145
- };
1146
- ConfigurationRuntimeService.prototype.id15to18 = function (propertyName, source) {
1147
- if (!source) {
1148
- return;
1149
- }
1150
- var value = source[propertyName];
1151
- if (typeof value === 'string' && value.length === 15) {
1152
- source[propertyName] = core.SalesforceIdUtils.generateId18FromId15(value);
1153
- }
1154
- };
1155
- ConfigurationRuntimeService.prototype.getAsset = function (lineItem) {
1156
- return this._assets && this._assets.find(function (a) { return a.id === lineItem.openOrderLineItemId || a.id === lineItem.assetId; });
1157
- };
1158
- Object.defineProperty(ConfigurationRuntimeService.prototype, "isInitialized", {
1159
- get: function () {
1160
- return this._isInitialized;
1161
- },
1162
- enumerable: false,
1163
- configurable: true
1164
- });
1165
- Object.defineProperty(ConfigurationRuntimeService.prototype, "runtimeModel", {
1166
- get: function () {
1167
- var _a;
1168
- return (_a = this.runtimeContext) === null || _a === void 0 ? void 0 : _a.runtimeModel;
1169
- },
1170
- enumerable: false,
1171
- configurable: true
1172
- });
1173
- Object.defineProperty(ConfigurationRuntimeService.prototype, "runtimeContext", {
1174
- get: function () {
1175
- return this._runtimeContext;
1176
- },
1177
- enumerable: false,
1178
- configurable: true
1179
- });
1180
- return ConfigurationRuntimeService;
1181
- }());
1182
- ConfigurationRuntimeService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ConfigurationRuntimeService, deps: [{ token: i1__namespace.ConfigurationApiService }, { token: i2__namespace.ContextService }, { token: RuntimeContextService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1183
- ConfigurationRuntimeService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ConfigurationRuntimeService });
1184
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ConfigurationRuntimeService, decorators: [{
1185
- type: i0.Injectable
1186
- }], ctorParameters: function () { return [{ type: i1__namespace.ConfigurationApiService }, { type: i2__namespace.ContextService }, { type: RuntimeContextService }]; } });
1187
-
1188
- var ConfigurationService = /** @class */ (function () {
1189
- function ConfigurationService(runtimeService, contextService, configurationApiService, messageService, dialogService) {
1190
- this.runtimeService = runtimeService;
1191
- this.contextService = contextService;
1192
- this.configurationApiService = configurationApiService;
1193
- this.messageService = messageService;
1194
- this.dialogService = dialogService;
1195
- this.mode = core.ConfigurationMode.SEARCH;
1196
- this.states = {};
1197
- this.lineItem = new rxjs.BehaviorSubject(undefined);
1198
- this.charges = new rxjs.BehaviorSubject({});
1199
- }
1200
- ConfigurationService.prototype.reset = function () {
1201
- this.runtimeService.reset();
1202
- this.states = {};
1203
- this.lineItem.next(undefined);
1204
- this.charges.next({});
1205
- };
1206
- ConfigurationService.prototype.patch$ = function (lineItem) {
1207
- var _this = this;
1208
- if (!this.lineItem.value) {
1209
- return rxjs.throwError(function () { return new Error("Source LineItem not found"); });
1210
- }
1211
- this.states.configurableRamp = new LineItemWorker(this.lineItem.value).replace(lineItem).li;
1212
- this.states.asset = this.states.configurableRamp
1213
- ? this.runtimeService.getAsset(this.states.configurableRamp)
1214
- : undefined;
1215
- return this.configure().pipe(rxjsOperators.catchError(function (error) {
1216
- console.error(error);
1217
- if (!_this.runtimeService.uiDefinitionProperties.suppressToastMessages) {
1218
- _this.messageService.add({ severity: 'error', summary: error });
1219
- }
1220
- // bounce back if configuration call has failed
1221
- _this.lineItem.next(_this.lineItem.value ? Object.assign({}, _this.lineItem.value) : undefined);
1222
- return rxjs.throwError(function () { return error; });
1223
- }));
1224
- };
1225
- ConfigurationService.prototype.patch = function (lineItem) {
1226
- this.patch$(lineItem).subscribe();
1227
- };
1228
- ConfigurationService.prototype.updateCurrentStates = function (update) {
1229
- this.states = Object.assign(Object.assign({}, this.states), update);
1230
- };
1231
- ConfigurationService.prototype.get = function () {
1232
- return this.lineItem.asObservable().pipe(rxjs.shareReplay());
1233
- };
1234
- ConfigurationService.prototype.getSnapshot = function () {
1235
- return this.lineItem.value ? Object.assign({}, this.lineItem.value) : undefined;
1236
- };
1237
- ConfigurationService.prototype.getRuntimeModel = function () {
1238
- return this.runtimeService.runtimeModel;
1239
- };
1240
- ConfigurationService.prototype.getRuntimeContext = function () {
1241
- return this.runtimeService.runtimeContext;
1242
- };
1243
- Object.defineProperty(ConfigurationService.prototype, "contextSnapshot", {
1244
- get: function () {
1245
- return this.contextService.resolve();
1246
- },
1247
- enumerable: false,
1248
- configurable: true
1249
- });
1250
- Object.defineProperty(ConfigurationService.prototype, "context$", {
1251
- get: function () {
1252
- return this.contextService.resolve$();
1253
- },
1254
- enumerable: false,
1255
- configurable: true
1256
- });
1257
- Object.defineProperty(ConfigurationService.prototype, "charges$", {
1258
- get: function () {
1259
- return this.charges.asObservable();
1260
- },
1261
- enumerable: false,
1262
- configurable: true
1263
- });
1264
- Object.defineProperty(ConfigurationService.prototype, "chargesSnapshot", {
1265
- get: function () {
1266
- return this.charges.value;
1267
- },
1268
- enumerable: false,
1269
- configurable: true
1270
- });
1271
- ConfigurationService.prototype.configure = function () {
1272
- var _this = this;
1273
- var _a, _b, _c, _d, _e;
1274
- var runtimeContext = this.getRuntimeContext();
1275
- var runtimeModel = this.getRuntimeModel();
1276
- if (!runtimeContext || !runtimeModel) {
1277
- return rxjs.throwError(function () { return new Error('Runtime context/model not initialized'); });
1278
- }
1279
- var uiDefinitionProperties = Object.assign(Object.assign({}, ((_b = (_a = runtimeContext.uiDefinition) === null || _a === void 0 ? void 0 : _a.properties) !== null && _b !== void 0 ? _b : {})), ((_c = this.runtimeService.uiDefinitionProperties) !== null && _c !== void 0 ? _c : {}));
1280
- var lineItem = (_d = this.states.configurableRamp) !== null && _d !== void 0 ? _d : getDefaultLineItem(runtimeContext, uiDefinitionProperties);
1281
- var configurationRequest = this.createRequest(lineItem);
1282
- configurationRequest.lineItems = this.states.currentState || [];
1283
- configurationRequest.asset = this.states.asset;
1284
- var mainPricingEnabled = (_e = runtimeContext.properties) === null || _e === void 0 ? void 0 : _e.PricingEnabled;
1285
- var pricingEnabled = mainPricingEnabled ? mainPricingEnabled === 'true' : uiDefinitionProperties.pricingEnabled;
1286
- return this.configurationApiService
1287
- .configureLineItem({ configurationRequest: configurationRequest, runtimeModel: runtimeModel, pricingEnabled: pricingEnabled })
1288
- .pipe(rxjsOperators.map(function (_f) {
1289
- var lineItem = _f.lineItem, context = _f.context, charges = _f.charges, deletedLineItems = _f.deletedLineItems;
1290
- _this.contextService.update(context !== null && context !== void 0 ? context : {});
1291
- _this.charges.next(charges !== null && charges !== void 0 ? charges : {});
1292
- if (deletedLineItems === null || deletedLineItems === void 0 ? void 0 : deletedLineItems.length) {
1293
- _this.showInactiveProductsConfirmation();
1294
- }
1295
- return lineItem;
1296
- }))
1297
- .pipe(rxjsOperators.tap(function (lineItem) { return lineItem && _this.lineItem.next(lineItem); }), rxjsOperators.catchError(function (error) { return rxjs.throwError(function () { var _a; return new Error(((_a = error.error) === null || _a === void 0 ? void 0 : _a.message) || error.message || JSON.stringify(error)); }); }));
1298
- };
1299
- ConfigurationService.prototype.createRequest = function (lineItem) {
1300
- return {
1301
- lineItem: lineItem,
1302
- mode: this.mode,
1303
- step: !this.lineItem.value ? i2.RuntimeStep.START : i2.RuntimeStep.UPDATE,
1304
- attributeDomainMode: 'ALL',
1305
- context: this.contextService.resolve(),
1306
- };
1307
- };
1308
- ConfigurationService.prototype.showInactiveProductsConfirmation = function () {
1309
- var _this = this;
1310
- this.dialogService
1311
- .open(i6.ConfirmationComponent, {
1312
- dismissableMask: false,
1313
- closeOnEscape: false,
1314
- closable: false,
1315
- showHeader: true,
1316
- header: "Inactive Products in Quote",
1317
- width: '440px',
1318
- data: {
1319
- confirmationConfig: {
1320
- title: ' ',
1321
- description: 'This quote contains inactive products. Do you want to remove them?',
1322
- submitBtn: 'Remove products',
1323
- cancelBtn: 'Back to Quote',
1324
- },
1325
- },
1326
- })
1327
- .onClose.subscribe(function (result) {
1328
- if (!result) {
1329
- var context = _this.contextService.resolve();
1330
- window['VELO_BACK_FN'].apply(null, [(context === null || context === void 0 ? void 0 : context.headerId) || '']);
1331
- }
1332
- });
1333
- };
1334
- return ConfigurationService;
1335
- }());
1336
- ConfigurationService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ConfigurationService, deps: [{ token: ConfigurationRuntimeService }, { token: i2__namespace.ContextService }, { token: i1__namespace.ConfigurationApiService }, { token: i3__namespace.MessageService }, { token: i5__namespace.DialogService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1337
- ConfigurationService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ConfigurationService });
1338
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ConfigurationService, decorators: [{
1339
- type: i0.Injectable
1340
- }], ctorParameters: function () { return [{ type: ConfigurationRuntimeService }, { type: i2__namespace.ContextService }, { type: i1__namespace.ConfigurationApiService }, { type: i3__namespace.MessageService }, { type: i5__namespace.DialogService }]; } });
1341
-
1342
892
  var ElementRendererComponent = /** @class */ (function () {
1343
893
  function ElementRendererComponent(parentInjector, dynamicModuleService, elementContext, ioProviderService, configurationService, elementRef, cdr) {
1344
894
  this.parentInjector = parentInjector;
@@ -1460,7 +1010,7 @@
1460
1010
  };
1461
1011
  return ElementRendererComponent;
1462
1012
  }());
1463
- ElementRendererComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementRendererComponent, deps: [{ token: i0__namespace.Injector, skipSelf: true }, { token: DynamicModuleService }, { token: ElementContextService }, { token: IOProviderService }, { token: ConfigurationService }, { token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1013
+ ElementRendererComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementRendererComponent, deps: [{ token: i0__namespace.Injector, skipSelf: true }, { token: DynamicModuleService }, { token: ElementContextService }, { token: IOProviderService }, { token: i2__namespace.ConfigurationService }, { token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1464
1014
  ElementRendererComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: ElementRendererComponent, selector: "vl-cms-element-renderer", inputs: { meta: "meta" }, providers: [ElementContextService], viewQueries: [{ propertyName: "el", first: true, predicate: ["el"], descendants: true, read: i0.ViewContainerRef, static: true }], ngImport: i0__namespace, template: "<ng-template #el></ng-template>\n", styles: [":host{display:contents}\n"], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1465
1015
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementRendererComponent, decorators: [{
1466
1016
  type: i0.Component,
@@ -1474,7 +1024,7 @@
1474
1024
  }], ctorParameters: function () {
1475
1025
  return [{ type: i0__namespace.Injector, decorators: [{
1476
1026
  type: i0.SkipSelf
1477
- }] }, { type: DynamicModuleService }, { type: ElementContextService }, { type: IOProviderService }, { type: ConfigurationService }, { type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }];
1027
+ }] }, { type: DynamicModuleService }, { type: ElementContextService }, { type: IOProviderService }, { type: i2__namespace.ConfigurationService }, { type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }];
1478
1028
  }, propDecorators: { el: [{
1479
1029
  type: i0.ViewChild,
1480
1030
  args: ['el', { read: i0.ViewContainerRef, static: true }]
@@ -1685,7 +1235,7 @@
1685
1235
  this.host = host;
1686
1236
  this.destroy$ = new rxjs.Subject();
1687
1237
  this.elementMetadata = this.host.injector.get(ELEMENT_METADATA);
1688
- this.configurationService = this.host.injector.get(ConfigurationService);
1238
+ this.configurationService = this.host.injector.get(i2.ConfigurationService);
1689
1239
  if ((_a = this.elementMetadata.model) === null || _a === void 0 ? void 0 : _a.lineItem) {
1690
1240
  this.host.model$.pipe(rxjs.takeUntil(this.destroy$)).subscribe(function (model) { return (_this.modelSnapshot = model); });
1691
1241
  var pathBlocks = parseBoundPath((_b = this.elementMetadata.model) === null || _b === void 0 ? void 0 : _b.lineItem);
@@ -1719,7 +1269,7 @@
1719
1269
  if (!rootLineItem) {
1720
1270
  return;
1721
1271
  }
1722
- _this.configurationService.patch(new LineItemWorker(rootLineItem).remove(id).li);
1272
+ _this.configurationService.patch(new i2.LineItemWorker(rootLineItem).remove(id).li);
1723
1273
  };
1724
1274
  this.typeHost.remove = remove;
1725
1275
  };
@@ -1734,8 +1284,8 @@
1734
1284
  if (!portDomain) {
1735
1285
  return;
1736
1286
  }
1737
- var generated = generateLineItem(portDomain.name, type, _this.modelSnapshot.id, attributes);
1738
- _this.configurationService.patch(new LineItemWorker(_this.modelSnapshot).insert(_this.modelSnapshot.id, generated).li);
1287
+ var generated = i2.generateLineItem(portDomain.name, type, _this.modelSnapshot.id, attributes);
1288
+ _this.configurationService.patch(new i2.LineItemWorker(_this.modelSnapshot).insert(_this.modelSnapshot.id, generated).li);
1739
1289
  };
1740
1290
  this.portHost.addPortItem = add;
1741
1291
  };
@@ -1745,12 +1295,12 @@
1745
1295
  if (!this.host.model$) {
1746
1296
  return;
1747
1297
  }
1748
- var value$ = (_a = this.host.model$) === null || _a === void 0 ? void 0 : _a.pipe(rxjs.map(function (model) { var _a; return getAttributeValue((_a = model === null || model === void 0 ? void 0 : model.attributes) !== null && _a !== void 0 ? _a : [], name); }));
1298
+ var value$ = (_a = this.host.model$) === null || _a === void 0 ? void 0 : _a.pipe(rxjs.map(function (model) { var _a; return i2.getAttributeValue((_a = model === null || model === void 0 ? void 0 : model.attributes) !== null && _a !== void 0 ? _a : [], name); }));
1749
1299
  var patch = function (value) {
1750
1300
  if (!_this.modelSnapshot) {
1751
1301
  return;
1752
1302
  }
1753
- _this.configurationService.patch(new LineItemWorker(_this.modelSnapshot).patchAttribute([{ name: name, value: value }]).li);
1303
+ _this.configurationService.patch(new i2.LineItemWorker(_this.modelSnapshot).patchAttribute([{ name: name, value: value }]).li);
1754
1304
  };
1755
1305
  this.attributeHost.value$ = value$;
1756
1306
  this.attributeHost.patch = patch;
@@ -1789,246 +1339,6 @@
1789
1339
  DEFAULT: [],
1790
1340
  };
1791
1341
 
1792
- var FlowUpdateService = /** @class */ (function () {
1793
- function FlowUpdateService() {
1794
- }
1795
- FlowUpdateService.prototype.update = function (rootLineItems, updates) {
1796
- var _this = this;
1797
- var remainingUpdates = __spreadArray([], __read(updates));
1798
- var currentLevel = rootLineItems;
1799
- while (currentLevel.length && remainingUpdates.length) {
1800
- currentLevel.forEach(function (li) {
1801
- var unhandledUpdates = [];
1802
- remainingUpdates.forEach(function (update) {
1803
- var updated = false;
1804
- switch (update.dataType) {
1805
- case 'LINEITEM':
1806
- updated = _this.applyLineItemUpdate(li, update);
1807
- break;
1808
- case 'CHARGE':
1809
- updated = _this.applyChargeUpdate(li, update);
1810
- break;
1811
- case 'GROUP_CHARGE':
1812
- updated = _this.applyChargeGroupUpdate(li, update);
1813
- break;
1814
- default:
1815
- // Unknown dataType. Do not try to handle it anymore
1816
- updated = true;
1817
- }
1818
- if (!updated) {
1819
- unhandledUpdates.push(update);
1820
- }
1821
- });
1822
- remainingUpdates = unhandledUpdates;
1823
- });
1824
- currentLevel = lodash.flatten(currentLevel.map(function (parent) { return parent.lineItems; }));
1825
- }
1826
- };
1827
- FlowUpdateService.prototype.delete = function (lineItems, id) {
1828
- var idsToRemove = [id];
1829
- var topLevelLineItem = lineItems.find(function (li) { return li.id === id; });
1830
- if (topLevelLineItem) {
1831
- // find term-related line items (which are only top level)
1832
- // expired term line items won't be deleted
1833
- var foundTermLineItem_1 = topLevelLineItem;
1834
- while (foundTermLineItem_1) {
1835
- foundTermLineItem_1 = lineItems.find(function (li) { return foundTermLineItem_1 && li.rampInstanceId === foundTermLineItem_1.id; });
1836
- if (foundTermLineItem_1) {
1837
- idsToRemove.push(foundTermLineItem_1.id);
1838
- }
1839
- }
1840
- }
1841
- var filtered = lineItems.filter(function (lineItem) { return !idsToRemove.includes(lineItem.id); });
1842
- return filtered.map(function (lineItem) { return new LineItemWorker(lineItem).remove(id).li; });
1843
- };
1844
- FlowUpdateService.prototype.applyLineItemUpdate = function (lineItem, update) {
1845
- if (lineItem.id !== update.id) {
1846
- return false;
1847
- }
1848
- switch (update.attributeType) {
1849
- case 'QTY':
1850
- lineItem.qty = update.newValue;
1851
- break;
1852
- case 'EFFECTIVE_START_DATE':
1853
- lineItem.effectiveStartDate = moment__default["default"](update.newValue).format('YYYY-MM-DD');
1854
- break;
1855
- case 'END_DATE':
1856
- lineItem.endDate = moment__default["default"](update.newValue).format('YYYY-MM-DD');
1857
- break;
1858
- case 'PRICE_ADJUSTMENT':
1859
- {
1860
- var _a = __read(lineItem.chargeItems, 1), charge = _a[0];
1861
- if (charge) {
1862
- charge.priceAdjustment = update.newValue;
1863
- }
1864
- }
1865
- break;
1866
- default:
1867
- throw new Error("Not suppored AttributeType for LineItem update: " + update.attributeType);
1868
- }
1869
- return true;
1870
- };
1871
- FlowUpdateService.prototype.applyChargeUpdate = function (lineItem, update) {
1872
- var foundCharge = lineItem.chargeItems.find(function (_a) {
1873
- var id = _a.id;
1874
- return id === update.id;
1875
- });
1876
- if (!foundCharge) {
1877
- return false;
1878
- }
1879
- if (update.attributeType === 'PRICE_ADJUSTMENT') {
1880
- foundCharge.priceAdjustment = update.newValue;
1881
- }
1882
- else {
1883
- throw new Error("Not suppored AttributeType for Charge Item update: " + update.attributeType);
1884
- }
1885
- return true;
1886
- };
1887
- FlowUpdateService.prototype.applyChargeGroupUpdate = function (lineItem, update) {
1888
- var foundChargeGroup = lineItem.chargeGroupItems.find(function (_a) {
1889
- var id = _a.id;
1890
- return id === update.id;
1891
- });
1892
- if (!foundChargeGroup) {
1893
- return false;
1894
- }
1895
- if (update.attributeType === 'PRICE_ADJUSTMENT') {
1896
- foundChargeGroup.priceAdjustment = update.newValue;
1897
- }
1898
- else {
1899
- throw new Error("Not suppored AttributeType for Charge Group Item update: " + update.attributeType);
1900
- }
1901
- return true;
1902
- };
1903
- return FlowUpdateService;
1904
- }());
1905
- FlowUpdateService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowUpdateService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1906
- FlowUpdateService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowUpdateService });
1907
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowUpdateService, decorators: [{
1908
- type: i0.Injectable
1909
- }] });
1910
-
1911
- var FlowConfigurationService = /** @class */ (function () {
1912
- function FlowConfigurationService(priceApiService, contextService, messageService, updateService) {
1913
- this.priceApiService = priceApiService;
1914
- this.contextService = contextService;
1915
- this.messageService = messageService;
1916
- this.updateService = updateService;
1917
- this.lineItems = new rxjs.BehaviorSubject([]);
1918
- this.charges = new rxjs.BehaviorSubject({});
1919
- }
1920
- FlowConfigurationService.prototype.reset = function () {
1921
- this.lineItems.next([]);
1922
- this.charges.next({});
1923
- };
1924
- FlowConfigurationService.prototype.calculate$ = function (currentState) {
1925
- var _this = this;
1926
- var context = this.contextService.resolve();
1927
- return this.priceApiService.calculate({ context: context, currentState: currentState }).pipe(rxjs.tap(function (result) {
1928
- _this.lineItems.next(result.lineItems);
1929
- _this.charges.next(result.charges);
1930
- if (context) {
1931
- _this.contextService.update({ properties: context.properties });
1932
- }
1933
- }), this.handleError());
1934
- };
1935
- FlowConfigurationService.prototype.calculate = function (currentState) {
1936
- this.calculate$(currentState).subscribe();
1937
- };
1938
- FlowConfigurationService.prototype.update$ = function (updates) {
1939
- var _this = this;
1940
- var lineItems = lodash.cloneDeep(this.lineItems.value);
1941
- return rxjs.of([]).pipe(rxjs.tap(function () { return _this.updateService.update(lineItems, updates); }), this.handleError(), rxjs.switchMap(function () { return _this.calculate$(lineItems); }));
1942
- };
1943
- FlowConfigurationService.prototype.update = function (updates) {
1944
- this.update$(updates).subscribe();
1945
- };
1946
- FlowConfigurationService.prototype.delete$ = function (ids) {
1947
- var _this = this;
1948
- return rxjs.of([]).pipe(rxjs.map(function () { return ids.reduce(function (result, id) { return _this.updateService.delete(result, id); }, _this.lineItems.value); }), this.handleError(), rxjs.switchMap(function (currentState) { return _this.calculate$(currentState); }));
1949
- };
1950
- FlowConfigurationService.prototype.delete = function (ids) {
1951
- this.delete$(ids).subscribe();
1952
- };
1953
- FlowConfigurationService.prototype.get = function () {
1954
- return this.lineItems.asObservable().pipe(rxjs.shareReplay());
1955
- };
1956
- FlowConfigurationService.prototype.getSnapshot = function () {
1957
- return this.lineItems.value.slice();
1958
- };
1959
- Object.defineProperty(FlowConfigurationService.prototype, "charges$", {
1960
- get: function () {
1961
- return this.charges.asObservable();
1962
- },
1963
- enumerable: false,
1964
- configurable: true
1965
- });
1966
- Object.defineProperty(FlowConfigurationService.prototype, "chargesSnapshot", {
1967
- get: function () {
1968
- return this.charges.value;
1969
- },
1970
- enumerable: false,
1971
- configurable: true
1972
- });
1973
- Object.defineProperty(FlowConfigurationService.prototype, "contextSnapshot", {
1974
- get: function () {
1975
- return this.contextService.resolve();
1976
- },
1977
- enumerable: false,
1978
- configurable: true
1979
- });
1980
- Object.defineProperty(FlowConfigurationService.prototype, "context$", {
1981
- get: function () {
1982
- return this.contextService.resolve$();
1983
- },
1984
- enumerable: false,
1985
- configurable: true
1986
- });
1987
- FlowConfigurationService.prototype.handleError = function () {
1988
- var _this = this;
1989
- return function (source$) {
1990
- return source$.pipe(rxjs.catchError(function (error) {
1991
- console.error(error);
1992
- _this.messageService.add({ severity: 'error', summary: error });
1993
- // bounce back if configuration call has failed
1994
- _this.lineItems.next(_this.lineItems.value.slice());
1995
- return rxjs.throwError(function () { return error; });
1996
- }));
1997
- };
1998
- };
1999
- return FlowConfigurationService;
2000
- }());
2001
- FlowConfigurationService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowConfigurationService, deps: [{ token: i1__namespace.PriceApiService }, { token: i2__namespace.ContextService }, { token: i3__namespace.MessageService }, { token: FlowUpdateService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2002
- FlowConfigurationService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowConfigurationService });
2003
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowConfigurationService, decorators: [{
2004
- type: i0.Injectable
2005
- }], ctorParameters: function () { return [{ type: i1__namespace.PriceApiService }, { type: i2__namespace.ContextService }, { type: i3__namespace.MessageService }, { type: FlowUpdateService }]; } });
2006
-
2007
- var FlowConfigurationModule = /** @class */ (function () {
2008
- function FlowConfigurationModule() {
2009
- }
2010
- return FlowConfigurationModule;
2011
- }());
2012
- FlowConfigurationModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowConfigurationModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
2013
- FlowConfigurationModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowConfigurationModule });
2014
- FlowConfigurationModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowConfigurationModule, providers: [FlowConfigurationService, FlowUpdateService, i2.ContextService, i1.PriceApiService] });
2015
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowConfigurationModule, decorators: [{
2016
- type: i0.NgModule,
2017
- args: [{
2018
- providers: [FlowConfigurationService, FlowUpdateService, i2.ContextService, i1.PriceApiService],
2019
- }]
2020
- }] });
2021
-
2022
- var vlCmsModules = /*#__PURE__*/Object.freeze({
2023
- __proto__: null,
2024
- getDefaultLineItem: getDefaultLineItem,
2025
- ConfigurationRuntimeService: ConfigurationRuntimeService,
2026
- ConfigurationService: ConfigurationService,
2027
- FlowConfigurationModule: FlowConfigurationModule,
2028
- FlowConfigurationService: FlowConfigurationService,
2029
- FlowUpdateService: FlowUpdateService
2030
- });
2031
-
2032
1342
  var InitAction = { type: 'INIT' };
2033
1343
  var ClearAction = { type: 'CLEAR' };
2034
1344
  var IntegrationState = /** @class */ (function () {
@@ -2075,41 +1385,15 @@
2075
1385
  args: [{ providedIn: 'root' }]
2076
1386
  }] });
2077
1387
 
2078
- var vlCmsUtils = /*#__PURE__*/Object.freeze({
2079
- __proto__: null,
2080
- UiBuildError: UiBuildError,
2081
- elementToMetadata: elementToMetadata,
2082
- metadataToElement: metadataToElement,
2083
- normalizeElementMetadata: normalizeElementMetadata,
2084
- extractElementMetadata: extractElementMetadata,
2085
- extendElementMetadata: extendElementMetadata,
2086
- getElementConfig: getElementConfig,
2087
- doesElementSupportIO: doesElementSupportIO,
2088
- stringifyElementMetadata: stringifyElementMetadata,
2089
- isValidScript: isValidScript,
2090
- parseBoundPath: parseBoundPath,
2091
- findLineItem: findLineItem,
2092
- findLineItemWithComparator: findLineItemWithComparator,
2093
- insertLineItem: insertLineItem,
2094
- removeLineItem: removeLineItem,
2095
- replaceLineItem: replaceLineItem,
2096
- mapAttributes: mapAttributes,
2097
- getAttributes: getAttributes,
2098
- upsertAttributes: upsertAttributes,
2099
- patchAttributes: patchAttributes,
2100
- getAttributeValue: getAttributeValue,
2101
- generateLineItem: generateLineItem,
2102
- getRecommendedPrices: getRecommendedPrices
2103
- });
2104
-
2105
1388
  var vendorMap = {
2106
- '@veloce/sdk/cms': Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, vlCmsModules), vlCmsUtils), vlCmsLineItemTypes), vlInjectionTokens), { TemplatesService: TemplatesService, IntegrationState: IntegrationState }),
1389
+ '@veloce/sdk/core': Object.assign({ ConfigurationService: i2.ConfigurationService, FlowConfigurationService: i2.FlowConfigurationService, LineItemWorker: i2.LineItemWorker }, i2.lineItemUtils),
1390
+ '@veloce/sdk/cms': Object.assign(Object.assign({}, vlInjectionTokens), { TemplatesService: TemplatesService, IntegrationState: IntegrationState }),
2107
1391
  '@veloce/api': {
2108
- SalesforceApiService: i1.SalesforceApiService,
2109
- QuoteApiService: i1.QuoteApiService,
2110
- DocumentTemplatesApiService: i1.DocumentTemplatesApiService,
2111
- DocumentAttachmentApiService: i1.DocumentAttachmentApiService,
2112
- RampApiService: i1.RampApiService,
1392
+ SalesforceApiService: api.SalesforceApiService,
1393
+ QuoteApiService: api.QuoteApiService,
1394
+ DocumentTemplatesApiService: api.DocumentTemplatesApiService,
1395
+ DocumentAttachmentApiService: api.DocumentAttachmentApiService,
1396
+ RampApiService: api.RampApiService,
2113
1397
  },
2114
1398
  '@angular/core': i0__namespace,
2115
1399
  '@angular/forms': angularForms__namespace,
@@ -2273,7 +1557,7 @@
2273
1557
  }());
2274
1558
  DynamicModule = __decorate([
2275
1559
  i0.NgModule({
2276
- imports: [i8.CommonModule, angularForms.FormsModule, angularForms.ReactiveFormsModule, FederatedModule, dragDrop.DragDropModule],
1560
+ imports: [i7.CommonModule, angularForms.FormsModule, angularForms.ReactiveFormsModule, FederatedModule, dragDrop.DragDropModule],
2277
1561
  declarations: __spreadArray(__spreadArray([], __read(staticComponents)), __read(elementsResolver.getNgComponents())),
2278
1562
  jit: true,
2279
1563
  })
@@ -2361,8 +1645,8 @@
2361
1645
  };
2362
1646
  return PreviewComponent;
2363
1647
  }());
2364
- PreviewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreviewComponent, deps: [{ token: LauncherService }, { token: ConfigurationService }, { token: i3__namespace.MessageService }, { token: ConfigurationRuntimeService }, { token: IntegrationState }], target: i0__namespace.ɵɵFactoryTarget.Component });
2365
- PreviewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: PreviewComponent, selector: "vl-cms-preview", inputs: { modelId: "modelId", uiDefinition: "uiDefinition", clearState: "clearState" }, providers: [IOProviderService, TemplatesService], ngImport: i0__namespace, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-element-renderer *ngFor=\"let el of elements\" [meta]=\"el\"></vl-cms-element-renderer>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [":host{flex-grow:1;display:flex;flex-direction:column;height:100%}\n"], components: [{ type: i6__namespace.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { type: ElementRendererComponent, selector: "vl-cms-element-renderer", inputs: ["meta"] }], directives: [{ type: i8__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i8__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.ShadowDom });
1648
+ PreviewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreviewComponent, deps: [{ token: LauncherService }, { token: i2__namespace.ConfigurationService }, { token: i3__namespace.MessageService }, { token: i2__namespace.ConfigurationRuntimeService }, { token: IntegrationState }], target: i0__namespace.ɵɵFactoryTarget.Component });
1649
+ PreviewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: PreviewComponent, selector: "vl-cms-preview", inputs: { modelId: "modelId", uiDefinition: "uiDefinition", clearState: "clearState" }, providers: [IOProviderService, TemplatesService], ngImport: i0__namespace, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-element-renderer *ngFor=\"let el of elements\" [meta]=\"el\"></vl-cms-element-renderer>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [":host{flex-grow:1;display:flex;flex-direction:column;height:100%}\n"], components: [{ type: i5__namespace.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { type: ElementRendererComponent, selector: "vl-cms-element-renderer", inputs: ["meta"] }], directives: [{ type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i7__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.ShadowDom });
2366
1650
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreviewComponent, decorators: [{
2367
1651
  type: i0.Component,
2368
1652
  args: [{
@@ -2374,7 +1658,7 @@
2374
1658
  // use shadow DOM to prevent UI from being affected by global styles
2375
1659
  encapsulation: i0.ViewEncapsulation.ShadowDom,
2376
1660
  }]
2377
- }], ctorParameters: function () { return [{ type: LauncherService }, { type: ConfigurationService }, { type: i3__namespace.MessageService }, { type: ConfigurationRuntimeService }, { type: IntegrationState }]; }, propDecorators: { modelId: [{
1661
+ }], ctorParameters: function () { return [{ type: LauncherService }, { type: i2__namespace.ConfigurationService }, { type: i3__namespace.MessageService }, { type: i2__namespace.ConfigurationRuntimeService }, { type: IntegrationState }]; }, propDecorators: { modelId: [{
2378
1662
  type: i0.Input
2379
1663
  }], uiDefinition: [{
2380
1664
  type: i0.Input
@@ -2421,13 +1705,13 @@
2421
1705
  return PreviewModule;
2422
1706
  }());
2423
1707
  PreviewModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreviewModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
2424
- PreviewModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreviewModule, declarations: [PreviewComponent], imports: [i8.CommonModule, i6.LoaderModule, ElementRendererModule, ElementChildrenModule], exports: [PreviewComponent] });
2425
- PreviewModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreviewModule, providers: [IntegrationState], imports: [[i8.CommonModule, i6.LoaderModule, ElementRendererModule, ElementChildrenModule]] });
1708
+ PreviewModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreviewModule, declarations: [PreviewComponent], imports: [i7.CommonModule, i5.LoaderModule, ElementRendererModule, ElementChildrenModule], exports: [PreviewComponent] });
1709
+ PreviewModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreviewModule, providers: [IntegrationState], imports: [[i7.CommonModule, i5.LoaderModule, ElementRendererModule, ElementChildrenModule]] });
2426
1710
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreviewModule, decorators: [{
2427
1711
  type: i0.NgModule,
2428
1712
  args: [{
2429
1713
  declarations: [PreviewComponent],
2430
- imports: [i8.CommonModule, i6.LoaderModule, ElementRendererModule, ElementChildrenModule],
1714
+ imports: [i7.CommonModule, i5.LoaderModule, ElementRendererModule, ElementChildrenModule],
2431
1715
  providers: [IntegrationState],
2432
1716
  exports: [PreviewComponent],
2433
1717
  }]
@@ -2439,51 +1723,19 @@
2439
1723
  };
2440
1724
  }
2441
1725
 
2442
- var ConfigurationModule = /** @class */ (function () {
2443
- function ConfigurationModule() {
2444
- }
2445
- return ConfigurationModule;
2446
- }());
2447
- ConfigurationModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ConfigurationModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
2448
- ConfigurationModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ConfigurationModule, imports: [i6.ConfirmationDialogModule] });
2449
- ConfigurationModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ConfigurationModule, providers: [
2450
- i2.ContextService,
2451
- i1.ContextApiService,
2452
- i1.ProductModelApiService,
2453
- i1.ConfigurationApiService,
2454
- ConfigurationRuntimeService,
2455
- RuntimeContextService,
2456
- ConfigurationService,
2457
- ], imports: [[i6.ConfirmationDialogModule]] });
2458
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ConfigurationModule, decorators: [{
2459
- type: i0.NgModule,
2460
- args: [{
2461
- imports: [i6.ConfirmationDialogModule],
2462
- providers: [
2463
- i2.ContextService,
2464
- i1.ContextApiService,
2465
- i1.ProductModelApiService,
2466
- i1.ConfigurationApiService,
2467
- ConfigurationRuntimeService,
2468
- RuntimeContextService,
2469
- ConfigurationService,
2470
- ],
2471
- }]
2472
- }] });
2473
-
2474
1726
  var LauncherModule = /** @class */ (function () {
2475
1727
  function LauncherModule() {
2476
1728
  }
2477
1729
  return LauncherModule;
2478
1730
  }());
2479
1731
  LauncherModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LauncherModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
2480
- LauncherModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LauncherModule, imports: [i8.CommonModule, core.CoreModule, i1.ApiModule, ConfigurationModule, FlowConfigurationModule] });
2481
- LauncherModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LauncherModule, providers: [LauncherService, IntegrationState, DynamicModuleService, i5.DialogService], imports: [[i8.CommonModule, core.CoreModule, i1.ApiModule, ConfigurationModule, FlowConfigurationModule]] });
1732
+ LauncherModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LauncherModule, imports: [i7.CommonModule, core.CoreModule, api.ApiModule, i2.SdkCoreModule] });
1733
+ LauncherModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LauncherModule, providers: [LauncherService, IntegrationState, DynamicModuleService, dynamicdialog.DialogService], imports: [[i7.CommonModule, core.CoreModule, api.ApiModule, i2.SdkCoreModule]] });
2482
1734
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LauncherModule, decorators: [{
2483
1735
  type: i0.NgModule,
2484
1736
  args: [{
2485
- imports: [i8.CommonModule, core.CoreModule, i1.ApiModule, ConfigurationModule, FlowConfigurationModule],
2486
- providers: [LauncherService, IntegrationState, DynamicModuleService, i5.DialogService],
1737
+ imports: [i7.CommonModule, core.CoreModule, api.ApiModule, i2.SdkCoreModule],
1738
+ providers: [LauncherService, IntegrationState, DynamicModuleService, dynamicdialog.DialogService],
2487
1739
  }]
2488
1740
  }] });
2489
1741
 
@@ -2491,19 +1743,14 @@
2491
1743
  * Generated bundle index. Do not edit.
2492
1744
  */
2493
1745
 
2494
- exports.ConfigurationRuntimeService = ConfigurationRuntimeService;
2495
- exports.ConfigurationService = ConfigurationService;
2496
1746
  exports.DEFAULT_PLUGINS_TOKEN = DEFAULT_PLUGINS_TOKEN;
2497
1747
  exports.ELEMENT_CONFIG = ELEMENT_CONFIG;
2498
1748
  exports.ELEMENT_METADATA = ELEMENT_METADATA;
2499
1749
  exports.ElementDefinition = ElementDefinition;
2500
- exports.FlowConfigurationModule = FlowConfigurationModule;
2501
- exports.FlowConfigurationService = FlowConfigurationService;
2502
- exports.FlowUpdateService = FlowUpdateService;
1750
+ exports.ElementsResolver = ElementsResolver;
2503
1751
  exports.IntegrationState = IntegrationState;
2504
1752
  exports.LauncherModule = LauncherModule;
2505
1753
  exports.LauncherService = LauncherService;
2506
- exports.LineItemWorker = LineItemWorker;
2507
1754
  exports.PreviewComponent = PreviewComponent;
2508
1755
  exports.PreviewModule = PreviewModule;
2509
1756
  exports.SHARED_ELEMENT_METADATA = SHARED_ELEMENT_METADATA;
@@ -2515,25 +1762,16 @@
2515
1762
  exports.elementToMetadata = elementToMetadata;
2516
1763
  exports.extendElementMetadata = extendElementMetadata;
2517
1764
  exports.extractElementMetadata = extractElementMetadata;
2518
- exports.findLineItem = findLineItem;
2519
- exports.findLineItemWithComparator = findLineItemWithComparator;
2520
- exports.generateLineItem = generateLineItem;
2521
- exports.getAttributeValue = getAttributeValue;
2522
- exports.getAttributes = getAttributes;
2523
- exports.getDefaultLineItem = getDefaultLineItem;
1765
+ exports.findElementByModule = findElementByModule;
1766
+ exports.getAbsolutePath = getAbsolutePath;
2524
1767
  exports.getElementConfig = getElementConfig;
2525
- exports.getRecommendedPrices = getRecommendedPrices;
2526
- exports.insertLineItem = insertLineItem;
2527
1768
  exports.isValidScript = isValidScript;
2528
- exports.mapAttributes = mapAttributes;
1769
+ exports.loadRemoteModule = loadRemoteModule;
2529
1770
  exports.metadataToElement = metadataToElement;
2530
1771
  exports.normalizeElementMetadata = normalizeElementMetadata;
2531
1772
  exports.parseBoundPath = parseBoundPath;
2532
- exports.patchAttributes = patchAttributes;
2533
- exports.removeLineItem = removeLineItem;
2534
- exports.replaceLineItem = replaceLineItem;
1773
+ exports.parsePath = parsePath;
2535
1774
  exports.stringifyElementMetadata = stringifyElementMetadata;
2536
- exports.upsertAttributes = upsertAttributes;
2537
1775
 
2538
1776
  Object.defineProperty(exports, '__esModule', { value: true });
2539
1777