@o3r/rules-engine 12.0.0-next.2 → 12.0.0-next.21

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 (108) hide show
  1. package/builders/package.json +3 -0
  2. package/components/rules-engine/rule-actions/rule-actions-pres.component.d.ts +1 -1
  3. package/components/rules-engine/rule-actions/rule-actions-pres.component.d.ts.map +1 -1
  4. package/components/rules-engine/rule-condition/rule-condition-pres.component.d.ts +1 -1
  5. package/components/rules-engine/rule-condition/rule-condition-pres.component.d.ts.map +1 -1
  6. package/components/rules-engine/rule-key-value/rule-key-value-pres.component.d.ts +1 -1
  7. package/components/rules-engine/rule-key-value/rule-key-value-pres.component.d.ts.map +1 -1
  8. package/components/rules-engine/rule-tree/rule-tree-pres.component.d.ts +1 -1
  9. package/components/rules-engine/rule-tree/rule-tree-pres.component.d.ts.map +1 -1
  10. package/components/rules-engine/ruleset-history/ruleset-history-pres.component.d.ts +1 -1
  11. package/components/rules-engine/ruleset-history/ruleset-history-pres.component.d.ts.map +1 -1
  12. package/components/rules-engine/ruleset-history/ruleset-history-pres.module.d.ts +7 -9
  13. package/components/rules-engine/ruleset-history/ruleset-history-pres.module.d.ts.map +1 -1
  14. package/components/rules-engine/shared/fallback-to.pipe.d.ts +0 -7
  15. package/components/rules-engine/shared/fallback-to.pipe.d.ts.map +1 -1
  16. package/components/rules-engine/shared/json-or-string.pipe.d.ts.map +1 -1
  17. package/engine/debug/helpers.d.ts +3 -2
  18. package/engine/debug/helpers.d.ts.map +1 -1
  19. package/engine/engine.interface.d.ts +2 -8
  20. package/engine/engine.interface.d.ts.map +1 -1
  21. package/engine/helpers/filter-ruleset-event.operator.d.ts.map +1 -1
  22. package/engine/ruleset-executor.d.ts.map +1 -1
  23. package/engine/structure.d.ts +0 -8
  24. package/engine/structure.d.ts.map +1 -1
  25. package/fesm2022/o3r-rules-engine.mjs +186 -218
  26. package/fesm2022/o3r-rules-engine.mjs.map +1 -1
  27. package/fixtures/jasmine/package.json +3 -0
  28. package/fixtures/jest/package.json +3 -0
  29. package/interfaces/index.d.ts +0 -1
  30. package/interfaces/index.d.ts.map +1 -1
  31. package/package.json +17 -22
  32. package/schemas/rulesets.schema.json +0 -13
  33. package/schematics/package.json +3 -0
  34. package/stores/rulesets/rulesets.selectors.d.ts +0 -5
  35. package/stores/rulesets/rulesets.selectors.d.ts.map +1 -1
  36. package/esm2022/components/index.mjs +0 -2
  37. package/esm2022/components/rules-engine/index.mjs +0 -4
  38. package/esm2022/components/rules-engine/rule-actions/rule-actions-pres.component.mjs +0 -35
  39. package/esm2022/components/rules-engine/rule-condition/rule-condition-pres.component.mjs +0 -36
  40. package/esm2022/components/rules-engine/rule-key-value/rule-key-value-pres.component.mjs +0 -63
  41. package/esm2022/components/rules-engine/rule-tree/rule-tree-pres.component.mjs +0 -48
  42. package/esm2022/components/rules-engine/ruleset-history/ruleset-history-pres.component.mjs +0 -50
  43. package/esm2022/components/rules-engine/ruleset-history/ruleset-history-pres.module.mjs +0 -23
  44. package/esm2022/components/rules-engine/shared/fallback-to.pipe.mjs +0 -25
  45. package/esm2022/components/rules-engine/shared/index.mjs +0 -4
  46. package/esm2022/components/rules-engine/shared/json-or-string.pipe.mjs +0 -23
  47. package/esm2022/components/rules-engine/shared/ruleset-history.helper.mjs +0 -51
  48. package/esm2022/devkit/index.mjs +0 -7
  49. package/esm2022/devkit/rules-engine-devkit.interface.mjs +0 -6
  50. package/esm2022/devkit/rules-engine-devtools.console.service.mjs +0 -111
  51. package/esm2022/devkit/rules-engine-devtools.message.service.mjs +0 -115
  52. package/esm2022/devkit/rules-engine-devtools.module.mjs +0 -47
  53. package/esm2022/devkit/rules-engine-devtools.service.mjs +0 -130
  54. package/esm2022/devkit/rules-engine-devtools.token.mjs +0 -6
  55. package/esm2022/engine/debug/engine.debug.mjs +0 -195
  56. package/esm2022/engine/debug/helpers.mjs +0 -91
  57. package/esm2022/engine/engine.interface.mjs +0 -2
  58. package/esm2022/engine/engine.mjs +0 -134
  59. package/esm2022/engine/fact/fact.interfaces.mjs +0 -2
  60. package/esm2022/engine/fact/index.mjs +0 -2
  61. package/esm2022/engine/helpers/filter-ruleset-event.operator.mjs +0 -19
  62. package/esm2022/engine/index.mjs +0 -8
  63. package/esm2022/engine/operator/index.mjs +0 -4
  64. package/esm2022/engine/operator/operator.helpers.mjs +0 -107
  65. package/esm2022/engine/operator/operator.interface.mjs +0 -2
  66. package/esm2022/engine/operator/operators/array-based.operators.mjs +0 -266
  67. package/esm2022/engine/operator/operators/basic.operators.mjs +0 -93
  68. package/esm2022/engine/operator/operators/date-based.operators.mjs +0 -119
  69. package/esm2022/engine/operator/operators/index.mjs +0 -10
  70. package/esm2022/engine/operator/operators/number-based.operators.mjs +0 -44
  71. package/esm2022/engine/rule/index.mjs +0 -2
  72. package/esm2022/engine/rule/rule.helpers.mjs +0 -50
  73. package/esm2022/engine/ruleset-executor.mjs +0 -256
  74. package/esm2022/engine/structure.mjs +0 -2
  75. package/esm2022/fact/fact.abstract-service.mjs +0 -12
  76. package/esm2022/fact/index.mjs +0 -3
  77. package/esm2022/fact/reserved.facts.mjs +0 -2
  78. package/esm2022/fixtures/jasmine/index.mjs +0 -2
  79. package/esm2022/fixtures/jasmine/o3r-rules-engine-fixtures-jasmine.mjs +0 -5
  80. package/esm2022/fixtures/jasmine/rules-engine.runner.service.fixture.jasmine.mjs +0 -14
  81. package/esm2022/fixtures/jest/index.mjs +0 -2
  82. package/esm2022/fixtures/jest/o3r-rules-engine-fixtures-jest.mjs +0 -5
  83. package/esm2022/fixtures/jest/rules-engine.runner.service.fixture.jest.mjs +0 -14
  84. package/esm2022/inner-facts/current-time/current-time-fact.service.mjs +0 -29
  85. package/esm2022/inner-facts/current-time/current-time.facts.mjs +0 -2
  86. package/esm2022/inner-facts/current-time/index.mjs +0 -3
  87. package/esm2022/inner-facts/index.mjs +0 -2
  88. package/esm2022/interfaces/action.interfaces.mjs +0 -2
  89. package/esm2022/interfaces/index.mjs +0 -3
  90. package/esm2022/interfaces/linkable-to-ruleset.interfaces.mjs +0 -2
  91. package/esm2022/o3r-rules-engine.mjs +0 -5
  92. package/esm2022/public_api.mjs +0 -9
  93. package/esm2022/services/index.mjs +0 -3
  94. package/esm2022/services/rules-engine.token.mjs +0 -9
  95. package/esm2022/services/runner/index.mjs +0 -3
  96. package/esm2022/services/runner/rules-engine.runner.module.mjs +0 -37
  97. package/esm2022/services/runner/rules-engine.runner.service.mjs +0 -132
  98. package/esm2022/stores/index.mjs +0 -2
  99. package/esm2022/stores/rulesets/index.mjs +0 -8
  100. package/esm2022/stores/rulesets/rulesets.actions.mjs +0 -42
  101. package/esm2022/stores/rulesets/rulesets.effect.mjs +0 -30
  102. package/esm2022/stores/rulesets/rulesets.module.mjs +0 -42
  103. package/esm2022/stores/rulesets/rulesets.reducer.mjs +0 -35
  104. package/esm2022/stores/rulesets/rulesets.selectors.mjs +0 -115
  105. package/esm2022/stores/rulesets/rulesets.state.mjs +0 -5
  106. package/esm2022/stores/rulesets/rulesets.sync.mjs +0 -20
  107. package/interfaces/action.interfaces.d.ts +0 -44
  108. package/interfaces/action.interfaces.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
