@o3r/components 11.6.0-prerelease.2 → 11.6.0-prerelease.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 (142) hide show
  1. package/builders/component-extractor/helpers/component/component-class.extractor.d.ts +3 -9
  2. package/builders/component-extractor/helpers/component/component-class.extractor.d.ts.map +1 -1
  3. package/builders/component-extractor/helpers/component/component-class.extractor.js +34 -37
  4. package/builders/component-extractor/helpers/component/component-config.extractor.d.ts +2 -15
  5. package/builders/component-extractor/helpers/component/component-config.extractor.d.ts.map +1 -1
  6. package/builders/component-extractor/helpers/component/component-config.extractor.js +41 -48
  7. package/builders/component-extractor/helpers/component/component.extractor.d.ts +2 -10
  8. package/builders/component-extractor/helpers/component/component.extractor.d.ts.map +1 -1
  9. package/builders/component-extractor/helpers/component/component.extractor.js +20 -25
  10. package/builders/component-extractor/helpers/component/component.parser.d.ts +2 -3
  11. package/builders/component-extractor/helpers/component/component.parser.d.ts.map +1 -1
  12. package/builders/component-extractor/helpers/component/component.parser.js +11 -14
  13. package/builders/component-extractor/index.d.ts.map +1 -1
  14. package/builders/component-extractor/index.js +25 -27
  15. package/builders/component-extractor/schema.d.ts.map +1 -1
  16. package/builders/metadata-check/helpers/config-metadata-comparison.helper.d.ts +2 -2
  17. package/builders/metadata-check/helpers/config-metadata-comparison.helper.d.ts.map +1 -1
  18. package/builders/metadata-check/helpers/config-metadata-comparison.helper.js +1 -1
  19. package/builders/metadata-check/index.d.ts.map +1 -1
  20. package/builders/metadata-check/schema.d.ts.map +1 -1
  21. package/core/component.output.d.ts.map +1 -1
  22. package/core/rendering/helpers.d.ts +0 -1
  23. package/core/rendering/helpers.d.ts.map +1 -1
  24. package/devkit/components-devkit.interface.d.ts.map +1 -1
  25. package/devkit/components-devtools.message.service.d.ts +2 -3
  26. package/devkit/components-devtools.message.service.d.ts.map +1 -1
  27. package/devkit/components-devtools.module.d.ts.map +1 -1
  28. package/devkit/components-devtools.token.d.ts +1 -1
  29. package/devkit/components-devtools.token.d.ts.map +1 -1
  30. package/devkit/inspector/ng/ng.d.ts +3 -1
  31. package/devkit/inspector/ng/ng.d.ts.map +1 -1
  32. package/devkit/inspector/otter-inspector.helpers.d.ts.map +1 -1
  33. package/devkit/inspector/otter-inspector.service.d.ts.map +1 -1
  34. package/esm2022/core/component.output.mjs +1 -1
  35. package/esm2022/core/rendering/helpers.mjs +3 -4
  36. package/esm2022/devkit/components-devkit.interface.mjs +7 -7
  37. package/esm2022/devkit/components-devtools.message.service.mjs +15 -16
  38. package/esm2022/devkit/components-devtools.module.mjs +10 -10
  39. package/esm2022/devkit/components-devtools.token.mjs +2 -2
  40. package/esm2022/devkit/index.mjs +1 -1
  41. package/esm2022/devkit/inspector/index.mjs +1 -1
  42. package/esm2022/devkit/inspector/ng/ng.mjs +1 -1
  43. package/esm2022/devkit/inspector/otter-inspector.helpers.mjs +8 -8
  44. package/esm2022/devkit/inspector/otter-inspector.service.mjs +8 -8
  45. package/esm2022/rules-engine/placeholder.action-handler.mjs +23 -21
  46. package/esm2022/rules-engine/placeholder.interfaces.mjs +1 -1
  47. package/esm2022/rules-engine/placeholder.rules-engine.effect.mjs +28 -25
  48. package/esm2022/rules-engine/placeholder.rules-engine.module.mjs +10 -10
  49. package/esm2022/rules-engine/public_api.mjs +2 -2
  50. package/esm2022/stores/index.mjs +2 -2
  51. package/esm2022/stores/placeholder-request/index.mjs +1 -1
  52. package/esm2022/stores/placeholder-request/placeholder-request.actions.mjs +3 -3
  53. package/esm2022/stores/placeholder-request/placeholder-request.module.mjs +9 -9
  54. package/esm2022/stores/placeholder-request/placeholder-request.reducer.mjs +4 -4
  55. package/esm2022/stores/placeholder-request/placeholder-request.selectors.mjs +4 -4
  56. package/esm2022/stores/placeholder-request/placeholder-request.state.mjs +1 -1
  57. package/esm2022/stores/placeholder-request/placeholder-request.sync.mjs +3 -3
  58. package/esm2022/stores/placeholder-template/index.mjs +1 -1
  59. package/esm2022/stores/placeholder-template/placeholder-template.actions.mjs +2 -2
  60. package/esm2022/stores/placeholder-template/placeholder-template.module.mjs +9 -9
  61. package/esm2022/stores/placeholder-template/placeholder-template.reducer.mjs +3 -3
  62. package/esm2022/stores/placeholder-template/placeholder-template.selectors.mjs +8 -8
  63. package/esm2022/stores/placeholder-template/placeholder-template.state.mjs +1 -1
  64. package/esm2022/stores/placeholder-template/placeholder-template.sync.mjs +2 -2
  65. package/esm2022/tools/component-replacement/c11n.directive.mjs +9 -8
  66. package/esm2022/tools/component-replacement/c11n.helpers.mjs +1 -1
  67. package/esm2022/tools/component-replacement/c11n.mock.module.mjs +15 -15
  68. package/esm2022/tools/component-replacement/c11n.module.mjs +10 -9
  69. package/esm2022/tools/component-replacement/c11n.service.mjs +7 -7
  70. package/esm2022/tools/component-replacement/c11n.token.mjs +2 -2
  71. package/esm2022/tools/component-replacement/index.mjs +3 -3
  72. package/esm2022/tools/pipes/capitalize/capitalize.module.mjs +7 -7
  73. package/esm2022/tools/pipes/capitalize/capitalize.pipe.mjs +8 -8
  74. package/esm2022/tools/pipes/duration/duration.module.mjs +7 -7
  75. package/esm2022/tools/pipes/duration/duration.pipe.mjs +10 -9
  76. package/esm2022/tools/pipes/keep-white-space/keep-white-space.module.mjs +7 -7
  77. package/esm2022/tools/pipes/keep-white-space/keep-white-space.pipe.mjs +8 -8
  78. package/esm2022/tools/pipes/replace-with-bold/replace-with-bold.module.mjs +7 -7
  79. package/esm2022/tools/pipes/replace-with-bold/replace-with-bold.pipe.mjs +9 -9
  80. package/esm2022/tools/placeholder/placeholder.component.mjs +18 -22
  81. package/esm2022/tools/placeholder/placeholder.interface.mjs +1 -1
  82. package/esm2022/tools/placeholder/placeholder.module.mjs +11 -11
  83. package/fesm2022/o3r-components-rules-engine.mjs +41 -36
  84. package/fesm2022/o3r-components-rules-engine.mjs.map +1 -1
  85. package/fesm2022/o3r-components.mjs +241 -244
  86. package/fesm2022/o3r-components.mjs.map +1 -1
  87. package/package.json +11 -11
  88. package/rules-engine/placeholder.action-handler.d.ts +1 -1
  89. package/rules-engine/placeholder.action-handler.d.ts.map +1 -1
  90. package/rules-engine/placeholder.interfaces.d.ts.map +1 -1
  91. package/rules-engine/placeholder.rules-engine.effect.d.ts +2 -2
  92. package/rules-engine/placeholder.rules-engine.effect.d.ts.map +1 -1
  93. package/rules-engine/placeholder.rules-engine.module.d.ts.map +1 -1
  94. package/rules-engine/public_api.d.ts +1 -1
  95. package/rules-engine/public_api.d.ts.map +1 -1
  96. package/schematics/cms-adapter/index.d.ts.map +1 -1
  97. package/schematics/cms-adapter/index.js +1 -1
  98. package/schematics/ng-add/helpers/devtools-registration.d.ts +0 -2
  99. package/schematics/ng-add/helpers/devtools-registration.d.ts.map +1 -1
  100. package/schematics/ng-add/helpers/devtools-registration.js +1 -3
  101. package/schematics/ng-add/index.d.ts.map +1 -1
  102. package/schematics/ng-add/index.js +3 -4
  103. package/schematics/ng-add/schema.d.ts.map +1 -1
  104. package/schematics/ng-update/v10-0/index.d.ts.map +1 -1
  105. package/schematics/ng-update/v10-0/index.js +2 -1
  106. package/stores/index.d.ts +1 -1
  107. package/stores/index.d.ts.map +1 -1
  108. package/stores/placeholder-request/placeholder-request.actions.d.ts.map +1 -1
  109. package/stores/placeholder-request/placeholder-request.module.d.ts.map +1 -1
  110. package/stores/placeholder-request/placeholder-request.reducer.d.ts.map +1 -1
  111. package/stores/placeholder-request/placeholder-request.selectors.d.ts.map +1 -1
  112. package/stores/placeholder-request/placeholder-request.state.d.ts.map +1 -1
  113. package/stores/placeholder-request/placeholder-request.sync.d.ts +1 -1
  114. package/stores/placeholder-request/placeholder-request.sync.d.ts.map +1 -1
  115. package/stores/placeholder-template/placeholder-template.actions.d.ts.map +1 -1
  116. package/stores/placeholder-template/placeholder-template.module.d.ts.map +1 -1
  117. package/stores/placeholder-template/placeholder-template.reducer.d.ts.map +1 -1
  118. package/stores/placeholder-template/placeholder-template.selectors.d.ts.map +1 -1
  119. package/stores/placeholder-template/placeholder-template.state.d.ts.map +1 -1
  120. package/stores/placeholder-template/placeholder-template.sync.d.ts +2 -2
  121. package/stores/placeholder-template/placeholder-template.sync.d.ts.map +1 -1
  122. package/tools/component-replacement/c11n.directive.d.ts.map +1 -1
  123. package/tools/component-replacement/c11n.helpers.d.ts.map +1 -1
  124. package/tools/component-replacement/c11n.mock.module.d.ts.map +1 -1
  125. package/tools/component-replacement/c11n.module.d.ts +1 -0
  126. package/tools/component-replacement/c11n.module.d.ts.map +1 -1
  127. package/tools/component-replacement/c11n.service.d.ts.map +1 -1
  128. package/tools/component-replacement/c11n.token.d.ts.map +1 -1
  129. package/tools/component-replacement/index.d.ts +2 -2
  130. package/tools/component-replacement/index.d.ts.map +1 -1
  131. package/tools/pipes/capitalize/capitalize.module.d.ts.map +1 -1
  132. package/tools/pipes/capitalize/capitalize.pipe.d.ts.map +1 -1
  133. package/tools/pipes/duration/duration.module.d.ts.map +1 -1
  134. package/tools/pipes/duration/duration.pipe.d.ts +1 -0
  135. package/tools/pipes/duration/duration.pipe.d.ts.map +1 -1
  136. package/tools/pipes/keep-white-space/keep-white-space.module.d.ts.map +1 -1
  137. package/tools/pipes/keep-white-space/keep-white-space.pipe.d.ts.map +1 -1
  138. package/tools/pipes/replace-with-bold/replace-with-bold.module.d.ts.map +1 -1
  139. package/tools/pipes/replace-with-bold/replace-with-bold.pipe.d.ts.map +1 -1
  140. package/tools/placeholder/placeholder.component.d.ts.map +1 -1
  141. package/tools/placeholder/placeholder.interface.d.ts.map +1 -1
  142. package/tools/placeholder/placeholder.module.d.ts.map +1 -1
