@o3r/rules-engine 10.0.0-next.9 → 11.0.0-next.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 (195) hide show
  1. package/README.md +16 -17
  2. package/builders/rules-engine-extractor/helpers/rules-engine.extractor.d.ts +1 -1
  3. package/builders/rules-engine-extractor/helpers/rules-engine.extractor.d.ts.map +1 -1
  4. package/builders/rules-engine-extractor/helpers/rules-engine.extractor.interfaces.d.ts +2 -0
  5. package/builders/rules-engine-extractor/helpers/rules-engine.extractor.interfaces.d.ts.map +1 -1
  6. package/builders/rules-engine-extractor/helpers/rules-engine.extractor.js +10 -2
  7. package/builders/rules-engine-extractor/helpers/rules-engine.extractor.js.map +1 -1
  8. package/builders/rules-engine-extractor/index.js.map +1 -1
  9. package/builders/rules-engine-extractor/schema.json +1 -1
  10. package/components/rules-engine/rule-condition/rule-condition-pres.component.d.ts +2 -2
  11. package/components/rules-engine/rule-condition/rule-condition-pres.component.d.ts.map +1 -1
  12. package/components/rules-engine/rule-key-value/rule-key-value-pres.component.d.ts +1 -1
  13. package/components/rules-engine/rule-key-value/rule-key-value-pres.component.d.ts.map +1 -1
  14. package/components/rules-engine/ruleset-history/ruleset-history-pres.component.d.ts +1 -3
  15. package/components/rules-engine/ruleset-history/ruleset-history-pres.component.d.ts.map +1 -1
  16. package/components/rules-engine/shared/ruleset-history.helper.d.ts +0 -2
  17. package/components/rules-engine/shared/ruleset-history.helper.d.ts.map +1 -1
  18. package/devkit/rules-engine-devtools.console.service.d.ts +0 -7
  19. package/devkit/rules-engine-devtools.console.service.d.ts.map +1 -1
  20. package/devkit/rules-engine-devtools.message.service.d.ts +4 -6
  21. package/devkit/rules-engine-devtools.message.service.d.ts.map +1 -1
  22. package/devkit/rules-engine-devtools.module.d.ts +0 -1
  23. package/devkit/rules-engine-devtools.module.d.ts.map +1 -1
  24. package/devkit/rules-engine-devtools.service.d.ts +3 -10
  25. package/devkit/rules-engine-devtools.service.d.ts.map +1 -1
  26. package/engine/debug/engine.debug.d.ts +4 -12
  27. package/engine/debug/engine.debug.d.ts.map +1 -1
  28. package/engine/debug/helpers.d.ts +2 -4
  29. package/engine/debug/helpers.d.ts.map +1 -1
  30. package/engine/engine.d.ts +4 -13
  31. package/engine/engine.d.ts.map +1 -1
  32. package/engine/engine.interface.d.ts +2 -6
  33. package/engine/engine.interface.d.ts.map +1 -1
  34. package/engine/fact/fact.interfaces.d.ts +2 -0
  35. package/engine/fact/fact.interfaces.d.ts.map +1 -1
  36. package/engine/helpers/filter-ruleset-event.operator.d.ts +0 -1
  37. package/engine/helpers/filter-ruleset-event.operator.d.ts.map +1 -1
  38. package/engine/operator/operator.helpers.d.ts +10 -9
  39. package/engine/operator/operator.helpers.d.ts.map +1 -1
  40. package/engine/operator/operator.interface.d.ts +4 -1
  41. package/engine/operator/operator.interface.d.ts.map +1 -1
  42. package/engine/operator/operators/array-based.operators.d.ts +0 -23
  43. package/engine/operator/operators/array-based.operators.d.ts.map +1 -1
  44. package/engine/operator/operators/basic.operators.d.ts +5 -8
  45. package/engine/operator/operators/basic.operators.d.ts.map +1 -1
  46. package/engine/operator/operators/date-based.operators.d.ts +13 -6
  47. package/engine/operator/operators/date-based.operators.d.ts.map +1 -1
  48. package/engine/operator/operators/index.d.ts +1 -1
  49. package/engine/operator/operators/index.d.ts.map +1 -1
  50. package/engine/operator/operators/number-based.operators.d.ts +0 -4
  51. package/engine/operator/operators/number-based.operators.d.ts.map +1 -1
  52. package/engine/rule/rule.helpers.d.ts +0 -7
  53. package/engine/rule/rule.helpers.d.ts.map +1 -1
  54. package/engine/ruleset-executor.d.ts +15 -13
  55. package/engine/ruleset-executor.d.ts.map +1 -1
  56. package/engine/structure.d.ts +9 -5
  57. package/engine/structure.d.ts.map +1 -1
  58. package/esm2022/components/rules-engine/rule-actions/rule-actions-pres.component.mjs +4 -4
  59. package/esm2022/components/rules-engine/rule-condition/rule-condition-pres.component.mjs +8 -13
  60. package/esm2022/components/rules-engine/rule-key-value/rule-key-value-pres.component.mjs +5 -5
  61. package/esm2022/components/rules-engine/rule-tree/rule-tree-pres.component.mjs +5 -5
  62. package/esm2022/components/rules-engine/ruleset-history/ruleset-history-pres.component.mjs +6 -8
  63. package/esm2022/components/rules-engine/ruleset-history/ruleset-history-pres.module.mjs +4 -4
  64. package/esm2022/components/rules-engine/shared/fallback-to.pipe.mjs +3 -3
  65. package/esm2022/components/rules-engine/shared/ruleset-history.helper.mjs +1 -3
  66. package/esm2022/devkit/rules-engine-devtools.console.service.mjs +6 -13
  67. package/esm2022/devkit/rules-engine-devtools.message.service.mjs +6 -8
  68. package/esm2022/devkit/rules-engine-devtools.module.mjs +5 -6
  69. package/esm2022/devkit/rules-engine-devtools.service.mjs +7 -14
  70. package/esm2022/engine/debug/engine.debug.mjs +2 -10
  71. package/esm2022/engine/debug/helpers.mjs +1 -4
  72. package/esm2022/engine/engine.interface.mjs +1 -1
  73. package/esm2022/engine/engine.mjs +1 -9
  74. package/esm2022/engine/fact/fact.interfaces.mjs +1 -1
  75. package/esm2022/engine/helpers/filter-ruleset-event.operator.mjs +1 -2
  76. package/esm2022/engine/operator/index.mjs +1 -1
  77. package/esm2022/engine/operator/operator.helpers.mjs +33 -13
  78. package/esm2022/engine/operator/operator.interface.mjs +1 -1
  79. package/esm2022/engine/operator/operators/array-based.operators.mjs +6 -29
  80. package/esm2022/engine/operator/operators/basic.operators.mjs +16 -11
  81. package/esm2022/engine/operator/operators/date-based.operators.mjs +48 -8
  82. package/esm2022/engine/operator/operators/number-based.operators.mjs +1 -5
  83. package/esm2022/engine/rule/rule.helpers.mjs +1 -8
  84. package/esm2022/engine/ruleset-executor.mjs +58 -32
  85. package/esm2022/engine/structure.mjs +1 -1
  86. package/esm2022/fact/fact.abstract-service.mjs +1 -1
  87. package/esm2022/facts/current-time/current-time.facts.mjs +2 -0
  88. package/esm2022/facts/current-time/index.mjs +2 -0
  89. package/esm2022/facts/index.mjs +2 -0
  90. package/esm2022/fixtures/jasmine/index.mjs +2 -2
  91. package/esm2022/fixtures/jasmine/rules-engine.runner.service.fixture.jasmine.mjs +14 -0
  92. package/esm2022/fixtures/jest/index.mjs +2 -2
  93. package/esm2022/fixtures/jest/rules-engine.runner.service.fixture.jest.mjs +14 -0
  94. package/esm2022/interfaces/action.interfaces.mjs +1 -1
  95. package/esm2022/public_api.mjs +2 -1
  96. package/esm2022/services/index.mjs +2 -3
  97. package/esm2022/services/rules-engine.token.mjs +2 -1
  98. package/esm2022/services/runner/index.mjs +3 -0
  99. package/esm2022/services/runner/rules-engine.runner.module.mjs +37 -0
  100. package/esm2022/services/runner/rules-engine.runner.service.mjs +119 -0
  101. package/esm2022/stores/rulesets/rulesets.effect.mjs +4 -4
  102. package/esm2022/stores/rulesets/rulesets.module.mjs +4 -4
  103. package/esm2022/stores/rulesets/rulesets.selectors.mjs +3 -4
  104. package/fact/fact.abstract-service.d.ts +3 -3
  105. package/fact/fact.abstract-service.d.ts.map +1 -1
  106. package/facts/current-time/current-time.facts.d.ts +11 -0
  107. package/facts/current-time/current-time.facts.d.ts.map +1 -0
  108. package/facts/current-time/index.d.ts +2 -0
  109. package/facts/current-time/index.d.ts.map +1 -0
  110. package/facts/index.d.ts +2 -0
  111. package/facts/index.d.ts.map +1 -0
  112. package/fesm2022/o3r-rules-engine-fixtures-jasmine.mjs +3 -6
  113. package/fesm2022/o3r-rules-engine-fixtures-jasmine.mjs.map +1 -1
  114. package/fesm2022/o3r-rules-engine-fixtures-jest.mjs +3 -6
  115. package/fesm2022/o3r-rules-engine-fixtures-jest.mjs.map +1 -1
  116. package/fesm2022/o3r-rules-engine.mjs +264 -560
  117. package/fesm2022/o3r-rules-engine.mjs.map +1 -1
  118. package/fixtures/jasmine/index.d.ts +1 -1
  119. package/fixtures/jasmine/index.d.ts.map +1 -1
  120. package/fixtures/jasmine/rules-engine.runner.service.fixture.jasmine.d.ts +14 -0
  121. package/fixtures/jasmine/rules-engine.runner.service.fixture.jasmine.d.ts.map +1 -0
  122. package/fixtures/jest/index.d.ts +1 -1
  123. package/fixtures/jest/index.d.ts.map +1 -1
  124. package/fixtures/jest/index.js +1 -1
  125. package/fixtures/jest/index.js.map +1 -1
  126. package/fixtures/jest/rules-engine.runner.service.fixture.jest.d.ts +14 -0
  127. package/fixtures/jest/rules-engine.runner.service.fixture.jest.d.ts.map +1 -0
  128. package/fixtures/jest/{rules-engine.service.fixture.jest.js → rules-engine.runner.service.fixture.jest.js} +3 -6
  129. package/fixtures/jest/rules-engine.runner.service.fixture.jest.js.map +1 -0
  130. package/interfaces/action.interfaces.d.ts +5 -0
  131. package/interfaces/action.interfaces.d.ts.map +1 -1
  132. package/migration.json +10 -0
  133. package/package.json +57 -46
  134. package/public_api.d.ts +1 -0
  135. package/public_api.d.ts.map +1 -1
  136. package/rules.facts.metadata.json +7 -1
  137. package/rules.operators.metadata.json +61 -0
  138. package/schemas/rulesets.schema.json +6 -110
  139. package/schematics/cms-adapter/index.d.ts +0 -1
  140. package/schematics/cms-adapter/index.d.ts.map +1 -1
  141. package/schematics/cms-adapter/index.js +5 -9
  142. package/schematics/cms-adapter/index.js.map +1 -1
  143. package/schematics/facts-service/schema.json +1 -1
  144. package/schematics/ng-add/helpers/devtools-registration.d.ts +11 -0
  145. package/schematics/ng-add/helpers/devtools-registration.d.ts.map +1 -0
  146. package/schematics/ng-add/helpers/devtools-registration.js +36 -0
  147. package/schematics/ng-add/helpers/devtools-registration.js.map +1 -0
  148. package/schematics/ng-add/index.d.ts +1 -0
  149. package/schematics/ng-add/index.d.ts.map +1 -1
  150. package/schematics/ng-add/index.js +8 -4
  151. package/schematics/ng-add/index.js.map +1 -1
  152. package/schematics/ng-add/schema.json +1 -1
  153. package/schematics/ng-update/index.d.ts +6 -0
  154. package/schematics/ng-update/index.d.ts.map +1 -0
  155. package/schematics/ng-update/index.js +22 -0
  156. package/schematics/ng-update/index.js.map +1 -0
  157. package/schematics/ng-update/v10.0/action-module-split.d.ts +6 -0
  158. package/schematics/ng-update/v10.0/action-module-split.d.ts.map +1 -0
  159. package/schematics/ng-update/v10.0/action-module-split.js +21 -0
  160. package/schematics/ng-update/v10.0/action-module-split.js.map +1 -0
  161. package/schematics/operator/schema.json +1 -1
  162. package/schematics/rules-engine-to-component/index.d.ts +0 -1
  163. package/schematics/rules-engine-to-component/index.d.ts.map +1 -1
  164. package/schematics/rules-engine-to-component/index.js +7 -8
  165. package/schematics/rules-engine-to-component/index.js.map +1 -1
  166. package/schematics/rules-engine-to-component/schema.json +1 -1
  167. package/services/index.d.ts +1 -2
  168. package/services/index.d.ts.map +1 -1
  169. package/services/rules-engine.token.d.ts +1 -0
  170. package/services/rules-engine.token.d.ts.map +1 -1
  171. package/services/runner/index.d.ts +3 -0
  172. package/services/runner/index.d.ts.map +1 -0
  173. package/services/runner/rules-engine.runner.module.d.ts +13 -0
  174. package/services/runner/rules-engine.runner.module.d.ts.map +1 -0
  175. package/services/runner/rules-engine.runner.service.d.ts +60 -0
  176. package/services/runner/rules-engine.runner.service.d.ts.map +1 -0
  177. package/stores/rulesets/rulesets.selectors.d.ts.map +1 -1
  178. package/builders/package.json +0 -3
  179. package/esm2022/fixtures/jasmine/rules-engine.service.fixture.jasmine.mjs +0 -17
  180. package/esm2022/fixtures/jest/rules-engine.service.fixture.jest.mjs +0 -17
  181. package/esm2022/services/rules-engine.effect.mjs +0 -162
  182. package/esm2022/services/rules-engine.module.mjs +0 -50
  183. package/esm2022/services/rules-engine.service.mjs +0 -272
  184. package/fixtures/jasmine/rules-engine.service.fixture.jasmine.d.ts +0 -17
  185. package/fixtures/jasmine/rules-engine.service.fixture.jasmine.d.ts.map +0 -1
  186. package/fixtures/jest/rules-engine.service.fixture.jest.d.ts +0 -18
  187. package/fixtures/jest/rules-engine.service.fixture.jest.d.ts.map +0 -1
  188. package/fixtures/jest/rules-engine.service.fixture.jest.js.map +0 -1
  189. package/schematics/package.json +0 -3
  190. package/services/rules-engine.effect.d.ts +0 -53
  191. package/services/rules-engine.effect.d.ts.map +0 -1
  192. package/services/rules-engine.module.d.ts +0 -16
  193. package/services/rules-engine.module.d.ts.map +0 -1
  194. package/services/rules-engine.service.d.ts +0 -90
  195. package/services/rules-engine.service.d.ts.map +0 -1
@@ -2,24 +2,16 @@ import * as i1 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
4
  import { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Pipe, NgModule, Injectable, InjectionToken, Optional, Inject } from '@angular/core';
5
- import { Subject, of, from, ReplaySubject, Observable, combineLatest, BehaviorSubject, merge, firstValueFrom, Subscription, EMPTY, fromEvent } from 'rxjs';
6
- import { switchMap, delay, startWith, mergeMap, map, catchError, withLatestFrom, concatMap, tap, share, shareReplay, pairwise, distinctUntilChanged, takeUntil, filter, take, scan } from 'rxjs/operators';
5
+ import { Subject, of, from, ReplaySubject, Observable, combineLatest, BehaviorSubject, merge, firstValueFrom, Subscription, fromEvent } from 'rxjs';
6
+ import { delay, startWith, switchMap, map, catchError, mergeMap, withLatestFrom, concatMap, tap, share, shareReplay, pairwise, distinctUntilChanged, takeUntil, filter, scan } from 'rxjs/operators';
7
7
  import * as i1$2 from '@ngrx/store';
8
- import { createAction, props, on, createReducer, StoreModule, createFeatureSelector, createSelector, select } from '@ngrx/store';
9
- import * as i1$1 from '@ngrx/effects';
10
- import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
11
- import * as i4 from '@o3r/logger';
8
+ import { props, createAction, on, createReducer, StoreModule, createFeatureSelector, createSelector, select } from '@ngrx/store';
9
+ import * as i2 from '@o3r/logger';
12
10
  import { LoggerModule } from '@o3r/logger';
13
- import * as i2 from '@ngx-translate/core';
14
- import { TranslateModule } from '@ngx-translate/core';
15
- import * as i3 from '@o3r/dynamic-content';
16
- import { setAssetPathOverride, DynamicContentModule } from '@o3r/dynamic-content';
17
- import { asyncProps, fromApiEffectSwitchMap, asyncStoreItemAdapter, fromApiEffectSwitchMapById, sendOtterMessage, filterMessageContent } from '@o3r/core';
11
+ import { asyncProps, fromApiEffectSwitchMap, asyncStoreItemAdapter, computeItemIdentifier, sendOtterMessage, filterMessageContent } from '@o3r/core';
12
+ import * as i1$1 from '@ngrx/effects';
13
+ import { ofType, createEffect, EffectsModule } from '@ngrx/effects';
18
14
  import { createEntityAdapter } from '@ngrx/entity';
19
- import { computeConfigurationName, setConfigOverride } from '@o3r/configuration';
20
- import { selectPlaceholderTemplateEntities, selectPlaceholderRequestEntities, deletePlaceholderTemplateEntity, setPlaceholderTemplateEntity, updatePlaceholderRequestEntity, setPlaceholderRequestEntityFromUrl, selectPlaceholderRequestEntityUsage, failPlaceholderRequestEntity, cancelPlaceholderRequest } from '@o3r/components';
21
- import * as i5 from '@o3r/localization';
22
- import { setLocalizationOverride } from '@o3r/localization';
23
15
  import { JSONPath } from 'jsonpath-plus';
24
16
 
25
17
  /**
@@ -64,12 +56,12 @@ class RuleKeyValuePresComponent {
64
56
  await navigator.clipboard.writeText(content);
65
57
  this.triggerNotification.next();
66
58
  }
67
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RuleKeyValuePresComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
68
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.0", type: RuleKeyValuePresComponent, selector: "o3r-rule-key-value-pres", inputs: { key: "key", value: "value", oldValue: "oldValue", type: "type" }, usesOnChanges: true, ngImport: i0, template: "<span *ngIf=\"key\" class=\"input-key\">{{key}}<ng-container *ngIf=\"type === 'state'\">: </ng-container></span>\n<ng-container *ngIf=\"type === 'assignment'\"> = </ng-container>\n<ng-container *ngIf=\"oldValue\">\n <pre class=\"input-value\"\n [class.limit-characters]=\"shouldLimitCharactersForOldValue\"\n (click)=\"shouldLimitCharactersForOldValue = !shouldLimitCharactersForOldValue\">{{isOldValuePrimitiveType ? oldValue : (oldValue | json)}}</pre>\n <button (click)=\"copyToClipBoard(oldValue)\" *ngIf=\"isClipBoardFeatureAvailableForOldValue\" title=\"Copy to clipboard\">\uD83D\uDCCB</button>\n \u2192\n</ng-container>\n<pre class=\"input-value\"\n [class.limit-characters]=\"shouldLimitCharactersForValue\"\n (click)=\"shouldLimitCharactersForValue = !shouldLimitCharactersForValue\">{{isValuePrimitiveType ? value : (value | json)}}</pre>\n<button (click)=\"copyToClipBoard(value)\" *ngIf=\"isClipBoardFeatureAvailableForValue\" title=\"Copy to clipboard\">\uD83D\uDCCB</button>\n<div role=\"alert\" class=\"notification\" *ngIf=\"showNotification$ | async\">Copied to clipboard</div>\n", styles: ["o3r-rule-key-value-pres{position:relative}o3r-rule-key-value-pres .ruleset-panel-title,o3r-rule-key-value-pres .ruleset-panel-category-title{display:flex;justify-content:space-between;align-items:center}o3r-rule-key-value-pres .ruleset-panel-title{font-size:1rem;padding:.5rem 0 .1rem}o3r-rule-key-value-pres .ruleset-expansion-action,o3r-rule-key-value-pres .icon-caret-down,o3r-rule-key-value-pres .icon-caret-up{cursor:pointer}o3r-rule-key-value-pres .ruleset-panel-subtitle{font-size:.75rem}o3r-rule-key-value-pres .ruleset-panel-title-aside{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;min-width:-moz-fit-content;min-width:fit-content}o3r-rule-key-value-pres .ruleset-panel-category-title{font-size:.95rem;background:#eeeeee;padding:.5rem;margin-bottom:.5rem;margin-top:1rem}o3r-rule-key-value-pres .rule-description .ruleset-panel-category-title{font-size:.893rem;cursor:default}o3r-rule-key-value-pres .rule-description .ruleset-panel-title{font-size:.94rem}o3r-rule-key-value-pres .rule-description .ruleset-panel-category-body{padding-bottom:.5rem;padding-left:1.5rem}o3r-rule-key-value-pres .rule-description .ruleset-panel-category-body:empty{margin:0;padding:0 0 0 1.5rem}o3r-rule-key-value-pres .limit-characters{display:inline-block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:38rem;vertical-align:bottom}o3r-rule-key-value-pres .input-value{margin-top:0;margin-bottom:0}o3r-rule-key-value-pres button{background:none;border:0;-webkit-appearance:none;appearance:none}o3r-rule-key-value-pres .notification{position:absolute;padding:1rem 1.5rem;border-radius:5px;background:#444444;color:#eee;right:0;z-index:1}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.JsonPipe, name: "json" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
59
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RuleKeyValuePresComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
60
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: RuleKeyValuePresComponent, selector: "o3r-rule-key-value-pres", inputs: { key: "key", value: "value", oldValue: "oldValue", type: "type" }, usesOnChanges: true, ngImport: i0, template: "<span *ngIf=\"key\" class=\"input-key\">{{key}}<ng-container *ngIf=\"type === 'state'\">: </ng-container></span>\n<ng-container *ngIf=\"type === 'assignment'\"> = </ng-container>\n<ng-container *ngIf=\"oldValue\">\n <pre class=\"input-value\"\n [class.limit-characters]=\"shouldLimitCharactersForOldValue\"\n (click)=\"shouldLimitCharactersForOldValue = !shouldLimitCharactersForOldValue\">{{isOldValuePrimitiveType ? oldValue : (oldValue | json)}}</pre>\n <button (click)=\"copyToClipBoard(oldValue)\" *ngIf=\"isClipBoardFeatureAvailableForOldValue\" title=\"Copy to clipboard\">\uD83D\uDCCB</button>\n \u2192\n</ng-container>\n<pre class=\"input-value\"\n [class.limit-characters]=\"shouldLimitCharactersForValue\"\n (click)=\"shouldLimitCharactersForValue = !shouldLimitCharactersForValue\">{{isValuePrimitiveType ? value : (value | json)}}</pre>\n<button (click)=\"copyToClipBoard(value)\" *ngIf=\"isClipBoardFeatureAvailableForValue\" title=\"Copy to clipboard\">\uD83D\uDCCB</button>\n<div role=\"alert\" class=\"notification\" *ngIf=\"showNotification$ | async\">Copied to clipboard</div>\n", styles: ["o3r-rule-key-value-pres{position:relative}o3r-rule-key-value-pres .ruleset-panel-title,o3r-rule-key-value-pres .ruleset-panel-category-title{display:flex;justify-content:space-between;align-items:center}o3r-rule-key-value-pres .ruleset-panel-title{font-size:1rem;padding:.5rem 0 .1rem}o3r-rule-key-value-pres .ruleset-expansion-action,o3r-rule-key-value-pres .icon-caret-down,o3r-rule-key-value-pres .icon-caret-up{cursor:pointer}o3r-rule-key-value-pres .ruleset-panel-subtitle{font-size:.75rem}o3r-rule-key-value-pres .ruleset-panel-title-aside{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;min-width:-moz-fit-content;min-width:fit-content}o3r-rule-key-value-pres .ruleset-panel-category-title{font-size:.95rem;background:#eee;padding:.5rem;margin-bottom:.5rem;margin-top:1rem}o3r-rule-key-value-pres .rule-description .ruleset-panel-category-title{font-size:.893rem;cursor:default}o3r-rule-key-value-pres .rule-description .ruleset-panel-title{font-size:.94rem}o3r-rule-key-value-pres .rule-description .ruleset-panel-category-body{padding-bottom:.5rem;padding-left:1.5rem}o3r-rule-key-value-pres .rule-description .ruleset-panel-category-body:empty{margin:0;padding:0 0 0 1.5rem}o3r-rule-key-value-pres .limit-characters{display:inline-block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:38rem;vertical-align:bottom}o3r-rule-key-value-pres .input-value{margin-top:0;margin-bottom:0}o3r-rule-key-value-pres button{background:none;border:0;appearance:none}o3r-rule-key-value-pres .notification{position:absolute;padding:1rem 1.5rem;border-radius:5px;background:#444;color:#eee;right:0;z-index:1}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.JsonPipe, name: "json" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
69
61
  }
70
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RuleKeyValuePresComponent, decorators: [{
62
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RuleKeyValuePresComponent, decorators: [{
71
63
  type: Component,
72
- args: [{ selector: 'o3r-rule-key-value-pres', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<span *ngIf=\"key\" class=\"input-key\">{{key}}<ng-container *ngIf=\"type === 'state'\">: </ng-container></span>\n<ng-container *ngIf=\"type === 'assignment'\"> = </ng-container>\n<ng-container *ngIf=\"oldValue\">\n <pre class=\"input-value\"\n [class.limit-characters]=\"shouldLimitCharactersForOldValue\"\n (click)=\"shouldLimitCharactersForOldValue = !shouldLimitCharactersForOldValue\">{{isOldValuePrimitiveType ? oldValue : (oldValue | json)}}</pre>\n <button (click)=\"copyToClipBoard(oldValue)\" *ngIf=\"isClipBoardFeatureAvailableForOldValue\" title=\"Copy to clipboard\">\uD83D\uDCCB</button>\n \u2192\n</ng-container>\n<pre class=\"input-value\"\n [class.limit-characters]=\"shouldLimitCharactersForValue\"\n (click)=\"shouldLimitCharactersForValue = !shouldLimitCharactersForValue\">{{isValuePrimitiveType ? value : (value | json)}}</pre>\n<button (click)=\"copyToClipBoard(value)\" *ngIf=\"isClipBoardFeatureAvailableForValue\" title=\"Copy to clipboard\">\uD83D\uDCCB</button>\n<div role=\"alert\" class=\"notification\" *ngIf=\"showNotification$ | async\">Copied to clipboard</div>\n", styles: ["o3r-rule-key-value-pres{position:relative}o3r-rule-key-value-pres .ruleset-panel-title,o3r-rule-key-value-pres .ruleset-panel-category-title{display:flex;justify-content:space-between;align-items:center}o3r-rule-key-value-pres .ruleset-panel-title{font-size:1rem;padding:.5rem 0 .1rem}o3r-rule-key-value-pres .ruleset-expansion-action,o3r-rule-key-value-pres .icon-caret-down,o3r-rule-key-value-pres .icon-caret-up{cursor:pointer}o3r-rule-key-value-pres .ruleset-panel-subtitle{font-size:.75rem}o3r-rule-key-value-pres .ruleset-panel-title-aside{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;min-width:-moz-fit-content;min-width:fit-content}o3r-rule-key-value-pres .ruleset-panel-category-title{font-size:.95rem;background:#eeeeee;padding:.5rem;margin-bottom:.5rem;margin-top:1rem}o3r-rule-key-value-pres .rule-description .ruleset-panel-category-title{font-size:.893rem;cursor:default}o3r-rule-key-value-pres .rule-description .ruleset-panel-title{font-size:.94rem}o3r-rule-key-value-pres .rule-description .ruleset-panel-category-body{padding-bottom:.5rem;padding-left:1.5rem}o3r-rule-key-value-pres .rule-description .ruleset-panel-category-body:empty{margin:0;padding:0 0 0 1.5rem}o3r-rule-key-value-pres .limit-characters{display:inline-block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:38rem;vertical-align:bottom}o3r-rule-key-value-pres .input-value{margin-top:0;margin-bottom:0}o3r-rule-key-value-pres button{background:none;border:0;-webkit-appearance:none;appearance:none}o3r-rule-key-value-pres .notification{position:absolute;padding:1rem 1.5rem;border-radius:5px;background:#444444;color:#eee;right:0;z-index:1}\n"] }]
64
+ args: [{ selector: 'o3r-rule-key-value-pres', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<span *ngIf=\"key\" class=\"input-key\">{{key}}<ng-container *ngIf=\"type === 'state'\">: </ng-container></span>\n<ng-container *ngIf=\"type === 'assignment'\"> = </ng-container>\n<ng-container *ngIf=\"oldValue\">\n <pre class=\"input-value\"\n [class.limit-characters]=\"shouldLimitCharactersForOldValue\"\n (click)=\"shouldLimitCharactersForOldValue = !shouldLimitCharactersForOldValue\">{{isOldValuePrimitiveType ? oldValue : (oldValue | json)}}</pre>\n <button (click)=\"copyToClipBoard(oldValue)\" *ngIf=\"isClipBoardFeatureAvailableForOldValue\" title=\"Copy to clipboard\">\uD83D\uDCCB</button>\n \u2192\n</ng-container>\n<pre class=\"input-value\"\n [class.limit-characters]=\"shouldLimitCharactersForValue\"\n (click)=\"shouldLimitCharactersForValue = !shouldLimitCharactersForValue\">{{isValuePrimitiveType ? value : (value | json)}}</pre>\n<button (click)=\"copyToClipBoard(value)\" *ngIf=\"isClipBoardFeatureAvailableForValue\" title=\"Copy to clipboard\">\uD83D\uDCCB</button>\n<div role=\"alert\" class=\"notification\" *ngIf=\"showNotification$ | async\">Copied to clipboard</div>\n", styles: ["o3r-rule-key-value-pres{position:relative}o3r-rule-key-value-pres .ruleset-panel-title,o3r-rule-key-value-pres .ruleset-panel-category-title{display:flex;justify-content:space-between;align-items:center}o3r-rule-key-value-pres .ruleset-panel-title{font-size:1rem;padding:.5rem 0 .1rem}o3r-rule-key-value-pres .ruleset-expansion-action,o3r-rule-key-value-pres .icon-caret-down,o3r-rule-key-value-pres .icon-caret-up{cursor:pointer}o3r-rule-key-value-pres .ruleset-panel-subtitle{font-size:.75rem}o3r-rule-key-value-pres .ruleset-panel-title-aside{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;min-width:-moz-fit-content;min-width:fit-content}o3r-rule-key-value-pres .ruleset-panel-category-title{font-size:.95rem;background:#eee;padding:.5rem;margin-bottom:.5rem;margin-top:1rem}o3r-rule-key-value-pres .rule-description .ruleset-panel-category-title{font-size:.893rem;cursor:default}o3r-rule-key-value-pres .rule-description .ruleset-panel-title{font-size:.94rem}o3r-rule-key-value-pres .rule-description .ruleset-panel-category-body{padding-bottom:.5rem;padding-left:1.5rem}o3r-rule-key-value-pres .rule-description .ruleset-panel-category-body:empty{margin:0;padding:0 0 0 1.5rem}o3r-rule-key-value-pres .limit-characters{display:inline-block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:38rem;vertical-align:bottom}o3r-rule-key-value-pres .input-value{margin-top:0;margin-bottom:0}o3r-rule-key-value-pres button{background:none;border:0;appearance:none}o3r-rule-key-value-pres .notification{position:absolute;padding:1rem 1.5rem;border-radius:5px;background:#444;color:#eee;right:0;z-index:1}\n"] }]
73
65
  }], propDecorators: { key: [{
74
66
  type: Input
75
67
  }], value: [{
@@ -84,10 +76,10 @@ class FallbackToPipe {
84
76
  transform(value, fallback = 'undefined') {
85
77
  return value !== undefined ? value : fallback;
86
78
  }
87
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: FallbackToPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
88
- /** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.0", ngImport: i0, type: FallbackToPipe, name: "fallbackTo" }); }
79
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: FallbackToPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
80
+ /** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: FallbackToPipe, name: "fallbackTo" }); }
89
81
  }
90
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: FallbackToPipe, decorators: [{
82
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: FallbackToPipe, decorators: [{
91
83
  type: Pipe,
92
84
  args: [{ name: 'fallbackTo' }]
93
85
  }] });
@@ -108,12 +100,12 @@ class RuleActionsPresComponent {
108
100
  */