- import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Pipe, NgModule, InjectionToken, Injectable, Optional, Inject, inject, DestroyRef } from '@angular/core';
3
1
  import * as i1 from '@angular/common';
4
2
  import { CommonModule, JsonPipe } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Pipe, NgModule, InjectionToken, Injectable, Optional, Inject, inject, DestroyRef } from '@angular/core';
5
5
  import { Subject, of, from, ReplaySubject, Observable, combineLatest, BehaviorSubject, merge, firstValueFrom, fromEvent } from 'rxjs';
6
6
  import { switchMap, delay, startWith, mergeMap, map, catchError, withLatestFrom, concatMap, tap, share, shareReplay, pairwise, distinctUntilChanged, takeUntil, filter, scan } from 'rxjs/operators';
7
7
  import * as i1$2 from '@ngrx/store';
@@ -15,39 +15,6 @@ import { createEntityAdapter } from '@ngrx/entity';
15
15
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
16
16
  import { JSONPath } from 'jsonpath-plus';
17
17
 
18
- class RuleConditionPresComponent {
19
- constructor() {
20
- /**
21
- * Left hand operator as it will be displayed in the template.
22
- * In the case of a fact with a json path, will resolve the whole fact path, else will only display the value
23
- */
24
- this.lhs = 'undefined';
25
- }
26
- /**
27
- * Rule condition that will be flattened by the component setter
28
- */
29
- set condition(condition) {
30
- this._condition = condition;
31
- this.lhs = condition?.lhs ? this.getOperandName(condition.lhs) : 'undefined';
32
- this.rhs = condition?.rhs ? this.getOperandName(condition.rhs) : undefined;
33
- }
34
- get condition() {
35
- return this._condition;
36
- }
37
- getOperandName(operand) {
38
- const value = `${operand.value ?? 'MISSING_VALUE'}`;
39
- return operand.path ? operand.path.replace(/^\$/, value) : value;
40
- }
41
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RuleConditionPresComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
42
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", 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 }); }
43
- }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RuleConditionPresComponent, decorators: [{
45
- type: Component,
46
- 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"] }]
47
- }], propDecorators: { condition: [{
48
- type: Input
49
- }] } });
50
-
51
18
  /**
52
19
  * Duration of the notification for clipboard feature (in milliseconds)
53
20
  */
@@ -90,12 +57,12 @@ class RuleKeyValuePresComponent {
90
57
  await navigator.clipboard.writeText(content);
91
58
  this.triggerNotification.next();
92
59
  }
93
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RuleKeyValuePresComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
94
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", 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\"\n (keyup.enter)=\"shouldLimitCharactersForOldValue = !shouldLimitCharactersForOldValue\"\n tabindex=\"0\"\n >\n {{isOldValuePrimitiveType ? oldValue : (oldValue | json)}}\n </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\"\n (keyup.enter)=\"shouldLimitCharactersForValue = !shouldLimitCharactersForValue\"\n tabindex=\"0\"\n>\n {{isValuePrimitiveType ? value : (value | json)}}\n</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: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 }); }
60
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RuleKeyValuePresComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
61
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.7", type: RuleKeyValuePresComponent, isStandalone: true, 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\"\n (keyup.enter)=\"shouldLimitCharactersForOldValue = !shouldLimitCharactersForOldValue\"\n tabindex=\"0\"\n >\n {{isOldValuePrimitiveType ? oldValue : (oldValue | json)}}\n </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\"\n (keyup.enter)=\"shouldLimitCharactersForValue = !shouldLimitCharactersForValue\"\n tabindex=\"0\"\n>\n {{isValuePrimitiveType ? value : (value | json)}}\n</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: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: "ngmodule", type: CommonModule }, { 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 }); }
95
62
  }