@@ -1,22 +1,22 @@
1
- import { CommonModule } from '@angular/common';
2
- import { NgModule } from '@angular/core';
3
- import { StoreModule } from '@ngrx/store';
4
- import { PlaceholderTemplateStoreModule } from '../../stores/placeholder-template/index';
5
- import { PlaceholderComponent } from './placeholder.component';
6
- import { PlaceholderRequestStoreModule } from '../../stores/placeholder-request/index';
1
+ import { CommonModule, } from '@angular/common';
2
+ import { NgModule, } from '@angular/core';
3
+ import { StoreModule, } from '@ngrx/store';
4
+ import { PlaceholderRequestStoreModule, } from '../../stores/placeholder-request/index';
5
+ import { PlaceholderTemplateStoreModule, } from '../../stores/placeholder-template/index';
6
+ import { PlaceholderComponent, } from './placeholder.component';
7
7
  import * as i0 from "@angular/core";
8
8
  export class PlaceholderModule {
9
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: PlaceholderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
10
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.12", ngImport: i0, type: PlaceholderModule, declarations: [PlaceholderComponent], imports: [CommonModule,
9
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
10
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderModule, declarations: [PlaceholderComponent], imports: [CommonModule,
11
11
  StoreModule,
12
12
  PlaceholderTemplateStoreModule,
13
13
  PlaceholderRequestStoreModule], exports: [PlaceholderComponent] }); }
14
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: PlaceholderModule, imports: [CommonModule,
14
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderModule, imports: [CommonModule,
15
15
  StoreModule,
16
16
  PlaceholderTemplateStoreModule,
17
17
  PlaceholderRequestStoreModule] }); }
18
18
  }
19
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: PlaceholderModule, decorators: [{
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderModule, decorators: [{
20
20
  type: NgModule,
21
21
  args: [{
22
22
  imports: [
@@ -29,4 +29,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
29
29
  exports: [PlaceholderComponent]
30
30
  }]
31
31
  }] });
32
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGxhY2Vob2xkZXIubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3Rvb2xzL3BsYWNlaG9sZGVyL3BsYWNlaG9sZGVyLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDL0MsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6QyxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sYUFBYSxDQUFDO0FBQzFDLE9BQU8sRUFBRSw4QkFBOEIsRUFBRSxNQUFNLHlDQUF5QyxDQUFDO0FBQ3pGLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQy9ELE9BQU8sRUFBRSw2QkFBNkIsRUFBRSxNQUFNLHdDQUF3QyxDQUFDOztBQVl2RixNQUFNLE9BQU8saUJBQWlCO2tJQUFqQixpQkFBaUI7bUlBQWpCLGlCQUFpQixpQkFIYixvQkFBb0IsYUFMakMsWUFBWTtZQUNaLFdBQVc7WUFDWCw4QkFBOEI7WUFDOUIsNkJBQTZCLGFBR3JCLG9CQUFvQjttSUFFbkIsaUJBQWlCLFlBUjFCLFlBQVk7WUFDWixXQUFXO1lBQ1gsOEJBQThCO1lBQzlCLDZCQUE2Qjs7NEZBS3BCLGlCQUFpQjtrQkFWN0IsUUFBUTttQkFBQzt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EMsT0FBTyxFQUFFLENBQUMsb0JBQW9CLENBQUM7aUJBQ2hDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtcbiAgQ29tbW9uTW9kdWxlLFxufSBmcm9tICdAYW5ndWxhci9jb21tb24nO1xuaW1wb3J0IHtcbiAgTmdNb2R1bGUsXG59IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHtcbiAgU3RvcmVNb2R1bGUsXG59IGZyb20gJ0BuZ3J4L3N0b3JlJztcbmltcG9ydCB7XG4gIFBsYWNlaG9sZGVyUmVxdWVzdFN0b3JlTW9kdWxlLFxufSBmcm9tICcuLi8uLi9zdG9yZXMvcGxhY2Vob2xkZXItcmVxdWVzdC9pbmRleCc7XG5pbXBvcnQge1xuICBQbGFjZWhvbGRlclRlbXBsYXRlU3RvcmVNb2R1bGUsXG59IGZyb20gJy4uLy4uL3N0b3Jlcy9wbGFjZWhvbGRlci10ZW1wbGF0ZS9pbmRleCc7XG5pbXBvcnQge1xuICBQbGFjZWhvbGRlckNvbXBvbmVudCxcbn0gZnJvbSAnLi9wbGFjZWhvbGRlci5jb21wb25lbnQnO1xuXG5ATmdNb2R1bGUoe1xuICBpbXBvcnRzOiBbXG4gICAgQ29tbW9uTW9kdWxlLFxuICAgIFN0b3JlTW9kdWxlLFxuICAgIFBsYWNlaG9sZGVyVGVtcGxhdGVTdG9yZU1vZHVsZSxcbiAgICBQbGFjZWhvbGRlclJlcXVlc3RTdG9yZU1vZHVsZVxuICBdLFxuICBkZWNsYXJhdGlvbnM6IFtQbGFjZWhvbGRlckNvbXBvbmVudF0sXG4gIGV4cG9ydHM6IFtQbGFjZWhvbGRlckNvbXBvbmVudF1cbn0pXG5leHBvcnQgY2xhc3MgUGxhY2Vob2xkZXJNb2R1bGUge31cbiJdfQ==
@@ -1,8 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, Optional, NgModule } from '@angular/core';
3
- import * as i1$1 from '@ngrx/effects';
4
- import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
5
- import { selectPlaceholderTemplateEntities, selectPlaceholderRequestEntities, deletePlaceholderTemplateEntity, setPlaceholderTemplateEntity, updatePlaceholderRequestEntity, setPlaceholderRequestEntityFromUrl, selectPlaceholderRequestEntityUsage, failPlaceholderRequestEntity, cancelPlaceholderRequest, PlaceholderRequestStoreModule, PlaceholderTemplateStoreModule } from '@o3r/components';
6
3
  import * as i1 from '@ngrx/store';