109
101
  this.runtimeOutputs = [];
110
102
  }
111
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RuleActionsPresComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
112
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.0", type: RuleActionsPresComponent, selector: "o3r-rule-actions-pres", inputs: { actions: "actions", temporaryFacts: "temporaryFacts", runtimeOutputs: "runtimeOutputs" }, ngImport: i0, template: "<div class=\"ruleset-panel-category-title\">Output Actions</div>\n<div *ngIf=\"actions.length === 0 && runtimeOutputs.length === 0\" class=\"ruleset-panel-category-body empty\">\n No action\n</div>\n<ul class=\"ruleset-panel-category-body\">\n <li *ngFor=\"let action of actions\">\n <ng-container *ngIf=\"action.actionType\">\n <ng-container [ngSwitch]=\"action.actionType\">\n <div *ngSwitchCase=\"'SET_FACT'\">\n <div>Set Fact</div>\n <div>\n <o3r-rule-key-value-pres\n [key]=\"action.fact | fallbackTo: 'Missing \\'fact\\''\"\n [value]=\"action.value | fallbackTo\"\n [type]=\"'assignment'\"></o3r-rule-key-value-pres>\n </div>\n </div>\n <div *ngSwitchCase=\"'UPDATE_CONFIG'\">\n <div>Update Config {{action.component}} {{action.library}}</div>\n <div>\n <o3r-rule-key-value-pres\n [key]=\"action.property | fallbackTo: 'Missing \\'property\\''\"\n [value]=\"action.value | fallbackTo\"\n [type]=\"'assignment'\"></o3r-rule-key-value-pres>\n </div>\n </div>\n <div *ngSwitchCase=\"'UPDATE_ASSET'\">\n <div>Update Asset:</div>\n <div>\n <o3r-rule-key-value-pres\n [oldValue]=\"action.asset | fallbackTo: 'Missing \\'asset\\''\"\n [value]=\"action.value | fallbackTo\"\n [type]=\"'state'\"></o3r-rule-key-value-pres>\n </div>\n </div>\n <div *ngSwitchCase=\"'UPDATE_LOCALISATION'\">\n <div>Update localization:</div>\n <div>\n <o3r-rule-key-value-pres\n [oldValue]=\"action.key | fallbackTo: 'Missing \\'key\\''\"\n [value]=\"action.value | fallbackTo\"\n [type]=\"'state'\"></o3r-rule-key-value-pres>\n </div>\n </div>\n <div\n *ngSwitchCase=\"'UPDATE_PLACEHOLDER'\"\n [class.error]=\"!action.placeholderId\">\n <div>Update placeholder in {{action.component}} {{action.library}}</div>\n <div>\n <o3r-rule-key-value-pres\n [oldValue]=\"action.placeholderId | fallbackTo: 'Missing \\'placeholderId\\''\"\n [value]=\"action.value\"\n [type]=\"'state'\"></o3r-rule-key-value-pres>\n </div>\n </div>\n <div *ngSwitchDefault class=\"error\">\n <div>Unrecognized action</div>\n <div>{{action | json}}</div>\n </div>\n </ng-container>\n </ng-container>\n </li>\n <li *ngFor=\"let runtimeOutput of runtimeOutputs\">\n <div>Set temporary fact</div>\n <div>\n <o3r-rule-key-value-pres\n [key]=\"runtimeOutput | fallbackTo: 'Missing \\'fact\\''\"\n [value]=\"temporaryFacts[runtimeOutput] | fallbackTo\"\n [type]=\"'assignment'\"></o3r-rule-key-value-pres>\n </div>\n </li>\n</ul>\n", styles: ["o3r-rule-actions-pres .ruleset-panel-title,o3r-rule-actions-pres .ruleset-panel-category-title{display:flex;justify-content:space-between;align-items:center}o3r-rule-actions-pres .ruleset-panel-title{font-size:1rem;padding:.5rem 0 .1rem}o3r-rule-actions-pres .ruleset-expansion-action,o3r-rule-actions-pres .icon-caret-down,o3r-rule-actions-pres .icon-caret-up{cursor:pointer}o3r-rule-actions-pres .ruleset-panel-subtitle{font-size:.75rem}o3r-rule-actions-pres .ruleset-panel-title-aside{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;min-width:-moz-fit-content;min-width:fit-content}o3r-rule-actions-pres .ruleset-panel-category-title{font-size:.95rem;background:#eeeeee;padding:.5rem;margin-bottom:.5rem;margin-top:1rem}o3r-rule-actions-pres .rule-description .ruleset-panel-category-title{font-size:.893rem;cursor:default}o3r-rule-actions-pres .rule-description .ruleset-panel-title{font-size:.94rem}o3r-rule-actions-pres .rule-description .ruleset-panel-category-body{padding-bottom:.5rem;padding-left:1.5rem}o3r-rule-actions-pres .rule-description .ruleset-panel-category-body:empty{margin:0;padding:0 0 0 1.5rem}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: RuleKeyValuePresComponent, selector: "o3r-rule-key-value-pres", inputs: ["key", "value", "oldValue", "type"] }, { kind: "pipe", type: i1.JsonPipe, name: "json" }, { kind: "pipe", type: FallbackToPipe, name: "fallbackTo" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
103
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RuleActionsPresComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
104
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: RuleActionsPresComponent, selector: "o3r-rule-actions-pres", inputs: { actions: "actions", temporaryFacts: "temporaryFacts", runtimeOutputs: "runtimeOutputs" }, ngImport: i0, template: "<div class=\"ruleset-panel-category-title\">Output Actions</div>\n<div *ngIf=\"actions.length === 0 && runtimeOutputs.length === 0\" class=\"ruleset-panel-category-body empty\">\n No action\n</div>\n<ul class=\"ruleset-panel-category-body\">\n <li *ngFor=\"let action of actions\">\n <ng-container *ngIf=\"action.actionType\">\n <ng-container [ngSwitch]=\"action.actionType\">\n <div *ngSwitchCase=\"'SET_FACT'\">\n <div>Set Fact</div>\n <div>\n <o3r-rule-key-value-pres\n [key]=\"action.fact | fallbackTo: 'Missing \\'fact\\''\"\n [value]=\"action.value | fallbackTo\"\n [type]=\"'assignment'\"></o3r-rule-key-value-pres>\n </div>\n </div>\n <div *ngSwitchCase=\"'UPDATE_CONFIG'\">\n <div>Update Config {{action.component}} {{action.library}}</div>\n <div>\n <o3r-rule-key-value-pres\n [key]=\"action.property | fallbackTo: 'Missing \\'property\\''\"\n [value]=\"action.value | fallbackTo\"\n [type]=\"'assignment'\"></o3r-rule-key-value-pres>\n </div>\n </div>\n <div *ngSwitchCase=\"'UPDATE_ASSET'\">\n <div>Update Asset:</div>\n <div>\n <o3r-rule-key-value-pres\n [oldValue]=\"action.asset | fallbackTo: 'Missing \\'asset\\''\"\n [value]=\"action.value | fallbackTo\"\n [type]=\"'state'\"></o3r-rule-key-value-pres>\n </div>\n </div>\n <div *ngSwitchCase=\"'UPDATE_LOCALISATION'\">\n <div>Update localization:</div>\n <div>\n <o3r-rule-key-value-pres\n [oldValue]=\"action.key | fallbackTo: 'Missing \\'key\\''\"\n [value]=\"action.value | fallbackTo\"\n [type]=\"'state'\"></o3r-rule-key-value-pres>\n </div>\n </div>\n <div\n *ngSwitchCase=\"'UPDATE_PLACEHOLDER'\"\n [class.error]=\"!action.placeholderId\">\n <div>Update placeholder in {{action.component}} {{action.library}}</div>\n <div>\n <o3r-rule-key-value-pres\n [oldValue]=\"action.placeholderId | fallbackTo: 'Missing \\'placeholderId\\''\"\n [value]=\"action.value\"\n [type]=\"'state'\"></o3r-rule-key-value-pres>\n </div>\n </div>\n <div *ngSwitchDefault class=\"error\">\n <div>Unrecognized action</div>\n <div>{{action | json}}</div>\n </div>\n </ng-container>\n </ng-container>\n </li>\n <li *ngFor=\"let runtimeOutput of runtimeOutputs\">\n <div>Set temporary fact</div>\n <div>\n <o3r-rule-key-value-pres\n [key]=\"runtimeOutput | fallbackTo: 'Missing \\'fact\\''\"\n [value]=\"temporaryFacts[runtimeOutput] | fallbackTo\"\n [type]=\"'assignment'\"></o3r-rule-key-value-pres>\n </div>\n </li>\n</ul>\n", styles: ["o3r-rule-actions-pres .ruleset-panel-title,o3r-rule-actions-pres .ruleset-panel-category-title{display:flex;justify-content:space-between;align-items:center}o3r-rule-actions-pres .ruleset-panel-title{font-size:1rem;padding:.5rem 0 .1rem}o3r-rule-actions-pres .ruleset-expansion-action,o3r-rule-actions-pres .icon-caret-down,o3r-rule-actions-pres .icon-caret-up{cursor:pointer}o3r-rule-actions-pres .ruleset-panel-subtitle{font-size:.75rem}o3r-rule-actions-pres .ruleset-panel-title-aside{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;min-width:-moz-fit-content;min-width:fit-content}o3r-rule-actions-pres .ruleset-panel-category-title{font-size:.95rem;background:#eee;padding:.5rem;margin-bottom:.5rem;margin-top:1rem}o3r-rule-actions-pres .rule-description .ruleset-panel-category-title{font-size:.893rem;cursor:default}o3r-rule-actions-pres .rule-description .ruleset-panel-title{font-size:.94rem}o3r-rule-actions-pres .rule-description .ruleset-panel-category-body{padding-bottom:.5rem;padding-left:1.5rem}o3r-rule-actions-pres .rule-description .ruleset-panel-category-body:empty{margin:0;padding:0 0 0 1.5rem}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: RuleKeyValuePresComponent, selector: "o3r-rule-key-value-pres", inputs: ["key", "value", "oldValue", "type"] }, { kind: "pipe", type: i1.JsonPipe, name: "json" }, { kind: "pipe", type: FallbackToPipe, name: "fallbackTo" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
113
105
  }
114
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RuleActionsPresComponent, decorators: [{
106
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RuleActionsPresComponent, decorators: [{
115
107
  type: Component,
116
- args: [{ selector: 'o3r-rule-actions-pres', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"ruleset-panel-category-title\">Output Actions</div>\n<div *ngIf=\"actions.length === 0 && runtimeOutputs.length === 0\" class=\"ruleset-panel-category-body empty\">\n No action\n</div>\n<ul class=\"ruleset-panel-category-body\">\n <li *ngFor=\"let action of actions\">\n <ng-container *ngIf=\"action.actionType\">\n <ng-container [ngSwitch]=\"action.actionType\">\n <div *ngSwitchCase=\"'SET_FACT'\">\n <div>Set Fact</div>\n <div>\n <o3r-rule-key-value-pres\n [key]=\"action.fact | fallbackTo: 'Missing \\'fact\\''\"\n [value]=\"action.value | fallbackTo\"\n [type]=\"'assignment'\"></o3r-rule-key-value-pres>\n </div>\n </div>\n <div *ngSwitchCase=\"'UPDATE_CONFIG'\">\n <div>Update Config {{action.component}} {{action.library}}</div>\n <div>\n <o3r-rule-key-value-pres\n [key]=\"action.property | fallbackTo: 'Missing \\'property\\''\"\n [value]=\"action.value | fallbackTo\"\n [type]=\"'assignment'\"></o3r-rule-key-value-pres>\n </div>\n </div>\n <div *ngSwitchCase=\"'UPDATE_ASSET'\">\n <div>Update Asset:</div>\n <div>\n <o3r-rule-key-value-pres\n [oldValue]=\"action.asset | fallbackTo: 'Missing \\'asset\\''\"\n [value]=\"action.value | fallbackTo\"\n [type]=\"'state'\"></o3r-rule-key-value-pres>\n </div>\n </div>\n <div *ngSwitchCase=\"'UPDATE_LOCALISATION'\">\n <div>Update localization:</div>\n <div>\n <o3r-rule-key-value-pres\n [oldValue]=\"action.key | fallbackTo: 'Missing \\'key\\''\"\n [value]=\"action.value | fallbackTo\"\n [type]=\"'state'\"></o3r-rule-key-value-pres>\n </div>\n </div>\n <div\n *ngSwitchCase=\"'UPDATE_PLACEHOLDER'\"\n [class.error]=\"!action.placeholderId\">\n <div>Update placeholder in {{action.component}} {{action.library}}</div>\n <div>\n <o3r-rule-key-value-pres\n [oldValue]=\"action.placeholderId | fallbackTo: 'Missing \\'placeholderId\\''\"\n [value]=\"action.value\"\n [type]=\"'state'\"></o3r-rule-key-value-pres>\n </div>\n </div>\n <div *ngSwitchDefault class=\"error\">\n <div>Unrecognized action</div>\n <div>{{action | json}}</div>\n </div>\n </ng-container>\n </ng-container>\n </li>\n <li *ngFor=\"let runtimeOutput of runtimeOutputs\">\n <div>Set temporary fact</div>\n <div>\n <o3r-rule-key-value-pres\n [key]=\"runtimeOutput | fallbackTo: 'Missing \\'fact\\''\"\n [value]=\"temporaryFacts[runtimeOutput] | fallbackTo\"\n [type]=\"'assignment'\"></o3r-rule-key-value-pres>\n </div>\n </li>\n</ul>\n", styles: ["o3r-rule-actions-pres .ruleset-panel-title,o3r-rule-actions-pres .ruleset-panel-category-title{display:flex;justify-content:space-between;align-items:center}o3r-rule-actions-pres .ruleset-panel-title{font-size:1rem;padding:.5rem 0 .1rem}o3r-rule-actions-pres .ruleset-expansion-action,o3r-rule-actions-pres .icon-caret-down,o3r-rule-actions-pres .icon-caret-up{cursor:pointer}o3r-rule-actions-pres .ruleset-panel-subtitle{font-size:.75rem}o3r-rule-actions-pres .ruleset-panel-title-aside{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;min-width:-moz-fit-content;min-width:fit-content}o3r-rule-actions-pres .ruleset-panel-category-title{font-size:.95rem;background:#eeeeee;padding:.5rem;margin-bottom:.5rem;margin-top:1rem}o3r-rule-actions-pres .rule-description .ruleset-panel-category-title{font-size:.893rem;cursor:default}o3r-rule-actions-pres .rule-description .ruleset-panel-title{font-size:.94rem}o3r-rule-actions-pres .rule-description .ruleset-panel-category-body{padding-bottom:.5rem;padding-left:1.5rem}o3r-rule-actions-pres .rule-description .ruleset-panel-category-body:empty{margin:0;padding:0 0 0 1.5rem}\n"] }]
108
+ args: [{ selector: 'o3r-rule-actions-pres', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"ruleset-panel-category-title\">Output Actions</div>\n<div *ngIf=\"actions.length === 0 && runtimeOutputs.length === 0\" class=\"ruleset-panel-category-body empty\">\n No action\n</div>\n<ul class=\"ruleset-panel-category-body\">\n <li *ngFor=\"let action of actions\">\n <ng-container *ngIf=\"action.actionType\">\n <ng-container [ngSwitch]=\"action.actionType\">\n <div *ngSwitchCase=\"'SET_FACT'\">\n <div>Set Fact</div>\n <div>\n <o3r-rule-key-value-pres\n [key]=\"action.fact | fallbackTo: 'Missing \\'fact\\''\"\n [value]=\"action.value | fallbackTo\"\n [type]=\"'assignment'\"></o3r-rule-key-value-pres>\n </div>\n </div>\n <div *ngSwitchCase=\"'UPDATE_CONFIG'\">\n <div>Update Config {{action.component}} {{action.library}}</div>\n <div>\n <o3r-rule-key-value-pres\n [key]=\"action.property | fallbackTo: 'Missing \\'property\\''\"\n [value]=\"action.value | fallbackTo\"\n [type]=\"'assignment'\"></o3r-rule-key-value-pres>\n </div>\n </div>\n <div *ngSwitchCase=\"'UPDATE_ASSET'\">\n <div>Update Asset:</div>\n <div>\n <o3r-rule-key-value-pres\n [oldValue]=\"action.asset | fallbackTo: 'Missing \\'asset\\''\"\n [value]=\"action.value | fallbackTo\"\n [type]=\"'state'\"></o3r-rule-key-value-pres>\n </div>\n </div>\n <div *ngSwitchCase=\"'UPDATE_LOCALISATION'\">\n <div>Update localization:</div>\n <div>\n <o3r-rule-key-value-pres\n [oldValue]=\"action.key | fallbackTo: 'Missing \\'key\\''\"\n [value]=\"action.value | fallbackTo\"\n [type]=\"'state'\"></o3r-rule-key-value-pres>\n </div>\n </div>\n <div\n *ngSwitchCase=\"'UPDATE_PLACEHOLDER'\"\n [class.error]=\"!action.placeholderId\">\n <div>Update placeholder in {{action.component}} {{action.library}}</div>\n <div>\n <o3r-rule-key-value-pres\n [oldValue]=\"action.placeholderId | fallbackTo: 'Missing \\'placeholderId\\''\"\n [value]=\"action.value\"\n [type]=\"'state'\"></o3r-rule-key-value-pres>\n </div>\n </div>\n <div *ngSwitchDefault class=\"error\">\n <div>Unrecognized action</div>\n <div>{{action | json}}</div>\n </div>\n </ng-container>\n </ng-container>\n </li>\n <li *ngFor=\"let runtimeOutput of runtimeOutputs\">\n <div>Set temporary fact</div>\n <div>\n <o3r-rule-key-value-pres\n [key]=\"runtimeOutput | fallbackTo: 'Missing \\'fact\\''\"\n [value]=\"temporaryFacts[runtimeOutput] | fallbackTo\"\n [type]=\"'assignment'\"></o3r-rule-key-value-pres>\n </div>\n </li>\n</ul>\n", styles: ["o3r-rule-actions-pres .ruleset-panel-title,o3r-rule-actions-pres .ruleset-panel-category-title{display:flex;justify-content:space-between;align-items:center}o3r-rule-actions-pres .ruleset-panel-title{font-size:1rem;padding:.5rem 0 .1rem}o3r-rule-actions-pres .ruleset-expansion-action,o3r-rule-actions-pres .icon-caret-down,o3r-rule-actions-pres .icon-caret-up{cursor:pointer}o3r-rule-actions-pres .ruleset-panel-subtitle{font-size:.75rem}o3r-rule-actions-pres .ruleset-panel-title-aside{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;min-width:-moz-fit-content;min-width:fit-content}o3r-rule-actions-pres .ruleset-panel-category-title{font-size:.95rem;background:#eee;padding:.5rem;margin-bottom:.5rem;margin-top:1rem}o3r-rule-actions-pres .rule-description .ruleset-panel-category-title{font-size:.893rem;cursor:default}o3r-rule-actions-pres .rule-description .ruleset-panel-title{font-size:.94rem}o3r-rule-actions-pres .rule-description .ruleset-panel-category-body{padding-bottom:.5rem;padding-left:1.5rem}o3r-rule-actions-pres .rule-description .ruleset-panel-category-body:empty{margin:0;padding:0 0 0 1.5rem}\n"] }]
117
109
  }], propDecorators: { actions: [{
118
110
  type: Input
119
111
  }], temporaryFacts: [{
@@ -129,34 +121,29 @@ class RuleConditionPresComponent {
129
121
  * In the case of a fact with a json path, will resolve the whole fact path, else will only display the value
130
122
  */
131
123
  this.lhs = 'undefined';
132
- /**
133
- * Right hand operator as it will be displayed in the template.
134
- * In the case of a fact with a json path, will resolve the whole fact path, else will only display the value
135
- */
136
- this.rhs = 'undefined';
137
124
  }
138
125
  /**
139
- * Rule condition that will be flatten by the component setter
126
+ * Rule condition that will be flattened by the component setter
140
127
  */
141
128
  set condition(condition) {
142
129
  this._condition = condition;
143
130
  this.lhs = condition?.lhs ? this.getOperandName(condition.lhs) : 'undefined';
144
- this.rhs = condition?.rhs ? this.getOperandName(condition.rhs) : 'undefined';
131
+ this.rhs = condition?.rhs ? this.getOperandName(condition.rhs) : undefined;
145
132
  }
146
133
  get condition() {
147
134
  return this._condition;
148
135
  }
149
136
  getOperandName(operand) {
150
137
  // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
151
- const value = `${operand.value !== undefined ? operand.value : 'MISSING_VALUE'}`;
138
+ const value = `${operand.value ?? 'MISSING_VALUE'}`;
152
139
  return operand.path ? operand.path.replace(/^[$]/, value) : value;
153
140
  }
154
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RuleConditionPresComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
155
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.0", type: RuleConditionPresComponent, selector: "o3r-rule-condition-pres", inputs: { condition: "condition" }, ngImport: i0, template: "<ng-container *ngIf=\"!condition; else displayConditions\">\n <span class=\"input-value\">true</span>\n</ng-container>\n<ng-template #displayConditions>\n <ng-container *ngIf=\"!$any(condition).all && !$any(condition).any && !$any(condition).not\">\n <span class=\"input-key\">{{ lhs }}</span> {{ $any(condition).operator }} <span class=\"input-value\">{{ rhs }}</span>\n </ng-container>\n <ng-container *ngIf=\"$any(condition).all || $any(condition).any || $any(condition).not\">\n <span *ngIf=\"$any(condition).all\">ALL</span>\n <span *ngIf=\"$any(condition).any\">ANY</span>\n <span *ngIf=\"$any(condition).not\">NOT</span>\n <span>(\n <ng-container *ngFor=\"let cond of $any(condition).all || $any(condition).any || [$any(condition).not]; let last = last;\">\n <o3r-rule-condition-pres [condition]=\"cond\"></o3r-rule-condition-pres>\n <span *ngIf=\"!last\">, </span>\n </ng-container>\n )</span>\n </ng-container>\n</ng-template>\n", styles: ["o3r-rule-condition-pres{word-break:break-word}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: RuleConditionPresComponent, selector: "o3r-rule-condition-pres", inputs: ["condition"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
141
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RuleConditionPresComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
142
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: RuleConditionPresComponent, selector: "o3r-rule-condition-pres", inputs: { condition: "condition" }, ngImport: i0, template: "<ng-container *ngIf=\"!condition; else displayConditions\">\n <span class=\"input-value\">true</span>\n</ng-container>\n<ng-template #displayConditions>\n <ng-container *ngIf=\"!$any(condition).all && !$any(condition).any && !$any(condition).not\">\n <span class=\"input-key\">{{ lhs }}</span> {{ $any(condition).operator }} <span class=\"input-value\" *ngIf=\"rhs !== undefined\">{{ rhs }}</span>\n </ng-container>\n <ng-container *ngIf=\"$any(condition).all || $any(condition).any || $any(condition).not\">\n <span *ngIf=\"$any(condition).all\">ALL</span>\n <span *ngIf=\"$any(condition).any\">ANY</span>\n <span *ngIf=\"$any(condition).not\">NOT</span>\n <span>(\n <ng-container *ngFor=\"let cond of $any(condition).all || $any(condition).any || [$any(condition).not]; let last = last;\">\n <o3r-rule-condition-pres [condition]=\"cond\"></o3r-rule-condition-pres>\n <span *ngIf=\"!last\">, </span>\n </ng-container>\n )</span>\n </ng-container>\n</ng-template>\n", styles: ["o3r-rule-condition-pres{word-break:break-word}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: RuleConditionPresComponent, selector: "o3r-rule-condition-pres", inputs: ["condition"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
156
143
  }
157
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RuleConditionPresComponent, decorators: [{
144
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RuleConditionPresComponent, decorators: [{
158
145
  type: Component,
159
- args: [{ selector: 'o3r-rule-condition-pres', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ng-container *ngIf=\"!condition; else displayConditions\">\n <span class=\"input-value\">true</span>\n</ng-container>\n<ng-template #displayConditions>\n <ng-container *ngIf=\"!$any(condition).all && !$any(condition).any && !$any(condition).not\">\n <span class=\"input-key\">{{ lhs }}</span> {{ $any(condition).operator }} <span class=\"input-value\">{{ rhs }}</span>\n </ng-container>\n <ng-container *ngIf=\"$any(condition).all || $any(condition).any || $any(condition).not\">\n <span *ngIf=\"$any(condition).all\">ALL</span>\n <span *ngIf=\"$any(condition).any\">ANY</span>\n <span *ngIf=\"$any(condition).not\">NOT</span>\n <span>(\n <ng-container *ngFor=\"let cond of $any(condition).all || $any(condition).any || [$any(condition).not]; let last = last;\">\n <o3r-rule-condition-pres [condition]=\"cond\"></o3r-rule-condition-pres>\n <span *ngIf=\"!last\">, </span>\n </ng-container>\n )</span>\n </ng-container>\n</ng-template>\n", styles: ["o3r-rule-condition-pres{word-break:break-word}\n"] }]
146
+ args: [{ selector: 'o3r-rule-condition-pres', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ng-container *ngIf=\"!condition; else displayConditions\">\n <span class=\"input-value\">true</span>\n</ng-container>\n<ng-template #displayConditions>\n <ng-container *ngIf=\"!$any(condition).all && !$any(condition).any && !$any(condition).not\">\n <span class=\"input-key\">{{ lhs }}</span> {{ $any(condition).operator }} <span class=\"input-value\" *ngIf=\"rhs !== undefined\">{{ rhs }}</span>\n </ng-container>\n <ng-container *ngIf=\"$any(condition).all || $any(condition).any || $any(condition).not\">\n <span *ngIf=\"$any(condition).all\">ALL</span>\n <span *ngIf=\"$any(condition).any\">ANY</span>\n <span *ngIf=\"$any(condition).not\">NOT</span>\n <span>(\n <ng-container *ngFor=\"let cond of $any(condition).all || $any(condition).any || [$any(condition).not]; let last = last;\">\n <o3r-rule-condition-pres [condition]=\"cond\"></o3r-rule-condition-pres>\n <span *ngIf=\"!last\">, </span>\n </ng-container>\n )</span>\n </ng-container>\n</ng-template>\n", styles: ["o3r-rule-condition-pres{word-break:break-word}\n"] }]
160
147
  }], propDecorators: { condition: [{
161
148
  type: Input
162
149
  }] } });
@@ -186,12 +173,12 @@ class RuleTreePresComponent {
186
173
  */
187
174
  this.successActionsExpanded = false;
188
175
  }
189
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RuleTreePresComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
190
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.0", type: RuleTreePresComponent, selector: "o3r-rule-tree-pres", inputs: { name: "name", blockType: "blockType", condition: "condition", successElements: "successElements", failureElements: "failureElements" }, ngImport: i0, template: "<span *ngIf=\"name\">{{name | titlecase}}:</span>\n<div class=\"rule-wrapper tree\">\n <ng-container *ngIf=\"blockType === 'IF_ELSE'; else noCondition\">\n <div class=\"tree-root\" *ngIf=\"!name\" [attr.aria-hidden]=\"true\">\n <div></div>\n <div></div>\n </div>\n <div class=\"rule-conditions\">\n <div class=\"rule-conditions-title\">If\n <o3r-rule-condition-pres [condition]=\"condition\"></o3r-rule-condition-pres>\n </div>\n <div class=\"tree-root\" [attr.aria-hidden]=\"true\">\n <div></div>\n <div></div>\n </div>\n </div>\n <div class=\"rule-actions-wrapper tree-node\">\n <div class=\"rule-actions tree-branch\">\n <div class=\"tree-leaf\" [attr.aria-hidden]=\"true\">\n <div></div>\n <div></div>\n </div>\n <div class=\"rule-action-title success-actions\"\n tabindex=\"0\"\n (click)=\"successActionsExpanded = !successActionsExpanded\"\n (keyup.enter)=\"successActionsExpanded = !successActionsExpanded\">\n <i class=\"icon refx-icon-validate\"></i>\n <span>Then</span>\n <i class=\"icon\"\n [class.icon-caret-down]=\"!successActionsExpanded\"\n [class.icon-caret-up]=\"successActionsExpanded\">\n </i>\n </div>\n <o3r-rule-actions-pres class=\"rule-tree-actions\" *ngIf=\"successActionsExpanded\"\n [actions]=\"successElements\">\n </o3r-rule-actions-pres>\n <ng-container [ngTemplateOutlet]=\"subTree\" [ngTemplateOutletContext]=\"{blocks: successElements}\"></ng-container>\n </div>\n <div class=\"rule-actions tree-branch\">\n <div class=\"tree-leaf\" [attr.aria-hidden]=\"true\">\n <div></div>\n <div></div>\n </div>\n <div class=\"rule-action-title error-actions\"\n tabindex=\"0\"\n (click)=\"failureActionsExpanded = !failureActionsExpanded\"\n (keyup.enter)=\"failureActionsExpanded = !failureActionsExpanded\">\n <i class=\"icon refx-icon-cross\"></i>\n <span>Else</span>\n <i class=\"icon\"\n [class.icon-caret-down]=\"!failureActionsExpanded\"\n [class.icon-caret-up]=\"failureActionsExpanded\">\n </i>\n </div>\n <o3r-rule-actions-pres class=\"rule-tree-actions\"\n *ngIf=\"failureActionsExpanded\"\n [actions]=\"failureElements\">\n </o3r-rule-actions-pres>\n <ng-container [ngTemplateOutlet]=\"subTree\" [ngTemplateOutletContext]=\"{blocks: failureElements}\"></ng-container>\n </div>\n </div>\n </ng-container>\n</div>\n<ng-template #noCondition>\n <div class=\"rule-conditions\">\n <div class=\"rule-conditions-title\">If <span class=\"input-value\">true</span></div>\n <div class=\"tree-root\" [attr.aria-hidden]=\"true\">\n <div></div>\n <div></div>\n </div>\n </div>\n <div class=\"rule-actions-wrapper\">\n <div class=\"rule-actions\">\n <div class=\"rule-action-title success-actions\" tabindex=\"0\"\n (keyup.enter)=\"successActionsExpanded = !successActionsExpanded\"\n (click)=\"successActionsExpanded = !successActionsExpanded\">\n <i class=\"icon refx-icon-validate\">\n </i>\n <span>Then</span>\n <i class=\"icon\"\n [class.icon-caret-down]=\"!successActionsExpanded\"\n [class.icon-caret-up]=\"successActionsExpanded\">\n </i>\n </div>\n <o3r-rule-actions-pres class=\"rule-tree-actions\"\n *ngIf=\"successActionsExpanded\"\n [actions]=\"successElements\">\n </o3r-rule-actions-pres>\n <ng-container [ngTemplateOutlet]=\"subTree\" [ngTemplateOutletContext]=\"{blocks: successElements}\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #subTree let-blocks=\"blocks\">\n <div class=\"rule-sub-trees\">\n <ng-container *ngFor=\"let block of blocks\">\n <div *ngIf=\"block.blockType === 'IF_ELSE'\" class=\"tree-branch\">\n <o3r-rule-tree-pres\n [blockType]=\"'IF_ELSE'\"\n [condition]=\"block.condition\"\n [failureElements]=\"block.failureElements\"\n [successElements]=\"block.successElements\"></o3r-rule-tree-pres>\n </div>\n </ng-container>\n </div>\n</ng-template>\n", styles: ["o3r-rule-tree-pres{display:block;padding-bottom:1rem}o3r-rule-tree-pres .rule-sub-trees{display:flex}o3r-rule-tree-pres .rule-conditions-title,o3r-rule-tree-pres .rule-action-title{text-align:center}o3r-rule-tree-pres .rule-conditions-title{border:1px solid #999999;background:white;color:#000;padding:.2rem}o3r-rule-tree-pres .rule-action-title{background:white;border-radius:0;border:1px solid #999999;cursor:pointer;display:flex;justify-content:center;align-items:center;gap:.5rem}o3r-rule-tree-pres .rule-tree-actions{display:block;padding:.5rem}o3r-rule-tree-pres .rule-actions:first-child>.rule-action-title{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}o3r-rule-tree-pres .rule-actions:last-child>.rule-action-title{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}o3r-rule-tree-pres .rule-actions-wrapper{display:flex}o3r-rule-tree-pres .rule-actions-wrapper .rule-actions{flex:1 1 100%}o3r-rule-tree-pres .success-actions{border-color:#16aa32}o3r-rule-tree-pres .success-actions.rule-action-title{background:#16aa32;color:#fff}o3r-rule-tree-pres .error-actions{border-color:#c02020}o3r-rule-tree-pres .error-actions.rule-action-title{background:#c02020;color:#fff}o3r-rule-tree-pres .tree .tree-leaf,o3r-rule-tree-pres .tree .tree-root{display:flex;width:100%}o3r-rule-tree-pres .tree .tree-leaf>div,o3r-rule-tree-pres .tree .tree-root>div{height:1rem;width:50%}o3r-rule-tree-pres .tree .tree-root div:first-child{border-right:1px dashed}o3r-rule-tree-pres .tree .tree-root{margin-top:.2rem}o3r-rule-tree-pres .tree .tree-node>.tree-branch:last-child>.tree-leaf>div:first-child{border-right:1px dashed;border-top:1px dashed;border-top-right-radius:.2rem}o3r-rule-tree-pres .tree .tree-node>.tree-branch:first-child>.tree-leaf>div:last-child{border-left:1px dashed;border-top:1px dashed;border-top-left-radius:.2rem}o3r-rule-tree-pres .icon{cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: RuleConditionPresComponent, selector: "o3r-rule-condition-pres", inputs: ["condition"] }, { kind: "component", type: RuleTreePresComponent, selector: "o3r-rule-tree-pres", inputs: ["name", "blockType", "condition", "successElements", "failureElements"] }, { kind: "component", type: RuleActionsPresComponent, selector: "o3r-rule-actions-pres", inputs: ["actions", "temporaryFacts", "runtimeOutputs"] }, { kind: "pipe", type: i1.TitleCasePipe, name: "titlecase" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
176
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RuleTreePresComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
177
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: RuleTreePresComponent, selector: "o3r-rule-tree-pres", inputs: { name: "name", blockType: "blockType", condition: "condition", successElements: "successElements", failureElements: "failureElements" }, ngImport: i0, template: "<span *ngIf=\"name\">{{name | titlecase}}:</span>\n<div class=\"rule-wrapper tree\">\n <ng-container *ngIf=\"blockType === 'IF_ELSE'; else noCondition\">\n <div class=\"tree-root\" *ngIf=\"!name\" [attr.aria-hidden]=\"true\">\n <div></div>\n <div></div>\n </div>\n <div class=\"rule-conditions\">\n <div class=\"rule-conditions-title\">If\n <o3r-rule-condition-pres [condition]=\"condition\"></o3r-rule-condition-pres>\n </div>\n <div class=\"tree-root\" [attr.aria-hidden]=\"true\">\n <div></div>\n <div></div>\n </div>\n </div>\n <div class=\"rule-actions-wrapper tree-node\">\n <div class=\"rule-actions tree-branch\">\n <div class=\"tree-leaf\" [attr.aria-hidden]=\"true\">\n <div></div>\n <div></div>\n </div>\n <div class=\"rule-action-title success-actions\"\n tabindex=\"0\"\n (click)=\"successActionsExpanded = !successActionsExpanded\"\n (keyup.enter)=\"successActionsExpanded = !successActionsExpanded\">\n <i class=\"icon refx-icon-validate\"></i>\n <span>Then</span>\n <i class=\"icon\"\n [class.icon-caret-down]=\"!successActionsExpanded\"\n [class.icon-caret-up]=\"successActionsExpanded\">\n </i>\n </div>\n <o3r-rule-actions-pres class=\"rule-tree-actions\" *ngIf=\"successActionsExpanded\"\n [actions]=\"successElements\">\n </o3r-rule-actions-pres>\n <ng-container [ngTemplateOutlet]=\"subTree\" [ngTemplateOutletContext]=\"{blocks: successElements}\"></ng-container>\n </div>\n <div class=\"rule-actions tree-branch\">\n <div class=\"tree-leaf\" [attr.aria-hidden]=\"true\">\n <div></div>\n <div></div>\n </div>\n <div class=\"rule-action-title error-actions\"\n tabindex=\"0\"\n (click)=\"failureActionsExpanded = !failureActionsExpanded\"\n (keyup.enter)=\"failureActionsExpanded = !failureActionsExpanded\">\n <i class=\"icon refx-icon-cross\"></i>\n <span>Else</span>\n <i class=\"icon\"\n [class.icon-caret-down]=\"!failureActionsExpanded\"\n [class.icon-caret-up]=\"failureActionsExpanded\">\n </i>\n </div>\n <o3r-rule-actions-pres class=\"rule-tree-actions\"\n *ngIf=\"failureActionsExpanded\"\n [actions]=\"failureElements\">\n </o3r-rule-actions-pres>\n <ng-container [ngTemplateOutlet]=\"subTree\" [ngTemplateOutletContext]=\"{blocks: failureElements}\"></ng-container>\n </div>\n </div>\n </ng-container>\n</div>\n<ng-template #noCondition>\n <div class=\"rule-conditions\">\n <div class=\"rule-conditions-title\">If <span class=\"input-value\">true</span></div>\n <div class=\"tree-root\" [attr.aria-hidden]=\"true\">\n <div></div>\n <div></div>\n </div>\n </div>\n <div class=\"rule-actions-wrapper\">\n <div class=\"rule-actions\">\n <div class=\"rule-action-title success-actions\" tabindex=\"0\"\n (keyup.enter)=\"successActionsExpanded = !successActionsExpanded\"\n (click)=\"successActionsExpanded = !successActionsExpanded\">\n <i class=\"icon refx-icon-validate\">\n </i>\n <span>Then</span>\n <i class=\"icon\"\n [class.icon-caret-down]=\"!successActionsExpanded\"\n [class.icon-caret-up]=\"successActionsExpanded\">\n </i>\n </div>\n <o3r-rule-actions-pres class=\"rule-tree-actions\"\n *ngIf=\"successActionsExpanded\"\n [actions]=\"successElements\">\n </o3r-rule-actions-pres>\n <ng-container [ngTemplateOutlet]=\"subTree\" [ngTemplateOutletContext]=\"{blocks: successElements}\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #subTree let-blocks=\"blocks\">\n <div class=\"rule-sub-trees\">\n <ng-container *ngFor=\"let block of blocks\">\n <div *ngIf=\"block.blockType === 'IF_ELSE'\" class=\"tree-branch\">\n <o3r-rule-tree-pres\n [blockType]=\"'IF_ELSE'\"\n [condition]=\"block.condition\"\n [failureElements]=\"block.failureElements\"\n [successElements]=\"block.successElements\"></o3r-rule-tree-pres>\n </div>\n </ng-container>\n </div>\n</ng-template>\n", styles: ["o3r-rule-tree-pres{display:block;padding-bottom:1rem}o3r-rule-tree-pres .rule-sub-trees{display:flex}o3r-rule-tree-pres .rule-conditions-title,o3r-rule-tree-pres .rule-action-title{text-align:center}o3r-rule-tree-pres .rule-conditions-title{border:1px solid #999999;background:#fff;color:#000;padding:.2rem}o3r-rule-tree-pres .rule-action-title{background:#fff;border-radius:0;border:1px solid #999999;cursor:pointer;display:flex;justify-content:center;align-items:center;gap:.5rem}o3r-rule-tree-pres .rule-tree-actions{display:block;padding:.5rem}o3r-rule-tree-pres .rule-actions:first-child>.rule-action-title{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}o3r-rule-tree-pres .rule-actions:last-child>.rule-action-title{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}o3r-rule-tree-pres .rule-actions-wrapper{display:flex}o3r-rule-tree-pres .rule-actions-wrapper .rule-actions{flex:1 1 100%}o3r-rule-tree-pres .success-actions{border-color:#16aa32}o3r-rule-tree-pres .success-actions.rule-action-title{background:#16aa32;color:#fff}o3r-rule-tree-pres .error-actions{border-color:#c02020}o3r-rule-tree-pres .error-actions.rule-action-title{background:#c02020;color:#fff}o3r-rule-tree-pres .tree .tree-leaf,o3r-rule-tree-pres .tree .tree-root{display:flex;width:100%}o3r-rule-tree-pres .tree .tree-leaf>div,o3r-rule-tree-pres .tree .tree-root>div{height:1rem;width:50%}o3r-rule-tree-pres .tree .tree-root div:first-child{border-right:1px dashed}o3r-rule-tree-pres .tree .tree-root{margin-top:.2rem}o3r-rule-tree-pres .tree .tree-node>.tree-branch:last-child>.tree-leaf>div:first-child{border-right:1px dashed;border-top:1px dashed;border-top-right-radius:.2rem}o3r-rule-tree-pres .tree .tree-node>.tree-branch:first-child>.tree-leaf>div:last-child{border-left:1px dashed;border-top:1px dashed;border-top-left-radius:.2rem}o3r-rule-tree-pres .icon{cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: RuleConditionPresComponent, selector: "o3r-rule-condition-pres", inputs: ["condition"] }, { kind: "component", type: RuleTreePresComponent, selector: "o3r-rule-tree-pres", inputs: ["name", "blockType", "condition", "successElements", "failureElements"] }, { kind: "component", type: RuleActionsPresComponent, selector: "o3r-rule-actions-pres", inputs: ["actions", "temporaryFacts", "runtimeOutputs"] }, { kind: "pipe", type: i1.TitleCasePipe, name: "titlecase" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
191
178
  }
192
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RuleTreePresComponent, decorators: [{
179
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RuleTreePresComponent, decorators: [{
193
180
  type: Component,
194
- args: [{ selector: 'o3r-rule-tree-pres', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<span *ngIf=\"name\">{{name | titlecase}}:</span>\n<div class=\"rule-wrapper tree\">\n <ng-container *ngIf=\"blockType === 'IF_ELSE'; else noCondition\">\n <div class=\"tree-root\" *ngIf=\"!name\" [attr.aria-hidden]=\"true\">\n <div></div>\n <div></div>\n </div>\n <div class=\"rule-conditions\">\n <div class=\"rule-conditions-title\">If\n <o3r-rule-condition-pres [condition]=\"condition\"></o3r-rule-condition-pres>\n </div>\n <div class=\"tree-root\" [attr.aria-hidden]=\"true\">\n <div></div>\n <div></div>\n </div>\n </div>\n <div class=\"rule-actions-wrapper tree-node\">\n <div class=\"rule-actions tree-branch\">\n <div class=\"tree-leaf\" [attr.aria-hidden]=\"true\">\n <div></div>\n <div></div>\n </div>\n <div class=\"rule-action-title success-actions\"\n tabindex=\"0\"\n (click)=\"successActionsExpanded = !successActionsExpanded\"\n (keyup.enter)=\"successActionsExpanded = !successActionsExpanded\">\n <i class=\"icon refx-icon-validate\"></i>\n <span>Then</span>\n <i class=\"icon\"\n [class.icon-caret-down]=\"!successActionsExpanded\"\n [class.icon-caret-up]=\"successActionsExpanded\">\n </i>\n </div>\n <o3r-rule-actions-pres class=\"rule-tree-actions\" *ngIf=\"successActionsExpanded\"\n [actions]=\"successElements\">\n </o3r-rule-actions-pres>\n <ng-container [ngTemplateOutlet]=\"subTree\" [ngTemplateOutletContext]=\"{blocks: successElements}\"></ng-container>\n </div>\n <div class=\"rule-actions tree-branch\">\n <div class=\"tree-leaf\" [attr.aria-hidden]=\"true\">\n <div></div>\n <div></div>\n </div>\n <div class=\"rule-action-title error-actions\"\n tabindex=\"0\"\n (click)=\"failureActionsExpanded = !failureActionsExpanded\"\n (keyup.enter)=\"failureActionsExpanded = !failureActionsExpanded\">\n <i class=\"icon refx-icon-cross\"></i>\n <span>Else</span>\n <i class=\"icon\"\n [class.icon-caret-down]=\"!failureActionsExpanded\"\n [class.icon-caret-up]=\"failureActionsExpanded\">\n </i>\n </div>\n <o3r-rule-actions-pres class=\"rule-tree-actions\"\n *ngIf=\"failureActionsExpanded\"\n [actions]=\"failureElements\">\n </o3r-rule-actions-pres>\n <ng-container [ngTemplateOutlet]=\"subTree\" [ngTemplateOutletContext]=\"{blocks: failureElements}\"></ng-container>\n </div>\n </div>\n </ng-container>\n</div>\n<ng-template #noCondition>\n <div class=\"rule-conditions\">\n <div class=\"rule-conditions-title\">If <span class=\"input-value\">true</span></div>\n <div class=\"tree-root\" [attr.aria-hidden]=\"true\">\n <div></div>\n <div></div>\n </div>\n </div>\n <div class=\"rule-actions-wrapper\">\n <div class=\"rule-actions\">\n <div class=\"rule-action-title success-actions\" tabindex=\"0\"\n (keyup.enter)=\"successActionsExpanded = !successActionsExpanded\"\n (click)=\"successActionsExpanded = !successActionsExpanded\">\n <i class=\"icon refx-icon-validate\">\n </i>\n <span>Then</span>\n <i class=\"icon\"\n [class.icon-caret-down]=\"!successActionsExpanded\"\n [class.icon-caret-up]=\"successActionsExpanded\">\n </i>\n </div>\n <o3r-rule-actions-pres class=\"rule-tree-actions\"\n *ngIf=\"successActionsExpanded\"\n [actions]=\"successElements\">\n </o3r-rule-actions-pres>\n <ng-container [ngTemplateOutlet]=\"subTree\" [ngTemplateOutletContext]=\"{blocks: successElements}\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #subTree let-blocks=\"blocks\">\n <div class=\"rule-sub-trees\">\n <ng-container *ngFor=\"let block of blocks\">\n <div *ngIf=\"block.blockType === 'IF_ELSE'\" class=\"tree-branch\">\n <o3r-rule-tree-pres\n [blockType]=\"'IF_ELSE'\"\n [condition]=\"block.condition\"\n [failureElements]=\"block.failureElements\"\n [successElements]=\"block.successElements\"></o3r-rule-tree-pres>\n </div>\n </ng-container>\n </div>\n</ng-template>\n", styles: ["o3r-rule-tree-pres{display:block;padding-bottom:1rem}o3r-rule-tree-pres .rule-sub-trees{display:flex}o3r-rule-tree-pres .rule-conditions-title,o3r-rule-tree-pres .rule-action-title{text-align:center}o3r-rule-tree-pres .rule-conditions-title{border:1px solid #999999;background:white;color:#000;padding:.2rem}o3r-rule-tree-pres .rule-action-title{background:white;border-radius:0;border:1px solid #999999;cursor:pointer;display:flex;justify-content:center;align-items:center;gap:.5rem}o3r-rule-tree-pres .rule-tree-actions{display:block;padding:.5rem}o3r-rule-tree-pres .rule-actions:first-child>.rule-action-title{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}o3r-rule-tree-pres .rule-actions:last-child>.rule-action-title{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}o3r-rule-tree-pres .rule-actions-wrapper{display:flex}o3r-rule-tree-pres .rule-actions-wrapper .rule-actions{flex:1 1 100%}o3r-rule-tree-pres .success-actions{border-color:#16aa32}o3r-rule-tree-pres .success-actions.rule-action-title{background:#16aa32;color:#fff}o3r-rule-tree-pres .error-actions{border-color:#c02020}o3r-rule-tree-pres .error-actions.rule-action-title{background:#c02020;color:#fff}o3r-rule-tree-pres .tree .tree-leaf,o3r-rule-tree-pres .tree .tree-root{display:flex;width:100%}o3r-rule-tree-pres .tree .tree-leaf>div,o3r-rule-tree-pres .tree .tree-root>div{height:1rem;width:50%}o3r-rule-tree-pres .tree .tree-root div:first-child{border-right:1px dashed}o3r-rule-tree-pres .tree .tree-root{margin-top:.2rem}o3r-rule-tree-pres .tree .tree-node>.tree-branch:last-child>.tree-leaf>div:first-child{border-right:1px dashed;border-top:1px dashed;border-top-right-radius:.2rem}o3r-rule-tree-pres .tree .tree-node>.tree-branch:first-child>.tree-leaf>div:last-child{border-left:1px dashed;border-top:1px dashed;border-top-left-radius:.2rem}o3r-rule-tree-pres .icon{cursor:pointer}\n"] }]
181
+ args: [{ selector: 'o3r-rule-tree-pres', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<span *ngIf=\"name\">{{name | titlecase}}:</span>\n<div class=\"rule-wrapper tree\">\n <ng-container *ngIf=\"blockType === 'IF_ELSE'; else noCondition\">\n <div class=\"tree-root\" *ngIf=\"!name\" [attr.aria-hidden]=\"true\">\n <div></div>\n <div></div>\n </div>\n <div class=\"rule-conditions\">\n <div class=\"rule-conditions-title\">If\n <o3r-rule-condition-pres [condition]=\"condition\"></o3r-rule-condition-pres>\n </div>\n <div class=\"tree-root\" [attr.aria-hidden]=\"true\">\n <div></div>\n <div></div>\n </div>\n </div>\n <div class=\"rule-actions-wrapper tree-node\">\n <div class=\"rule-actions tree-branch\">\n <div class=\"tree-leaf\" [attr.aria-hidden]=\"true\">\n <div></div>\n <div></div>\n </div>\n <div class=\"rule-action-title success-actions\"\n tabindex=\"0\"\n (click)=\"successActionsExpanded = !successActionsExpanded\"\n (keyup.enter)=\"successActionsExpanded = !successActionsExpanded\">\n <i class=\"icon refx-icon-validate\"></i>\n <span>Then</span>\n <i class=\"icon\"\n [class.icon-caret-down]=\"!successActionsExpanded\"\n [class.icon-caret-up]=\"successActionsExpanded\">\n </i>\n </div>\n <o3r-rule-actions-pres class=\"rule-tree-actions\" *ngIf=\"successActionsExpanded\"\n [actions]=\"successElements\">\n </o3r-rule-actions-pres>\n <ng-container [ngTemplateOutlet]=\"subTree\" [ngTemplateOutletContext]=\"{blocks: successElements}\"></ng-container>\n </div>\n <div class=\"rule-actions tree-branch\">\n <div class=\"tree-leaf\" [attr.aria-hidden]=\"true\">\n <div></div>\n <div></div>\n </div>\n <div class=\"rule-action-title error-actions\"\n tabindex=\"0\"\n (click)=\"failureActionsExpanded = !failureActionsExpanded\"\n (keyup.enter)=\"failureActionsExpanded = !failureActionsExpanded\">\n <i class=\"icon refx-icon-cross\"></i>\n <span>Else</span>\n <i class=\"icon\"\n [class.icon-caret-down]=\"!failureActionsExpanded\"\n [class.icon-caret-up]=\"failureActionsExpanded\">\n </i>\n </div>\n <o3r-rule-actions-pres class=\"rule-tree-actions\"\n *ngIf=\"failureActionsExpanded\"\n [actions]=\"failureElements\">\n </o3r-rule-actions-pres>\n <ng-container [ngTemplateOutlet]=\"subTree\" [ngTemplateOutletContext]=\"{blocks: failureElements}\"></ng-container>\n </div>\n </div>\n </ng-container>\n</div>\n<ng-template #noCondition>\n <div class=\"rule-conditions\">\n <div class=\"rule-conditions-title\">If <span class=\"input-value\">true</span></div>\n <div class=\"tree-root\" [attr.aria-hidden]=\"true\">\n <div></div>\n <div></div>\n </div>\n </div>\n <div class=\"rule-actions-wrapper\">\n <div class=\"rule-actions\">\n <div class=\"rule-action-title success-actions\" tabindex=\"0\"\n (keyup.enter)=\"successActionsExpanded = !successActionsExpanded\"\n (click)=\"successActionsExpanded = !successActionsExpanded\">\n <i class=\"icon refx-icon-validate\">\n </i>\n <span>Then</span>\n <i class=\"icon\"\n [class.icon-caret-down]=\"!successActionsExpanded\"\n [class.icon-caret-up]=\"successActionsExpanded\">\n </i>\n </div>\n <o3r-rule-actions-pres class=\"rule-tree-actions\"\n *ngIf=\"successActionsExpanded\"\n [actions]=\"successElements\">\n </o3r-rule-actions-pres>\n <ng-container [ngTemplateOutlet]=\"subTree\" [ngTemplateOutletContext]=\"{blocks: successElements}\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #subTree let-blocks=\"blocks\">\n <div class=\"rule-sub-trees\">\n <ng-container *ngFor=\"let block of blocks\">\n <div *ngIf=\"block.blockType === 'IF_ELSE'\" class=\"tree-branch\">\n <o3r-rule-tree-pres\n [blockType]=\"'IF_ELSE'\"\n [condition]=\"block.condition\"\n [failureElements]=\"block.failureElements\"\n [successElements]=\"block.successElements\"></o3r-rule-tree-pres>\n </div>\n </ng-container>\n </div>\n</ng-template>\n", styles: ["o3r-rule-tree-pres{display:block;padding-bottom:1rem}o3r-rule-tree-pres .rule-sub-trees{display:flex}o3r-rule-tree-pres .rule-conditions-title,o3r-rule-tree-pres .rule-action-title{text-align:center}o3r-rule-tree-pres .rule-conditions-title{border:1px solid #999999;background:#fff;color:#000;padding:.2rem}o3r-rule-tree-pres .rule-action-title{background:#fff;border-radius:0;border:1px solid #999999;cursor:pointer;display:flex;justify-content:center;align-items:center;gap:.5rem}o3r-rule-tree-pres .rule-tree-actions{display:block;padding:.5rem}o3r-rule-tree-pres .rule-actions:first-child>.rule-action-title{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}o3r-rule-tree-pres .rule-actions:last-child>.rule-action-title{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}o3r-rule-tree-pres .rule-actions-wrapper{display:flex}o3r-rule-tree-pres .rule-actions-wrapper .rule-actions{flex:1 1 100%}o3r-rule-tree-pres .success-actions{border-color:#16aa32}o3r-rule-tree-pres .success-actions.rule-action-title{background:#16aa32;color:#fff}o3r-rule-tree-pres .error-actions{border-color:#c02020}o3r-rule-tree-pres .error-actions.rule-action-title{background:#c02020;color:#fff}o3r-rule-tree-pres .tree .tree-leaf,o3r-rule-tree-pres .tree .tree-root{display:flex;width:100%}o3r-rule-tree-pres .tree .tree-leaf>div,o3r-rule-tree-pres .tree .tree-root>div{height:1rem;width:50%}o3r-rule-tree-pres .tree .tree-root div:first-child{border-right:1px dashed}o3r-rule-tree-pres .tree .tree-root{margin-top:.2rem}o3r-rule-tree-pres .tree .tree-node>.tree-branch:last-child>.tree-leaf>div:first-child{border-right:1px dashed;border-top:1px dashed;border-top-right-radius:.2rem}o3r-rule-tree-pres .tree .tree-node>.tree-branch:first-child>.tree-leaf>div:last-child{border-left:1px dashed;border-top:1px dashed;border-top-left-radius:.2rem}o3r-rule-tree-pres .icon{cursor:pointer}\n"] }]
195
182
  }], propDecorators: { name: [{
196
183
  type: Input
197
184
  }], blockType: [{
@@ -207,7 +194,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImpor
207
194
  /**
208
195
  * Compute the status of the execution depending on its execution event type, the output and whether the execution
209
196
  * is still active
210
- *
211
197
  * @param rulesetExecution
212
198
  * @param isActive
213
199
  */
@@ -225,7 +211,6 @@ const getStatus = (rulesetExecution, isActive) => {
225
211
  };
226
212
  /**
227
213
  * Transform the output of the debug reports into the model for the ruleset history debug panel
228
- *
229
214
  * @param events
230
215
  * @param rulesetMap
231
216
  */
@@ -264,7 +249,6 @@ class RulesetHistoryPresComponent {
264
249
  * Reflects the state of each ruleset expanded elements.
265
250
  * Each ruleset entry contains a list of subpanel that can be collapsed or expanded.
266
251
  * Ruleset whole panel status is store the 'ruleset' entry.
267
- *
268
252
  * @example
269
253
  * Expanded ruleset with rule overview collapsed:
270
254
  * {'rulesetId': {'ruleset' : true, 'ruleOverview': false}}
@@ -276,7 +260,6 @@ class RulesetHistoryPresComponent {
276
260
  }
277
261
  /**
278
262
  * Toggle a ruleset subpanel
279
- *
280
263
  * @param ruleId
281
264
  * @param subpanel element to collapse. 'ruleset' will toggle the whole panel but won't reset the subpanels states.
282
265
  */
@@ -289,24 +272,24 @@ class RulesetHistoryPresComponent {
289
272
  }
290
273
  this.cd.detectChanges();
291
274
  }
292
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesetHistoryPresComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
293
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.0", type: RulesetHistoryPresComponent, selector: "o3r-ruleset-history-pres", inputs: { rulesetExecutions: "rulesetExecutions", executionDurationFormat: "executionDurationFormat" }, ngImport: i0, template: "<section>\n <h4 class=\"mb-4\">Ruleset Execution History</h4>\n <ng-template #noRulesEngine>\n <div class=\"alert alert-danger m-2\" role=\"alert\">\n The Rules Engine is not configured on this page.\n </div>\n </ng-template>\n <ul *ngIf=\"rulesetExecutions; else noRulesEngine\" class=\"rulesets\">\n <li *ngFor=\"let execution of rulesetExecutions\" class=\"ruleset\">\n <div class=\"ruleset-panel-title ruleset-expansion-action\"\n [class.error]=\"execution.type === 'RulesetExecutionError'\"\n (click)=\"toggleExpansion(execution.executionId, 'ruleset')\">\n <div><span [title]=\"'This ruleset has been evaluated ' + execution.executionCounter + ' time(s)'\">{{execution.executionCounter}}</span> - {{execution.rulesetName | titlecase }}\n <div class=\"ruleset-panel-subtitle\" *ngIf=\"execution.rulesetInformation?.linkedComponent as linkedComponent\">\n {{linkedComponent.name}} {{linkedComponent.library}}\n </div>\n <div class=\"ruleset-panel-subtitle\" *ngIf=\"execution.rulesetInformation?.validityRange as validityRange\">\n Date range: {{validityRange.from}} - {{validityRange.to}}\n </div>\n </div>\n <div class=\"ruleset-panel-title-aside\">\n <span class=\"error capsule\" *ngIf=\"execution.status === 'Error'\">Error</span>\n <span class=\"success capsule\" *ngIf=\"execution.status === 'Active'\">Applied</span>\n <span class=\"inactive capsule\" *ngIf=\"execution.status === 'Deactivated'\">Deactivated</span>\n <span class=\"warn capsule\" *ngIf=\"execution.status === 'NoEffect'\">No effect</span>\n <span class=\"time capsule\">\n <span>{{execution.timestamp | date: 'HH:mm:ss SSS'}}</span>\n <span>({{execution.duration | number: executionDurationFormat}}ms)</span>\n </span>\n <button\n class=\"icon\"\n [class.icon-caret-down]=\"!expansionStatus[execution.executionId]?.ruleset\"\n [class.icon-caret-up]=\"expansionStatus[execution.executionId]?.ruleset\">\n </button>\n </div>\n </div>\n <div class=\"ruleset-panel-description\" *ngIf=\"expansionStatus[execution.executionId]?.ruleset\">\n <ng-container [ngTemplateOutlet]=\"rules\"\n [ngTemplateOutletContext]=\"{\n rules: execution.rulesetInformation.rules,\n expansionID: execution.executionId\n }\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"inputs\"\n [ngTemplateOutletContext]=\"{\n inputs: execution.inputFacts\n }\"></ng-container>\n <ng-container *ngIf=\"execution.type === 'RulesetExecutionError'; else success\">\n <div class=\"ruleset-panel-category-title\">Rules:</div>\n <ul class=\"ruleset-panel-category-body rule-description\">\n <li *ngFor=\"let ruleEvaluation of execution.rulesEvaluations; let index=index;\">\n <ng-container>\n <div class=\"ruleset-panel-title\" [class.error]=\"ruleEvaluation.error\">\n <span>{{ruleEvaluation.rule.name | titlecase}} </span>\n <span class=\"capsule error\" *ngIf=\"ruleEvaluation.error\">Error</span>\n </div>\n <div>\n <ng-container *ngIf=\"ruleEvaluation.error\">\n <span class=\"ruleset-panel-category-title\">Error:</span>\n <span class=\"ruleset-panel-category-body error\">{{ruleEvaluation.error.message}}</span>\n </ng-container>\n <ng-container [ngTemplateOutlet]=\"inputs\"\n [ngTemplateOutletContext]=\"{\n inputs: execution.inputFacts,\n runtimeInputs: execution.rulesetInformation?.rules[index]?.inputRuntimeFacts\n }\"></ng-container>\n <o3r-rule-actions-pres *ngIf=\"!ruleEvaluation.error\"\n [temporaryFacts]=\"ruleEvaluation.temporaryFacts\"\n [runtimeOutputs]=\"execution.rulesetInformation?.rules[index]?.outputRuntimeFacts\"\n ></o3r-rule-actions-pres>\n </div>\n </ng-container>\n </li>\n </ul>\n </ng-container>\n <ng-template #success>\n <o3r-rule-actions-pres [actions]=\"execution.outputActions\"></o3r-rule-actions-pres>\n <div class=\"ruleset-panel-category-title\">Executed Rules</div>\n <ul class=\"rule-description ruleset-panel-category-body\">\n <li *ngFor=\"let ruleEvaluation of execution.rulesEvaluations; let index=index;\">\n <div class=\"ruleset-panel-title\">\n <span>{{ruleEvaluation.rule.name | titlecase}}</span>\n <span class=\"capsule inactive\" *ngIf=\"ruleEvaluation.cached\">Cached</span>\n <span class=\"capsule\">({{ruleEvaluation.duration | number: executionDurationFormat}}ms)</span>\n </div>\n <div>\n <ng-container [ngTemplateOutlet]=\"triggers\"\n [ngTemplateOutletContext]=\"{triggers: (ruleEvaluation.triggers[ruleEvaluation.rule.id])}\"></ng-container>\n <o3r-rule-actions-pres\n [actions]=\"ruleEvaluation.outputActions\"\n [temporaryFacts]=\"ruleEvaluation.temporaryFacts\"\n [runtimeOutputs]=\"execution.rulesetInformation?.rules[index]?.outputRuntimeFacts\">\n </o3r-rule-actions-pres>\n </div>\n </li>\n </ul>\n </ng-template>\n </div>\n </li>\n </ul>\n</section>\n\n<ng-template let-triggers=\"triggers\" #triggers>\n <div class=\"ruleset-panel-category-title\">Basefacts Triggers</div>\n <ul class=\"ruleset-panel-category-body triggers\">\n <ng-container *ngFor=\"let trigger of (triggers | keyvalue)\">\n <li *ngIf=\"trigger.value?.factName\">\n <o3r-rule-key-value-pres\n [key]=\"trigger.value.factName\"\n [oldValue]=\"trigger.value.oldValue | fallbackTo\"\n [value]=\"trigger.value.newValue | fallbackTo\"\n [type]=\"'state'\"></o3r-rule-key-value-pres>\n </li>\n </ng-container>\n </ul>\n</ng-template>\n\n<ng-template let-rules=\"rules\" let-expansionID=\"expansionID\" #rules>\n <div class=\"ruleset-panel-category-title ruleset-expansion-action\"\n (click)=\"toggleExpansion(expansionID, 'rulesOverview')\">\n <span>Rules Overview</span>\n <button class=\"icon\"\n [class.icon-caret-down]=\"!expansionStatus[expansionID]?.rulesOverview\"\n [class.icon-caret-up]=\"expansionStatus[expansionID]?.rulesOverview\">\n </button>\n </div>\n <ng-container *ngIf=\"expansionStatus[expansionID]?.rulesOverview\">\n <div *ngIf=\"rules?.length === 0\" class=\"ruleset-panel-category-body empty\">No rule</div>\n <ul class=\"ruleset-panel-category-body\" *ngIf=\"rules?.length > 0\">\n <li *ngFor=\"let rule of rules\">\n <o3r-rule-tree-pres [name]=\"rule.name\"\n [condition]=\"rule?.rootElement?.condition\"\n [blockType]=\"rule?.rootElement?.blockType\"\n [successElements]=\"rule?.rootElement?.successElements\"\n [failureElements]=\"rule?.rootElement?.failureElements\">\n </o3r-rule-tree-pres>\n </li>\n </ul>\n </ng-container>\n</ng-template>\n\n<ng-template let-inputs=\"inputs\" let-runtimeInputs=\"runtimeInputs\" #inputs>\n <div class=\"ruleset-panel-category-title\">Inputs snapshot</div>\n <div *ngIf=\"inputs?.length === 0\" class=\"ruleset-panel-category-body empty\">No inputs</div>\n <ul class=\"ruleset-panel-category-body\" *ngIf=\"inputs?.length > 0\">\n <li *ngFor=\"let input of inputs\">\n <o3r-rule-key-value-pres\n [key]=\"input.factName\"\n [value]=\"input.value | fallbackTo\"\n [type]=\"'state'\"></o3r-rule-key-value-pres>\n </li>\n <li *ngFor=\"let input of runtimeInputs\">{{input}} (scope limited to ruleset)</li>\n </ul>\n</ng-template>\n", styles: ["o3r-ruleset-history-pres .ruleset-panel-title,o3r-ruleset-history-pres .ruleset-panel-category-title{display:flex;justify-content:space-between;align-items:center}o3r-ruleset-history-pres .ruleset-panel-title{font-size:1rem;padding:.5rem 0 .1rem}o3r-ruleset-history-pres .ruleset-expansion-action,o3r-ruleset-history-pres .icon-caret-down,o3r-ruleset-history-pres .icon-caret-up{cursor:pointer}o3r-ruleset-history-pres .ruleset-panel-subtitle{font-size:.75rem}o3r-ruleset-history-pres .ruleset-panel-title-aside{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;min-width:-moz-fit-content;min-width:fit-content}o3r-ruleset-history-pres .ruleset-panel-category-title{font-size:.95rem;background:#eeeeee;padding:.5rem;margin-bottom:.5rem;margin-top:1rem}o3r-ruleset-history-pres .rule-description .ruleset-panel-category-title{font-size:.893rem;cursor:default}o3r-ruleset-history-pres .rule-description .ruleset-panel-title{font-size:.94rem}o3r-ruleset-history-pres .rule-description .ruleset-panel-category-body{padding-bottom:.5rem;padding-left:1.5rem}o3r-ruleset-history-pres .rule-description .ruleset-panel-category-body:empty{margin:0;padding:0 0 0 1.5rem}o3r-ruleset-history-pres .rulesets{margin:0;padding:0;list-style:none}o3r-ruleset-history-pres .rulesets ul{margin:0;padding-left:2rem}o3r-ruleset-history-pres .rulesets li.ruleset:nth-child(odd){background:#fbfbfb}o3r-ruleset-history-pres .ruleset-panel-category-body li{list-style:disc}o3r-ruleset-history-pres li:empty{display:none}o3r-ruleset-history-pres .ruleset{border-bottom:1px solid #dddddd}o3r-ruleset-history-pres .ruleset .ruleset-panel-description{padding:0 1rem 0 2rem;margin-bottom:2em}o3r-ruleset-history-pres .ruleset:first-child{border-top:1px solid #dddddd}o3r-ruleset-history-pres .ruleset-panel-title.ruleset-expansion-action{padding:.5rem 1rem}o3r-ruleset-history-pres .empty{font-style:italic;padding-left:1.5rem}o3r-ruleset-history-pres .ruleset-panel-category-body:empty.triggers:after{content:\"No trigger for this rule\";display:block;font-style:italic;padding-bottom:.5rem}o3r-ruleset-history-pres .ruleset-panel-title-aside{padding-left:1rem}o3r-ruleset-history-pres .rule-description .capsule{font-size:.8em;padding:.1rem .5rem;margin:0 .5rem}o3r-ruleset-history-pres .icon{background:none;border:none;font-size:1em}o3r-ruleset-history-pres .capsule{padding:.3rem;margin:.5rem;font-size:.875em;min-width:6rem;text-align:center}o3r-ruleset-history-pres .capsule.time{display:flex;flex-direction:column}o3r-ruleset-history-pres .success{background-color:#16aa32;color:#fff}o3r-ruleset-history-pres .inactive{background-color:#aaa;color:#fff}o3r-ruleset-history-pres .error{color:#c02020}o3r-ruleset-history-pres .error .capsule.error{background-color:#c02020;color:#fff}o3r-ruleset-history-pres .warn{background-color:#b92;color:#fff}o3r-ruleset-history-pres .input-key{color:#26c}o3r-ruleset-history-pres .input-value{color:#c29}o3r-ruleset-history-pres .input-key,o3r-ruleset-history-pres .input-value{font-family:monospace}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: RuleTreePresComponent, selector: "o3r-rule-tree-pres", inputs: ["name", "blockType", "condition", "successElements", "failureElements"] }, { kind: "component", type: RuleActionsPresComponent, selector: "o3r-rule-actions-pres", inputs: ["actions", "temporaryFacts", "runtimeOutputs"] }, { kind: "component", type: RuleKeyValuePresComponent, selector: "o3r-rule-key-value-pres", inputs: ["key", "value", "oldValue", "type"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1.TitleCasePipe, name: "titlecase" }, { kind: "pipe", type: i1.DatePipe, name: "date" }, { kind: "pipe", type: i1.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: FallbackToPipe, name: "fallbackTo" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
275
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesetHistoryPresComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
276
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: RulesetHistoryPresComponent, selector: "o3r-ruleset-history-pres", inputs: { rulesetExecutions: "rulesetExecutions", executionDurationFormat: "executionDurationFormat" }, ngImport: i0, template: "<section>\n <h4 class=\"mb-4\">Ruleset Execution History</h4>\n <ng-template #noRulesEngine>\n <div class=\"alert alert-danger m-2\" role=\"alert\">\n The Rules Engine is not configured on this page.\n </div>\n </ng-template>\n <ul *ngIf=\"rulesetExecutions; else noRulesEngine\" class=\"rulesets\">\n <li *ngFor=\"let execution of rulesetExecutions\" class=\"ruleset\">\n <div class=\"ruleset-panel-title ruleset-expansion-action\"\n [class.error]=\"execution.type === 'RulesetExecutionError'\"\n (click)=\"toggleExpansion(execution.executionId, 'ruleset')\">\n <div><span [title]=\"'This ruleset has been evaluated ' + execution.executionCounter + ' time(s)'\">{{execution.executionCounter}}</span> - {{execution.rulesetName | titlecase }}\n <div class=\"ruleset-panel-subtitle\" *ngIf=\"execution.rulesetInformation?.linkedComponent as linkedComponent\">\n {{linkedComponent.name}} {{linkedComponent.library}}\n </div>\n <div class=\"ruleset-panel-subtitle\" *ngIf=\"execution.rulesetInformation?.validityRange as validityRange\">\n Date range: {{validityRange.from}} - {{validityRange.to}}\n </div>\n </div>\n <div class=\"ruleset-panel-title-aside\">\n <span class=\"error capsule\" *ngIf=\"execution.status === 'Error'\">Error</span>\n <span class=\"success capsule\" *ngIf=\"execution.status === 'Active'\">Applied</span>\n <span class=\"inactive capsule\" *ngIf=\"execution.status === 'Deactivated'\">Deactivated</span>\n <span class=\"warn capsule\" *ngIf=\"execution.status === 'NoEffect'\">No effect</span>\n <span class=\"time capsule\">\n <span>{{execution.timestamp | date: 'HH:mm:ss SSS'}}</span>\n <span>({{execution.duration | number: executionDurationFormat}}ms)</span>\n </span>\n <button\n class=\"icon\"\n [class.icon-caret-down]=\"!expansionStatus[execution.executionId]?.ruleset\"\n [class.icon-caret-up]=\"expansionStatus[execution.executionId]?.ruleset\">\n </button>\n </div>\n </div>\n <div class=\"ruleset-panel-description\" *ngIf=\"expansionStatus[execution.executionId]?.ruleset\">\n <ng-container [ngTemplateOutlet]=\"rules\"\n [ngTemplateOutletContext]=\"{\n rules: execution.rulesetInformation.rules,\n expansionID: execution.executionId\n }\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"inputs\"\n [ngTemplateOutletContext]=\"{\n inputs: execution.inputFacts\n }\"></ng-container>\n <ng-container *ngIf=\"execution.type === 'RulesetExecutionError'; else success\">\n <div class=\"ruleset-panel-category-title\">Rules:</div>\n <ul class=\"ruleset-panel-category-body rule-description\">\n <li *ngFor=\"let ruleEvaluation of execution.rulesEvaluations; let index=index;\">\n <ng-container>\n <div class=\"ruleset-panel-title\" [class.error]=\"ruleEvaluation.error\">\n <span>{{ruleEvaluation.rule.name | titlecase}} </span>\n <span class=\"capsule error\" *ngIf=\"ruleEvaluation.error\">Error</span>\n </div>\n <div>\n <ng-container *ngIf=\"ruleEvaluation.error\">\n <span class=\"ruleset-panel-category-title\">Error:</span>\n <span class=\"ruleset-panel-category-body error\">{{ruleEvaluation.error.message}}</span>\n </ng-container>\n <ng-container [ngTemplateOutlet]=\"inputs\"\n [ngTemplateOutletContext]=\"{\n inputs: execution.inputFacts,\n runtimeInputs: execution.rulesetInformation?.rules[index]?.inputRuntimeFacts\n }\"></ng-container>\n <o3r-rule-actions-pres *ngIf=\"!ruleEvaluation.error\"\n [temporaryFacts]=\"ruleEvaluation.temporaryFacts\"\n [runtimeOutputs]=\"execution.rulesetInformation?.rules[index]?.outputRuntimeFacts\"\n ></o3r-rule-actions-pres>\n </div>\n </ng-container>\n </li>\n </ul>\n </ng-container>\n <ng-template #success>\n <o3r-rule-actions-pres [actions]=\"execution.outputActions\"></o3r-rule-actions-pres>\n <div class=\"ruleset-panel-category-title\">Executed Rules</div>\n <ul class=\"rule-description ruleset-panel-category-body\">\n <li *ngFor=\"let ruleEvaluation of execution.rulesEvaluations; let index=index;\">\n <div class=\"ruleset-panel-title\">\n <span>{{ruleEvaluation.rule.name | titlecase}}</span>\n <span class=\"capsule inactive\" *ngIf=\"ruleEvaluation.cached\">Cached</span>\n <span class=\"capsule\">({{ruleEvaluation.duration | number: executionDurationFormat}}ms)</span>\n </div>\n <div>\n <ng-container [ngTemplateOutlet]=\"triggers\"\n [ngTemplateOutletContext]=\"{triggers: (ruleEvaluation.triggers[ruleEvaluation.rule.id])}\"></ng-container>\n <o3r-rule-actions-pres\n [actions]=\"ruleEvaluation.outputActions\"\n [temporaryFacts]=\"ruleEvaluation.temporaryFacts\"\n [runtimeOutputs]=\"execution.rulesetInformation?.rules[index]?.outputRuntimeFacts\">\n </o3r-rule-actions-pres>\n </div>\n </li>\n </ul>\n </ng-template>\n </div>\n </li>\n </ul>\n</section>\n\n<ng-template let-triggers=\"triggers\" #triggers>\n <div class=\"ruleset-panel-category-title\">Basefacts Triggers</div>\n <ul class=\"ruleset-panel-category-body triggers\">\n <ng-container *ngFor=\"let trigger of (triggers | keyvalue)\">\n <li *ngIf=\"trigger.value?.factName\">\n <o3r-rule-key-value-pres\n [key]=\"trigger.value.factName\"\n [oldValue]=\"trigger.value.oldValue | fallbackTo\"\n [value]=\"trigger.value.newValue | fallbackTo\"\n [type]=\"'state'\"></o3r-rule-key-value-pres>\n </li>\n </ng-container>\n </ul>\n</ng-template>\n\n<ng-template let-rules=\"rules\" let-expansionID=\"expansionID\" #rules>\n <div class=\"ruleset-panel-category-title ruleset-expansion-action\"\n (click)=\"toggleExpansion(expansionID, 'rulesOverview')\">\n <span>Rules Overview</span>\n <button class=\"icon\"\n [class.icon-caret-down]=\"!expansionStatus[expansionID]?.rulesOverview\"\n [class.icon-caret-up]=\"expansionStatus[expansionID]?.rulesOverview\">\n </button>\n </div>\n <ng-container *ngIf=\"expansionStatus[expansionID]?.rulesOverview\">\n <div *ngIf=\"rules?.length === 0\" class=\"ruleset-panel-category-body empty\">No rule</div>\n <ul class=\"ruleset-panel-category-body\" *ngIf=\"rules?.length > 0\">\n <li *ngFor=\"let rule of rules\">\n <o3r-rule-tree-pres [name]=\"rule.name\"\n [condition]=\"rule?.rootElement?.condition\"\n [blockType]=\"rule?.rootElement?.blockType\"\n [successElements]=\"rule?.rootElement?.successElements\"\n [failureElements]=\"rule?.rootElement?.failureElements\">\n </o3r-rule-tree-pres>\n </li>\n </ul>\n </ng-container>\n</ng-template>\n\n<ng-template let-inputs=\"inputs\" let-runtimeInputs=\"runtimeInputs\" #inputs>\n <div class=\"ruleset-panel-category-title\">Inputs snapshot</div>\n <div *ngIf=\"inputs?.length === 0\" class=\"ruleset-panel-category-body empty\">No inputs</div>\n <ul class=\"ruleset-panel-category-body\" *ngIf=\"inputs?.length > 0\">\n <li *ngFor=\"let input of inputs\">\n <o3r-rule-key-value-pres\n [key]=\"input.factName\"\n [value]=\"input.value | fallbackTo\"\n [type]=\"'state'\"></o3r-rule-key-value-pres>\n </li>\n <li *ngFor=\"let input of runtimeInputs\">{{input}} (scope limited to ruleset)</li>\n </ul>\n</ng-template>\n", styles: ["o3r-ruleset-history-pres .ruleset-panel-title,o3r-ruleset-history-pres .ruleset-panel-category-title{display:flex;justify-content:space-between;align-items:center}o3r-ruleset-history-pres .ruleset-panel-title{font-size:1rem;padding:.5rem 0 .1rem}o3r-ruleset-history-pres .ruleset-expansion-action,o3r-ruleset-history-pres .icon-caret-down,o3r-ruleset-history-pres .icon-caret-up{cursor:pointer}o3r-ruleset-history-pres .ruleset-panel-subtitle{font-size:.75rem}o3r-ruleset-history-pres .ruleset-panel-title-aside{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;min-width:-moz-fit-content;min-width:fit-content}o3r-ruleset-history-pres .ruleset-panel-category-title{font-size:.95rem;background:#eee;padding:.5rem;margin-bottom:.5rem;margin-top:1rem}o3r-ruleset-history-pres .rule-description .ruleset-panel-category-title{font-size:.893rem;cursor:default}o3r-ruleset-history-pres .rule-description .ruleset-panel-title{font-size:.94rem}o3r-ruleset-history-pres .rule-description .ruleset-panel-category-body{padding-bottom:.5rem;padding-left:1.5rem}o3r-ruleset-history-pres .rule-description .ruleset-panel-category-body:empty{margin:0;padding:0 0 0 1.5rem}o3r-ruleset-history-pres .rulesets{margin:0;padding:0;list-style:none}o3r-ruleset-history-pres .rulesets ul{margin:0;padding-left:2rem}o3r-ruleset-history-pres .rulesets li.ruleset:nth-child(odd){background:#fbfbfb}o3r-ruleset-history-pres .ruleset-panel-category-body li{list-style:disc}o3r-ruleset-history-pres li:empty{display:none}o3r-ruleset-history-pres .ruleset{border-bottom:1px solid #dddddd}o3r-ruleset-history-pres .ruleset .ruleset-panel-description{padding:0 1rem 0 2rem;margin-bottom:2em}o3r-ruleset-history-pres .ruleset:first-child{border-top:1px solid #dddddd}o3r-ruleset-history-pres .ruleset-panel-title.ruleset-expansion-action{padding:.5rem 1rem}o3r-ruleset-history-pres .empty{font-style:italic;padding-left:1.5rem}o3r-ruleset-history-pres .ruleset-panel-category-body:empty.triggers:after{content:\"No trigger for this rule\";display:block;font-style:italic;padding-bottom:.5rem}o3r-ruleset-history-pres .ruleset-panel-title-aside{padding-left:1rem}o3r-ruleset-history-pres .rule-description .capsule{font-size:.8em;padding:.1rem .5rem;margin:0 .5rem}o3r-ruleset-history-pres .icon{background:none;border:none;font-size:1em}o3r-ruleset-history-pres .capsule{padding:.3rem;margin:.5rem;font-size:.875em;min-width:6rem;text-align:center}o3r-ruleset-history-pres .capsule.time{display:flex;flex-direction:column}o3r-ruleset-history-pres .success{background-color:#16aa32;color:#fff}o3r-ruleset-history-pres .inactive{background-color:#aaa;color:#fff}o3r-ruleset-history-pres .error{color:#c02020}o3r-ruleset-history-pres .error .capsule.error{background-color:#c02020;color:#fff}o3r-ruleset-history-pres .warn{background-color:#b92;color:#fff}o3r-ruleset-history-pres .input-key{color:#26c}o3r-ruleset-history-pres .input-value{color:#c29}o3r-ruleset-history-pres .input-key,o3r-ruleset-history-pres .input-value{font-family:monospace}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: RuleTreePresComponent, selector: "o3r-rule-tree-pres", inputs: ["name", "blockType", "condition", "successElements", "failureElements"] }, { kind: "component", type: RuleActionsPresComponent, selector: "o3r-rule-actions-pres", inputs: ["actions", "temporaryFacts", "runtimeOutputs"] }, { kind: "component", type: RuleKeyValuePresComponent, selector: "o3r-rule-key-value-pres", inputs: ["key", "value", "oldValue", "type"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1.TitleCasePipe, name: "titlecase" }, { kind: "pipe", type: i1.DatePipe, name: "date" }, { kind: "pipe", type: i1.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: FallbackToPipe, name: "fallbackTo" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
294
277
  }
295
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesetHistoryPresComponent, decorators: [{
278
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesetHistoryPresComponent, decorators: [{
296
279
  type: Component,
297
- args: [{ selector: 'o3r-ruleset-history-pres', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<section>\n <h4 class=\"mb-4\">Ruleset Execution History</h4>\n <ng-template #noRulesEngine>\n <div class=\"alert alert-danger m-2\" role=\"alert\">\n The Rules Engine is not configured on this page.\n </div>\n </ng-template>\n <ul *ngIf=\"rulesetExecutions; else noRulesEngine\" class=\"rulesets\">\n <li *ngFor=\"let execution of rulesetExecutions\" class=\"ruleset\">\n <div class=\"ruleset-panel-title ruleset-expansion-action\"\n [class.error]=\"execution.type === 'RulesetExecutionError'\"\n (click)=\"toggleExpansion(execution.executionId, 'ruleset')\">\n <div><span [title]=\"'This ruleset has been evaluated ' + execution.executionCounter + ' time(s)'\">{{execution.executionCounter}}</span> - {{execution.rulesetName | titlecase }}\n <div class=\"ruleset-panel-subtitle\" *ngIf=\"execution.rulesetInformation?.linkedComponent as linkedComponent\">\n {{linkedComponent.name}} {{linkedComponent.library}}\n </div>\n <div class=\"ruleset-panel-subtitle\" *ngIf=\"execution.rulesetInformation?.validityRange as validityRange\">\n Date range: {{validityRange.from}} - {{validityRange.to}}\n </div>\n </div>\n <div class=\"ruleset-panel-title-aside\">\n <span class=\"error capsule\" *ngIf=\"execution.status === 'Error'\">Error</span>\n <span class=\"success capsule\" *ngIf=\"execution.status === 'Active'\">Applied</span>\n <span class=\"inactive capsule\" *ngIf=\"execution.status === 'Deactivated'\">Deactivated</span>\n <span class=\"warn capsule\" *ngIf=\"execution.status === 'NoEffect'\">No effect</span>\n <span class=\"time capsule\">\n <span>{{execution.timestamp | date: 'HH:mm:ss SSS'}}</span>\n <span>({{execution.duration | number: executionDurationFormat}}ms)</span>\n </span>\n <button\n class=\"icon\"\n [class.icon-caret-down]=\"!expansionStatus[execution.executionId]?.ruleset\"\n [class.icon-caret-up]=\"expansionStatus[execution.executionId]?.ruleset\">\n </button>\n </div>\n </div>\n <div class=\"ruleset-panel-description\" *ngIf=\"expansionStatus[execution.executionId]?.ruleset\">\n <ng-container [ngTemplateOutlet]=\"rules\"\n [ngTemplateOutletContext]=\"{\n rules: execution.rulesetInformation.rules,\n expansionID: execution.executionId\n }\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"inputs\"\n [ngTemplateOutletContext]=\"{\n inputs: execution.inputFacts\n }\"></ng-container>\n <ng-container *ngIf=\"execution.type === 'RulesetExecutionError'; else success\">\n <div class=\"ruleset-panel-category-title\">Rules:</div>\n <ul class=\"ruleset-panel-category-body rule-description\">\n <li *ngFor=\"let ruleEvaluation of execution.rulesEvaluations; let index=index;\">\n <ng-container>\n <div class=\"ruleset-panel-title\" [class.error]=\"ruleEvaluation.error\">\n <span>{{ruleEvaluation.rule.name | titlecase}} </span>\n <span class=\"capsule error\" *ngIf=\"ruleEvaluation.error\">Error</span>\n </div>\n <div>\n <ng-container *ngIf=\"ruleEvaluation.error\">\n <span class=\"ruleset-panel-category-title\">Error:</span>\n <span class=\"ruleset-panel-category-body error\">{{ruleEvaluation.error.message}}</span>\n </ng-container>\n <ng-container [ngTemplateOutlet]=\"inputs\"\n [ngTemplateOutletContext]=\"{\n inputs: execution.inputFacts,\n runtimeInputs: execution.rulesetInformation?.rules[index]?.inputRuntimeFacts\n }\"></ng-container>\n <o3r-rule-actions-pres *ngIf=\"!ruleEvaluation.error\"\n [temporaryFacts]=\"ruleEvaluation.temporaryFacts\"\n [runtimeOutputs]=\"execution.rulesetInformation?.rules[index]?.outputRuntimeFacts\"\n ></o3r-rule-actions-pres>\n </div>\n </ng-container>\n </li>\n </ul>\n </ng-container>\n <ng-template #success>\n <o3r-rule-actions-pres [actions]=\"execution.outputActions\"></o3r-rule-actions-pres>\n <div class=\"ruleset-panel-category-title\">Executed Rules</div>\n <ul class=\"rule-description ruleset-panel-category-body\">\n <li *ngFor=\"let ruleEvaluation of execution.rulesEvaluations; let index=index;\">\n <div class=\"ruleset-panel-title\">\n <span>{{ruleEvaluation.rule.name | titlecase}}</span>\n <span class=\"capsule inactive\" *ngIf=\"ruleEvaluation.cached\">Cached</span>\n <span class=\"capsule\">({{ruleEvaluation.duration | number: executionDurationFormat}}ms)</span>\n </div>\n <div>\n <ng-container [ngTemplateOutlet]=\"triggers\"\n [ngTemplateOutletContext]=\"{triggers: (ruleEvaluation.triggers[ruleEvaluation.rule.id])}\"></ng-container>\n <o3r-rule-actions-pres\n [actions]=\"ruleEvaluation.outputActions\"\n [temporaryFacts]=\"ruleEvaluation.temporaryFacts\"\n [runtimeOutputs]=\"execution.rulesetInformation?.rules[index]?.outputRuntimeFacts\">\n </o3r-rule-actions-pres>\n </div>\n </li>\n </ul>\n </ng-template>\n </div>\n </li>\n </ul>\n</section>\n\n<ng-template let-triggers=\"triggers\" #triggers>\n <div class=\"ruleset-panel-category-title\">Basefacts Triggers</div>\n <ul class=\"ruleset-panel-category-body triggers\">\n <ng-container *ngFor=\"let trigger of (triggers | keyvalue)\">\n <li *ngIf=\"trigger.value?.factName\">\n <o3r-rule-key-value-pres\n [key]=\"trigger.value.factName\"\n [oldValue]=\"trigger.value.oldValue | fallbackTo\"\n [value]=\"trigger.value.newValue | fallbackTo\"\n [type]=\"'state'\"></o3r-rule-key-value-pres>\n </li>\n </ng-container>\n </ul>\n</ng-template>\n\n<ng-template let-rules=\"rules\" let-expansionID=\"expansionID\" #rules>\n <div class=\"ruleset-panel-category-title ruleset-expansion-action\"\n (click)=\"toggleExpansion(expansionID, 'rulesOverview')\">\n <span>Rules Overview</span>\n <button class=\"icon\"\n [class.icon-caret-down]=\"!expansionStatus[expansionID]?.rulesOverview\"\n [class.icon-caret-up]=\"expansionStatus[expansionID]?.rulesOverview\">\n </button>\n </div>\n <ng-container *ngIf=\"expansionStatus[expansionID]?.rulesOverview\">\n <div *ngIf=\"rules?.length === 0\" class=\"ruleset-panel-category-body empty\">No rule</div>\n <ul class=\"ruleset-panel-category-body\" *ngIf=\"rules?.length > 0\">\n <li *ngFor=\"let rule of rules\">\n <o3r-rule-tree-pres [name]=\"rule.name\"\n [condition]=\"rule?.rootElement?.condition\"\n [blockType]=\"rule?.rootElement?.blockType\"\n [successElements]=\"rule?.rootElement?.successElements\"\n [failureElements]=\"rule?.rootElement?.failureElements\">\n </o3r-rule-tree-pres>\n </li>\n </ul>\n </ng-container>\n</ng-template>\n\n<ng-template let-inputs=\"inputs\" let-runtimeInputs=\"runtimeInputs\" #inputs>\n <div class=\"ruleset-panel-category-title\">Inputs snapshot</div>\n <div *ngIf=\"inputs?.length === 0\" class=\"ruleset-panel-category-body empty\">No inputs</div>\n <ul class=\"ruleset-panel-category-body\" *ngIf=\"inputs?.length > 0\">\n <li *ngFor=\"let input of inputs\">\n <o3r-rule-key-value-pres\n [key]=\"input.factName\"\n [value]=\"input.value | fallbackTo\"\n [type]=\"'state'\"></o3r-rule-key-value-pres>\n </li>\n <li *ngFor=\"let input of runtimeInputs\">{{input}} (scope limited to ruleset)</li>\n </ul>\n</ng-template>\n", styles: ["o3r-ruleset-history-pres .ruleset-panel-title,o3r-ruleset-history-pres .ruleset-panel-category-title{display:flex;justify-content:space-between;align-items:center}o3r-ruleset-history-pres .ruleset-panel-title{font-size:1rem;padding:.5rem 0 .1rem}o3r-ruleset-history-pres .ruleset-expansion-action,o3r-ruleset-history-pres .icon-caret-down,o3r-ruleset-history-pres .icon-caret-up{cursor:pointer}o3r-ruleset-history-pres .ruleset-panel-subtitle{font-size:.75rem}o3r-ruleset-history-pres .ruleset-panel-title-aside{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;min-width:-moz-fit-content;min-width:fit-content}o3r-ruleset-history-pres .ruleset-panel-category-title{font-size:.95rem;background:#eeeeee;padding:.5rem;margin-bottom:.5rem;margin-top:1rem}o3r-ruleset-history-pres .rule-description .ruleset-panel-category-title{font-size:.893rem;cursor:default}o3r-ruleset-history-pres .rule-description .ruleset-panel-title{font-size:.94rem}o3r-ruleset-history-pres .rule-description .ruleset-panel-category-body{padding-bottom:.5rem;padding-left:1.5rem}o3r-ruleset-history-pres .rule-description .ruleset-panel-category-body:empty{margin:0;padding:0 0 0 1.5rem}o3r-ruleset-history-pres .rulesets{margin:0;padding:0;list-style:none}o3r-ruleset-history-pres .rulesets ul{margin:0;padding-left:2rem}o3r-ruleset-history-pres .rulesets li.ruleset:nth-child(odd){background:#fbfbfb}o3r-ruleset-history-pres .ruleset-panel-category-body li{list-style:disc}o3r-ruleset-history-pres li:empty{display:none}o3r-ruleset-history-pres .ruleset{border-bottom:1px solid #dddddd}o3r-ruleset-history-pres .ruleset .ruleset-panel-description{padding:0 1rem 0 2rem;margin-bottom:2em}o3r-ruleset-history-pres .ruleset:first-child{border-top:1px solid #dddddd}o3r-ruleset-history-pres .ruleset-panel-title.ruleset-expansion-action{padding:.5rem 1rem}o3r-ruleset-history-pres .empty{font-style:italic;padding-left:1.5rem}o3r-ruleset-history-pres .ruleset-panel-category-body:empty.triggers:after{content:\"No trigger for this rule\";display:block;font-style:italic;padding-bottom:.5rem}o3r-ruleset-history-pres .ruleset-panel-title-aside{padding-left:1rem}o3r-ruleset-history-pres .rule-description .capsule{font-size:.8em;padding:.1rem .5rem;margin:0 .5rem}o3r-ruleset-history-pres .icon{background:none;border:none;font-size:1em}o3r-ruleset-history-pres .capsule{padding:.3rem;margin:.5rem;font-size:.875em;min-width:6rem;text-align:center}o3r-ruleset-history-pres .capsule.time{display:flex;flex-direction:column}o3r-ruleset-history-pres .success{background-color:#16aa32;color:#fff}o3r-ruleset-history-pres .inactive{background-color:#aaa;color:#fff}o3r-ruleset-history-pres .error{color:#c02020}o3r-ruleset-history-pres .error .capsule.error{background-color:#c02020;color:#fff}o3r-ruleset-history-pres .warn{background-color:#b92;color:#fff}o3r-ruleset-history-pres .input-key{color:#26c}o3r-ruleset-history-pres .input-value{color:#c29}o3r-ruleset-history-pres .input-key,o3r-ruleset-history-pres .input-value{font-family:monospace}\n"] }]
298
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { rulesetExecutions: [{
280
+ args: [{ selector: 'o3r-ruleset-history-pres', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<section>\n <h4 class=\"mb-4\">Ruleset Execution History</h4>\n <ng-template #noRulesEngine>\n <div class=\"alert alert-danger m-2\" role=\"alert\">\n The Rules Engine is not configured on this page.\n </div>\n </ng-template>\n <ul *ngIf=\"rulesetExecutions; else noRulesEngine\" class=\"rulesets\">\n <li *ngFor=\"let execution of rulesetExecutions\" class=\"ruleset\">\n <div class=\"ruleset-panel-title ruleset-expansion-action\"\n [class.error]=\"execution.type === 'RulesetExecutionError'\"\n (click)=\"toggleExpansion(execution.executionId, 'ruleset')\">\n <div><span [title]=\"'This ruleset has been evaluated ' + execution.executionCounter + ' time(s)'\">{{execution.executionCounter}}</span> - {{execution.rulesetName | titlecase }}\n <div class=\"ruleset-panel-subtitle\" *ngIf=\"execution.rulesetInformation?.linkedComponent as linkedComponent\">\n {{linkedComponent.name}} {{linkedComponent.library}}\n </div>\n <div class=\"ruleset-panel-subtitle\" *ngIf=\"execution.rulesetInformation?.validityRange as validityRange\">\n Date range: {{validityRange.from}} - {{validityRange.to}}\n </div>\n </div>\n <div class=\"ruleset-panel-title-aside\">\n <span class=\"error capsule\" *ngIf=\"execution.status === 'Error'\">Error</span>\n <span class=\"success capsule\" *ngIf=\"execution.status === 'Active'\">Applied</span>\n <span class=\"inactive capsule\" *ngIf=\"execution.status === 'Deactivated'\">Deactivated</span>\n <span class=\"warn capsule\" *ngIf=\"execution.status === 'NoEffect'\">No effect</span>\n <span class=\"time capsule\">\n <span>{{execution.timestamp | date: 'HH:mm:ss SSS'}}</span>\n <span>({{execution.duration | number: executionDurationFormat}}ms)</span>\n </span>\n <button\n class=\"icon\"\n [class.icon-caret-down]=\"!expansionStatus[execution.executionId]?.ruleset\"\n [class.icon-caret-up]=\"expansionStatus[execution.executionId]?.ruleset\">\n </button>\n </div>\n </div>\n <div class=\"ruleset-panel-description\" *ngIf=\"expansionStatus[execution.executionId]?.ruleset\">\n <ng-container [ngTemplateOutlet]=\"rules\"\n [ngTemplateOutletContext]=\"{\n rules: execution.rulesetInformation.rules,\n expansionID: execution.executionId\n }\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"inputs\"\n [ngTemplateOutletContext]=\"{\n inputs: execution.inputFacts\n }\"></ng-container>\n <ng-container *ngIf=\"execution.type === 'RulesetExecutionError'; else success\">\n <div class=\"ruleset-panel-category-title\">Rules:</div>\n <ul class=\"ruleset-panel-category-body rule-description\">\n <li *ngFor=\"let ruleEvaluation of execution.rulesEvaluations; let index=index;\">\n <ng-container>\n <div class=\"ruleset-panel-title\" [class.error]=\"ruleEvaluation.error\">\n <span>{{ruleEvaluation.rule.name | titlecase}} </span>\n <span class=\"capsule error\" *ngIf=\"ruleEvaluation.error\">Error</span>\n </div>\n <div>\n <ng-container *ngIf=\"ruleEvaluation.error\">\n <span class=\"ruleset-panel-category-title\">Error:</span>\n <span class=\"ruleset-panel-category-body error\">{{ruleEvaluation.error.message}}</span>\n </ng-container>\n <ng-container [ngTemplateOutlet]=\"inputs\"\n [ngTemplateOutletContext]=\"{\n inputs: execution.inputFacts,\n runtimeInputs: execution.rulesetInformation?.rules[index]?.inputRuntimeFacts\n }\"></ng-container>\n <o3r-rule-actions-pres *ngIf=\"!ruleEvaluation.error\"\n [temporaryFacts]=\"ruleEvaluation.temporaryFacts\"\n [runtimeOutputs]=\"execution.rulesetInformation?.rules[index]?.outputRuntimeFacts\"\n ></o3r-rule-actions-pres>\n </div>\n </ng-container>\n </li>\n </ul>\n </ng-container>\n <ng-template #success>\n <o3r-rule-actions-pres [actions]=\"execution.outputActions\"></o3r-rule-actions-pres>\n <div class=\"ruleset-panel-category-title\">Executed Rules</div>\n <ul class=\"rule-description ruleset-panel-category-body\">\n <li *ngFor=\"let ruleEvaluation of execution.rulesEvaluations; let index=index;\">\n <div class=\"ruleset-panel-title\">\n <span>{{ruleEvaluation.rule.name | titlecase}}</span>\n <span class=\"capsule inactive\" *ngIf=\"ruleEvaluation.cached\">Cached</span>\n <span class=\"capsule\">({{ruleEvaluation.duration | number: executionDurationFormat}}ms)</span>\n </div>\n <div>\n <ng-container [ngTemplateOutlet]=\"triggers\"\n [ngTemplateOutletContext]=\"{triggers: (ruleEvaluation.triggers[ruleEvaluation.rule.id])}\"></ng-container>\n <o3r-rule-actions-pres\n [actions]=\"ruleEvaluation.outputActions\"\n [temporaryFacts]=\"ruleEvaluation.temporaryFacts\"\n [runtimeOutputs]=\"execution.rulesetInformation?.rules[index]?.outputRuntimeFacts\">\n </o3r-rule-actions-pres>\n </div>\n </li>\n </ul>\n </ng-template>\n </div>\n </li>\n </ul>\n</section>\n\n<ng-template let-triggers=\"triggers\" #triggers>\n <div class=\"ruleset-panel-category-title\">Basefacts Triggers</div>\n <ul class=\"ruleset-panel-category-body triggers\">\n <ng-container *ngFor=\"let trigger of (triggers | keyvalue)\">\n <li *ngIf=\"trigger.value?.factName\">\n <o3r-rule-key-value-pres\n [key]=\"trigger.value.factName\"\n [oldValue]=\"trigger.value.oldValue | fallbackTo\"\n [value]=\"trigger.value.newValue | fallbackTo\"\n [type]=\"'state'\"></o3r-rule-key-value-pres>\n </li>\n </ng-container>\n </ul>\n</ng-template>\n\n<ng-template let-rules=\"rules\" let-expansionID=\"expansionID\" #rules>\n <div class=\"ruleset-panel-category-title ruleset-expansion-action\"\n (click)=\"toggleExpansion(expansionID, 'rulesOverview')\">\n <span>Rules Overview</span>\n <button class=\"icon\"\n [class.icon-caret-down]=\"!expansionStatus[expansionID]?.rulesOverview\"\n [class.icon-caret-up]=\"expansionStatus[expansionID]?.rulesOverview\">\n </button>\n </div>\n <ng-container *ngIf=\"expansionStatus[expansionID]?.rulesOverview\">\n <div *ngIf=\"rules?.length === 0\" class=\"ruleset-panel-category-body empty\">No rule</div>\n <ul class=\"ruleset-panel-category-body\" *ngIf=\"rules?.length > 0\">\n <li *ngFor=\"let rule of rules\">\n <o3r-rule-tree-pres [name]=\"rule.name\"\n [condition]=\"rule?.rootElement?.condition\"\n [blockType]=\"rule?.rootElement?.blockType\"\n [successElements]=\"rule?.rootElement?.successElements\"\n [failureElements]=\"rule?.rootElement?.failureElements\">\n </o3r-rule-tree-pres>\n </li>\n </ul>\n </ng-container>\n</ng-template>\n\n<ng-template let-inputs=\"inputs\" let-runtimeInputs=\"runtimeInputs\" #inputs>\n <div class=\"ruleset-panel-category-title\">Inputs snapshot</div>\n <div *ngIf=\"inputs?.length === 0\" class=\"ruleset-panel-category-body empty\">No inputs</div>\n <ul class=\"ruleset-panel-category-body\" *ngIf=\"inputs?.length > 0\">\n <li *ngFor=\"let input of inputs\">\n <o3r-rule-key-value-pres\n [key]=\"input.factName\"\n [value]=\"input.value | fallbackTo\"\n [type]=\"'state'\"></o3r-rule-key-value-pres>\n </li>\n <li *ngFor=\"let input of runtimeInputs\">{{input}} (scope limited to ruleset)</li>\n </ul>\n</ng-template>\n", styles: ["o3r-ruleset-history-pres .ruleset-panel-title,o3r-ruleset-history-pres .ruleset-panel-category-title{display:flex;justify-content:space-between;align-items:center}o3r-ruleset-history-pres .ruleset-panel-title{font-size:1rem;padding:.5rem 0 .1rem}o3r-ruleset-history-pres .ruleset-expansion-action,o3r-ruleset-history-pres .icon-caret-down,o3r-ruleset-history-pres .icon-caret-up{cursor:pointer}o3r-ruleset-history-pres .ruleset-panel-subtitle{font-size:.75rem}o3r-ruleset-history-pres .ruleset-panel-title-aside{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;min-width:-moz-fit-content;min-width:fit-content}o3r-ruleset-history-pres .ruleset-panel-category-title{font-size:.95rem;background:#eee;padding:.5rem;margin-bottom:.5rem;margin-top:1rem}o3r-ruleset-history-pres .rule-description .ruleset-panel-category-title{font-size:.893rem;cursor:default}o3r-ruleset-history-pres .rule-description .ruleset-panel-title{font-size:.94rem}o3r-ruleset-history-pres .rule-description .ruleset-panel-category-body{padding-bottom:.5rem;padding-left:1.5rem}o3r-ruleset-history-pres .rule-description .ruleset-panel-category-body:empty{margin:0;padding:0 0 0 1.5rem}o3r-ruleset-history-pres .rulesets{margin:0;padding:0;list-style:none}o3r-ruleset-history-pres .rulesets ul{margin:0;padding-left:2rem}o3r-ruleset-history-pres .rulesets li.ruleset:nth-child(odd){background:#fbfbfb}o3r-ruleset-history-pres .ruleset-panel-category-body li{list-style:disc}o3r-ruleset-history-pres li:empty{display:none}o3r-ruleset-history-pres .ruleset{border-bottom:1px solid #dddddd}o3r-ruleset-history-pres .ruleset .ruleset-panel-description{padding:0 1rem 0 2rem;margin-bottom:2em}o3r-ruleset-history-pres .ruleset:first-child{border-top:1px solid #dddddd}o3r-ruleset-history-pres .ruleset-panel-title.ruleset-expansion-action{padding:.5rem 1rem}o3r-ruleset-history-pres .empty{font-style:italic;padding-left:1.5rem}o3r-ruleset-history-pres .ruleset-panel-category-body:empty.triggers:after{content:\"No trigger for this rule\";display:block;font-style:italic;padding-bottom:.5rem}o3r-ruleset-history-pres .ruleset-panel-title-aside{padding-left:1rem}o3r-ruleset-history-pres .rule-description .capsule{font-size:.8em;padding:.1rem .5rem;margin:0 .5rem}o3r-ruleset-history-pres .icon{background:none;border:none;font-size:1em}o3r-ruleset-history-pres .capsule{padding:.3rem;margin:.5rem;font-size:.875em;min-width:6rem;text-align:center}o3r-ruleset-history-pres .capsule.time{display:flex;flex-direction:column}o3r-ruleset-history-pres .success{background-color:#16aa32;color:#fff}o3r-ruleset-history-pres .inactive{background-color:#aaa;color:#fff}o3r-ruleset-history-pres .error{color:#c02020}o3r-ruleset-history-pres .error .capsule.error{background-color:#c02020;color:#fff}o3r-ruleset-history-pres .warn{background-color:#b92;color:#fff}o3r-ruleset-history-pres .input-key{color:#26c}o3r-ruleset-history-pres .input-value{color:#c29}o3r-ruleset-history-pres .input-key,o3r-ruleset-history-pres .input-value{font-family:monospace}\n"] }]
281
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { rulesetExecutions: [{
299
282
  type: Input
300
283
  }], executionDurationFormat: [{
301
284
  type: Input
302
285
  }] } });
303
286
 
304
287
  class RulesetHistoryPresModule {
305
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesetHistoryPresModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
306
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.0", ngImport: i0, type: RulesetHistoryPresModule, declarations: [FallbackToPipe, RulesetHistoryPresComponent, RuleConditionPresComponent, RuleTreePresComponent, RuleActionsPresComponent, RuleKeyValuePresComponent], imports: [CommonModule, CommonModule, CommonModule], exports: [RulesetHistoryPresComponent] }); }
307
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesetHistoryPresModule, imports: [CommonModule, CommonModule, CommonModule] }); }
288
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesetHistoryPresModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
289
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: RulesetHistoryPresModule, declarations: [FallbackToPipe, RulesetHistoryPresComponent, RuleConditionPresComponent, RuleTreePresComponent, RuleActionsPresComponent, RuleKeyValuePresComponent], imports: [CommonModule, CommonModule, CommonModule], exports: [RulesetHistoryPresComponent] }); }
290
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesetHistoryPresModule, imports: [CommonModule, CommonModule, CommonModule] }); }
308
291
  }
309
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesetHistoryPresModule, decorators: [{
292
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesetHistoryPresModule, decorators: [{
310
293
  type: NgModule,
311
294
  args: [{
312
295
  imports: [CommonModule, CommonModule, CommonModule],
@@ -376,12 +359,12 @@ class RulesetsEffect {
376
359
  */
377
360
  this.upsertEntitiesFromApi$ = createEffect(() => this.actions$.pipe(ofType(upsertRulesetsEntitiesFromApi), mergeMap((payload) => from(payload.call).pipe(map((reply) => upsertRulesetsEntities({ entities: reply, requestId: payload.requestId })), catchError((err) => of(failRulesetsEntities({ error: err, requestId: payload.requestId })))))));
378
361
  }
379
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesetsEffect, deps: [{ token: i1$1.Actions }], target: i0.ɵɵFactoryTarget.Injectable }); }
380
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesetsEffect }); }
362
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesetsEffect, deps: [{ token: i1$1.Actions }], target: i0.ɵɵFactoryTarget.Injectable }); }
363
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesetsEffect }); }
381
364
  }
382
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesetsEffect, decorators: [{
365
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesetsEffect, decorators: [{
383
366
  type: Injectable
384
- }], ctorParameters: function () { return [{ type: i1$1.Actions }]; } });
367
+ }], ctorParameters: () => [{ type: i1$1.Actions }] });
385
368
 