96
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RuleKeyValuePresComponent, decorators: [{
63
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RuleKeyValuePresComponent, decorators: [{
97
64
  type: Component,
98
- 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\"\n (keyup.enter)=\"shouldLimitCharactersForOldValue = !shouldLimitCharactersForOldValue\"\n tabindex=\"0\"\n >\n {{isOldValuePrimitiveType ? oldValue : (oldValue | json)}}\n </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\"\n (keyup.enter)=\"shouldLimitCharactersForValue = !shouldLimitCharactersForValue\"\n tabindex=\"0\"\n>\n {{isValuePrimitiveType ? value : (value | json)}}\n</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: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"] }]
65
+ args: [{ selector: 'o3r-rule-key-value-pres', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [CommonModule, JsonPipe], 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\"\n (keyup.enter)=\"shouldLimitCharactersForOldValue = !shouldLimitCharactersForOldValue\"\n tabindex=\"0\"\n >\n {{isOldValuePrimitiveType ? oldValue : (oldValue | json)}}\n </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\"\n (keyup.enter)=\"shouldLimitCharactersForValue = !shouldLimitCharactersForValue\"\n tabindex=\"0\"\n>\n {{isValuePrimitiveType ? value : (value | json)}}\n</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: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"] }]
99
66
  }], propDecorators: { key: [{
100
67
  type: Input
101
68
  }], value: [{
@@ -110,25 +77,83 @@ class O3rFallbackToPipe {
110
77
  transform(value, fallback = 'undefined') {
111
78
  return value === undefined ? fallback : value;
112
79
  }
113
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: O3rFallbackToPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
114
- /** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: O3rFallbackToPipe, isStandalone: true, name: "o3rFallbackTo" }); }
80
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: O3rFallbackToPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
81
+ /** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.7", ngImport: i0, type: O3rFallbackToPipe, isStandalone: true, name: "o3rFallbackTo" }); }
115
82
  }
116
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: O3rFallbackToPipe, decorators: [{
83
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: O3rFallbackToPipe, decorators: [{
117
84
  type: Pipe,
118
- args: [{ name: 'o3rFallbackTo', standalone: true }]
85
+ args: [{ name: 'o3rFallbackTo' }]
119
86
  }] });
120
- /**
121
- * @deprecated please use O3rFallbackToPipe, will be removed in v12.
122
- */
123
- class FallbackToPipe extends O3rFallbackToPipe {
124
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FallbackToPipe, deps: null, target: i0.ɵɵFactoryTarget.Pipe }); }
125
- /** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: FallbackToPipe, name: "fallbackTo" }); }
87
+
88
+ class O3rJsonOrStringPipe {
89
+ /**
90
+ * @inheritDoc
91
+ */
92
+ transform(value) {
93
+ if (typeof value === 'string') {
94
+ return value;
95
+ }
96
+ return JSON.stringify(value, null, 2);
97
+ }
98
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: O3rJsonOrStringPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
99
+ /** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.7", ngImport: i0, type: O3rJsonOrStringPipe, isStandalone: true, name: "o3rJsonOrString" }); }
126
100
  }
127
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FallbackToPipe, decorators: [{
101
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: O3rJsonOrStringPipe, decorators: [{
128
102
  type: Pipe,
129
- args: [{ name: 'fallbackTo' }]
103
+ args: [{ name: 'o3rJsonOrString' }]
130
104
  }] });
131
105
 
106
+ /**
107
+ * Compute the status of the execution depending on its execution event type, the output and whether the execution
108
+ * is still active
109
+ * @param rulesetExecution
110
+ * @param isActive
111
+ */
112
+ const getStatus = (rulesetExecution, isActive) => {
113
+ if (rulesetExecution.type === 'RulesetExecutionError') {
114
+ return 'Error';
115
+ }
116
+ else if (rulesetExecution.outputActions?.length === 0) {
117
+ return 'NoEffect';
118
+ }
119
+ else if (isActive) {
120
+ return 'Active';
121
+ }
122
+ return 'Deactivated';
123
+ };
124
+ /**
125
+ * Transform the output of the debug reports into the model for the ruleset history debug panel
126
+ * @param events
127
+ * @param rulesetMap
128
+ */
129
+ const rulesetReportToHistory = (events, rulesetMap) => {
130
+ const availableRulesets = (events.filter((e) => e.type === 'AvailableRulesets').reverse()[0])?.availableRulesets || [];
131
+ const lastActiveRulesets = (events.filter((e) => e.type === 'ActiveRulesets').reverse()[0])?.rulesets || [];
132
+ return availableRulesets
133
+ .filter((ruleset) => !!ruleset)
134
+ .reduce((acc, ruleset) => {
135
+ const rulesetExecutions = events
136
+ .filter((e) => ((e.type === 'RulesetExecutionError' || e.type === 'RulesetExecution') && e.rulesetId === ruleset.id));
137
+ if (rulesetExecutions) {
138
+ acc.push(...rulesetExecutions);
139
+ }
140
+ return acc;
141
+ }, [])
142
+ .sort((execA, execB) => execB.timestamp - execA.timestamp)
143
+ .map((rulesetExecution) => {
144
+ const rulesetInformation = rulesetMap[rulesetExecution.rulesetId];
145
+ const isActive = lastActiveRulesets.find((r) => r.id === rulesetExecution.rulesetId);
146
+ return {
147
+ ...rulesetExecution,
148
+ status: getStatus(rulesetExecution, !!isActive),
149
+ isActive: !!isActive,
150
+ rulesetInformation,
151
+ rulesEvaluations: (rulesetExecution.rulesEvaluations || []).sort((evalA, evalB) => (rulesetInformation?.rules.findIndex((r) => r.id === evalA.rule.id) || -1)
152
+ - (rulesetInformation?.rules.findIndex((r) => r.id === evalB.rule.id) || -1))
153
+ };
154
+ });
155
+ };
156
+
132
157
  class RuleActionsPresComponent {
133
158
  constructor() {
134
159
  /**
@@ -145,12 +170,12 @@ class RuleActionsPresComponent {
145
170
  */
146
171
  this.runtimeOutputs = [];
147
172
  }
148
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RuleActionsPresComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
149
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", 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 | o3rFallbackTo: 'Missing \\'fact\\''\"\n [value]=\"action.value | o3rFallbackTo\"\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 | o3rFallbackTo: 'Missing \\'property\\''\"\n [value]=\"action.value | o3rFallbackTo\"\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 | o3rFallbackTo: 'Missing \\'asset\\''\"\n [value]=\"action.value | o3rFallbackTo\"\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 | o3rFallbackTo: 'Missing \\'key\\''\"\n [value]=\"action.value | o3rFallbackTo\"\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 | o3rFallbackTo: '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 | o3rFallbackTo: 'Missing \\'fact\\''\"\n [value]=\"temporaryFacts[runtimeOutput] | o3rFallbackTo\"\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: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: O3rFallbackToPipe, name: "o3rFallbackTo" }, { kind: "pipe", type: i1.JsonPipe, name: "json" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
173
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RuleActionsPresComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
174
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.7", type: RuleActionsPresComponent, isStandalone: true, 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 | o3rFallbackTo: 'Missing \\'fact\\''\"\n [value]=\"action.value | o3rFallbackTo\"\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 | o3rFallbackTo: 'Missing \\'property\\''\"\n [value]=\"action.value | o3rFallbackTo\"\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 | o3rFallbackTo: 'Missing \\'asset\\''\"\n [value]=\"action.value | o3rFallbackTo\"\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 | o3rFallbackTo: 'Missing \\'key\\''\"\n [value]=\"action.value | o3rFallbackTo\"\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 | o3rFallbackTo: '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 | o3rFallbackTo: 'Missing \\'fact\\''\"\n [value]=\"temporaryFacts[runtimeOutput] | o3rFallbackTo\"\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: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: "ngmodule", type: CommonModule }, { 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: "pipe", type: i1.JsonPipe, name: "json" }, { kind: "component", type: RuleKeyValuePresComponent, selector: "o3r-rule-key-value-pres", inputs: ["key", "value", "oldValue", "type"] }, { kind: "pipe", type: O3rFallbackToPipe, name: "o3rFallbackTo" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
150
175
  }
151
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RuleActionsPresComponent, decorators: [{
176
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RuleActionsPresComponent, decorators: [{
152
177
  type: Component,
153
- 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 | o3rFallbackTo: 'Missing \\'fact\\''\"\n [value]=\"action.value | o3rFallbackTo\"\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 | o3rFallbackTo: 'Missing \\'property\\''\"\n [value]=\"action.value | o3rFallbackTo\"\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 | o3rFallbackTo: 'Missing \\'asset\\''\"\n [value]=\"action.value | o3rFallbackTo\"\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 | o3rFallbackTo: 'Missing \\'key\\''\"\n [value]=\"action.value | o3rFallbackTo\"\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 | o3rFallbackTo: '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 | o3rFallbackTo: 'Missing \\'fact\\''\"\n [value]=\"temporaryFacts[runtimeOutput] | o3rFallbackTo\"\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: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"] }]
178
+ args: [{ selector: 'o3r-rule-actions-pres', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [CommonModule, JsonPipe, RuleKeyValuePresComponent, O3rFallbackToPipe], 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 | o3rFallbackTo: 'Missing \\'fact\\''\"\n [value]=\"action.value | o3rFallbackTo\"\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 | o3rFallbackTo: 'Missing \\'property\\''\"\n [value]=\"action.value | o3rFallbackTo\"\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 | o3rFallbackTo: 'Missing \\'asset\\''\"\n [value]=\"action.value | o3rFallbackTo\"\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 | o3rFallbackTo: 'Missing \\'key\\''\"\n [value]=\"action.value | o3rFallbackTo\"\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 | o3rFallbackTo: '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 | o3rFallbackTo: 'Missing \\'fact\\''\"\n [value]=\"temporaryFacts[runtimeOutput] | o3rFallbackTo\"\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: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"] }]
154
179
  }], propDecorators: { actions: [{
155
180
  type: Input
156
181
  }], temporaryFacts: [{
@@ -159,6 +184,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
159
184
  type: Input
160
185
  }] } });