7
4
  import { select } from '@ngrx/store';
8
5
  import * as i4 from '@o3r/dynamic-content';
@@ -10,9 +7,12 @@ import { DynamicContentService } from '@o3r/dynamic-content';
10
7
  import * as i3 from '@o3r/localization';
11
8
  import * as i2 from '@o3r/logger';
12
9
  import { Subscription, Subject, map, startWith, distinctUntilChanged, of, combineLatest, withLatestFrom, firstValueFrom, EMPTY } from 'rxjs';
10
+ import { selectPlaceholderTemplateEntities, selectPlaceholderRequestEntities, deletePlaceholderTemplateEntity, setPlaceholderTemplateEntity, updatePlaceholderRequestEntity, setPlaceholderRequestEntityFromUrl, selectPlaceholderRequestEntityUsage, failPlaceholderRequestEntity, cancelPlaceholderRequest, PlaceholderRequestStoreModule, PlaceholderTemplateStoreModule } from '@o3r/components';
11
+ import * as i1$1 from '@ngrx/effects';
12
+ import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
13
13
  import { fromApiEffectSwitchMapById } from '@o3r/core';
14
- import { map as map$1, distinctUntilChanged as distinctUntilChanged$1, switchMap, take } from 'rxjs/operators';
15
14
  import { JSONPath } from 'jsonpath-plus';
15
+ import { map as map$1, distinctUntilChanged as distinctUntilChanged$1, switchMap, take } from 'rxjs/operators';
16
16
  import * as i3$1 from '@o3r/rules-engine';
17
17
 
18
18
  /** ActionUpdatePlaceholderBlock */