386
369
  /**
387
370
  * Rulesets Store adapter
@@ -434,13 +417,13 @@ class RulesetsStoreModule {
434
417
  ]
435
418
  };
436
419
  }
437
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesetsStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
438
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.0", ngImport: i0, type: RulesetsStoreModule, imports: [i1$2.StoreFeatureModule, i1$1.EffectsFeatureModule] }); }
439
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesetsStoreModule, providers: [
420
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesetsStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
421
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: RulesetsStoreModule, imports: [i1$2.StoreFeatureModule, i1$1.EffectsFeatureModule] }); }
422
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesetsStoreModule, providers: [
440
423
  { provide: RULESETS_REDUCER_TOKEN, useFactory: getDefaultRulesetsReducer }
441
424
  ], imports: [StoreModule.forFeature(RULESETS_STORE_NAME, RULESETS_REDUCER_TOKEN), EffectsModule.forFeature([RulesetsEffect])] }); }
442
425
  }
443
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesetsStoreModule, decorators: [{
426
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesetsStoreModule, decorators: [{
444
427
  type: NgModule,
445
428
  args: [{
446
429
  imports: [
@@ -467,7 +450,6 @@ const selectRulesetsTotal = createSelector(selectRulesetsState, selectTotal);
467
450
  const selectRulesetsStorePendingStatus = createSelector(selectRulesetsState, (state) => state.isPending || false);
468
451
  /**
469
452
  * Check if the given value is a valid date
470
- *
471
453
  * @param d
472
454
  */