161
186
 
187
+ class RuleConditionPresComponent {
188
+ constructor() {
189
+ /**
190
+ * Left hand operator as it will be displayed in the template.
191
+ * In the case of a fact with a json path, will resolve the whole fact path, else will only display the value
192
+ */
193
+ this.lhs = 'undefined';
194
+ }
195
+ /**
196
+ * Rule condition that will be flattened by the component setter
197
+ */
198
+ set condition(condition) {
199
+ this._condition = condition;
200
+ this.lhs = condition?.lhs ? this.getOperandName(condition.lhs) : 'undefined';
201
+ this.rhs = condition?.rhs ? this.getOperandName(condition.rhs) : undefined;
202
+ }
203
+ get condition() {
204
+ return this._condition;
205
+ }
206
+ getOperandName(operand) {
207
+ const value = `${operand.value ?? 'MISSING_VALUE'}`;
208
+ return operand.path ? operand.path.replace(/^\$/, value) : value;
209
+ }
210
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RuleConditionPresComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
211
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.7", type: RuleConditionPresComponent, isStandalone: true, 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: "component", type: RuleConditionPresComponent, selector: "o3r-rule-condition-pres", inputs: ["condition"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
212
+ }
213
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RuleConditionPresComponent, decorators: [{
214
+ type: Component,
215
+ args: [{ selector: 'o3r-rule-condition-pres', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [CommonModule], 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"] }]
216
+ }], propDecorators: { condition: [{
217
+ type: Input
218
+ }] } });
219
+
162
220
  class RuleTreePresComponent {
163
221
  constructor() {
164
222
  /**
@@ -184,12 +242,12 @@ class RuleTreePresComponent {
184
242
  */
185
243
  this.successActionsExpanded = false;
186
244
  }
187
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RuleTreePresComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
188
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", 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 }); }
245
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RuleTreePresComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
246
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.7", type: RuleTreePresComponent, isStandalone: true, 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: "component", type: RuleTreePresComponent, selector: "o3r-rule-tree-pres", inputs: ["name", "blockType", "condition", "successElements", "failureElements"] }, { kind: "ngmodule", type: CommonModule }, { 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: "pipe", type: i1.TitleCasePipe, name: "titlecase" }, { kind: "component", type: RuleActionsPresComponent, selector: "o3r-rule-actions-pres", inputs: ["actions", "temporaryFacts", "runtimeOutputs"] }, { kind: "component", type: RuleConditionPresComponent, selector: "o3r-rule-condition-pres", inputs: ["condition"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
189
247
  }