@@ -29,7 +29,9 @@ class PlaceholderRulesEngineActionHandler {
29
29
  this.placeholdersActions$ = new Subject();
30
30
  /** @inheritdoc */
31
31
  this.supportingActions = [RULES_ENGINE_PLACEHOLDER_UPDATE_ACTION_TYPE];
32
- const lang$ = translateService ? translateService.getTranslateService().onLangChange.pipe(map(({ lang }) => lang), startWith(translateService.getCurrentLanguage()), distinctUntilChanged()) : of(null);
32
+ const lang$ = translateService
33
+ ? translateService.getTranslateService().onLangChange.pipe(map(({ lang }) => lang), startWith(translateService.getCurrentLanguage()), distinctUntilChanged())
34
+ : of(null);
33
35
  const filteredActions$ = combineLatest([
34
36
  lang$,
35
37
  this.placeholdersActions$.pipe(distinctUntilChanged((prev, next) => JSON.stringify(prev) === JSON.stringify(next)))
@@ -80,11 +82,11 @@ class PlaceholderRulesEngineActionHandler {
80
82
  });
81
83
  // Placeholder that are no longer filled by the current engine execution output will be cleared
82
84
  const placeholdersTemplatesToBeCleanedUp = Object.keys(storedPlaceholders)
83
- .filter(placeholderId => !placeholdersTemplates[placeholderId]);
85
+ .filter((placeholderId) => !placeholdersTemplates[placeholderId]);
84
86
  const placeholdersTemplatesToBeSet = Object.keys(placeholdersTemplates).reduce((changedPlaceholderTemplates, placeholderTemplateId) => {
85
87
  // Caching if the placeholder template already exists with the same urls
86
- if (!storedPlaceholders[placeholderTemplateId] ||
87
- !(JSON.stringify(storedPlaceholders[placeholderTemplateId].urlsWithPriority) === JSON.stringify(placeholdersTemplates[placeholderTemplateId]))) {
88
+ if (!storedPlaceholders[placeholderTemplateId]
89
+ || !(JSON.stringify(storedPlaceholders[placeholderTemplateId].urlsWithPriority) === JSON.stringify(placeholdersTemplates[placeholderTemplateId]))) {
88
90
  changedPlaceholderTemplates.push({
89
91
  id: placeholderTemplateId,
90
92
  urlsWithPriority: placeholdersTemplates[placeholderTemplateId]
@@ -101,19 +103,19 @@ class PlaceholderRulesEngineActionHandler {
101
103
  };
102
104
  }));
103
105
  this.subscription.add(filteredActions$.subscribe((placeholdersUpdates) => {
104
- placeholdersUpdates.placeholdersTemplatesToBeCleanedUp.forEach(placeholderId => store.dispatch(deletePlaceholderTemplateEntity({
106
+ placeholdersUpdates.placeholdersTemplatesToBeCleanedUp.forEach((placeholderId) => store.dispatch(deletePlaceholderTemplateEntity({
105
107
  id: placeholderId
106
108
  })));
107
- placeholdersUpdates.placeholdersTemplatesToBeSet.forEach(placeholdersTemplateToBeSet => {
109
+ placeholdersUpdates.placeholdersTemplatesToBeSet.forEach((placeholdersTemplateToBeSet) => {
108
110
  store.dispatch(setPlaceholderTemplateEntity({ entity: placeholdersTemplateToBeSet }));
109
111
  });
110
- placeholdersUpdates.placeholderRequestsToDisable.forEach(placeholderRequestToDisable => {
112
+ placeholdersUpdates.placeholderRequestsToDisable.forEach((placeholderRequestToDisable) => {
111
113
  store.dispatch(updatePlaceholderRequestEntity({ entity: { id: placeholderRequestToDisable, used: false } }));
112
114
  });
113
- placeholdersUpdates.placeholderRequestsToEnable.forEach(placeholderRequestToEnable => {
115
+ placeholdersUpdates.placeholderRequestsToEnable.forEach((placeholderRequestToEnable) => {
114
116
  store.dispatch(updatePlaceholderRequestEntity({ entity: { id: placeholderRequestToEnable, used: true } }));
115
117
  });
116
- placeholdersUpdates.placeholderNewRequests.forEach(placeholderNewRequest => {
118
+ placeholdersUpdates.placeholderNewRequests.forEach((placeholderNewRequest) => {
117
119
  store.dispatch(setPlaceholderRequestEntityFromUrl({
118
120
  resolvedUrl: placeholderNewRequest.resolvedUrl,
119
121
  id: placeholderNewRequest.rawUrl,
@@ -155,10 +157,10 @@ class PlaceholderRulesEngineActionHandler {
155
157
  ngOnDestroy() {
156
158
  this.subscription.unsubscribe();
157
159
  }
158
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: PlaceholderRulesEngineActionHandler, deps: [{ token: i1.Store }, { token: i2.LoggerService }, { token: i0.Injector }, { token: i3.LocalizationService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
159
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: PlaceholderRulesEngineActionHandler }); }
160
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderRulesEngineActionHandler, deps: [{ token: i1.Store }, { token: i2.LoggerService }, { token: i0.Injector }, { token: i3.LocalizationService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
161
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderRulesEngineActionHandler }); }
160
162
  }
161
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: PlaceholderRulesEngineActionHandler, decorators: [{
163
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderRulesEngineActionHandler, decorators: [{
162
164
  type: Injectable
163
165
  }], ctorParameters: () => [{ type: i1.Store }, { type: i2.LoggerService }, { type: i0.Injector }, { type: i3.LocalizationService, decorators: [{
164
166
  type: Optional
@@ -181,13 +183,15 @@ class PlaceholderTemplateResponseEffect {
181
183
  */
182
184
  this.setPlaceholderRequestEntityFromUrl$ = createEffect(() => this.actions$.pipe(ofType(setPlaceholderRequestEntityFromUrl), fromApiEffectSwitchMapById((templateResponse, action) => {
183
185
  const facts = templateResponse.vars ? Object.entries(templateResponse.vars).filter(([, variable]) => variable.type === 'fact') : [];
184
- const factsStreamsList = this.rulesEngineService ? facts.map(([varName, fact]) => this.rulesEngineService.engine.retrieveOrCreateFactStream(fact.value).pipe(map$1((factValue) => ({
185
- varName,
186
- factName: fact.value,
187
- // eslint-disable-next-line new-cap
188
- factValue: (fact.path && factValue) ? JSONPath({ wrap: false, json: factValue, path: fact.path }) : factValue
189
- })), distinctUntilChanged$1((previous, current) => previous.factValue === current.factValue))) : [];
190
- const factsStreamsList$ = factsStreamsList.length ? combineLatest(factsStreamsList) : of([]);
186
+ const factsStreamsList = this.rulesEngineService
187
+ ? facts.map(([varName, fact]) => this.rulesEngineService.engine.retrieveOrCreateFactStream(fact.value).pipe(map$1((factValue) => ({
188
+ varName,
189
+ factName: fact.value,
190
+ // eslint-disable-next-line new-cap -- naming convention imposed by jsonpath-plus
191
+ factValue: (fact.path && factValue) ? JSONPath({ wrap: false, json: factValue, path: fact.path }) : factValue
192
+ })), distinctUntilChanged$1((previous, current) => previous.factValue === current.factValue)))
193
+ : [];
194
+ const factsStreamsList$ = factsStreamsList.length > 0 ? combineLatest(factsStreamsList) : of([]);
191
195
  return combineLatest([factsStreamsList$, this.store.select(selectPlaceholderRequestEntityUsage(action.id)).pipe(distinctUntilChanged$1())]).pipe(switchMap(([factsUsedInTemplate, placeholderRequestUsage]) => {
192
196
  if (!placeholderRequestUsage) {
193
197
  return EMPTY;
@@ -251,9 +255,9 @@ class PlaceholderTemplateResponseEffect {
251
255
  acc[paramKey] = factMapFromVars[paramValue];
252
256
  return acc;
253
257
  }, linkedVars);
254
- replacements$.push(this.translationService ?
255
- this.translationService.translate(vars[varName].value, linkedParams).pipe(map$1((value) => (value ? { ejsVar, value } : null))) :
256
- of(null));
258
+ replacements$.push(this.translationService
259
+ ? this.translationService.translate(vars[varName].value, linkedParams).pipe(map$1((value) => (value ? { ejsVar, value } : null)))
260
+ : of(null));
257
261
  break;
258
262
  }
259
263
  default: {
@@ -264,16 +268,17 @@ class PlaceholderTemplateResponseEffect {
264
268
  }
265
269
  }
266
270
  }
267
- return replacements$.length > 0 && !!template ?
268
- combineLatest(replacements$).pipe(map$1((replacements) => ({
271
+ return replacements$.length > 0 && !!template
272
+ ? combineLatest(replacements$).pipe(map$1((replacements) => ({
269
273
  renderedTemplate: replacements.reduce((acc, replacement) => replacement ? acc.replace(replacement.ejsVar, replacement.value) : acc, template),
270
274
  unknownTypeFound
271
- }))) : of({ renderedTemplate: template, unknownTypeFound });
275
+ })))
276
+ : of({ renderedTemplate: template, unknownTypeFound });
272
277
  }
273
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: PlaceholderTemplateResponseEffect, deps: [{ token: i1$1.Actions }, { token: i1.Store }, { token: i3$1.RulesEngineRunnerService, optional: true }, { token: i4.DynamicContentService, optional: true }, { token: i3.LocalizationService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
274
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: PlaceholderTemplateResponseEffect }); }
278
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderTemplateResponseEffect, deps: [{ token: i1$1.Actions }, { token: i1.Store }, { token: i3$1.RulesEngineRunnerService, optional: true }, { token: i4.DynamicContentService, optional: true }, { token: i3.LocalizationService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
279
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderTemplateResponseEffect }); }
275
280
  }
276
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: PlaceholderTemplateResponseEffect, decorators: [{
281
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderTemplateResponseEffect, decorators: [{
277
282
  type: Injectable
278
283
  }], ctorParameters: () => [{ type: i1$1.Actions }, { type: i1.Store }, { type: i3$1.RulesEngineRunnerService, decorators: [{
279
284
  type: Optional
@@ -284,16 +289,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
284
289
  }] }] });
285
290
 
286
291
  class PlaceholderRulesEngineActionModule {
287
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: PlaceholderRulesEngineActionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
288
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.12", ngImport: i0, type: PlaceholderRulesEngineActionModule, imports: [i1$1.EffectsFeatureModule, PlaceholderRequestStoreModule,
292
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderRulesEngineActionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
293
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderRulesEngineActionModule, imports: [i1$1.EffectsFeatureModule, PlaceholderRequestStoreModule,
289
294
  PlaceholderTemplateStoreModule] }); }
290
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: PlaceholderRulesEngineActionModule, providers: [
295
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderRulesEngineActionModule, providers: [
291
296
  PlaceholderRulesEngineActionHandler
292
297
  ], imports: [EffectsModule.forFeature([PlaceholderTemplateResponseEffect]),
293
298
  PlaceholderRequestStoreModule,
294
299
  PlaceholderTemplateStoreModule] }); }
295
300
  }
296
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: PlaceholderRulesEngineActionModule, decorators: [{
301
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderRulesEngineActionModule, decorators: [{
297
302
  type: NgModule,
298
303
  args: [{
299
304
  imports: [
@@ -1 +1 @@
1
- {"version":3,"file":"o3r-components-rules-engine.mjs","sources":["../../src/rules-engine/placeholder.interfaces.ts","../../src/rules-engine/placeholder.action-handler.ts","../../src/rules-engine/placeholder.rules-engine.effect.ts","../../src/rules-engine/placeholder.rules-engine.module.ts","../../src/rules-engine/o3r-components-rules-engine.ts"],"sourcesContent":["import type { RulesEngineAction } from '@o3r/core';\n\n/** ActionUpdatePlaceholderBlock */\nexport const RULES_ENGINE_PLACEHOLDER_UPDATE_ACTION_TYPE = 'UPDATE_PLACEHOLDER';\n\n/**\n * Content of action that updates a placeholder\n */\nexport interface ActionUpdatePlaceholderBlock extends RulesEngineAction {\n actionType: typeof RULES_ENGINE_PLACEHOLDER_UPDATE_ACTION_TYPE;\n placeholderId: string;\n value: string;\n priority?: number;\n}\n","import { Injectable, Injector, OnDestroy, Optional } from '@angular/core';\nimport { select, Store } from '@ngrx/store';\nimport type { RulesEngineActionHandler } from '@o3r/core';\nimport {\n deletePlaceholderTemplateEntity,\n PlaceholderRequestReply,\n PlaceholderTemplateStore,\n selectPlaceholderRequestEntities,\n selectPlaceholderTemplateEntities,\n setPlaceholderRequestEntityFromUrl,\n setPlaceholderTemplateEntity,\n updatePlaceholderRequestEntity\n} from '@o3r/components';\nimport { DynamicContentService } from '@o3r/dynamic-content';\nimport { LocalizationService } from '@o3r/localization';\nimport { LoggerService } from '@o3r/logger';\nimport { combineLatest, distinctUntilChanged, firstValueFrom, map, of, startWith, Subject, Subscription, withLatestFrom } from 'rxjs';\nimport { ActionUpdatePlaceholderBlock, RULES_ENGINE_PLACEHOLDER_UPDATE_ACTION_TYPE } from './placeholder.interfaces';\n\n/**\n * Service to handle async PlaceholderTemplate actions\n */\n@Injectable()\nexport class PlaceholderRulesEngineActionHandler implements OnDestroy, RulesEngineActionHandler<ActionUpdatePlaceholderBlock> {\n\n protected subscription = new Subscription();\n\n protected placeholdersActions$: Subject<{ placeholderId: string; templateUrl: string; priority: number }[]> = new Subject();\n\n /** @inheritdoc */\n public readonly supportingActions = [RULES_ENGINE_PLACEHOLDER_UPDATE_ACTION_TYPE] as const;\n\n constructor(\n store: Store<PlaceholderTemplateStore>,\n private readonly logger: LoggerService,\n private readonly injector: Injector,\n @Optional() translateService?: LocalizationService\n ) {\n const lang$ = translateService ? translateService.getTranslateService().onLangChange.pipe(\n map(({ lang }) => lang),\n startWith(translateService.getCurrentLanguage()),\n distinctUntilChanged()\n ) : of(null);\n\n const filteredActions$ = combineLatest([\n lang$,\n this.placeholdersActions$.pipe(\n distinctUntilChanged((prev, next) => JSON.stringify(prev) === JSON.stringify(next))\n )\n ]).pipe(\n withLatestFrom(\n combineLatest([store.pipe(select(selectPlaceholderTemplateEntities)), store.pipe(select(selectPlaceholderRequestEntities))])\n ),\n map(([langAndTemplatesUrls, storedPlaceholdersAndRequests]) => {\n const [lang, placeholderActions] = langAndTemplatesUrls;\n const storedPlaceholders = storedPlaceholdersAndRequests[0] || {};\n const storedPlaceholderRequests = storedPlaceholdersAndRequests[1] || {};\n const placeholderNewRequests: { rawUrl: string; resolvedUrl: string }[] = [];\n // Stores all raw Urls used from the current engine execution\n const usedUrls: Record<string, boolean> = {};\n // Get all Urls that needs to be resolved from current rules engine output\n const placeholdersTemplates = placeholderActions.reduce((acc, placeholderAction) => {\n const placeholdersTemplateUrl = {\n rawUrl: placeholderAction.templateUrl,\n priority: placeholderAction.priority\n };\n if (acc[placeholderAction.placeholderId]) {\n acc[placeholderAction.placeholderId].push(placeholdersTemplateUrl);\n } else {\n acc[placeholderAction.placeholderId] = [placeholdersTemplateUrl];\n }\n const resolvedUrl = this.resolveUrlWithLang(placeholderAction.templateUrl, lang);\n // Filters duplicates and resolved urls that are already in the store\n if (!usedUrls[placeholderAction.templateUrl] && (!storedPlaceholderRequests[placeholderAction.templateUrl]\n || storedPlaceholderRequests[placeholderAction.templateUrl]!.resolvedUrl !== resolvedUrl)) {\n placeholderNewRequests.push({\n rawUrl: placeholderAction.templateUrl,\n resolvedUrl: this.resolveUrlWithLang(placeholderAction.templateUrl, lang)\n });\n }\n usedUrls[placeholderAction.templateUrl] = true;\n return acc;\n }, {} as { [key: string]: { rawUrl: string; priority: number }[] });\n // Urls not used anymore and not already disabled\n const placeholderRequestsToDisable: string[] = [];\n // Urls used that were disabled\n const placeholderRequestsToEnable: string[] = [];\n Object.keys(storedPlaceholderRequests).forEach((storedPlaceholderRequestRawUrl) => {\n const usedFromEngineIteration = usedUrls[storedPlaceholderRequestRawUrl];\n const usedFromStore = (storedPlaceholderRequests && storedPlaceholderRequests[storedPlaceholderRequestRawUrl]) ? storedPlaceholderRequests[storedPlaceholderRequestRawUrl].used : false;\n if (!usedFromEngineIteration && usedFromStore) {\n placeholderRequestsToDisable.push(storedPlaceholderRequestRawUrl);\n } else if (usedFromEngineIteration && !usedFromStore) {\n placeholderRequestsToEnable.push(storedPlaceholderRequestRawUrl);\n }\n });\n // Placeholder that are no longer filled by the current engine execution output will be cleared\n const placeholdersTemplatesToBeCleanedUp = Object.keys(storedPlaceholders)\n .filter(placeholderId => !placeholdersTemplates[placeholderId]);\n\n const placeholdersTemplatesToBeSet = Object.keys(placeholdersTemplates).reduce((changedPlaceholderTemplates, placeholderTemplateId) => {\n // Caching if the placeholder template already exists with the same urls\n if (!storedPlaceholders[placeholderTemplateId] ||\n !(JSON.stringify(storedPlaceholders[placeholderTemplateId].urlsWithPriority) === JSON.stringify(placeholdersTemplates[placeholderTemplateId]))) {\n changedPlaceholderTemplates.push({\n id: placeholderTemplateId,\n urlsWithPriority: placeholdersTemplates[placeholderTemplateId]\n });\n }\n return changedPlaceholderTemplates;\n }, [] as { id: string; urlsWithPriority: { rawUrl: string; priority: number }[] }[]);\n return {\n placeholdersTemplatesToBeCleanedUp,\n placeholderRequestsToDisable,\n placeholderRequestsToEnable,\n placeholdersTemplatesToBeSet,\n placeholderNewRequests\n };\n })\n );\n this.subscription.add(filteredActions$.subscribe((placeholdersUpdates) => {\n placeholdersUpdates.placeholdersTemplatesToBeCleanedUp.forEach(placeholderId =>\n store.dispatch(deletePlaceholderTemplateEntity({\n id: placeholderId\n }))\n );\n placeholdersUpdates.placeholdersTemplatesToBeSet.forEach(placeholdersTemplateToBeSet => {\n store.dispatch(setPlaceholderTemplateEntity({ entity: placeholdersTemplateToBeSet }));\n });\n placeholdersUpdates.placeholderRequestsToDisable.forEach(placeholderRequestToDisable => {\n store.dispatch(updatePlaceholderRequestEntity({ entity: { id: placeholderRequestToDisable, used: false } }));\n });\n placeholdersUpdates.placeholderRequestsToEnable.forEach(placeholderRequestToEnable => {\n store.dispatch(updatePlaceholderRequestEntity({ entity: { id: placeholderRequestToEnable, used: true } }));\n });\n placeholdersUpdates.placeholderNewRequests.forEach(placeholderNewRequest => {\n store.dispatch(setPlaceholderRequestEntityFromUrl({\n resolvedUrl: placeholderNewRequest.resolvedUrl,\n id: placeholderNewRequest.rawUrl,\n call: this.retrieveTemplate(placeholderNewRequest.resolvedUrl)\n }));\n });\n }));\n }\n\n /**\n * Localize the url, replacing the language marker\n * @param url\n * @param language\n */\n protected resolveUrlWithLang(url: string, language: string | null): string {\n if (!language && url.includes('[LANGUAGE]')) {\n this.logger.warn(`Missing language when trying to resolve ${url}`);\n }\n return language ? url.replace(/\\[LANGUAGE]/g, language) : url;\n }\n\n /**\n * Retrieve template as json from a given url\n * @param url\n */\n protected async retrieveTemplate(url: string): Promise<PlaceholderRequestReply> {\n const resolvedUrl$ = this.injector.get(DynamicContentService, null, { optional: true })?.getContentPathStream(url) || of(url);\n const fullUrl = await firstValueFrom(resolvedUrl$);\n return fetch(fullUrl).then((response) => response.json());\n }\n\n /** @inheritdoc */\n public executeActions(actions: ActionUpdatePlaceholderBlock[]) {\n const templates = actions.map((action) => ({\n placeholderId: action.placeholderId,\n templateUrl: action.value,\n priority: action.priority || 0\n }));\n\n this.placeholdersActions$.next(templates);\n }\n\n /** @inheritdoc */\n public ngOnDestroy(): void {\n this.subscription.unsubscribe();\n }\n}\n","import {Injectable, Optional} from '@angular/core';\nimport {Actions, createEffect, ofType} from '@ngrx/effects';\nimport {\n cancelPlaceholderRequest,\n failPlaceholderRequestEntity,\n PlaceholderRequestStore,\n PlaceholderVariable,\n selectPlaceholderRequestEntityUsage,\n setPlaceholderRequestEntityFromUrl,\n updatePlaceholderRequestEntity\n} from '@o3r/components';\nimport {fromApiEffectSwitchMapById} from '@o3r/core';\nimport {DynamicContentService} from '@o3r/dynamic-content';\nimport {LocalizationService} from '@o3r/localization';\nimport {RulesEngineRunnerService} from '@o3r/rules-engine';\nimport {combineLatest, EMPTY, Observable, of} from 'rxjs';\nimport {distinctUntilChanged, map, switchMap, take} from 'rxjs/operators';\nimport {Store} from '@ngrx/store';\nimport { JSONPath } from 'jsonpath-plus';\n\n/**\n * Service to handle async PlaceholderTemplate actions\n */\n@Injectable()\nexport class PlaceholderTemplateResponseEffect {\n /**\n * Set the PlaceholderRequest entity with the reply content, dispatch failPlaceholderRequestEntity if it catches a failure\n * Handles the rendering of the HTML content from the template and creates the combine latest from facts list if needed\n * Disables unused templates refresh if used is false in the store\n */\n public setPlaceholderRequestEntityFromUrl$ = createEffect(() =>\n this.actions$.pipe(\n ofType(setPlaceholderRequestEntityFromUrl),\n fromApiEffectSwitchMapById(\n (templateResponse, action) => {\n const facts = templateResponse.vars ? Object.entries(templateResponse.vars).filter(([, variable]) => variable.type === 'fact') : [];\n const factsStreamsList = this.rulesEngineService ? facts.map(([varName, fact]) =>\n this.rulesEngineService!.engine.retrieveOrCreateFactStream(fact.value).pipe(\n map((factValue) => ({\n varName,\n factName: fact.value,\n // eslint-disable-next-line new-cap\n factValue: (fact.path && factValue) ? JSONPath({ wrap: false, json: factValue, path: fact.path }) : factValue\n })),\n distinctUntilChanged((previous, current) => previous.factValue === current.factValue)\n )) : [];\n\n const factsStreamsList$ = factsStreamsList.length ? combineLatest(factsStreamsList) : of([]);\n return combineLatest([factsStreamsList$, this.store.select(selectPlaceholderRequestEntityUsage(action.id)).pipe(distinctUntilChanged())]).pipe(\n switchMap(([factsUsedInTemplate, placeholderRequestUsage]) => {\n if (!placeholderRequestUsage) {\n return EMPTY;\n }\n return this.getRenderedHTML$(templateResponse.template, templateResponse.vars, factsUsedInTemplate).pipe(\n map(({renderedTemplate, unknownTypeFound}) =>\n // Update instead of set because used already set by the update from url action\n updatePlaceholderRequestEntity({\n entity: {\n ...templateResponse,\n resolvedUrl: action.resolvedUrl,\n id: action.id,\n renderedTemplate,\n unknownTypeFound\n },\n requestId: action.requestId\n })\n )\n );\n }));\n },\n (error, action) => of(failPlaceholderRequestEntity({ids: [action.id], error, requestId: action.requestId})),\n (requestIdPayload, action) => cancelPlaceholderRequest({...requestIdPayload, id: action.id})\n )\n )\n );\n\n constructor(\n private readonly actions$: Actions,\n private readonly store: Store<PlaceholderRequestStore>,\n @Optional() private readonly rulesEngineService: RulesEngineRunnerService | null,\n @Optional() private readonly dynamicContentService: DynamicContentService | null,\n @Optional() private readonly translationService: LocalizationService | null) {\n }\n\n /**\n * Renders the html template, replacing facts and urls and localizationKeys\n * @param template\n * @param vars\n * @param facts\n */\n private getRenderedHTML$(template?: string, vars?: Record<string, PlaceholderVariable>, facts?: { varName: string; factName: string; factValue: any }[]) {\n let unknownTypeFound = false;\n const factMap = (facts || []).reduce((mapping: { [key: string]: any }, fact) => {\n mapping[fact.factName] = fact.factValue;\n return mapping;\n }, {});\n const factMapFromVars = (facts || []).reduce((mapping: { [key: string]: any }, fact) => {\n mapping[fact.varName] = fact.factValue;\n return mapping;\n }, {});\n const replacements$: Observable<{ ejsVar: RegExp; value: string } | null>[] = [];\n if (vars && template) {\n for (const varName in vars) {\n if (Object.prototype.hasOwnProperty.call(vars, varName)) {\n const ejsVar = new RegExp(`<%=\\\\s*${varName}\\\\s*%>`, 'g');\n switch (vars[varName].type) {\n case 'relativeUrl': {\n replacements$.push(\n this.dynamicContentService?.getMediaPathStream(vars[varName].value).pipe(\n take(1),\n map((value: string) => ({ejsVar, value}))\n ) || of({ ejsVar, value: vars[varName].value })\n );\n break;\n }\n case 'fullUrl': {\n template = template.replace(ejsVar, vars[varName].value);\n break;\n }\n case 'fact': {\n template = template.replace(ejsVar, factMap[vars[varName].value] ?? '');\n break;\n }\n case 'localisation': {\n const linkedVars = (vars[varName].vars || []).reduce((acc: { [key: string]: any }, parameter) => {\n const paramName = vars[parameter].value;\n acc[paramName] = factMap[paramName];\n return acc;\n }, {});\n const linkedParams = (Object.entries(vars[varName].parameters || {})).reduce((acc: { [key: string]: any }, [paramKey, paramValue]) => {\n acc[paramKey] = factMapFromVars[paramValue];\n return acc;\n }, linkedVars);\n replacements$.push(\n this.translationService ?\n this.translationService.translate(vars[varName].value, linkedParams).pipe(\n map((value) => (value ? { ejsVar, value } : null))\n ) :\n of(null)\n );\n break;\n }\n default : {\n unknownTypeFound = true;\n break;\n }\n }\n }\n }\n }\n return replacements$.length > 0 && !!template ?\n combineLatest(replacements$).pipe(\n map((replacements) => ({\n renderedTemplate: replacements.reduce(\n (acc, replacement) =>\n replacement ? acc.replace(replacement.ejsVar, replacement.value) : acc,\n template\n ),\n unknownTypeFound\n }))\n ) : of({renderedTemplate: template, unknownTypeFound});\n }\n}\n","import { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { PlaceholderRequestStoreModule, PlaceholderTemplateStoreModule } from '@o3r/components';\nimport { PlaceholderRulesEngineActionHandler } from './placeholder.action-handler';\nimport { PlaceholderTemplateResponseEffect } from './placeholder.rules-engine.effect';\n\n@NgModule({\n imports: [\n EffectsModule.forFeature([PlaceholderTemplateResponseEffect]),\n PlaceholderRequestStoreModule,\n PlaceholderTemplateStoreModule\n ],\n providers: [\n PlaceholderRulesEngineActionHandler\n ]\n})\nexport class PlaceholderRulesEngineActionModule {\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["map","distinctUntilChanged","i1","i2","i3","i5"],"mappings":";;;;;;;;;;;;;;;;;AAEA;AACO,MAAM,2CAA2C,GAAG;;ACgB3D;;AAEG;MAEU,mCAAmC,CAAA;AAS9C,IAAA,WAAA,CACE,KAAsC,EACrB,MAAqB,EACrB,QAAkB,EACvB,gBAAsC,EAAA;QAFjC,IAAM,CAAA,MAAA,GAAN,MAAM;QACN,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ine.mjs","sources":["../../src/rules-engine/placeholder.interfaces.ts","../../src/rules-engine/placeholder.action-handler.ts","../../src/rules-engine/placeholder.rules-engine.effect.ts","../../src/rules-engine/placeholder.rules-engine.module.ts","../../src/rules-engine/o3r-components-rules-engine.ts"],"sourcesContent":["import type {\n RulesEngineAction,\n} from '@o3r/core';\n\n/** ActionUpdatePlaceholderBlock */\nexport const RULES_ENGINE_PLACEHOLDER_UPDATE_ACTION_TYPE = 'UPDATE_PLACEHOLDER';\n\n/**\n * Content of action that updates a placeholder\n */\nexport interface ActionUpdatePlaceholderBlock extends RulesEngineAction {\n actionType: typeof RULES_ENGINE_PLACEHOLDER_UPDATE_ACTION_TYPE;\n placeholderId: string;\n value: string;\n priority?: number;\n}\n","import {\n Injectable,\n Injector,\n OnDestroy,\n Optional,\n} from '@angular/core';\nimport {\n select,\n Store,\n} from '@ngrx/store';\nimport type {\n RulesEngineActionHandler,\n} from '@o3r/core';\nimport {\n DynamicContentService,\n} from '@o3r/dynamic-content';\nimport {\n LocalizationService,\n} from '@o3r/localization';\nimport {\n LoggerService,\n} from '@o3r/logger';\nimport {\n combineLatest,\n distinctUntilChanged,\n firstValueFrom,\n map,\n of,\n startWith,\n Subject,\n Subscription,\n withLatestFrom,\n} from 'rxjs';\nimport {\n ActionUpdatePlaceholderBlock,\n RULES_ENGINE_PLACEHOLDER_UPDATE_ACTION_TYPE,\n} from './placeholder.interfaces';\nimport {\n deletePlaceholderTemplateEntity,\n PlaceholderRequestReply,\n PlaceholderTemplateStore,\n selectPlaceholderRequestEntities,\n selectPlaceholderTemplateEntities,\n setPlaceholderRequestEntityFromUrl,\n setPlaceholderTemplateEntity,\n updatePlaceholderRequestEntity,\n} from '@o3r/components';\n\n/**\n * Service to handle async PlaceholderTemplate actions\n */\n@Injectable()\nexport class PlaceholderRulesEngineActionHandler implements OnDestroy, RulesEngineActionHandler<ActionUpdatePlaceholderBlock> {\n protected subscription = new Subscription();\n\n protected placeholdersActions$: Subject<{ placeholderId: string; templateUrl: string; priority: number }[]> = new Subject();\n\n /** @inheritdoc */\n public readonly supportingActions = [RULES_ENGINE_PLACEHOLDER_UPDATE_ACTION_TYPE] as const;\n\n constructor(\n store: Store<PlaceholderTemplateStore>,\n private readonly logger: LoggerService,\n private readonly injector: Injector,\n @Optional() translateService?: LocalizationService\n ) {\n const lang$ = translateService\n ? translateService.getTranslateService().onLangChange.pipe(\n map(({ lang }) => lang),\n startWith(translateService.getCurrentLanguage()),\n distinctUntilChanged()\n )\n : of(null);\n\n const filteredActions$ = combineLatest([\n lang$,\n this.placeholdersActions$.pipe(\n distinctUntilChanged((prev, next) => JSON.stringify(prev) === JSON.stringify(next))\n )\n ]).pipe(\n withLatestFrom(\n combineLatest([store.pipe(select(selectPlaceholderTemplateEntities)), store.pipe(select(selectPlaceholderRequestEntities))])\n ),\n map(([langAndTemplatesUrls, storedPlaceholdersAndRequests]) => {\n const [lang, placeholderActions] = langAndTemplatesUrls;\n const storedPlaceholders = storedPlaceholdersAndRequests[0] || {};\n const storedPlaceholderRequests = storedPlaceholdersAndRequests[1] || {};\n const placeholderNewRequests: { rawUrl: string; resolvedUrl: string }[] = [];\n // Stores all raw Urls used from the current engine execution\n const usedUrls: Record<string, boolean> = {};\n // Get all Urls that needs to be resolved from current rules engine output\n const placeholdersTemplates = placeholderActions.reduce((acc, placeholderAction) => {\n const placeholdersTemplateUrl = {\n rawUrl: placeholderAction.templateUrl,\n priority: placeholderAction.priority\n };\n if (acc[placeholderAction.placeholderId]) {\n acc[placeholderAction.placeholderId].push(placeholdersTemplateUrl);\n } else {\n acc[placeholderAction.placeholderId] = [placeholdersTemplateUrl];\n }\n const resolvedUrl = this.resolveUrlWithLang(placeholderAction.templateUrl, lang);\n // Filters duplicates and resolved urls that are already in the store\n if (!usedUrls[placeholderAction.templateUrl] && (!storedPlaceholderRequests[placeholderAction.templateUrl]\n || storedPlaceholderRequests[placeholderAction.templateUrl]!.resolvedUrl !== resolvedUrl)) {\n placeholderNewRequests.push({\n rawUrl: placeholderAction.templateUrl,\n resolvedUrl: this.resolveUrlWithLang(placeholderAction.templateUrl, lang)\n });\n }\n usedUrls[placeholderAction.templateUrl] = true;\n return acc;\n }, {} as { [key: string]: { rawUrl: string; priority: number }[] });\n // Urls not used anymore and not already disabled\n const placeholderRequestsToDisable: string[] = [];\n // Urls used that were disabled\n const placeholderRequestsToEnable: string[] = [];\n Object.keys(storedPlaceholderRequests).forEach((storedPlaceholderRequestRawUrl) => {\n const usedFromEngineIteration = usedUrls[storedPlaceholderRequestRawUrl];\n const usedFromStore = (storedPlaceholderRequests && storedPlaceholderRequests[storedPlaceholderRequestRawUrl]) ? storedPlaceholderRequests[storedPlaceholderRequestRawUrl].used : false;\n if (!usedFromEngineIteration && usedFromStore) {\n placeholderRequestsToDisable.push(storedPlaceholderRequestRawUrl);\n } else if (usedFromEngineIteration && !usedFromStore) {\n placeholderRequestsToEnable.push(storedPlaceholderRequestRawUrl);\n }\n });\n // Placeholder that are no longer filled by the current engine execution output will be cleared\n const placeholdersTemplatesToBeCleanedUp = Object.keys(storedPlaceholders)\n .filter((placeholderId) => !placeholdersTemplates[placeholderId]);\n\n const placeholdersTemplatesToBeSet = Object.keys(placeholdersTemplates).reduce((changedPlaceholderTemplates, placeholderTemplateId) => {\n // Caching if the placeholder template already exists with the same urls\n if (!storedPlaceholders[placeholderTemplateId]\n || !(JSON.stringify(storedPlaceholders[placeholderTemplateId].urlsWithPriority) === JSON.stringify(placeholdersTemplates[placeholderTemplateId]))) {\n changedPlaceholderTemplates.push({\n id: placeholderTemplateId,\n urlsWithPriority: placeholdersTemplates[placeholderTemplateId]\n });\n }\n return changedPlaceholderTemplates;\n }, [] as { id: string; urlsWithPriority: { rawUrl: string; priority: number }[] }[]);\n return {\n placeholdersTemplatesToBeCleanedUp,\n placeholderRequestsToDisable,\n placeholderRequestsToEnable,\n placeholdersTemplatesToBeSet,\n placeholderNewRequests\n };\n })\n );\n this.subscription.add(filteredActions$.subscribe((placeholdersUpdates) => {\n placeholdersUpdates.placeholdersTemplatesToBeCleanedUp.forEach((placeholderId) =>\n store.dispatch(deletePlaceholderTemplateEntity({\n id: placeholderId\n }))\n );\n placeholdersUpdates.placeholdersTemplatesToBeSet.forEach((placeholdersTemplateToBeSet) => {\n store.dispatch(setPlaceholderTemplateEntity({ entity: placeholdersTemplateToBeSet }));\n });\n placeholdersUpdates.placeholderRequestsToDisable.forEach((placeholderRequestToDisable) => {\n store.dispatch(updatePlaceholderRequestEntity({ entity: { id: placeholderRequestToDisable, used: false } }));\n });\n placeholdersUpdates.placeholderRequestsToEnable.forEach((placeholderRequestToEnable) => {\n store.dispatch(updatePlaceholderRequestEntity({ entity: { id: placeholderRequestToEnable, used: true } }));\n });\n placeholdersUpdates.placeholderNewRequests.forEach((placeholderNewRequest) => {\n store.dispatch(setPlaceholderRequestEntityFromUrl({\n resolvedUrl: placeholderNewRequest.resolvedUrl,\n id: placeholderNewRequest.rawUrl,\n call: this.retrieveTemplate(placeholderNewRequest.resolvedUrl)\n }));\n });\n }));\n }\n\n /**\n * Localize the url, replacing the language marker\n * @param url\n * @param language\n */\n protected resolveUrlWithLang(url: string, language: string | null): string {\n if (!language && url.includes('[LANGUAGE]')) {\n this.logger.warn(`Missing language when trying to resolve ${url}`);\n }\n return language ? url.replace(/\\[LANGUAGE]/g, language) : url;\n }\n\n /**\n * Retrieve template as json from a given url\n * @param url\n */\n protected async retrieveTemplate(url: string): Promise<PlaceholderRequestReply> {\n const resolvedUrl$ = this.injector.get(DynamicContentService, null, { optional: true })?.getContentPathStream(url) || of(url);\n const fullUrl = await firstValueFrom(resolvedUrl$);\n return fetch(fullUrl).then((response) => response.json());\n }\n\n /** @inheritdoc */\n public executeActions(actions: ActionUpdatePlaceholderBlock[]) {\n const templates = actions.map((action) => ({\n placeholderId: action.placeholderId,\n templateUrl: action.value,\n priority: action.priority || 0\n }));\n\n this.placeholdersActions$.next(templates);\n }\n\n /** @inheritdoc */\n public ngOnDestroy(): void {\n this.subscription.unsubscribe();\n }\n}\n","import {\n Injectable,\n Optional,\n} from '@angular/core';\nimport {\n Actions,\n createEffect,\n ofType,\n} from '@ngrx/effects';\nimport {\n Store,\n} from '@ngrx/store';\nimport {\n fromApiEffectSwitchMapById,\n} from '@o3r/core';\nimport {\n DynamicContentService,\n} from '@o3r/dynamic-content';\nimport {\n LocalizationService,\n} from '@o3r/localization';\nimport {\n RulesEngineRunnerService,\n} from '@o3r/rules-engine';\nimport {\n JSONPath,\n} from 'jsonpath-plus';\nimport {\n combineLatest,\n EMPTY,\n Observable,\n of,\n} from 'rxjs';\nimport {\n distinctUntilChanged,\n map,\n switchMap,\n take,\n} from 'rxjs/operators';\nimport {\n cancelPlaceholderRequest,\n failPlaceholderRequestEntity,\n type PlaceholderRequestStore,\n type PlaceholderVariable,\n selectPlaceholderRequestEntityUsage,\n setPlaceholderRequestEntityFromUrl,\n updatePlaceholderRequestEntity,\n} from '@o3r/components';\n\n/**\n * Service to handle async PlaceholderTemplate actions\n */\n@Injectable()\nexport class PlaceholderTemplateResponseEffect {\n /**\n * Set the PlaceholderRequest entity with the reply content, dispatch failPlaceholderRequestEntity if it catches a failure\n * Handles the rendering of the HTML content from the template and creates the combine latest from facts list if needed\n * Disables unused templates refresh if used is false in the store\n */\n public setPlaceholderRequestEntityFromUrl$ = createEffect(() =>\n this.actions$.pipe(\n ofType(setPlaceholderRequestEntityFromUrl),\n fromApiEffectSwitchMapById(\n (templateResponse, action) => {\n const facts = templateResponse.vars ? Object.entries(templateResponse.vars).filter(([, variable]) => variable.type === 'fact') : [];\n const factsStreamsList = this.rulesEngineService\n ? facts.map(([varName, fact]) =>\n this.rulesEngineService!.engine.retrieveOrCreateFactStream(fact.value).pipe(\n map((factValue) => ({\n varName,\n factName: fact.value,\n // eslint-disable-next-line new-cap -- naming convention imposed by jsonpath-plus\n factValue: (fact.path && factValue) ? JSONPath({ wrap: false, json: factValue, path: fact.path }) : factValue\n })),\n distinctUntilChanged((previous, current) => previous.factValue === current.factValue)\n ))\n : [];\n\n const factsStreamsList$ = factsStreamsList.length > 0 ? combineLatest(factsStreamsList) : of([]);\n return combineLatest([factsStreamsList$, this.store.select(selectPlaceholderRequestEntityUsage(action.id)).pipe(distinctUntilChanged())]).pipe(\n switchMap(([factsUsedInTemplate, placeholderRequestUsage]) => {\n if (!placeholderRequestUsage) {\n return EMPTY;\n }\n return this.getRenderedHTML$(templateResponse.template, templateResponse.vars, factsUsedInTemplate).pipe(\n map(({ renderedTemplate, unknownTypeFound }) =>\n // Update instead of set because used already set by the update from url action\n updatePlaceholderRequestEntity({\n entity: {\n ...templateResponse,\n resolvedUrl: action.resolvedUrl,\n id: action.id,\n renderedTemplate,\n unknownTypeFound\n },\n requestId: action.requestId\n })\n )\n );\n }));\n },\n (error, action) => of(failPlaceholderRequestEntity({ ids: [action.id], error, requestId: action.requestId })),\n (requestIdPayload, action) => cancelPlaceholderRequest({ ...requestIdPayload, id: action.id })\n )\n )\n );\n\n constructor(\n private readonly actions$: Actions,\n private readonly store: Store<PlaceholderRequestStore>,\n @Optional() private readonly rulesEngineService: RulesEngineRunnerService | null,\n @Optional() private readonly dynamicContentService: DynamicContentService | null,\n @Optional() private readonly translationService: LocalizationService | null) {}\n\n /**\n * Renders the html template, replacing facts and urls and localizationKeys\n * @param template\n * @param vars\n * @param facts\n */\n private getRenderedHTML$(template?: string, vars?: Record<string, PlaceholderVariable>, facts?: { varName: string; factName: string; factValue: any }[]) {\n let unknownTypeFound = false;\n const factMap = (facts || []).reduce((mapping: { [key: string]: any }, fact) => {\n mapping[fact.factName] = fact.factValue;\n return mapping;\n }, {});\n const factMapFromVars = (facts || []).reduce((mapping: { [key: string]: any }, fact) => {\n mapping[fact.varName] = fact.factValue;\n return mapping;\n }, {});\n const replacements$: Observable<{ ejsVar: RegExp; value: string } | null>[] = [];\n if (vars && template) {\n for (const varName in vars) {\n if (Object.prototype.hasOwnProperty.call(vars, varName)) {\n const ejsVar = new RegExp(`<%=\\\\s*${varName}\\\\s*%>`, 'g');\n switch (vars[varName].type) {\n case 'relativeUrl': {\n replacements$.push(\n this.dynamicContentService?.getMediaPathStream(vars[varName].value).pipe(\n take(1),\n map((value: string) => ({ ejsVar, value }))\n ) || of({ ejsVar, value: vars[varName].value })\n );\n break;\n }\n case 'fullUrl': {\n template = template.replace(ejsVar, vars[varName].value);\n break;\n }\n case 'fact': {\n template = template.replace(ejsVar, factMap[vars[varName].value] ?? '');\n break;\n }\n case 'localisation': {\n const linkedVars = (vars[varName].vars || []).reduce((acc: { [key: string]: any }, parameter) => {\n const paramName = vars[parameter].value;\n acc[paramName] = factMap[paramName];\n return acc;\n }, {});\n const linkedParams = (Object.entries(vars[varName].parameters || {})).reduce((acc: { [key: string]: any }, [paramKey, paramValue]) => {\n acc[paramKey] = factMapFromVars[paramValue];\n return acc;\n }, linkedVars);\n replacements$.push(\n this.translationService\n ? this.translationService.translate(vars[varName].value, linkedParams).pipe(\n map((value) => (value ? { ejsVar, value } : null))\n )\n : of(null)\n );\n break;\n }\n default : {\n unknownTypeFound = true;\n break;\n }\n }\n }\n }\n }\n return replacements$.length > 0 && !!template\n ? combineLatest(replacements$).pipe(\n map((replacements) => ({\n renderedTemplate: replacements.reduce(\n (acc, replacement) =>\n replacement ? acc.replace(replacement.ejsVar, replacement.value) : acc,\n template\n ),\n unknownTypeFound\n }))\n )\n : of({ renderedTemplate: template, unknownTypeFound });\n }\n}\n","import {\n NgModule,\n} from '@angular/core';\nimport {\n EffectsModule,\n} from '@ngrx/effects';\nimport {\n PlaceholderRulesEngineActionHandler,\n} from './placeholder.action-handler';\nimport {\n PlaceholderTemplateResponseEffect,\n} from './placeholder.rules-engine.effect';\nimport {\n PlaceholderRequestStoreModule,\n PlaceholderTemplateStoreModule,\n} from '@o3r/components';\n\n@NgModule({\n imports: [\n EffectsModule.forFeature([PlaceholderTemplateResponseEffect]),\n PlaceholderRequestStoreModule,\n PlaceholderTemplateStoreModule\n ],\n providers: [\n PlaceholderRulesEngineActionHandler\n ]\n})\nexport class PlaceholderRulesEngineActionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["map","distinctUntilChanged","i1","i2","i3","i5"],"mappings":";;;;;;;;;;;;;;;;;AAIA;AACO,MAAM,2CAA2C,GAAG;;AC2C3D;;AAEG;MAEU,mCAAmC,CAAA;AAQ9C,IAAA,WAAA,CACE,KAAsC,EACrB,MAAqB,EACrB,QAAkB,EACvB,gBAAsC,EAAA;QAFjC,IAAM,CAAA,MAAA,GAAN,MAAM;QACN,IAAQ,CAAA,QAAA,GAAR,QAAQ;AAVjB,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,YAAY,EAAE;AAEjC,QAAA,IAAA,CAAA,oBAAoB,GAAgF,IAAI,OAAO,EAAE;;AAG3G,QAAA,IAAA,CAAA,iBAAiB,GAAG,CAAC,2CAA2C,CAAU;QAQxF,MAAM,KAAK,GAAG;AACZ,cAAE,gBAAgB,CAAC,mBAAmB,EAAE,CAAC,YAAY,CAAC,IAAI,CACxD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC,EACvB,SAAS,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,CAAC,EAChD,oBAAoB,EAAE;AAExB,cAAE,EAAE,CAAC,IAAI,CAAC;QAEZ,MAAM,gBAAgB,GAAG,aAAa,CAAC;YACrC,KAAK;AACL,YAAA,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAC5B,oBAAoB,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAEtF,SAAA,CAAC,CAAC,IAAI,CACL,cAAc,CACZ,aAAa,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,iCAAiC,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,gCAAgC,CAAC,CAAC,CAAC,CAAC,CAC7H,EACD,G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