473
455
  const isValidDate$1 = (d) => !isNaN(d) && d instanceof Date;
@@ -506,7 +488,7 @@ const selectRuleSetLinkComponents = createSelector(selectAllRulesets, (ruleSets)
506
488
  if (!ruleSet.linkedComponent) {
507
489
  return acc;
508
490
  }
509
- const configName = computeConfigurationName(ruleSet.linkedComponent.name, ruleSet.linkedComponent.library);
491
+ const configName = computeItemIdentifier(ruleSet.linkedComponent.name, ruleSet.linkedComponent.library);
510
492
  acc[configName] ||= [];
511
493
  acc[configName].push(ruleSet.id);
512
494
  return acc;
@@ -532,7 +514,6 @@ const rulesetsStorageSync = {
532
514
 
533
515
  /**
534
516
  * Function to retrive from 2 sequential executions only the triggers which activated the last ruleset execution
535
- *
536
517
  * @param currRes Current ruleset execution object
537
518
  * @param prevRes Previous ruleset execution object
538
519
  * @returns The triggers list which activates the last ruleset execution
@@ -571,7 +552,6 @@ function retrieveRulesetTriggers(currRes, prevRes) {
571
552
  }
572
553
  /**
573
554
  * Flag as cached the rules evaluations which are from previous ruleset executions
574
- *
575
555
  * @param rulesEvaluations all rules evaluations list
576
556
  * @param triggers Ruleset triggers object
577
557
  * @returns Rules evaluation list with flagged rules evaluation from previous ruleset executions
@@ -587,7 +567,6 @@ function flagCachedRules(rulesEvaluations, triggers) {
587
567
  }
588
568
  /**
589
569
  * Create the debug rule evaluation object
590
- *
591
570
  * @param rule
592
571
  * @param rulesetName
593
572
  * @param outputActions
@@ -634,7 +613,6 @@ class EngineDebugger {
634
613
  }
635
614
  /**
636
615
  * Instantiate a rules engine debugger
637
- *
638
616
  * @param options Options to configure the debugger
639
617
  */
640
618
  constructor(options) {
@@ -708,7 +686,6 @@ class EngineDebugger {
708
686
  }
709
687
  /**
710
688
  * Plug the debugger to a Rule Engine
711
- *
712
689
  * @param rulesEngine
713
690
  */
714
691
  registerRuleEngine(rulesEngine) {
@@ -716,7 +693,6 @@ class EngineDebugger {
716
693
  }
717
694
  /**
718
695
  * Handle ruleset execution debug info
719
- *
720
696
  * @param currRes
721
697
  * @param prevRes
722
698
  * @param allExecutionsValid
@@ -732,6 +708,7 @@ class EngineDebugger {
732
708
  this.addRulesetExecutionErrorEvent(ruleset, rulesetInputFacts, executionCounter, runtimeFactValues, rulesetTriggers, rulesetOutputExecution);
733
709
  }
734
710
  return {
711
+ executionCounter,
735
712
  rulesetOutputExecution,
736
713
  allExecutionsValid,
737
714
  rulesetTriggers
@@ -739,7 +716,6 @@ class EngineDebugger {
739
716
  }
740
717
  /**
741
718
  * Emits an 'AvailableRulesets' debug event when rulesets are registered to the rules engine
742
- *
743
719
  * @param rulesets
744
720
  */
745
721
  addAvailableRulesets(rulesets) {
@@ -753,7 +729,6 @@ class EngineDebugger {
753
729
  }
754
730
  /**
755
731
  * Computes and emits an 'ActiveRulesets' debug event when the active rulesets are changing
756
- *
757
732
  * @param ruleSetExecutorMap map off all rulesets executors
758
733
  * @param restrictiveRuleSets ids of the rulesets to activate; if not provided all registered rulesets will be considered as active
759
734
  */
@@ -771,7 +746,6 @@ class EngineDebugger {
771
746
  }
772
747
  /**
773
748
  * Emits an 'AllActions' debug event each time the rules engine outputs the list of actions
774
- *
775
749
  * @param actions list of outputed actions
776
750
  */
777
751
  allActionsChange(actions) {
@@ -780,7 +754,6 @@ class EngineDebugger {
780
754
  }
781
755
  /**
782
756
  * Emits a 'RulesetExecution' debug event at the ouput of a successful ruleset execution
783
- *
784
757
  * @param ruleset
785
758
  * @param executionCounter
786
759
  * @param rulesetInputFacts
@@ -796,7 +769,6 @@ class EngineDebugger {
796
769
  }
797
770
  /**
798
771
  * Emits a 'RulesetExecutionError' debug event at the ouput of a failing ruleset execution
799
- *
800
772
  * @param ruleset
801
773
  * @param rulesetInputFacts
802
774
  * @param executionCounter
@@ -811,7 +783,6 @@ class EngineDebugger {
811
783
  }
812
784
  /**
813
785
  * Returns a list of fact name and value pairs
814
- *
815
786
  * @param factsNames List of facts names to get the value for
816
787
  */
817
788
  async getFactsSnapshot(factsNames) {
@@ -828,7 +799,6 @@ class EngineDebugger {
828
799
 
829
800
  /**
830
801
  * Filter the actions outputted by the rules engine, based on active rulesets
831
- *
832
802
  * @param restrictiveRuleSets list of rules sets to get the event stream for
833
803
  */
834
804
  function filterRulesetsEventStream(restrictiveRuleSets) {
@@ -846,26 +816,37 @@ function filterRulesetsEventStream(restrictiveRuleSets) {
846
816
 
847
817
  /**
848
818
  * Execute Operator
849
- *
850
819
  * @param lhs Left hand side
851
820
  * @param rhs Right hand side
852
821
  * @param operator Operator to compare values
822
+ * @param operatorFacts Facts that operator can depend on
853
823
  */
854
- function executeOperator(lhs, rhs, operator) {
824
+ function executeOperator(lhs, rhs, operator, operatorFacts) {
855
825
  const validLhs = (!operator.validateLhs || operator.validateLhs(lhs));
856
826
  const validRhs = (!operator.validateRhs || operator.validateRhs(rhs));
827
+ let operatorFactValues;
828
+ if (operatorFacts && operator.factImplicitDependencies) {
829
+ operatorFactValues = operator.factImplicitDependencies.reduce((acc, dep) => {
830
+ if (operatorFacts[dep]) {
831
+ acc[dep] = operatorFacts[dep];
832
+ }
833
+ else {
834
+ throw new Error(`The fact "${dep}" requested by ${operator.name} cannot be found.`);
835
+ }
836
+ return acc;
837
+ }, {});
838
+ }
857
839
  if (!validLhs) {
858
- throw new Error(`Invalid left operand : ${JSON.stringify(lhs)}`);
840
+ throw new Error(`Invalid left operand: ${JSON.stringify(lhs)}`);
859
841
  }
860
842
  if (!validRhs) {
861
- throw new Error(`Invalid right operand : ${JSON.stringify(rhs)}`);
843
+ throw new Error(`Invalid right operand: ${JSON.stringify(rhs)}`);
862
844
  }
863
- const obs = operator.evaluator(lhs, rhs);
845
+ const obs = operator.evaluator(lhs, rhs, operatorFactValues);
864
846
  return obs;
865
847
  }
866
848
  /**
867
849
  * Validate a number operand
868
- *
869
850
  * @param operand value of one of the operands
870
851
  */
871
852
  function numberValidator(operand) {
@@ -874,7 +855,6 @@ function numberValidator(operand) {
874
855
  }
875
856
  /**
876
857
  * Validate an operand is a range of numbers
877
- *
878
858
  * @param operatorInput value of one of the operands
879
859
  */
880
860
  function isRangeNumber(operatorInput) {
@@ -886,7 +866,6 @@ function isRangeNumber(operatorInput) {
886
866
  }
887
867
  /**
888
868
  * Verifies if the parameter is a valid date for the operator (getTime function available returning a number)
889
- *
890
869
  * @param operatorInput
891
870
  */
892
871
  const isValidDate = (operatorInput) => {
@@ -898,7 +877,6 @@ const isValidDate = (operatorInput) => {
898
877
  };
899
878
  /**
900
879
  * Verifies if the parameter is a valid input for Date constructor (new Date returns a valid date)
901
- *
902
880
  * @param operatorInput
903
881
  */
904
882
  const isValidDateInput = (operatorInput) => {
@@ -906,7 +884,6 @@ const isValidDateInput = (operatorInput) => {
906
884
  };
907
885
  /**
908
886
  * Verifies if the parameter is a valid date range
909
- *
910
887
  * @param operatorInput
911
888
  */
912
889
  const isValidDateRange = (operatorInput) => {
@@ -918,7 +895,6 @@ const isValidDateRange = (operatorInput) => {
918
895
  };
919
896
  /**
920
897
  * Validate that a value is a supported simple type
921
- *
922
898
  * @param value value to validate
923
899
  */
924
900
  function isSupportedSimpleTypes(value) {
@@ -926,16 +902,29 @@ function isSupportedSimpleTypes(value) {
926
902
  }
927
903
  /**
928
904
  * Validate that a value is a string
929
- *
930
905
  * @param value
931
906
  */
932
907
  function isString(value) {
933
908
  return typeof value === 'string';
934
909
  }
910
+ /**
911
+ * Parse input to return RegExp
912
+ * @param value value to test whether pattern exists (can be string or array of strings)
913
+ * @param inputString regexp pattern
914
+ * @param inputRegExp
915
+ */
916
+ function parseRegExp(inputRegExp) {
917
+ if (inputRegExp.startsWith('/')) {
918
+ const finalSlash = inputRegExp.lastIndexOf('/');
919
+ const regexpPattern = inputRegExp.slice(1, finalSlash);
920
+ const regexpFlags = inputRegExp.slice(finalSlash + 1);
921
+ return new RegExp(regexpPattern, regexpFlags);
922
+ }
923
+ return new RegExp(inputRegExp);
924
+ }
935
925
 
936
926
  /**
937
927
  * Check if any of the variable's value is equal to a specific value
938
- *
939
928
  * @title contains
940
929
  */
941
930
  const arrayContains = {
@@ -946,7 +935,6 @@ const arrayContains = {
946
935
  };
947
936
  /**
948
937
  * Check if the specified text value is included in the text variable
949
- *
950
938
  * @title contains
951
939
  */
952
940
  const stringContains = {
@@ -957,7 +945,6 @@ const stringContains = {
957
945
  };
958
946
  /**
959
947
  * Check if every value of the variable is different from a specific value
960
- *
961
948
  * @title does not contain
962
949
  */
963
950
  const notArrayContains = {
@@ -968,7 +955,6 @@ const notArrayContains = {
968
955
  };
969
956
  /**
970
957
  * Check if the specified text value is not included in the text variable
971
- *
972
958
  * @title does not contain
973
959
  */
974
960
  const notStringContains = {
@@ -979,7 +965,6 @@ const notStringContains = {
979
965
  };
980
966
  /**
981
967
  * Check if every value of the variable equals a specific value
982
- *
983
968
  * @title all equal to
984
969
  */
985
970
  const allEqual = {
@@ -991,7 +976,6 @@ const allEqual = {
991
976
  };
992
977
  /**
993
978
  * Check if every numerical value of the variable is greater than a specific value
994
- *
995
979
  * @title all >
996
980
  */
997
981
  const allGreater = {
@@ -1002,7 +986,6 @@ const allGreater = {
1002
986
  };
1003
987
  /**
1004
988
  * Check if every value of the variable is in a specific list
1005
- *
1006
989
  * @title all in
1007
990
  */
1008
991
  const allIn = {
@@ -1013,7 +996,6 @@ const allIn = {
1013
996
  };
1014
997
  /**
1015
998
  * Check if every value of the variable is not in a specific list
1016
- *
1017
999
  * @title none in
1018
1000
  */
1019
1001
  const allNotIn = {
@@ -1024,7 +1006,6 @@ const allNotIn = {
1024
1006
  };
1025
1007
  /**
1026
1008
  * Check if every numerical value of the variable is lower than a specific value
1027
- *
1028
1009
  * @title all <
1029
1010
  */
1030
1011
  const allLower = {
@@ -1035,13 +1016,12 @@ const allLower = {
1035
1016
  };
1036
1017
  /**
1037
1018
  * Check if every string value of the variable matches a specific pattern
1038
- *
1039
1019
  * @title all match
1040
1020
  */
1041
1021
  const allMatch = {
1042
1022
  name: 'allMatch',
1043
- evaluator: (array, inputString) => {
1044
- const regExp = new RegExp(inputString);
1023
+ evaluator: (array, inputRegExp) => {
1024
+ const regExp = parseRegExp(inputRegExp);
1045
1025
  return array.every((elementValue) => regExp.test(elementValue));
1046
1026
  },
1047
1027
  validateLhs: Array.isArray,
@@ -1049,7 +1029,6 @@ const allMatch = {
1049
1029
  };
1050
1030
  /**
1051
1031
  * Check if every value of the variable is included in a specified range
1052
- *
1053
1032
  * @title all between
1054
1033
  */
1055
1034
  const allRangeNumber = {
@@ -1060,7 +1039,6 @@ const allRangeNumber = {
1060
1039
  };
1061
1040
  /**
1062
1041
  * Check if at least one of the values of the variable equals a specific value
1063
- *
1064
1042
  * @title one equal to
1065
1043
  */
1066
1044
  const oneEquals = {
@@ -1072,7 +1050,6 @@ const oneEquals = {
1072
1050
  };
1073
1051
  /**
1074
1052
  * Check if one of the values of the variable is greater than a specific value
1075
- *
1076
1053
  * @title one >
1077
1054
  */
1078
1055
  const oneGreater = {
@@ -1083,7 +1060,6 @@ const oneGreater = {
1083
1060
  };
1084
1061
  /**
1085
1062
  * Check if at least one of the values of the variable is equal to one in a specified list
1086
- *
1087
1063
  * @title one in
1088
1064
  */
1089
1065
  const oneIn = {
@@ -1094,7 +1070,6 @@ const oneIn = {
1094
1070
  };
1095
1071
  /**
1096
1072
  * Check if one of the values of the variable is lower than a specific value
1097
- *
1098
1073
  * @title one <
1099
1074
  */
1100
1075
  const oneLower = {
@@ -1105,13 +1080,12 @@ const oneLower = {
1105
1080
  };
1106
1081
  /**
1107
1082
  * Check if one of the values of the variable matches a specific pattern
1108
- *
1109
1083
  * @title one matches
1110
1084
  */
1111
1085
  const oneMatches = {
1112
1086
  name: 'oneMatches',
1113
- evaluator: (arrayString, value) => {
1114
- const regExp = new RegExp(value);
1087
+ evaluator: (arrayString, inputRegExp) => {
1088
+ const regExp = parseRegExp(inputRegExp);
1115
1089
  return arrayString.some((elementValue) => regExp.test(elementValue));
1116
1090
  },
1117
1091
  validateLhs: Array.isArray,
@@ -1119,7 +1093,6 @@ const oneMatches = {
1119
1093
  };
1120
1094
  /**
1121
1095
  * Check if one of the values of the variable is included in a specified range
1122
- *
1123
1096
  * @title one between
1124
1097
  */
1125
1098
  const oneRangeNumber = {
@@ -1130,7 +1103,6 @@ const oneRangeNumber = {
1130
1103
  };
1131
1104
  /**
1132
1105
  * Check if the number of values of the variable is equal to a specific value
1133
- *
1134
1106
  * @title number of =
1135
1107
  */
1136
1108
  const lengthEquals = {
@@ -1141,7 +1113,6 @@ const lengthEquals = {
1141
1113
  };
1142
1114
  /**
1143
1115
  * Check if the number of values of the variable is different from a specific value
1144
- *
1145
1116
  * @title number of ≠
1146
1117
  */
1147
1118
  const lengthNotEquals = {
@@ -1152,7 +1123,6 @@ const lengthNotEquals = {
1152
1123
  };
1153
1124
  /**
1154
1125
  * Check if the number of values of the variable is lower or equal to a specific value
1155
- *
1156
1126
  * @title number of ≤
1157
1127
  */
1158
1128
  const lengthLessThanOrEquals = {
@@ -1163,7 +1133,6 @@ const lengthLessThanOrEquals = {
1163
1133
  };
1164
1134
  /**
1165
1135
  * Check if the number of values of the variable is lower than a specific value
1166
- *
1167
1136
  * @title number of <
1168
1137
  */
1169
1138
  const lengthLessThan = {
@@ -1174,7 +1143,6 @@ const lengthLessThan = {
1174
1143
  };
1175
1144
  /**
1176
1145
  * Check if the number of values of the variable is greater or equal to a specific value
1177
- *
1178
1146
  * @title number of ≥
1179
1147
  */
1180
1148
  const lengthGreaterThanOrEquals = {
@@ -1185,7 +1153,6 @@ const lengthGreaterThanOrEquals = {
1185
1153
  };
1186
1154
  /**
1187
1155
  * Check if the number of values of the variable is greater than a specific value
1188
- *
1189
1156
  * @title number of >
1190
1157
  */
1191
1158
  const lengthGreaterThan = {
@@ -1223,7 +1190,6 @@ const arrayBasedOperators = [
1223
1190
 
1224
1191
  /**
1225
1192
  * Check if a variable is equal to a specific value
1226
- *
1227
1193
  * @title is equal to
1228
1194
  */
1229
1195
  const equals = {
@@ -1233,7 +1199,6 @@ const equals = {
1233
1199
  };
1234
1200
  /**
1235
1201
  * Check if a variable is different from a specific value
1236
- *
1237
1202
  * @title is not equal to
1238
1203
  */
1239
1204
  const notEquals = {
@@ -1243,7 +1208,6 @@ const notEquals = {
1243
1208
  };
1244
1209
  /**
1245
1210
  * Check if the variable's value is included in a specified list
1246
- *
1247
1211
  * @title is in
1248
1212
  */
1249
1213
  const inArray = {
@@ -1254,7 +1218,6 @@ const inArray = {
1254
1218
  };
1255
1219
  /**
1256
1220
  * Check if the variable's value is not included in the value list
1257
- *
1258
1221
  * @title is not in
1259
1222
  */
1260
1223
  const notInArray = {
@@ -1265,7 +1228,6 @@ const notInArray = {
1265
1228
  };
1266
1229
  /**
1267
1230
  * Check if the text variable is part of the specified value
1268
- *
1269
1231
  * @title within
1270
1232
  */
1271
1233
  const inString = {
@@ -1276,7 +1238,6 @@ const inString = {
1276
1238
  };
1277
1239
  /**
1278
1240
  * Check if the text variable is not part of the specified value
1279
- *
1280
1241
  * @title not within
1281
1242
  */
1282
1243
  const notInString = {
@@ -1287,7 +1248,6 @@ const notInString = {
1287
1248
  };
1288
1249
  /**
1289
1250
  * Check if the variable and its value are defined
1290
- *
1291
1251
  * @title is defined
1292
1252
  */
1293
1253
  const isDefined = {
@@ -1296,21 +1256,32 @@ const isDefined = {
1296
1256
  };
1297
1257
  /**
1298
1258
  * Check if the variable and its value are undefined
1299
- *
1300
1259
  * @title is not defined
1301
1260
  */
1302
1261
  const isUndefined = {
1303
1262
  name: 'isUndefined',
1304
1263
  evaluator: (input) => input === undefined || input === null
1305
1264
  };
1265
+ /**
1266
+ * Check if the text variable matches the specified RegExp pattern
1267
+ * @title matches the pattern
1268
+ */
1269
+ const matchesPattern = {
1270
+ name: 'matchesPattern',
1271
+ evaluator: (value, inputRegExp) => {
1272
+ const regExp = parseRegExp(inputRegExp);
1273
+ return regExp.test(value);
1274
+ },
1275
+ validateLhs: isString,
1276
+ validateRhs: isString
1277
+ };
1306
1278
  /** List of all default basic operators */
1307
1279
  const basicOperators = [
1308
- equals, inArray, inString, isDefined, isUndefined, notEquals, notInArray, notInString
1280
+ equals, inArray, inString, isDefined, isUndefined, matchesPattern, notEquals, notInArray, notInString
1309
1281
  ];
1310
1282
 
1311
1283
  /**
1312
1284
  * Check if the number variable is greater or equal to a specific value
1313
- *
1314
1285
  * @title ≥
1315
1286
  */
1316
1287
  const greaterThanOrEqual = {
@@ -1321,7 +1292,6 @@ const greaterThanOrEqual = {
1321
1292
  };
1322
1293
  /**
1323
1294
  * Check if the number variable is greater than a specific value
1324
- *
1325
1295
  * @title >
1326
1296
  */
1327
1297
  const greaterThan = {
@@ -1332,7 +1302,6 @@ const greaterThan = {
1332
1302
  };
1333
1303
  /**
1334
1304
  * Check if the number variable is lower or equal to a specific value
1335
- *
1336
1305
  * @title ≤
1337
1306
  */
1338
1307
  const lessOrEqual = {
@@ -1343,7 +1312,6 @@ const lessOrEqual = {
1343
1312
  };
1344
1313
  /**
1345
1314
  * Check if the number variable is lower than a specific value
1346
- *
1347
1315
  * @title <
1348
1316
  */
1349
1317
  const lessThan = {
@@ -1357,7 +1325,6 @@ const numberBasedOperators = [greaterThan, greaterThanOrEqual, lessThan, lessOrE
1357
1325
 
1358
1326
  /**
1359
1327
  * Check if a date variable is in a specified date range
1360
- *
1361
1328
  * @title is between
1362
1329
  */
1363
1330
  const inRangeDate = {
@@ -1369,9 +1336,53 @@ const inRangeDate = {
1369
1336
  validateLhs: isValidDateInput,
1370
1337
  validateRhs: isValidDateRange
1371
1338
  };
1339
+ /**
1340
+ * Check if the value of the variable is in the next x minutes
1341
+ * @title is in next minutes
1342
+ * @returns false for dates before `now` and for dates after `now` + `nextMinutes`, true for dates between `now` and `now` + `nextMinutes`
1343
+ */
1344
+ const dateInNextMinutes = {
1345
+ name: 'dateInNextMinutes',
1346
+ evaluator: (leftDateInput, minutes, operatorFactValues) => {
1347
+ if (!operatorFactValues) {
1348
+ throw new Error('No operatorFactValues. Unable to retrieve the current time.');
1349
+ }
1350
+ if (typeof operatorFactValues.o3rCurrentTime !== 'number') {
1351
+ throw new Error('o3rCurrentTime value is not a number');
1352
+ }
1353
+ const currentTimeValue = operatorFactValues.o3rCurrentTime;
1354
+ return inRangeDate.evaluator(leftDateInput, [currentTimeValue, currentTimeValue + +minutes * 60000]);
1355
+ },
1356
+ factImplicitDependencies: ['o3rCurrentTime'],
1357
+ validateLhs: isValidDateInput,
1358
+ validateRhs: numberValidator
1359
+ };
1360
+ /**
1361
+ * Check if the value of the variable is not in the next x minutes
1362
+ * @title is not in next minutes
1363
+ * @returns false for dates before `now` and for dates between `now` and `now` + `nextMinutes`, true for dates after `now` + `nextMinutes`
1364
+ */
1365
+ const dateNotInNextMinutes = {
1366
+ name: 'dateNotInNextMinutes',
1367
+ evaluator: (leftDateInput, minutes, operatorFactValues) => {
1368
+ if (!operatorFactValues) {
1369
+ throw new Error('No operatorFactValues. Unable to retrieve the current time.');
1370
+ }
1371
+ if (typeof operatorFactValues.o3rCurrentTime !== 'number') {
1372
+ throw new Error('o3rCurrentTime value is not a number');
1373
+ }
1374
+ const currentTimeValue = operatorFactValues.o3rCurrentTime;
1375
+ const now = new Date(currentTimeValue);
1376
+ const leftDate = new Date(leftDateInput);
1377
+ const targetDate = new Date(new Date(currentTimeValue).setMinutes(now.getMinutes() + +minutes));
1378
+ return leftDate >= now && leftDate > targetDate;
1379
+ },
1380
+ factImplicitDependencies: ['o3rCurrentTime'],
1381
+ validateLhs: isValidDateInput,
1382
+ validateRhs: numberValidator
1383
+ };
1372
1384
  /**
1373
1385
  * Check if a date variable is prior than a specified date
1374
- *
1375
1386
  * @title is before
1376
1387
  */
1377
1388
  const dateBefore = {
@@ -1386,7 +1397,6 @@ const dateBefore = {
1386
1397
  };
1387
1398
  /**
1388
1399
  * Check if a date variable is posterior than a specified date
1389
- *
1390
1400
  * @title is after
1391
1401
  */
1392
1402
  const dateAfter = {
@@ -1401,7 +1411,6 @@ const dateAfter = {
1401
1411
  };
1402
1412
  /**
1403
1413
  * Check if a date variable is the same as a specified date
1404
- *
1405
1414
  * @title is equal to
1406
1415
  */
1407
1416
  const dateEquals = {
@@ -1416,7 +1425,6 @@ const dateEquals = {
1416
1425
  };
1417
1426
  /**
1418
1427
  * Check if a date variable is different from a specified date
1419
- *
1420
1428
  * @title is not equal
1421
1429
  */
1422
1430
  const dateNotEquals = {
@@ -1430,14 +1438,13 @@ const dateNotEquals = {
1430
1438
  validateRhs: isValidDateInput
1431
1439
  };
1432
1440
  const dateBasedOperators = [
1433
- inRangeDate, dateAfter, dateBefore, dateEquals, dateNotEquals
1441
+ inRangeDate, dateInNextMinutes, dateNotInNextMinutes, dateAfter, dateBefore, dateEquals, dateNotEquals
1434
1442
  ];
1435
1443
 
1436
1444
  const operatorList = [...arrayBasedOperators, ...basicOperators, ...numberBasedOperators, ...dateBasedOperators];
1437
1445
 
1438
1446
  /**
1439
1447
  * Determine if the condition is a properties condition
1440
- *
1441
1448
  * @param condition Condition to analyze
1442
1449
  */
1443
1450
  function isConditionProperties(condition) {
@@ -1445,7 +1452,6 @@ function isConditionProperties(condition) {
1445
1452
  }
1446
1453
  /**
1447
1454
  * Determine if the given operand is a Fact operand
1448
- *
1449
1455
  * @param operand Operand to analyze
1450
1456
  */
1451
1457
  function isOperandFact(operand) {
@@ -1453,7 +1459,6 @@ function isOperandFact(operand) {
1453
1459
  }
1454
1460
  /**
1455
1461
  * Determine if the given operand is a Inner Fact operand
1456
- *
1457
1462
  * @param operand Operand to analyze
1458
1463
  */
1459
1464
  function isOperandRuntimeFact(operand) {
@@ -1461,7 +1466,6 @@ function isOperandRuntimeFact(operand) {
1461
1466
  }
1462
1467
  /**
1463
1468
  * Determine if the given operand is a Static Value operand
1464
- *
1465
1469
  * @param operand Operand to analyze
1466
1470
  */
1467
1471
  function isOperandLiteral(operand) {
@@ -1469,7 +1473,6 @@ function isOperandLiteral(operand) {
1469
1473
  }
1470
1474
  /**
1471
1475
  * Determine if the given condition is All based child conditions
1472
- *
1473
1476
  * @param condition Condition node
1474
1477
  */
1475
1478
  function isAllConditions(condition) {
@@ -1477,7 +1480,6 @@ function isAllConditions(condition) {
1477
1480
  }
1478
1481
  /**
1479
1482
  * Determine if the given condition is Any based child conditions
1480
- *
1481
1483
  * @param condition Condition node
1482
1484
  */
1483
1485
  function isAnyConditions(condition) {
@@ -1485,7 +1487,6 @@ function isAnyConditions(condition) {
1485
1487
  }
1486
1488
  /**
1487
1489
  * Determine if the given condition is Not based child conditions
1488
- *
1489
1490
  * @param condition Condition node
1490
1491
  */
1491
1492
  function isNotCondition(condition) {
@@ -1496,7 +1497,6 @@ function isNotCondition(condition) {
1496
1497
  class RulesetExecutor {
1497
1498
  /**
1498
1499
  * Create a new ruleset executor
1499
- *
1500
1500
  * @param ruleset Ruleset to evaluate
1501
1501
  * @param rulesEngine Instance of the rules engine
1502
1502
  */
@@ -1505,11 +1505,37 @@ class RulesetExecutor {
1505
1505
  this.ruleset = ruleset;
1506
1506
  this.rulesEngine = rulesEngine;
1507
1507
  this.operators = rulesEngine.operators;
1508
- this.engineRuleset = this.prepareRuleset();
1508
+ this.engineRuleset = this.plugRuleset();
1509
+ }
1510
+ /**
1511
+ * Recursively explores a rule to identify and collect input facts.
1512
+ * Input facts are identified based on the 'FACT' type and operator-specific implicit dependencies.
1513
+ * @param currentObject The current object being explored.
1514
+ * @param ruleInputFacts A set to store the identified input facts for the rule.
1515
+ */
1516
+ collectRuleInputFacts(currentObject, ruleInputFacts) {
1517
+ if (currentObject && isOperandFact(currentObject)) {
1518
+ ruleInputFacts.add(currentObject.value);
1519
+ }
1520
+ else if (Array.isArray(currentObject)) {
1521
+ currentObject.forEach((elem) => this.collectRuleInputFacts(elem, ruleInputFacts));
1522
+ }
1523
+ else {
1524
+ for (const key in currentObject) {
1525
+ if ((key === 'operator') && isConditionProperties(currentObject)) {
1526
+ const op = this.operators[currentObject[key]];
1527
+ if (op && op.factImplicitDependencies) {
1528
+ op.factImplicitDependencies.forEach(dep => ruleInputFacts.add(dep));
1529
+ }
1530
+ }
1531
+ else if (typeof currentObject[key] === 'object') {
1532
+ this.collectRuleInputFacts(currentObject[key], ruleInputFacts);
1533
+ }
1534
+ }
1535
+ }
1509
1536
  }
1510
1537
  /**
1511
1538
  * Report performance mark for a rule run
1512
- *
1513
1539
  * @param rule Rule to measure
1514
1540
  * @param status status of the rule evaluation
1515
1541
  */
@@ -1524,7 +1550,6 @@ class RulesetExecutor {
1524
1550
  }
1525
1551
  /**
1526
1552
  * Get operand value stream according to its type
1527
- *
1528
1553
  * @param operand operand of the condition
1529
1554
  * @param factsValue
1530
1555
  * @param runtimeFactValues
@@ -1550,7 +1575,6 @@ class RulesetExecutor {
1550
1575
  * Process a root rule from a ruleset, and return the associated actions to be processed
1551
1576
  * Will also update the runtimeFactValues map that is ruleset wise
1552
1577
  * Note that runtimeFactValues will be mutated by all the runtime facts actions executed
1553
- *
1554
1578
  * @param rule
1555
1579
  * @param factsValue
1556
1580
  * @param runtimeFactValues
@@ -1562,7 +1586,6 @@ class RulesetExecutor {
1562
1586
  /**
1563
1587
  * Recursively process a block to extract all the actions keeping the order
1564
1588
  * Note that runtimeFactValues will be mutated by all the runtime facts actions executed
1565
- *
1566
1589
  * @param element
1567
1590
  * @param actions
1568
1591
  * @param factsValue
@@ -1586,7 +1609,6 @@ class RulesetExecutor {
1586
1609
  }
1587
1610
  /**
1588
1611
  * Returns true if the element is a IfElse block
1589
- *
1590
1612
  * @param element
1591
1613
  * @protected
1592
1614
  */
@@ -1595,7 +1617,6 @@ class RulesetExecutor {
1595
1617
  }
1596
1618
  /**
1597
1619
  * Returns true if the element is an action block
1598
- *
1599
1620
  * @param element
1600
1621
  * @protected
1601
1622
  */
@@ -1604,7 +1625,6 @@ class RulesetExecutor {
1604
1625
  }
1605
1626
  /**
1606
1627
  * Returns true if the action sets a temporary fact
1607
- *
1608
1628
  * @param element
1609
1629
  * @protected
1610
1630
  */
@@ -1613,7 +1633,6 @@ class RulesetExecutor {
1613
1633
  }
1614
1634
  /**
1615
1635
  * Evaluate a condition block
1616
- *
1617
1636
  * @param nestedCondition
1618
1637
  * @param factsValue
1619
1638
  * @param runtimeFactValues
@@ -1625,53 +1644,55 @@ class RulesetExecutor {
1625
1644
  if (operator === undefined) {
1626
1645
  throw new Error(`Unknown operator : ${nestedCondition.operator}, skipping the rule execution...`);
1627
1646
  }
1628
- return executeOperator(this.getOperandValue(nestedCondition.lhs, factsValue, runtimeFactValues), this.getOperandValue('rhs' in nestedCondition ? nestedCondition.rhs : undefined, factsValue, runtimeFactValues), operator);
1647
+ return executeOperator(this.getOperandValue(nestedCondition.lhs, factsValue, runtimeFactValues), this.getOperandValue('rhs' in nestedCondition ? nestedCondition.rhs : undefined, factsValue, runtimeFactValues), operator, factsValue);
1629
1648
  }
1630
1649
  if (isNotCondition(nestedCondition)) {
1631
1650
  return !this.evaluateCondition(nestedCondition.not, factsValue, runtimeFactValues);
1632
1651
  }
1633
1652
  if (nestedCondition.all || nestedCondition.any) {
1634
- const children = (nestedCondition.all || nestedCondition.any).map((condition) => this.evaluateCondition(condition, factsValue, runtimeFactValues));
1635
- return isAllConditions(nestedCondition) ? children.every((value) => value) : children.some((value) => value);
1653
+ const evaluate = (condition) => this.evaluateCondition(condition, factsValue, runtimeFactValues);
1654
+ return isAllConditions(nestedCondition) ? nestedCondition.all.every(evaluate) : nestedCondition.any.some(evaluate);
1636
1655
  }
1637
1656
  throw new Error(`Unknown condition block met : ${JSON.stringify(nestedCondition)}`);
1638
1657
  }
1639
1658
  /**
1640
1659
  * Plug ruleset to fact streams and trigger a first evaluation
1641
- *
1642
- * @param ruleset
1643
1660
  */
1644
- prepareRuleset() {
1645
- const rulesWithContext = [];
1646
- const rulesWithoutContext = [];
1661
+ plugRuleset() {
1662
+ const inputFactsForRule = {};
1663
+ const findRuleInputFacts = (obj) => {
1664
+ const ruleInputFacts = new Set();
1665
+ this.collectRuleInputFacts(obj, ruleInputFacts);
1666
+ return Array.from(ruleInputFacts);
1667
+ };
1668
+ this.ruleset.rules.forEach((rule) => inputFactsForRule[rule.id] = findRuleInputFacts(rule.rootElement));
1647
1669
  const factsThatRerunEverything = [];
1648
1670
  this.ruleset.rules.forEach((rule) => {
1649
1671
  if (rule.outputRuntimeFacts.length > 0 || rule.inputRuntimeFacts.length > 0) {
1650
- rulesWithContext.push(rule);
1651
- factsThatRerunEverything.push(...rule.inputFacts);
1672
+ factsThatRerunEverything.push(...inputFactsForRule[rule.id]);
1652
1673
  }
1653
1674
  else {
1654
- rulesWithoutContext.push(rule);
1655
1675
  }
1656
1676
  });
1657
- const triggerFull = factsThatRerunEverything.length === 0 ? of([]) :
1677
+ const triggerFull$ = factsThatRerunEverything.length === 0 ? of([]) :
1658
1678
  combineLatest(factsThatRerunEverything.map((fact) => this.rulesEngine.retrieveOrCreateFactStream(fact)));
1659
- const result$ = triggerFull.pipe(switchMap(() => {
1679
+ const result$ = triggerFull$.pipe(switchMap(() => {
1660
1680
  const runtimeFactValues = {};
1661
1681
  let rulesetInputFacts;
1662
1682
  if (this.rulesEngine.debugMode) {
1663
1683
  rulesetInputFacts = Array.from(this.ruleset.rules.reduce((acc, rule) => {
1664
- rule.inputFacts.forEach((factName) => acc.add(factName));
1684
+ inputFactsForRule[rule.id].forEach((factName) => acc.add(factName));
1665
1685
  return acc;
1666
1686
  }, new Set()));
1667
1687
  }
1668
1688
  return combineLatest(this.ruleset.rules.map((rule) => {
1669
- const values$ = rule.inputFacts.map((fact) => this.rulesEngine.retrieveOrCreateFactStream(fact));
1689
+ const inputFacts = inputFactsForRule[rule.id];
1690
+ const values$ = inputFacts.map((fact) => this.rulesEngine.retrieveOrCreateFactStream(fact));
1670
1691
  return (values$.length ? combineLatest(values$) : of([[]]))
1671
1692
  .pipe(startWith(undefined), pairwise(), tap(() => this.performanceMark(rule, 'start')), map(([oldFactValues, factValues]) => {
1672
1693
  const output = { actions: undefined };
1673
1694
  try {
1674
- output.actions = this.evaluateRule(rule, rule.inputFacts.reduce((acc, id, index) => {
1695
+ output.actions = this.evaluateRule(rule, inputFacts.reduce((acc, id, index) => {
1675
1696
  acc[id] = factValues[index];
1676
1697
  return acc;
1677
1698
  }, {}), runtimeFactValues);
@@ -1681,7 +1702,7 @@ class RulesetExecutor {
1681
1702
  output.error = error;
1682
1703
  }
1683
1704
  if (this.rulesEngine.debugMode) {
1684
- output.evaluation = handleRuleEvaluationDebug(rule, this.ruleset.name, output.actions, output.error, runtimeFactValues, factValues, oldFactValues);
1705
+ output.evaluation = handleRuleEvaluationDebug({ ...rule, inputFacts }, this.ruleset.name, output.actions, output.error, runtimeFactValues, factValues, oldFactValues);
1685
1706
  }
1686
1707
  else if (output.error) {
1687
1708
  this.rulesEngine.logger?.error(output.error);
@@ -1694,21 +1715,20 @@ class RulesetExecutor {
1694
1715
  const allExecutionsValid = actionsLists.every((actions) => !!actions);
1695
1716
  let execInfo = { actionsLists: (allExecutionsValid ? actionsLists : [[]]) };
1696
1717
  if (this.rulesEngine.engineDebug) {
1697
- this.executionCounter++;
1698
1718
  execInfo = {
1699
1719
  ...execInfo,
1700
- ...this.rulesEngine.engineDebug.handleDebugRulesetExecutionInfo(currRes, prevRes, allExecutionsValid, rulesetInputFacts, runtimeFactValues, this.executionCounter, this.ruleset)
1720
+ ...this.rulesEngine.engineDebug.handleDebugRulesetExecutionInfo(currRes, prevRes, allExecutionsValid, rulesetInputFacts, runtimeFactValues, ++this.executionCounter, this.ruleset)
1701
1721
  };
1702
1722
  }
1703
1723
  return execInfo;
1704
1724
  }), map((output) => {
1705
1725
  const outputActions = [].concat(...output.actionsLists);
1706
1726
  if (this.rulesEngine.engineDebug && output.allExecutionsValid) {
1707
- this.rulesEngine.engineDebug.addRulesetExecutionEvent(this.ruleset, this.executionCounter, rulesetInputFacts, outputActions, runtimeFactValues, output.rulesetTriggers, output.rulesetOutputExecution);
1727
+ this.rulesEngine.engineDebug.addRulesetExecutionEvent(this.ruleset, output.executionCounter, rulesetInputFacts, outputActions, runtimeFactValues, output.rulesetTriggers, output.rulesetOutputExecution);
1708
1728
  }
1709
1729
  return outputActions;
1710
1730
  }), distinctUntilChanged((prev, curr) => prev.length === 0 && curr.length === 0));
1711
- }), shareReplay(1));
1731
+ }), shareReplay({ bufferSize: 1, refCount: true }));
1712
1732
  return {
1713
1733
  id: this.ruleset.id,
1714
1734
  validityRange: this.ruleset.validityRange,
@@ -1716,6 +1736,13 @@ class RulesetExecutor {
1716
1736
  rulesResultsSubject$: result$
1717
1737
  };
1718
1738
  }
1739
+ /**
1740
+ * Plug ruleset to fact streams and trigger a first evaluation
1741
+ * @deprecated This function is not made to be accessible from Outside of the class, will be removed in v10
1742
+ */
1743
+ prepareRuleset() {
1744
+ return this.plugRuleset();
1745
+ }
1719
1746
  }
1720
1747
 
1721
1748
  /** Rules engine */
@@ -1728,7 +1755,6 @@ class RulesEngine {
1728
1755
  }
1729
1756
  /**
1730
1757
  * Rules engine
1731
- *
1732
1758
  * @param options rules engine options
1733
1759
  * @param logger
1734
1760
  */
@@ -1761,7 +1787,6 @@ class RulesEngine {
1761
1787
  }
1762
1788
  /**
1763
1789
  * Attach debug events to actions stream if debug engine is activated
1764
- *
1765
1790
  * @param actionsStream
1766
1791
  */
1767
1792
  handleActionsStreamOutput() {
@@ -1769,7 +1794,6 @@ class RulesEngine {
1769
1794
  }
1770
1795
  /**
1771
1796
  * Create the actions stream event based on provided active rulesets ids; Handle debug too
1772
- *
1773
1797
  * @param ruleSets
1774
1798
  */
1775
1799
  prepareActionsStream(ruleSets) {
@@ -1780,7 +1804,6 @@ class RulesEngine {
1780
1804
  /**
1781
1805
  * Create or retrieve a fact stream
1782
1806
  * The fact stream created will be registered in the engine
1783
- *
1784
1807
  * @param id ID of the fact to retrieve
1785
1808
  * @param factValue$ Value stream for the fact
1786
1809
  */
@@ -1807,7 +1830,6 @@ class RulesEngine {
1807
1830
  /**
1808
1831
  * Retrieve the promise of the latest value of a fact.
1809
1832
  * Return undefined if the fact is not defined.
1810
- *
1811
1833
  * @param id ID of the fact to retrieve
1812
1834
  */
1813
1835
  retrieveFactValue(id) {
@@ -1815,7 +1837,6 @@ class RulesEngine {
1815
1837
  }
1816
1838
  /**
1817
1839
  * Update or insert fact in rules engine
1818
- *
1819
1840
  * @param facts fact list to add / update
1820
1841
  */
1821
1842
  upsertFacts(facts) {
@@ -1823,7 +1844,6 @@ class RulesEngine {
1823
1844
  }
1824
1845
  /**
1825
1846
  * Update or insert rule in rules engine
1826
- *
1827
1847
  * @param rules rule list to add / update
1828
1848
  * @param rulesets
1829
1849
  */
@@ -1836,7 +1856,6 @@ class RulesEngine {
1836
1856
  }
1837
1857
  /**
1838
1858
  * Update or insert operator in rules engine
1839
- *
1840
1859
  * @param operators operator list to add / update
1841
1860
  */
1842
1861
  upsertOperators(operators) {
@@ -1860,22 +1879,21 @@ class RulesEngine {
1860
1879
 
1861
1880
  /** Determine if the action should be executed */
1862
1881
  const RULES_ENGINE_OPTIONS = new InjectionToken('Rules Engine Options');
1882
+ /** Default Rules engine options */
1863
1883
  const DEFAULT_RULES_ENGINE_OPTIONS = {
1864
1884
  dryRun: false,
1865
1885
  debug: false
1866
1886
  };
1867
1887
 
1868
- class RulesEngineService {
1869
- constructor(store, translateService, dynamicContentService, logger, engineConfig) {
1888
+ class RulesEngineRunnerService {
1889
+ constructor(store, logger, engineConfig) {
1870
1890
  this.store = store;
1871
- this.translateService = translateService;
1872
- this.dynamicContentService = dynamicContentService;
1873
1891
  this.logger = logger;
1874
1892
  this.subscription = new Subscription();
1875
- /** Map that stores subscriptions to onDemand ruleset */
1876
- this.temporarySubscriptionMap = {};
1893
+ /** Observable of component linked to the component */
1877
1894
  this.linkedComponents$ = new BehaviorSubject({});
1878
- this.placeholdersActions$ = new Subject();
1895
+ /** List of action handlers */
1896
+ this.actionHandlers = new Set();
1879
1897
  this.enabled = !engineConfig?.dryRun;
1880
1898
  this.engine = new RulesEngine({
1881
1899
  debugger: engineConfig?.debug ? new EngineDebugger({ eventsStackLimit: engineConfig?.debugEventsStackLimit }) : undefined,
@@ -1893,163 +1911,40 @@ class RulesEngineService {
1893
1911
  this.events$ = this.ruleSets$.pipe(this.engine.getEventStream(), shareReplay(1));
1894
1912
  this.upsertOperators(operatorList);
1895
1913
  this.subscription.add(this.store.pipe(select(selectAllRulesets)).subscribe((rulesets) => this.engine.upsertRulesets(rulesets)));
1896
- this.subscription.add(this.events$.pipe(filter(() => this.enabled)).subscribe((events) => this.executeActionSync(events)));
1897
- const lang$ = this.translateService.onLangChange.pipe(map(({ lang }) => lang), distinctUntilChanged());
1898
- // TODO Check if distinctUntilChanged is a good idea
1899
- // DistinctUntilChanged will prevent double instant emission (second processed before first reach the store)
1900
- const filteredActions$ = combineLatest([lang$, this.placeholdersActions$.pipe(distinctUntilChanged((prev, next) => JSON.stringify(prev) === JSON.stringify(next)))]).pipe(withLatestFrom(combineLatest([this.store.pipe(select(selectPlaceholderTemplateEntities)), this.store.pipe(select(selectPlaceholderRequestEntities))])), map(([langAndTemplatesUrls, storedPlaceholdersAndRequests]) => {
1901
- const [lang, placeholderActions] = langAndTemplatesUrls;
1902
- const storedPlaceholders = storedPlaceholdersAndRequests[0] || {};
1903
- const storedPlaceholderRequests = storedPlaceholdersAndRequests[1] || {};
1904
- const placeholderNewRequests = [];
1905
- // Stores all raw Urls used from the current engine execution
1906
- const usedUrls = {};
1907
- // Get all Urls that needs to be resolved from current rules engine output
1908
- const placeholdersTemplates = placeholderActions.reduce((acc, placeholderAction) => {
1909
- const placeholdersTemplateUrl = {
1910
- rawUrl: placeholderAction.templateUrl,
1911
- priority: placeholderAction.priority
1912
- };
1913
- if (acc[placeholderAction.placeholderId]) {
1914
- acc[placeholderAction.placeholderId].push(placeholdersTemplateUrl);
1915
- }
1916
- else {
1917
- acc[placeholderAction.placeholderId] = [placeholdersTemplateUrl];
1918
- }
1919
- const resolvedUrl = this.resolveUrlWithLang(placeholderAction.templateUrl, lang);
1920
- // Filters duplicates and resolved urls that are already in the store
1921
- if (!usedUrls[placeholderAction.templateUrl] && (!storedPlaceholderRequests[placeholderAction.templateUrl]
1922
- || storedPlaceholderRequests[placeholderAction.templateUrl].resolvedUrl !== resolvedUrl)) {
1923
- placeholderNewRequests.push({
1924
- rawUrl: placeholderAction.templateUrl,
1925
- resolvedUrl: this.resolveUrlWithLang(placeholderAction.templateUrl, lang)
1926
- });
1927
- }
1928
- usedUrls[placeholderAction.templateUrl] = true;
1929
- return acc;
1930
- }, {});
1931
- // Urls not used anymore and not already disabled
1932
- const placeholderRequestsToDisable = [];
1933
- // Urls used that were disabled
1934
- const placeholderRequestsToEnable = [];
1935
- Object.keys(storedPlaceholderRequests).forEach((storedPlaceholderRequestRawUrl) => {
1936
- const usedFromEngineIteration = usedUrls[storedPlaceholderRequestRawUrl];
1937
- const usedFromStore = (storedPlaceholderRequests && storedPlaceholderRequests[storedPlaceholderRequestRawUrl]) ? storedPlaceholderRequests[storedPlaceholderRequestRawUrl].used : false;
1938
- if (!usedFromEngineIteration && usedFromStore) {
1939
- placeholderRequestsToDisable.push(storedPlaceholderRequestRawUrl);
1940
- }
1941
- else if (usedFromEngineIteration && !usedFromStore) {
1942
- placeholderRequestsToEnable.push(storedPlaceholderRequestRawUrl);
1943
- }
1944
- });
1945
- // Placeholder that are no longer filled by the current engine execution output will be cleared
1946
- const placeholdersTemplatesToBeCleanedUp = Object.keys(storedPlaceholders)
1947
- .filter(placeholderId => !placeholdersTemplates[placeholderId]);
1948
- const placeholdersTemplatesToBeSet = Object.keys(placeholdersTemplates).reduce((changedPlaceholderTemplates, placeholderTemplateId) => {
1949
- // Caching if the placeholder template already exists with the same urls
1950
- if (!storedPlaceholders[placeholderTemplateId] ||
1951
- !(JSON.stringify(storedPlaceholders[placeholderTemplateId].urlsWithPriority) === JSON.stringify(placeholdersTemplates[placeholderTemplateId]))) {
1952
- changedPlaceholderTemplates.push({
1953
- id: placeholderTemplateId,
1954
- urlsWithPriority: placeholdersTemplates[placeholderTemplateId]
1955
- });
1956
- }
1957
- return changedPlaceholderTemplates;
1958
- }, []);
1959
- return {
1960
- placeholdersTemplatesToBeCleanedUp,
1961
- placeholderRequestsToDisable,
1962
- placeholderRequestsToEnable,
1963
- placeholdersTemplatesToBeSet,
1964
- placeholderNewRequests
1965
- };
1966
- }));
1967
- this.subscription.add(filteredActions$.subscribe((placeholdersUpdates) => {
1968
- placeholdersUpdates.placeholdersTemplatesToBeCleanedUp.forEach(placeholderId => this.store.dispatch(deletePlaceholderTemplateEntity({
1969
- id: placeholderId
1970
- })));
1971
- placeholdersUpdates.placeholdersTemplatesToBeSet.forEach(placeholdersTemplateToBeSet => {
1972
- this.store.dispatch(setPlaceholderTemplateEntity({ entity: placeholdersTemplateToBeSet }));
1973
- });
1974
- placeholdersUpdates.placeholderRequestsToDisable.forEach(placeholderRequestToDisable => {
1975
- this.store.dispatch(updatePlaceholderRequestEntity({ entity: { id: placeholderRequestToDisable, used: false } }));
1976
- });
1977
- placeholdersUpdates.placeholderRequestsToEnable.forEach(placeholderRequestToEnable => {
1978
- this.store.dispatch(updatePlaceholderRequestEntity({ entity: { id: placeholderRequestToEnable, used: true } }));
1979
- });
1980
- placeholdersUpdates.placeholderNewRequests.forEach(placeholderNewRequest => {
1981
- this.store.dispatch(setPlaceholderRequestEntityFromUrl({
1982
- resolvedUrl: placeholderNewRequest.resolvedUrl,
1983
- id: placeholderNewRequest.rawUrl,
1984
- call: this.retrieveTemplate(placeholderNewRequest.resolvedUrl)
1985
- }));
1986
- });
1914
+ this.subscription.add(this.events$.pipe(filter(() => this.enabled)).subscribe(async (events) => {
1915
+ this.logger.debug('Start Rules Engine action executed');
1916
+ await this.executeActions(events);
1917
+ this.logger.debug('All Rules Engine actions executed');
1987
1918
  }));
1988
1919
  }
1989
1920
  /**
1990
1921
  * Execute the list of actions
1991
- *
1992
- * @param ruleEvent Rule engine execution result
1993
1922
  * @param actions
1994
1923
  */
1995
- executeActionSync(actions) {
1996
- const configOverrides = [];
1997
- const assets = {};
1998
- const locs = {};
1999
- const templates = [];
2000
- // create a map of actions depending on actions type
2001
- actions.forEach((action) => {
2002
- switch (action.actionType) {
2003
- case 'UPDATE_ASSET': {
2004
- assets[action.asset] = action.value;
2005
- break;
2006
- }
2007
- case 'UPDATE_LOCALISATION': {
2008
- locs[action.key] = action.value;
2009
- break;
2010
- }
2011
- case 'UPDATE_CONFIG': {
2012
- if (action.library && action.component && action.property && typeof action.value !== 'undefined') {
2013
- configOverrides.push({
2014
- component: action.component,
2015
- library: action.library,
2016
- property: action.property,
2017
- value: action.value
2018
- });
2019
- }
2020
- break;
2021
- }
2022
- case 'UPDATE_PLACEHOLDER': {
2023
- templates.push({
2024
- placeholderId: action.placeholderId,
2025
- templateUrl: action.value,
2026
- priority: action.priority || 0
2027
- });
2028
- break;
2029
- }
2030
- default: {
2031
- break;
2032
- }
1924
+ async executeActions(actions) {
1925
+ const actionHandlers = [...this.actionHandlers];
1926
+ const supportedActions = new Set(actionHandlers.map((handler) => handler.supportingActions).flat());
1927
+ const actionMaps = actions
1928
+ .filter((action) => {
1929
+ const isKnown = supportedActions.has(action.actionType);
1930
+ if (!isKnown) {
1931
+ this.logger.warn(`The action ${action.actionType} does not have registered handler`);
2033
1932
  }
2034
- });
2035
- const configOverrideMap = configOverrides.reduce((acc, ov) => {
2036
- const configName = computeConfigurationName(ov.component, ov.library);
2037
- acc[configName] ||= { overrides: {} };
2038
- acc[configName].overrides[ov.property] = ov.value;
1933
+ return isKnown;
1934
+ })
1935
+ .reduce((acc, action) => {
1936
+ acc[action.actionType] ||= [];
1937
+ acc[action.actionType].push(action);
2039
1938
  return acc;
2040
1939
  }, {});
2041
- const configs = {};
2042
- Object.entries(configOverrideMap).forEach(([key, value]) => {
2043
- configs[key] = value.overrides;
2044
- });
2045
- this.store.dispatch(setAssetPathOverride({ state: { assetPathOverrides: assets } }));
2046
- this.store.dispatch(setLocalizationOverride({ state: { localizationOverrides: locs } }));
2047
- this.placeholdersActions$.next(templates);
2048
- this.store.dispatch(setConfigOverride({ state: { configOverrides: configs } }));
1940
+ const handling = actionHandlers
1941
+ .map((handler) => handler.executeActions(handler.supportingActions
1942
+ .filter((supportedAction) => actionMaps[supportedAction])
1943
+ .reduce((acc, supportedAction) => acc.concat(actionMaps[supportedAction]), [])));
1944
+ await Promise.all(handling);
2049
1945
  }
2050
1946
  /**
2051
1947
  * Update or insert fact in rules engine
2052
- *
2053
1948
  * @param facts fact list to add / update
2054
1949
  */
2055
1950
  upsertFacts(facts) {
@@ -2057,7 +1952,6 @@ class RulesEngineService {
2057
1952
  }
2058
1953
  /**
2059
1954
  * Update or insert operator in rules engine
2060
- *
2061
1955
  * @param operators operator list to add / update
2062
1956
  */
2063
1957
  upsertOperators(operators) {
@@ -2069,7 +1963,6 @@ class RulesEngineService {
2069
1963
  }
2070
1964
  /**
2071
1965
  * Enable temporary a rule set
2072
- *
2073
1966
  * @param componentComputedName Name of the component to enable the ruleset for
2074
1967
  */
2075
1968
  enableRuleSetFor(componentComputedName) {
@@ -2079,7 +1972,6 @@ class RulesEngineService {
2079
1972
  }
2080
1973
  /**
2081
1974
  * Disable temporary a rule set
2082
- *
2083
1975
  * @param componentComputedName Name of the component to disable the ruleset for
2084
1976
  */
2085
1977
  disableRuleSetFor(componentComputedName) {
@@ -2089,215 +1981,44 @@ class RulesEngineService {
2089
1981
  this.linkedComponents$.next(newMap);
2090
1982
  }
2091
1983
  }
2092
- /**
2093
- * Localize the url, replacing the language marker
2094
- *
2095
- * @param url
2096
- * @param language
2097
- */
2098
- resolveUrlWithLang(url, language) {
2099
- return url.replace(/\[LANGUAGE]/g, language);
2100
- }
2101
- /**
2102
- * Retrieve template as json from a given url
2103
- *
2104
- * @param url
2105
- */
2106
- async retrieveTemplate(url) {
2107
- const fullUrl = await firstValueFrom(this.dynamicContentService.getContentPathStream(url));
2108
- return fetch(fullUrl).then((response) => response.json());
2109
- }
2110
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesEngineService, deps: [{ token: i1$2.Store }, { token: i2.TranslateService }, { token: i3.DynamicContentService }, { token: i4.LoggerService }, { token: RULES_ENGINE_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2111
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesEngineService }); }
1984
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesEngineRunnerService, deps: [{ token: i1$2.Store }, { token: i2.LoggerService }, { token: RULES_ENGINE_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
1985
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesEngineRunnerService }); }
2112
1986
  }
2113
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesEngineService, decorators: [{
1987
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesEngineRunnerService, decorators: [{
2114
1988
  type: Injectable
2115
- }], ctorParameters: function () { return [{ type: i1$2.Store }, { type: i2.TranslateService }, { type: i3.DynamicContentService }, { type: i4.LoggerService }, { type: undefined, decorators: [{
1989
+ }], ctorParameters: () => [{ type: i1$2.Store }, { type: i2.LoggerService }, { type: undefined, decorators: [{
2116
1990
  type: Optional
2117
1991
  }, {
2118
1992
  type: Inject,
2119
1993
  args: [RULES_ENGINE_OPTIONS]
2120
- }] }]; } });
2121
-
2122
- /**
2123
- * Service to handle async PlaceholderTemplate actions
2124
- */
2125
- class PlaceholderTemplateResponseEffect {
2126
- constructor(actions$, rulesEngineService, dynamicContentService, store, translationService) {
2127
- this.actions$ = actions$;
2128
- this.rulesEngineService = rulesEngineService;
2129
- this.dynamicContentService = dynamicContentService;
2130
- this.store = store;
2131
- this.translationService = translationService;
2132
- /**
2133
- * Set the PlaceholderRequest entity with the reply content, dispatch failPlaceholderRequestEntity if it catches a failure
2134
- * Handles the rendering of the HTML content from the template and creates the combine latest from facts list if needed
2135
- * Disables unused templates refresh if used is false in the store
2136
- */
2137
- this.setPlaceholderRequestEntityFromUrl$ = createEffect(() => this.actions$.pipe(ofType(setPlaceholderRequestEntityFromUrl), fromApiEffectSwitchMapById((templateResponse, action) => {
2138
- const facts = templateResponse.vars ? Object.values(templateResponse.vars).filter((variable) => variable.type === 'fact') : [];
2139
- const factsStreamsList = facts.map((fact) => this.rulesEngineService.engine.retrieveOrCreateFactStream(fact.value).pipe(map((factValue) => ({
2140
- // eslint-disable-next-line new-cap
2141
- name: fact.value, factValue: (fact.path && factValue) ? JSONPath({ wrap: false, json: factValue, path: fact.path }) : factValue
2142
- })), distinctUntilChanged((previous, current) => previous.factValue === current.factValue)));
2143
- const factsStreamsList$ = factsStreamsList.length ? combineLatest(factsStreamsList) : of([]);
2144
- return combineLatest([factsStreamsList$, this.store.select(selectPlaceholderRequestEntityUsage(action.id)).pipe(distinctUntilChanged())]).pipe(switchMap(([factsUsedInTemplate, placeholderRequestUsage]) => {
2145
- if (!placeholderRequestUsage) {
2146
- return EMPTY;
2147
- }
2148
- return this.getRenderedHTML$(templateResponse.template, templateResponse.vars, factsUsedInTemplate).pipe(map(({ renderedTemplate, unknownTypeFound }) =>
2149
- // Update instead of set because used already set by the update from url action
2150
- updatePlaceholderRequestEntity({
2151
- entity: {
2152
- ...templateResponse,
2153
- resolvedUrl: action.resolvedUrl,
2154
- id: action.id,
2155
- renderedTemplate,
2156
- unknownTypeFound
2157
- },
2158
- requestId: action.requestId
2159
- })));
2160
- }));
2161
- }, (error, action) => of(failPlaceholderRequestEntity({ ids: [action.id], error, requestId: action.requestId })), (requestIdPayload, action) => cancelPlaceholderRequest({ ...requestIdPayload, id: action.id }))));
2162
- }
2163
- /**
2164
- * Renders the html template, replacing facts and urls and localizationKeys
2165
- *
2166
- * @param template
2167
- * @param vars
2168
- * @param facts
2169
- */
2170
- getRenderedHTML$(template, vars, facts) {
2171
- let unknownTypeFound = false;
2172
- const factset = (facts || []).reduce((set, fact) => {
2173
- set[fact.name] = fact.factValue;
2174
- return set;
2175
- }, {});
2176
- const replacements$ = [];
2177
- if (vars && template) {
2178
- for (const varName in vars) {
2179
- if (Object.prototype.hasOwnProperty.call(vars, varName)) {
2180
- const ejsVar = new RegExp(`<%=\\s*${varName}\\s*%>`, 'g');
2181
- switch (vars[varName].type) {
2182
- case 'relativeUrl': {
2183
- replacements$.push(this.dynamicContentService.getMediaPathStream(vars[varName].value).pipe(take(1), map((value) => ({ ejsVar, value }))));
2184
- break;
2185
- }
2186
- case 'fullUrl': {
2187
- template = template.replace(ejsVar, vars[varName].value);
2188
- break;
2189
- }
2190
- case 'fact': {
2191
- template = template.replace(ejsVar, factset[vars[varName].value] ?? '');
2192
- break;
2193
- }
2194
- case 'localisation': {
2195
- const linkedParams = (vars[varName].vars || []).reduce((acc, parameter) => {
2196
- const paramName = vars[parameter].value;
2197
- acc[paramName] = factset[paramName];
2198
- return acc;
2199
- }, {});
2200
- if (this.translationService) {
2201
- replacements$.push(this.translationService.translate(vars[varName].value, linkedParams).pipe(map((value) => ({ ejsVar, value }))));
2202
- }
2203
- break;
2204
- }
2205
- default: {
2206
- unknownTypeFound = true;
2207
- break;
2208
- }
2209
- }
2210
- }
2211
- }
2212
- }
2213
- return replacements$.length > 0 && !!template ?
2214
- combineLatest(replacements$).pipe(map((replacements) => ({
2215
- renderedTemplate: replacements.reduce((acc, replacement) => acc.replace(replacement.ejsVar, replacement.value), template),
2216
- unknownTypeFound
2217
- }))) : of({ renderedTemplate: template, unknownTypeFound });
2218
- }
2219
- /**
2220
- * Renders the html template, replacing facts and urls
2221
- *
2222
- * @param template
2223
- * @param vars
2224
- * @param facts
2225
- * @deprecated will be removed in v10
2226
- */
2227
- async renderHTML(template, vars, facts) {
2228
- let unknownTypeFound = false;
2229
- if (vars && template) {
2230
- for (const varName in vars) {
2231
- if (Object.prototype.hasOwnProperty.call(vars, varName)) {
2232
- const ejsVar = new RegExp(`<%=\\s*${varName}\\s*%>`, 'g');
2233
- switch (vars[varName].type) {
2234
- case 'relativeUrl': {
2235
- const url = await firstValueFrom(this.dynamicContentService.getMediaPathStream(vars[varName].value));
2236
- template = template.replace(ejsVar, url);
2237
- break;
2238
- }
2239
- case 'fullUrl': {
2240
- template = template.replace(ejsVar, vars[varName].value);
2241
- break;
2242
- }
2243
- case 'fact': {
2244
- const fact = facts ? facts.find((el) => el.name === varName) : undefined;
2245
- template = template.replace(ejsVar, fact ? fact.factValue : '');
2246
- break;
2247
- }
2248
- default: {
2249
- unknownTypeFound = true;
2250
- break;
2251
- }
2252
- }
2253
- }
2254
- }
2255
- }
2256
- return { renderedTemplate: template, unknownTypeFound };
2257
- }
2258
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: PlaceholderTemplateResponseEffect, deps: [{ token: i1$1.Actions }, { token: RulesEngineService }, { token: i3.DynamicContentService }, { token: i1$2.Store }, { token: i5.LocalizationService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2259
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: PlaceholderTemplateResponseEffect }); }
2260
- }
2261
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: PlaceholderTemplateResponseEffect, decorators: [{
2262
- type: Injectable
2263
- }], ctorParameters: function () { return [{ type: i1$1.Actions }, { type: RulesEngineService }, { type: i3.DynamicContentService }, { type: i1$2.Store }, { type: i5.LocalizationService, decorators: [{
2264
- type: Optional
2265
- }] }]; } });
1994
+ }] }] });
2266
1995
 
2267
- class RulesEngineModule {
1996
+ class RulesEngineRunnerModule {
2268
1997
  static forRoot(options) {
2269
1998
  const opts = options ? { ...DEFAULT_RULES_ENGINE_OPTIONS, ...options } : DEFAULT_RULES_ENGINE_OPTIONS;
2270
1999
  return {
2271
- ngModule: RulesEngineModule,
2000
+ ngModule: RulesEngineRunnerModule,
2272
2001
  providers: [
2273
2002
  { provide: RULES_ENGINE_OPTIONS, useValue: opts },
2274
- RulesEngineService
2003
+ RulesEngineRunnerService
2275
2004
  ]
2276
2005
  };
2277
2006
  }
2278
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesEngineModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2279
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.0", ngImport: i0, type: RulesEngineModule, imports: [StoreModule,
2280
- DynamicContentModule,
2007
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesEngineRunnerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2008
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: RulesEngineRunnerModule, imports: [StoreModule,
2281
2009
  RulesetsStoreModule,
2282
- LoggerModule,
2283
- TranslateModule, i1$1.EffectsFeatureModule] }); }
2284
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesEngineModule, imports: [StoreModule,
2285
- DynamicContentModule,
2010
+ LoggerModule] }); }
2011
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesEngineRunnerModule, imports: [StoreModule,
2286
2012
  RulesetsStoreModule,
2287
- LoggerModule,
2288
- TranslateModule,
2289
- EffectsModule.forFeature([PlaceholderTemplateResponseEffect])] }); }
2013
+ LoggerModule] }); }
2290
2014
  }
2291
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesEngineModule, decorators: [{
2015
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesEngineRunnerModule, decorators: [{
2292
2016
  type: NgModule,
2293
2017
  args: [{
2294
2018
  imports: [
2295
2019
  StoreModule,
2296
- DynamicContentModule,
2297
2020
  RulesetsStoreModule,
2298
- LoggerModule,
2299
- TranslateModule,
2300
- EffectsModule.forFeature([PlaceholderTemplateResponseEffect])
2021
+ LoggerModule
2301
2022
  ]
2302
2023
  }]
2303
2024
  }] });
@@ -2353,7 +2074,6 @@ class OtterRulesEngineDevtools {
2353
2074
  }
2354
2075
  /**
2355
2076
  * Get the list of executions for the given ruleset
2356
- *
2357
2077
  * @param rulesetId
2358
2078
  */
2359
2079
  async getRulesetExecutions(rulesetId) {
@@ -2362,7 +2082,6 @@ class OtterRulesEngineDevtools {
2362
2082
  }
2363
2083
  /**
2364
2084
  * Check if the ruleset is activ in the moment when the function is called
2365
- *
2366
2085
  * @param rulesetId
2367
2086
  * @returns True if the ruleset is active; False if the ruleset is inactive or it does not exist
2368
2087
  */
@@ -2371,7 +2090,6 @@ class OtterRulesEngineDevtools {
2371
2090
  }
2372
2091
  /**
2373
2092
  * Get the list of rules executed for the specified ruleset
2374
- *
2375
2093
  * @param rulesetId
2376
2094
  */
2377
2095
  async getRulesEvaluationsForRuleset(rulesetId) {
@@ -2380,7 +2098,6 @@ class OtterRulesEngineDevtools {
2380
2098
  }
2381
2099
  /**
2382
2100
  * Get the list of input facts (name, current value) for the specified ruleset, at the moment when the function is called
2383
- *
2384
2101
  * @param rulesetId
2385
2102
  */
2386
2103
  async getInputFactsForRuleset(rulesetId) {
@@ -2389,7 +2106,6 @@ class OtterRulesEngineDevtools {
2389
2106
  }
2390
2107
  /**
2391
2108
  * Get the list of triggers for the specified ruleset
2392
- *
2393
2109
  * @param rulesetId
2394
2110
  */
2395
2111
  async getTriggersForRuleset(rulesetId) {
@@ -2397,7 +2113,6 @@ class OtterRulesEngineDevtools {
2397
2113
  }
2398
2114
  /**
2399
2115
  * Get the list of outputed actions emitted by the given ruleset, at the moment when the function is called
2400
- *
2401
2116
  * @param rulesetId
2402
2117
  */
2403
2118
  async getOutputActionsForRuleset(rulesetId) {
@@ -2413,26 +2128,25 @@ class OtterRulesEngineDevtools {
2413
2128
  }
2414
2129
  /**
2415
2130
  * Retrieve the ruleset information (rules, linkedComponent, validity range etc.) for a ruleset id
2416
- *
2417
2131
  * @param rulesetId
2418
2132
  */
2419
2133
  getRulesetInformation(rulesetId) {
2420
2134
  return firstValueFrom(this.store.pipe(select(selectRulesetsEntities), map((entities) => entities[rulesetId])));
2421
2135
  }
2422
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: OtterRulesEngineDevtools, deps: [{ token: i1$2.Store }, { token: RulesEngineService }, { token: OTTER_RULES_ENGINE_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2423
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: OtterRulesEngineDevtools, providedIn: 'root' }); }
2136
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: OtterRulesEngineDevtools, deps: [{ token: i1$2.Store }, { token: RulesEngineRunnerService }, { token: OTTER_RULES_ENGINE_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2137
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: OtterRulesEngineDevtools, providedIn: 'root' }); }
2424
2138
  }
2425
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: OtterRulesEngineDevtools, decorators: [{
2139
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: OtterRulesEngineDevtools, decorators: [{
2426
2140
  type: Injectable,
2427
2141
  args: [{
2428
2142
  providedIn: 'root'
2429
2143
  }]
2430
- }], ctorParameters: function () { return [{ type: i1$2.Store }, { type: RulesEngineService }, { type: undefined, decorators: [{
2144
+ }], ctorParameters: () => [{ type: i1$2.Store }, { type: RulesEngineRunnerService }, { type: undefined, decorators: [{
2431
2145
  type: Optional
2432
2146
  }, {
2433
2147
  type: Inject,
2434
2148
  args: [OTTER_RULES_ENGINE_DEVTOOLS_OPTIONS]
2435
- }] }]; } });
2149
+ }] }] });
2436
2150
 
2437
2151
  /* eslint-disable no-console */
2438
2152
  class RulesEngineDevtoolsConsoleService {
@@ -2475,7 +2189,6 @@ class RulesEngineDevtoolsConsoleService {
2475
2189
  }
2476
2190
  /**
2477
2191
  * Get the list of executions for the given ruleset
2478
- *
2479
2192
  * @param rulesetId
2480
2193
  */
2481
2194
  async getRulesetExecutions(rulesetId) {
@@ -2483,7 +2196,6 @@ class RulesEngineDevtoolsConsoleService {
2483
2196
  }
2484
2197
  /**
2485
2198
  * Check if the ruleset is activ in the moment when the function is called
2486
- *
2487
2199
  * @param rulesetId
2488
2200
  * @returns True if the ruleset is active; False if the ruleset is inactive or it does not exist
2489
2201
  */
@@ -2492,7 +2204,6 @@ class RulesEngineDevtoolsConsoleService {
2492
2204
  }
2493
2205
  /**
2494
2206
  * Get the list of rules executed for the specified ruleset
2495
- *
2496
2207
  * @param rulesetId
2497
2208
  */
2498
2209
  async getRulesEvaluationsForRuleset(rulesetId) {
@@ -2500,7 +2211,6 @@ class RulesEngineDevtoolsConsoleService {
2500
2211
  }
2501
2212
  /**
2502
2213
  * Get the list of input facts (name, current value) for the specified ruleset, at the moment when the function is called
2503
- *
2504
2214
  * @param rulesetId
2505
2215
  */
2506
2216
  async getInputFactsForRuleset(rulesetId) {
@@ -2508,7 +2218,6 @@ class RulesEngineDevtoolsConsoleService {
2508
2218
  }
2509
2219
  /**
2510
2220
  * Get the list of triggers for the specified ruleset
2511
- *
2512
2221
  * @param rulesetId
2513
2222
  */
2514
2223
  async getTriggersForRuleset(rulesetId) {
@@ -2516,7 +2225,6 @@ class RulesEngineDevtoolsConsoleService {
2516
2225
  }
2517
2226
  /**
2518
2227
  * Get the list of outputed actions emitted by the given ruleset, at the moment when the function is called
2519
- *
2520
2228
  * @param rulesetId
2521
2229
  */
2522
2230
  async getOutputActionsForRuleset(rulesetId) {
@@ -2528,26 +2236,25 @@ class RulesEngineDevtoolsConsoleService {
2528
2236
  }
2529
2237
  /**
2530
2238
  * Retrieve the ruleset information (rules, linkedComponent, validity range etc.) for a ruleset id
2531
- *
2532
2239
  * @param rulesetId
2533
2240
  */
2534
2241
  async getRulesetInformation(rulesetId) {
2535
2242
  console.log(await this.rulesEngineDevtools.getRulesetInformation(rulesetId));
2536
2243
  }
2537
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesEngineDevtoolsConsoleService, deps: [{ token: OtterRulesEngineDevtools }, { token: OTTER_RULES_ENGINE_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2538
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesEngineDevtoolsConsoleService, providedIn: 'root' }); }
2244
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesEngineDevtoolsConsoleService, deps: [{ token: OtterRulesEngineDevtools }, { token: OTTER_RULES_ENGINE_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2245
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesEngineDevtoolsConsoleService, providedIn: 'root' }); }
2539
2246
  }
2540
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesEngineDevtoolsConsoleService, decorators: [{
2247
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesEngineDevtoolsConsoleService, decorators: [{
2541
2248
  type: Injectable,
2542
2249
  args: [{
2543
2250
  providedIn: 'root'
2544
2251
  }]
2545
- }], ctorParameters: function () { return [{ type: OtterRulesEngineDevtools }, { type: undefined, decorators: [{
2252
+ }], ctorParameters: () => [{ type: OtterRulesEngineDevtools }, { type: undefined, decorators: [{
2546
2253
  type: Optional
2547
2254
  }, {
2548
2255
  type: Inject,
2549
2256
  args: [OTTER_RULES_ENGINE_DEVTOOLS_OPTIONS]
2550
- }] }]; } });
2257
+ }] }] });
2551
2258
 
2552
2259
  class RulesEngineDevtoolsMessageService {
2553
2260
  constructor(rulesEngineDevtools, logger, options) {
@@ -2566,7 +2273,6 @@ class RulesEngineDevtoolsMessageService {
2566
2273
  }
2567
2274
  /**
2568
2275
  * Function to trigger a re-send a requested messages to the Otter Chrome DevTools extension
2569
- *
2570
2276
  * @param only restricted list of messages to re-send
2571
2277
  */
2572
2278
  handleReEmitRequest(only) {
@@ -2576,7 +2282,6 @@ class RulesEngineDevtoolsMessageService {
2576
2282
  }
2577
2283
  /**
2578
2284
  * Function to handle the incoming messages from Otter Chrome DevTools extension
2579
- *
2580
2285
  * @param event Event coming from the Otter Chrome DevTools extension
2581
2286
  * @param message
2582
2287
  */
@@ -2620,25 +2325,24 @@ class RulesEngineDevtoolsMessageService {
2620
2325
  ngOnDestroy() {
2621
2326
  this.subscriptions.unsubscribe();
2622
2327
  }
2623
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesEngineDevtoolsMessageService, deps: [{ token: OtterRulesEngineDevtools }, { token: i4.LoggerService }, { token: OTTER_RULES_ENGINE_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2624
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesEngineDevtoolsMessageService, providedIn: 'root' }); }
2328
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesEngineDevtoolsMessageService, deps: [{ token: OtterRulesEngineDevtools }, { token: i2.LoggerService }, { token: OTTER_RULES_ENGINE_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2329
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesEngineDevtoolsMessageService, providedIn: 'root' }); }
2625
2330
  }
2626
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesEngineDevtoolsMessageService, decorators: [{
2331
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesEngineDevtoolsMessageService, decorators: [{
2627
2332
  type: Injectable,
2628
2333
  args: [{
2629
2334
  providedIn: 'root'
2630
2335
  }]
2631
- }], ctorParameters: function () { return [{ type: OtterRulesEngineDevtools }, { type: i4.LoggerService }, { type: undefined, decorators: [{
2336
+ }], ctorParameters: () => [{ type: OtterRulesEngineDevtools }, { type: i2.LoggerService }, { type: undefined, decorators: [{
2632
2337
  type: Optional
2633
2338
  }, {
2634
2339
  type: Inject,
2635
2340
  args: [OTTER_RULES_ENGINE_DEVTOOLS_OPTIONS]
2636
- }] }]; } });
2341
+ }] }] });
2637
2342
 
2638
2343
  class RulesEngineDevtoolsModule {
2639
2344
  /**
2640
2345
  * Initialize Otter Devtools
2641
- *
2642
2346
  * @param options
2643
2347
  */
2644
2348
  static instrument(options) {
@@ -2651,17 +2355,17 @@ class RulesEngineDevtoolsModule {
2651
2355
  ]
2652
2356
  };
2653
2357
  }
2654
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesEngineDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2655
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.0", ngImport: i0, type: RulesEngineDevtoolsModule, imports: [StoreModule,
2358
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesEngineDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2359
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: RulesEngineDevtoolsModule, imports: [StoreModule,
2656
2360
  RulesetsStoreModule] }); }
2657
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesEngineDevtoolsModule, providers: [
2361
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesEngineDevtoolsModule, providers: [
2658
2362
  { provide: OTTER_RULES_ENGINE_DEVTOOLS_OPTIONS, useValue: OTTER_RULES_ENGINE_DEVTOOLS_DEFAULT_OPTIONS },
2659
2363
  RulesEngineDevtoolsMessageService,
2660
2364
  RulesEngineDevtoolsConsoleService
2661
2365
  ], imports: [StoreModule,
2662
2366
  RulesetsStoreModule] }); }
2663
2367
  }
2664
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RulesEngineDevtoolsModule, decorators: [{
2368
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RulesEngineDevtoolsModule, decorators: [{
2665
2369
  type: NgModule,
2666
2370
  args: [{
2667
2371
  imports: [
@@ -2692,5 +2396,5 @@ class FactsService {
2692
2396
  * Generated bundle index. Do not edit.
2693
2397
  */
2694
2398
 
2695
- export { DEFAULT_RULES_ENGINE_OPTIONS, EngineDebugger, FactsService, FallbackToPipe, OTTER_RULES_ENGINE_DEVTOOLS_DEFAULT_OPTIONS, OTTER_RULES_ENGINE_DEVTOOLS_OPTIONS, OtterRulesEngineDevtools, RULESETS_REDUCER_TOKEN, RULESETS_STORE_NAME, RULES_ENGINE_OPTIONS, RulesEngine, RulesEngineDevtoolsConsoleService, RulesEngineDevtoolsMessageService, RulesEngineDevtoolsModule, RulesEngineModule, RulesEngineService, RulesetHistoryPresComponent, RulesetHistoryPresModule, RulesetsEffect, RulesetsStoreModule, allEqual, allGreater, allIn, allLower, allMatch, allNotIn, allRangeNumber, arrayBasedOperators, arrayContains, basicOperators, cancelRulesetsRequest, clearRulesetsEntities, dateAfter, dateBasedOperators, dateBefore, dateEquals, dateNotEquals, equals, executeOperator, failRulesetsEntities, getDefaultRulesetsReducer, getStatus, greaterThan, greaterThanOrEqual, inArray, inRangeDate, inString, isAllConditions, isAnyConditions, isConditionProperties, isDefined, isNotCondition, isOperandFact, isOperandLiteral, isOperandRuntimeFact, isRangeNumber, isRulesEngineMessage, isString, isSupportedSimpleTypes, isUndefined, isValidDate, isValidDateInput, isValidDateRange, lengthEquals, lengthGreaterThan, lengthGreaterThanOrEquals, lengthLessThan, lengthLessThanOrEquals, lengthNotEquals, lessOrEqual, lessThan, notArrayContains, notEquals, notInArray, notInString, notStringContains, numberBasedOperators, numberValidator, oneEquals, oneGreater, oneIn, oneLower, oneMatches, oneRangeNumber, operatorList, resetRulesets, rulesetReportToHistory, rulesetsAdapter, rulesetsInitialState, rulesetsReducer, rulesetsReducerFeatures, rulesetsStorageDeserializer, rulesetsStorageSerializer, rulesetsStorageSync, selectActiveRuleSets, selectAllRulesets, selectRuleSetLinkComponents, selectRulesetsEntities, selectRulesetsIds, selectRulesetsState, selectRulesetsStorePendingStatus, selectRulesetsTotal, setRulesets, setRulesetsEntities, setRulesetsEntitiesFromApi, stringContains, updateRulesets, upsertRulesetsEntities, upsertRulesetsEntitiesFromApi };
2399
+ export { DEFAULT_RULES_ENGINE_OPTIONS, EngineDebugger, FactsService, FallbackToPipe, OTTER_RULES_ENGINE_DEVTOOLS_DEFAULT_OPTIONS, OTTER_RULES_ENGINE_DEVTOOLS_OPTIONS, OtterRulesEngineDevtools, RULESETS_REDUCER_TOKEN, RULESETS_STORE_NAME, RULES_ENGINE_OPTIONS, RulesEngine, RulesEngineDevtoolsConsoleService, RulesEngineDevtoolsMessageService, RulesEngineDevtoolsModule, RulesEngineRunnerModule, RulesEngineRunnerService, RulesetHistoryPresComponent, RulesetHistoryPresModule, RulesetsEffect, RulesetsStoreModule, allEqual, allGreater, allIn, allLower, allMatch, allNotIn, allRangeNumber, arrayBasedOperators, arrayContains, basicOperators, cancelRulesetsRequest, clearRulesetsEntities, dateAfter, dateBasedOperators, dateBefore, dateEquals, dateInNextMinutes, dateNotEquals, dateNotInNextMinutes, equals, executeOperator, failRulesetsEntities, getDefaultRulesetsReducer, getStatus, greaterThan, greaterThanOrEqual, inArray, inRangeDate, inString, isAllConditions, isAnyConditions, isConditionProperties, isDefined, isNotCondition, isOperandFact, isOperandLiteral, isOperandRuntimeFact, isRangeNumber, isRulesEngineMessage, isString, isSupportedSimpleTypes, isUndefined, isValidDate, isValidDateInput, isValidDateRange, lengthEquals, lengthGreaterThan, lengthGreaterThanOrEquals, lengthLessThan, lengthLessThanOrEquals, lengthNotEquals, lessOrEqual, lessThan, matchesPattern, notArrayContains, notEquals, notInArray, notInString, notStringContains, numberBasedOperators, numberValidator, oneEquals, oneGreater, oneIn, oneLower, oneMatches, oneRangeNumber, operatorList, parseRegExp, resetRulesets, rulesetReportToHistory, rulesetsAdapter, rulesetsInitialState, rulesetsReducer, rulesetsReducerFeatures, rulesetsStorageDeserializer, rulesetsStorageSerializer, rulesetsStorageSync, selectActiveRuleSets, selectAllRulesets, selectRuleSetLinkComponents, selectRulesetsEntities, selectRulesetsIds, selectRulesetsState, selectRulesetsStorePendingStatus, selectRulesetsTotal, setRulesets, setRulesetsEntities, setRulesetsEntitiesFromApi, stringContains, updateRulesets, upsertRulesetsEntities, upsertRulesetsEntitiesFromApi };
2696
2400
  //# sourceMappingURL=o3r-rules-engine.mjs.map