190
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RuleTreePresComponent, decorators: [{
248
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RuleTreePresComponent, decorators: [{
191
249
  type: Component,
192
- 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"] }]
250
+ args: [{ selector: 'o3r-rule-tree-pres', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [CommonModule, RuleActionsPresComponent, RuleConditionPresComponent], 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"] }]
193
251
  }], propDecorators: { name: [{
194
252
  type: Input
195
253
  }], blockType: [{
@@ -202,27 +260,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
202
260
  type: Input
203
261
  }] } });
204
262
 
205
- class O3rJsonOrStringPipe {
206
- /**
207
- * @inheritDoc
208
- */
209
- transform(value) {
210
- if (typeof value === 'string') {
211
- return value;
212
- }
213
- return JSON.stringify(value, null, 2);
214
- }
215
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: O3rJsonOrStringPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
216
- /** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: O3rJsonOrStringPipe, isStandalone: true, name: "o3rJsonOrString" }); }
217
- }
218
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: O3rJsonOrStringPipe, decorators: [{
219
- type: Pipe,
220
- args: [{
221
- name: 'o3rJsonOrString',
222
- standalone: true
223
- }]
224
- }] });
225
-
226
263
  class RulesetHistoryPresComponent {
227
264
  constructor(cd) {
228
265
  this.cd = cd;
@@ -253,12 +290,19 @@ class RulesetHistoryPresComponent {
253
290
  }
254
291
  this.cd.detectChanges();
255
292
  }
256
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesetHistoryPresComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
257
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", 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 <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- need to refactor the div to accordion from DF #1518 -->\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?.linkedComponents?.or || execution.rulesetInformation?.linkedComponent\">\n <ng-container *ngFor=\"let lc of (execution.rulesetInformation?.linkedComponents?.or || [execution.rulesetInformation.linkedComponent]); last as isLast\">\n <div>{{lc.name}} {{lc.library}} <span *ngIf=\"!isLast\"> OR </span></div>\n </ng-container>\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 <pre class=\"ruleset-panel-category-body error\">{{ruleEvaluation.error | o3rJsonOrString}}</pre>\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 | o3rFallbackTo\"\n [value]=\"trigger.value.newValue | o3rFallbackTo\"\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 <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- need to refactor the div to accordion from DF #1518 -->\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 | o3rFallbackTo\"\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: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: O3rFallbackToPipe, name: "o3rFallbackTo" }, { 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: O3rJsonOrStringPipe, name: "o3rJsonOrString" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
293
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesetHistoryPresComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
294
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.7", type: RulesetHistoryPresComponent, isStandalone: true, 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 <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- need to refactor the div to accordion from DF #1518 -->\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?.linkedComponents?.or\">\n <ng-container *ngFor=\"let lc of execution.rulesetInformation?.linkedComponents?.or; last as isLast\">\n <div>{{lc.name}} {{lc.library}} <span *ngIf=\"!isLast\"> OR </span></div>\n </ng-container>\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 <pre class=\"ruleset-panel-category-body error\">{{ruleEvaluation.error | o3rJsonOrString}}</pre>\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 | o3rFallbackTo\"\n [value]=\"trigger.value.newValue | o3rFallbackTo\"\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 <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- need to refactor the div to accordion from DF #1518 -->\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 | o3rFallbackTo\"\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: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: "ngmodule", type: CommonModule }, { 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: "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: O3rFallbackToPipe, name: "o3rFallbackTo" }, { kind: "pipe", type: O3rJsonOrStringPipe, name: "o3rJsonOrString" }, { 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: "component", type: RuleTreePresComponent, selector: "o3r-rule-tree-pres", inputs: ["name", "blockType", "condition", "successElements", "failureElements"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
258
295
  }
259
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesetHistoryPresComponent, decorators: [{
296
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesetHistoryPresComponent, decorators: [{
260
297
  type: Component,
261
- 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 <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- need to refactor the div to accordion from DF #1518 -->\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?.linkedComponents?.or || execution.rulesetInformation?.linkedComponent\">\n <ng-container *ngFor=\"let lc of (execution.rulesetInformation?.linkedComponents?.or || [execution.rulesetInformation.linkedComponent]); last as isLast\">\n <div>{{lc.name}} {{lc.library}} <span *ngIf=\"!isLast\"> OR </span></div>\n </ng-container>\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 <pre class=\"ruleset-panel-category-body error\">{{ruleEvaluation.error | o3rJsonOrString}}</pre>\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 | o3rFallbackTo\"\n [value]=\"trigger.value.newValue | o3rFallbackTo\"\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 <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- need to refactor the div to accordion from DF #1518 -->\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 | o3rFallbackTo\"\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: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"] }]
298
+ args: [{ selector: 'o3r-ruleset-history-pres', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
299
+ CommonModule,
300
+ O3rFallbackToPipe,
301
+ O3rJsonOrStringPipe,
302
+ RuleActionsPresComponent,
303
+ RuleKeyValuePresComponent,
304
+ RuleTreePresComponent
305
+ ], 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 <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- need to refactor the div to accordion from DF #1518 -->\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?.linkedComponents?.or\">\n <ng-container *ngFor=\"let lc of execution.rulesetInformation?.linkedComponents?.or; last as isLast\">\n <div>{{lc.name}} {{lc.library}} <span *ngIf=\"!isLast\"> OR </span></div>\n </ng-container>\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 <pre class=\"ruleset-panel-category-body error\">{{ruleEvaluation.error | o3rJsonOrString}}</pre>\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 | o3rFallbackTo\"\n [value]=\"trigger.value.newValue | o3rFallbackTo\"\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 <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- need to refactor the div to accordion from DF #1518 -->\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 | o3rFallbackTo\"\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: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"] }]
262
306
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { rulesetExecutions: [{
263
307
  type: Input
264
308
  }], executionDurationFormat: [{
@@ -266,66 +310,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
266
310
  }] } });
267
311
 
268
312
  /**
269
- * Compute the status of the execution depending on its execution event type, the output and whether the execution
270
- * is still active
271
- * @param rulesetExecution
272
- * @param isActive
273
- */
274
- const getStatus = (rulesetExecution, isActive) => {
275
- if (rulesetExecution.type === 'RulesetExecutionError') {
276
- return 'Error';
277
- }
278
- else if (rulesetExecution.outputActions?.length === 0) {
279
- return 'NoEffect';
280
- }
281
- else if (isActive) {
282
- return 'Active';
283
- }
284
- return 'Deactivated';
285
- };
286
- /**
287
- * Transform the output of the debug reports into the model for the ruleset history debug panel
288
- * @param events
289
- * @param rulesetMap
313
+ * @deprecated The Components and Pipes are now standalone, this module will be removed in v14
290
314
  */
291
- const rulesetReportToHistory = (events, rulesetMap) => {
292
- const availableRulesets = (events.filter((e) => e.type === 'AvailableRulesets').reverse()[0])?.availableRulesets || [];
293
- const lastActiveRulesets = (events.filter((e) => e.type === 'ActiveRulesets').reverse()[0])?.rulesets || [];
294
- return availableRulesets
295
- .filter((ruleset) => !!ruleset)
296
- .reduce((acc, ruleset) => {
297
- const rulesetExecutions = events
298
- .filter((e) => ((e.type === 'RulesetExecutionError' || e.type === 'RulesetExecution') && e.rulesetId === ruleset.id));
299
- if (rulesetExecutions) {
300
- acc.push(...rulesetExecutions);
301
- }
302
- return acc;
303
- }, [])
304
- .sort((execA, execB) => execB.timestamp - execA.timestamp)
305
- .map((rulesetExecution) => {
306
- const rulesetInformation = rulesetMap[rulesetExecution.rulesetId];
307
- const isActive = lastActiveRulesets.find((r) => r.id === rulesetExecution.rulesetId);
308
- return {
309
- ...rulesetExecution,
310
- status: getStatus(rulesetExecution, !!isActive),
311
- isActive: !!isActive,
312
- rulesetInformation,
313
- rulesEvaluations: (rulesetExecution.rulesEvaluations || []).sort((evalA, evalB) => (rulesetInformation?.rules.findIndex((r) => r.id === evalA.rule.id) || -1)
314
- - (rulesetInformation?.rules.findIndex((r) => r.id === evalB.rule.id) || -1))
315
- };
316
- });
317
- };
318
-
319
315
  class RulesetHistoryPresModule {
320
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesetHistoryPresModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
321
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: RulesetHistoryPresModule, declarations: [RulesetHistoryPresComponent, RuleConditionPresComponent, RuleTreePresComponent, RuleActionsPresComponent, RuleKeyValuePresComponent], imports: [O3rFallbackToPipe, CommonModule, CommonModule, CommonModule, JsonPipe, O3rJsonOrStringPipe], exports: [RulesetHistoryPresComponent] }); }
322
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesetHistoryPresModule, imports: [CommonModule, CommonModule, CommonModule] }); }
316
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesetHistoryPresModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
317
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.7", ngImport: i0, type: RulesetHistoryPresModule, imports: [JsonPipe,
318
+ RulesetHistoryPresComponent,
319
+ RuleConditionPresComponent], exports: [RulesetHistoryPresComponent] }); }
320
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesetHistoryPresModule, imports: [RulesetHistoryPresComponent,
321
+ RuleConditionPresComponent] }); }
323
322
  }
324
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesetHistoryPresModule, decorators: [{
323
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesetHistoryPresModule, decorators: [{
325
324
  type: NgModule,
326
325
  args: [{
327
- imports: [O3rFallbackToPipe, CommonModule, CommonModule, CommonModule, JsonPipe, O3rJsonOrStringPipe],
328
- declarations: [RulesetHistoryPresComponent, RuleConditionPresComponent, RuleTreePresComponent, RuleActionsPresComponent, RuleKeyValuePresComponent],
326
+ imports: [
327
+ JsonPipe,
328
+ RulesetHistoryPresComponent,
329
+ RuleConditionPresComponent
330
+ ],
329
331
  exports: [RulesetHistoryPresComponent]
330
332
  }]
331
333
  }] });
@@ -399,10 +401,10 @@ class RulesetsEffect {
399
401
  */
400
402
  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 })))))));
401
403
  }
402
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesetsEffect, deps: [{ token: i1$1.Actions }], target: i0.ɵɵFactoryTarget.Injectable }); }
403
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesetsEffect }); }
404
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesetsEffect, deps: [{ token: i1$1.Actions }], target: i0.ɵɵFactoryTarget.Injectable }); }
405
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesetsEffect }); }
404
406
  }
405
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesetsEffect, decorators: [{
407
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesetsEffect, decorators: [{
406
408
  type: Injectable
407
409
  }], ctorParameters: () => [{ type: i1$1.Actions }] });
408
410
 
@@ -457,13 +459,13 @@ class RulesetsStoreModule {
457
459
  ]
458
460
  };
459
461
  }
460
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesetsStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
461
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: RulesetsStoreModule, imports: [i1$2.StoreFeatureModule, i1$1.EffectsFeatureModule] }); }
462
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesetsStoreModule, providers: [
462
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesetsStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
463
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.7", ngImport: i0, type: RulesetsStoreModule, imports: [i1$2.StoreFeatureModule, i1$1.EffectsFeatureModule] }); }
464
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesetsStoreModule, providers: [
463
465
  { provide: RULESETS_REDUCER_TOKEN, useFactory: getDefaultRulesetsReducer }
464
466
  ], imports: [StoreModule.forFeature(RULESETS_STORE_NAME, RULESETS_REDUCER_TOKEN), EffectsModule.forFeature([RulesetsEffect])] }); }
465
467
  }
466
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesetsStoreModule, decorators: [{
468
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesetsStoreModule, decorators: [{
467
469
  type: NgModule,
468
470
  args: [{
469
471
  imports: [
@@ -519,21 +521,8 @@ const selectRuleSetsInRange = createSelector(selectAllRulesets, (ruleSets) => ru
519
521
  * Returns the rulesets ids which are not onDemand and in the validity range
520
522
  */
521
523
  const selectActiveRuleSets = createSelector(selectRuleSetsInRange, (ruleSets) => ruleSets
522
- .filter((ruleSet) => (!(ruleSet.linkedComponents?.or?.length || ruleSet.linkedComponent)))
524
+ .filter((ruleSet) => (!ruleSet.linkedComponents?.or?.length))
523
525
  .map((ruleSet) => ruleSet.id));
524
- /**
525
- * Assign rulesetId to a component
526
- * @deprecated It will be removed in v12 with the selector using it
527
- * @param compName
528
- * @param library
529
- * @param ruleSetId
530
- * @param acc
531
- */
532
- function linkRulesetToComponent(compName, library, ruleSetId, acc = {}) {
533
- const configName = computeItemIdentifier(compName, library);
534
- acc[configName] ||= [];
535
- acc[configName].push(ruleSetId);
536
- }
537
526
  /**
538
527
  * Assign component to RulesetIds Map
539
528
  * @param compName
@@ -546,32 +535,12 @@ function linkComponentToRuleset(compName, library, ruleSetId, acc = {}) {
546
535
  acc[ruleSetId] ||= [];
547
536
  acc[ruleSetId].push(configName);
548
537
  }
549
- /**
550
- * Select the map of ruleSet to activate based on the component computed name
551
- * @deprecated use {@link selectComponentsLinkedToRuleset} instead. It will be removed in v12
552
- */
553
- const selectRuleSetLinkComponents = createSelector(selectRuleSetsInRange, (ruleSets) => ruleSets
554
- .reduce((acc, ruleSet) => {
555
- if ((!ruleSet.linkedComponents?.or || ruleSet.linkedComponents.or.length === 0) && !ruleSet.linkedComponent) {
556
- return acc;
557
- }
558
- if (ruleSet.linkedComponents?.or?.length) {
559
- ruleSet.linkedComponents.or.forEach((linkComp) => {
560
- linkRulesetToComponent(linkComp.name, linkComp.library, ruleSet.id, acc);
561
- });
562
- return acc;
563
- }
564
- if (ruleSet.linkedComponent) {
565
- linkRulesetToComponent(ruleSet.linkedComponent.name, ruleSet.linkedComponent.library, ruleSet.id, acc);
566
- }
567
- return acc;
568
- }, {}));
569
538
  /**
570
539
  * Select the map of ruleSets to activate based on linked components
571
540
  */
572
541
  const selectComponentsLinkedToRuleset = createSelector(selectRuleSetsInRange, (ruleSets) => ruleSets
573
542
  .reduce((acc, ruleSet) => {
574
- if ((!ruleSet.linkedComponents?.or || ruleSet.linkedComponents.or.length === 0) && !ruleSet.linkedComponent) {
543
+ if (!ruleSet.linkedComponents?.or || ruleSet.linkedComponents.or.length === 0) {
575
544
  return acc;
576
545
  }
577
546
  if (ruleSet.linkedComponents?.or?.length) {
@@ -580,9 +549,6 @@ const selectComponentsLinkedToRuleset = createSelector(selectRuleSetsInRange, (r
580
549
  });
581
550
  return acc;
582
551
  }
583
- if (ruleSet.linkedComponent) {
584
- linkComponentToRuleset(ruleSet.linkedComponent.name, ruleSet.linkedComponent.library, ruleSet.id, acc.or);
585
- }
586
552
  return acc;
587
553
  }, { or: {} }));
588
554
 
@@ -605,7 +571,7 @@ const rulesetsStorageSync = {
605
571
  };
606
572
 
607
573
  /**
608
- * Function to retrive from 2 sequential executions only the triggers which activated the last ruleset execution
574
+ * Function to retrieve from 2 sequential executions only the triggers which activated the last ruleset execution
609
575
  * @param currRes Current ruleset execution object
610
576
  * @param prevRes Previous ruleset execution object
611
577
  * @returns The triggers list which activates the last ruleset execution
@@ -666,16 +632,17 @@ function flagCachedRules(rulesEvaluations, triggers) {
666
632
  * @param runtimeFactValues
667
633
  * @param factValues
668
634
  * @param oldFactValues
635
+ * @param inputFacts
669
636
  */
670
- function handleRuleEvaluationDebug(rule, rulesetName, outputActions, outputError, runtimeFactValues, factValues, oldFactValues) {
637
+ function handleRuleEvaluationDebug(rule, rulesetName, outputActions, outputError, runtimeFactValues, factValues, oldFactValues, inputFacts = []) {
671
638
  const executionId = `${rulesetName} - ${rule.name}`;
672
639
  const reasons = {};
673
640
  for (let index = 0; index < factValues.length; index++) {
674
641
  if (!oldFactValues) {
675
- (reasons[rule.id] ||= {})[rule.inputFacts[index]] = { factName: rule.inputFacts[index], newValue: factValues[index] };
642
+ (reasons[rule.id] ||= {})[inputFacts[index]] = { factName: inputFacts[index], newValue: factValues[index] };
676
643
  }
677
644
  else if (oldFactValues[index]?.toString() !== factValues[index]?.toString()) {
678
- (reasons[rule.id] ||= {})[rule.inputFacts[index]] = { factName: rule.inputFacts[index], oldValue: oldFactValues[index], newValue: factValues[index] };
645
+ (reasons[rule.id] ||= {})[inputFacts[index]] = { factName: inputFacts[index], oldValue: oldFactValues[index], newValue: factValues[index] };
679
646
  }
680
647
  }
681
648
  const ruleEvaluation = {
@@ -897,10 +864,12 @@ function filterRulesetsEventStream(restrictiveRuleSets) {
897
864
  const activeRulesets = restrictiveRuleSets
898
865
  ? Object.values(rulesets).filter((ruleSet) => restrictiveRuleSets.includes(ruleSet.id))
899
866
  : Object.values(rulesets);
900
- return combineLatest(activeRulesets.map((ruleset) => ruleset.rulesResultsSubject$)).pipe(map((item) => item.reduce((acc, currentValue) => {
901
- acc.push(...currentValue);
902
- return acc;
903
- }, [])));
867
+ return activeRulesets?.length > 0
868
+ ? combineLatest(activeRulesets.map((ruleset) => ruleset.rulesResultsSubject$)).pipe(map((item) => item.reduce((acc, currentValue) => {
869
+ acc.push(...currentValue);
870
+ return acc;
871
+ }, [])))
872
+ : of([]);
904
873
  }), shareReplay(1));
905
874
  }
906
875
 
@@ -1794,7 +1763,7 @@ class RulesetExecutor {
1794
1763
  output.error = error;
1795
1764
  }
1796
1765
  if (this.rulesEngine.debugMode) {
1797
- output.evaluation = handleRuleEvaluationDebug({ ...rule, inputFacts }, this.ruleset.name, output.actions, output.error, runtimeFactValues, factValues, oldFactValues);
1766
+ output.evaluation = handleRuleEvaluationDebug(rule, this.ruleset.name, output.actions, output.error, runtimeFactValues, factValues, oldFactValues, inputFacts);
1798
1767
  }
1799
1768
  else if (output.error) {
1800
1769
  this.rulesEngine.logger?.error(output.error);
@@ -1824,7 +1793,6 @@ class RulesetExecutor {
1824
1793
  return {
1825
1794
  id: this.ruleset.id,
1826
1795
  validityRange: this.ruleset.validityRange,
1827
- linkedComponent: this.ruleset.linkedComponent,
1828
1796
  linkedComponents: this.ruleset.linkedComponents,
1829
1797
  rulesResultsSubject$: result$
1830
1798
  };
@@ -2068,10 +2036,10 @@ class RulesEngineRunnerService {
2068
2036
  this.linkedComponents$.next(newMap);
2069
2037
  }
2070
2038
  }
2071
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesEngineRunnerService, deps: [{ token: i1$2.Store }, { token: i2.LoggerService }, { token: RULES_ENGINE_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2072
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesEngineRunnerService }); }
2039
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesEngineRunnerService, deps: [{ token: i1$2.Store }, { token: i2.LoggerService }, { token: RULES_ENGINE_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2040
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesEngineRunnerService }); }
2073
2041
  }
2074
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesEngineRunnerService, decorators: [{
2042
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesEngineRunnerService, decorators: [{
2075
2043
  type: Injectable
2076
2044
  }], ctorParameters: () => [{ type: i1$2.Store }, { type: i2.LoggerService }, { type: undefined, decorators: [{
2077
2045
  type: Optional
@@ -2091,15 +2059,15 @@ class RulesEngineRunnerModule {
2091
2059
  ]
2092
2060
  };
2093
2061
  }
2094
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesEngineRunnerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2095
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: RulesEngineRunnerModule, imports: [StoreModule,
2062
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesEngineRunnerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2063
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.7", ngImport: i0, type: RulesEngineRunnerModule, imports: [StoreModule,
2096
2064
  RulesetsStoreModule,
2097
2065
  LoggerModule] }); }
2098
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesEngineRunnerModule, imports: [StoreModule,
2066
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesEngineRunnerModule, imports: [StoreModule,
2099
2067
  RulesetsStoreModule,
2100
2068
  LoggerModule] }); }
2101
2069
  }
2102
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesEngineRunnerModule, decorators: [{
2070
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesEngineRunnerModule, decorators: [{
2103
2071
  type: NgModule,
2104
2072
  args: [{
2105
2073
  imports: [
@@ -2220,10 +2188,10 @@ class OtterRulesEngineDevtools {
2220
2188
  getRulesetInformation(rulesetId) {
2221
2189
  return firstValueFrom(this.store.pipe(select(selectRulesetsEntities), map((entities) => entities[rulesetId])));
2222
2190
  }
2223
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OtterRulesEngineDevtools, deps: [{ token: i1$2.Store }, { token: RulesEngineRunnerService }, { token: OTTER_RULES_ENGINE_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2224
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OtterRulesEngineDevtools, providedIn: 'root' }); }
2191
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: OtterRulesEngineDevtools, deps: [{ token: i1$2.Store }, { token: RulesEngineRunnerService }, { token: OTTER_RULES_ENGINE_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2192
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: OtterRulesEngineDevtools, providedIn: 'root' }); }
2225
2193
  }
2226
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OtterRulesEngineDevtools, decorators: [{
2194
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: OtterRulesEngineDevtools, decorators: [{
2227
2195
  type: Injectable,
2228
2196
  args: [{
2229
2197
  providedIn: 'root'
@@ -2326,10 +2294,10 @@ class RulesEngineDevtoolsConsoleService {
2326
2294
  async getRulesetInformation(rulesetId) {
2327
2295
  console.log(await this.rulesEngineDevtools.getRulesetInformation(rulesetId));
2328
2296
  }
2329
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesEngineDevtoolsConsoleService, deps: [{ token: OtterRulesEngineDevtools }, { token: OTTER_RULES_ENGINE_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2330
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesEngineDevtoolsConsoleService, providedIn: 'root' }); }
2297
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesEngineDevtoolsConsoleService, deps: [{ token: OtterRulesEngineDevtools }, { token: OTTER_RULES_ENGINE_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2298
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesEngineDevtoolsConsoleService, providedIn: 'root' }); }
2331
2299
  }
2332
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesEngineDevtoolsConsoleService, decorators: [{
2300
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesEngineDevtoolsConsoleService, decorators: [{
2333
2301
  type: Injectable,
2334
2302
  args: [{
2335
2303
  providedIn: 'root'
@@ -2430,10 +2398,10 @@ class RulesEngineDevtoolsMessageService {
2430
2398
  this.startRulesEngineReport();
2431
2399
  fromEvent(window, 'message').pipe(takeUntilDestroyed(this.destroyRef), filterMessageContent(isRulesEngineMessage)).subscribe((e) => this.handleEvents(e));
2432
2400
  }
2433
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesEngineDevtoolsMessageService, deps: [{ token: OtterRulesEngineDevtools }, { token: i2.LoggerService }, { token: OTTER_RULES_ENGINE_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2434
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesEngineDevtoolsMessageService, providedIn: 'root' }); }
2401
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesEngineDevtoolsMessageService, deps: [{ token: OtterRulesEngineDevtools }, { token: i2.LoggerService }, { token: OTTER_RULES_ENGINE_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2402
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesEngineDevtoolsMessageService, providedIn: 'root' }); }
2435
2403
  }
2436
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesEngineDevtoolsMessageService, decorators: [{
2404
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesEngineDevtoolsMessageService, decorators: [{
2437
2405
  type: Injectable,
2438
2406
  args: [{
2439
2407
  providedIn: 'root'
@@ -2460,17 +2428,17 @@ class RulesEngineDevtoolsModule {
2460
2428
  ]
2461
2429
  };
2462
2430
  }
2463
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesEngineDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2464
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: RulesEngineDevtoolsModule, imports: [StoreModule,
2431
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesEngineDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2432
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.7", ngImport: i0, type: RulesEngineDevtoolsModule, imports: [StoreModule,
2465
2433
  RulesetsStoreModule] }); }
2466
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesEngineDevtoolsModule, providers: [
2434
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesEngineDevtoolsModule, providers: [
2467
2435
  { provide: OTTER_RULES_ENGINE_DEVTOOLS_OPTIONS, useValue: OTTER_RULES_ENGINE_DEVTOOLS_DEFAULT_OPTIONS },
2468
2436
  RulesEngineDevtoolsMessageService,
2469
2437
  RulesEngineDevtoolsConsoleService
2470
2438
  ], imports: [StoreModule,
2471
2439
  RulesetsStoreModule] }); }
2472
2440
  }
2473
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RulesEngineDevtoolsModule, decorators: [{
2441
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: RulesEngineDevtoolsModule, decorators: [{
2474
2442
  type: NgModule,
2475
2443
  args: [{
2476
2444
  imports: [
@@ -2510,10 +2478,10 @@ class CurrentTimeFactsService extends FactsService {
2510
2478
  tick() {
2511
2479
  this.currentTimeSubject$.next(Date.now());
2512
2480
  }
2513
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CurrentTimeFactsService, deps: [{ token: RulesEngineRunnerService }], target: i0.ɵɵFactoryTarget.Injectable }); }
2514
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CurrentTimeFactsService, providedIn: 'root' }); }
2481
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: CurrentTimeFactsService, deps: [{ token: RulesEngineRunnerService }], target: i0.ɵɵFactoryTarget.Injectable }); }
2482
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: CurrentTimeFactsService, providedIn: 'root' }); }
2515
2483
  }
2516
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CurrentTimeFactsService, decorators: [{
2484
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: CurrentTimeFactsService, decorators: [{
2517
2485
  type: Injectable,
2518
2486
  args: [{
2519
2487
  providedIn: 'root'
@@ -2524,5 +2492,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
2524
2492
  * Generated bundle index. Do not edit.
2525
2493
  */
2526
2494
 
2527
- export { CurrentTimeFactsService, DEFAULT_RULES_ENGINE_OPTIONS, EngineDebugger, FactsService, FallbackToPipe, O3rFallbackToPipe, O3rJsonOrStringPipe, 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, selectComponentsLinkedToRuleset, selectRuleSetLinkComponents, selectRuleSetsInRange, selectRulesetsEntities, selectRulesetsIds, selectRulesetsState, selectRulesetsStorePendingStatus, selectRulesetsTotal, setRulesets, setRulesetsEntities, setRulesetsEntitiesFromApi, stringContains, updateRulesets, upsertRulesetsEntities, upsertRulesetsEntitiesFromApi };
2495
+ export { CurrentTimeFactsService, DEFAULT_RULES_ENGINE_OPTIONS, EngineDebugger, FactsService, O3rFallbackToPipe, O3rJsonOrStringPipe, 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, selectComponentsLinkedToRuleset, selectRuleSetsInRange, selectRulesetsEntities, selectRulesetsIds, selectRulesetsState, selectRulesetsStorePendingStatus, selectRulesetsTotal, setRulesets, setRulesetsEntities, setRulesetsEntitiesFromApi, stringContains, updateRulesets, upsertRulesetsEntities, upsertRulesetsEntitiesFromApi };
2528
2496
  //# sourceMappingURL=o3r-rules-engine.mjs.map