@actuarial-ts/core 0.7.1 → 0.8.1

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 (125) hide show
  1. package/README.md +15 -4
  2. package/dist/analysisComparison.d.ts +6 -0
  3. package/dist/analysisComparison.d.ts.map +1 -0
  4. package/dist/analysisComparison.js +52 -0
  5. package/dist/analysisComparison.js.map +1 -0
  6. package/dist/analysisRecipe.d.ts +55 -0
  7. package/dist/analysisRecipe.d.ts.map +1 -0
  8. package/dist/analysisRecipe.js +602 -0
  9. package/dist/analysisRecipe.js.map +1 -0
  10. package/dist/analysisRecipeStatistics.d.ts +11 -0
  11. package/dist/analysisRecipeStatistics.d.ts.map +1 -0
  12. package/dist/analysisRecipeStatistics.js +49 -0
  13. package/dist/analysisRecipeStatistics.js.map +1 -0
  14. package/dist/classifications.d.ts +30 -0
  15. package/dist/classifications.d.ts.map +1 -0
  16. package/dist/classifications.js +207 -0
  17. package/dist/classifications.js.map +1 -0
  18. package/dist/customizationContracts.d.ts +749 -0
  19. package/dist/customizationContracts.d.ts.map +1 -0
  20. package/dist/customizationContracts.js +19 -0
  21. package/dist/customizationContracts.js.map +1 -0
  22. package/dist/descriptiveStatistics.d.ts +8 -0
  23. package/dist/descriptiveStatistics.d.ts.map +1 -0
  24. package/dist/descriptiveStatistics.js +283 -0
  25. package/dist/descriptiveStatistics.js.map +1 -0
  26. package/dist/diagnosticAggregation.d.ts.map +1 -1
  27. package/dist/diagnosticAggregation.js +16 -0
  28. package/dist/diagnosticAggregation.js.map +1 -1
  29. package/dist/diagnosticFreeze.d.ts +4 -0
  30. package/dist/diagnosticFreeze.d.ts.map +1 -0
  31. package/dist/diagnosticFreeze.js +37 -0
  32. package/dist/diagnosticFreeze.js.map +1 -0
  33. package/dist/diagnosticIdentityStream.d.ts +4 -0
  34. package/dist/diagnosticIdentityStream.d.ts.map +1 -1
  35. package/dist/diagnosticIdentityStream.js +32 -2
  36. package/dist/diagnosticIdentityStream.js.map +1 -1
  37. package/dist/diagnosticPreparation.d.ts +21 -0
  38. package/dist/diagnosticPreparation.d.ts.map +1 -1
  39. package/dist/diagnosticPreparation.js +231 -19
  40. package/dist/diagnosticPreparation.js.map +1 -1
  41. package/dist/diagnosticReview.d.ts.map +1 -1
  42. package/dist/diagnosticReview.js +43 -25
  43. package/dist/diagnosticReview.js.map +1 -1
  44. package/dist/diagnosticReviewSources.d.ts.map +1 -1
  45. package/dist/diagnosticReviewSources.js +25 -4
  46. package/dist/diagnosticReviewSources.js.map +1 -1
  47. package/dist/diagnosticReviewStore.d.ts +2 -0
  48. package/dist/diagnosticReviewStore.d.ts.map +1 -1
  49. package/dist/diagnosticReviewStore.js +110 -36
  50. package/dist/diagnosticReviewStore.js.map +1 -1
  51. package/dist/diagnosticRunner.d.ts.map +1 -1
  52. package/dist/diagnosticRunner.js +1 -8
  53. package/dist/diagnosticRunner.js.map +1 -1
  54. package/dist/exposureEarning.d.ts +12 -0
  55. package/dist/exposureEarning.d.ts.map +1 -0
  56. package/dist/exposureEarning.js +276 -0
  57. package/dist/exposureEarning.js.map +1 -0
  58. package/dist/exposureMovements.d.ts +8 -0
  59. package/dist/exposureMovements.d.ts.map +1 -0
  60. package/dist/exposureMovements.js +70 -0
  61. package/dist/exposureMovements.js.map +1 -0
  62. package/dist/exposureRevisions.d.ts +13 -0
  63. package/dist/exposureRevisions.d.ts.map +1 -0
  64. package/dist/exposureRevisions.js +161 -0
  65. package/dist/exposureRevisions.js.map +1 -0
  66. package/dist/financialPipeline.d.ts +14 -0
  67. package/dist/financialPipeline.d.ts.map +1 -0
  68. package/dist/financialPipeline.js +75 -0
  69. package/dist/financialPipeline.js.map +1 -0
  70. package/dist/financialTerms.d.ts +20 -0
  71. package/dist/financialTerms.d.ts.map +1 -0
  72. package/dist/financialTerms.js +205 -0
  73. package/dist/financialTerms.js.map +1 -0
  74. package/dist/fnvAccumulator.d.ts.map +1 -1
  75. package/dist/fnvAccumulator.js +11 -5
  76. package/dist/fnvAccumulator.js.map +1 -1
  77. package/dist/historyPreparation.d.ts +8 -0
  78. package/dist/historyPreparation.d.ts.map +1 -0
  79. package/dist/historyPreparation.js +557 -0
  80. package/dist/historyPreparation.js.map +1 -0
  81. package/dist/index.d.ts +15 -2
  82. package/dist/index.d.ts.map +1 -1
  83. package/dist/index.js +15 -2
  84. package/dist/index.js.map +1 -1
  85. package/dist/policyPeriods.d.ts +29 -0
  86. package/dist/policyPeriods.d.ts.map +1 -0
  87. package/dist/policyPeriods.js +322 -0
  88. package/dist/policyPeriods.js.map +1 -0
  89. package/dist/populations.d.ts +11 -0
  90. package/dist/populations.d.ts.map +1 -0
  91. package/dist/populations.js +264 -0
  92. package/dist/populations.js.map +1 -0
  93. package/dist/reservingAdapter.d.ts +16 -0
  94. package/dist/reservingAdapter.d.ts.map +1 -0
  95. package/dist/reservingAdapter.js +74 -0
  96. package/dist/reservingAdapter.js.map +1 -0
  97. package/dist/version.d.ts +1 -1
  98. package/dist/version.js +1 -1
  99. package/package.json +2 -2
  100. package/src/analysisComparison.ts +71 -0
  101. package/src/analysisRecipe.ts +666 -0
  102. package/src/analysisRecipeStatistics.ts +59 -0
  103. package/src/classifications.ts +231 -0
  104. package/src/customizationContracts.ts +763 -0
  105. package/src/descriptiveStatistics.ts +321 -0
  106. package/src/diagnosticAggregation.ts +16 -0
  107. package/src/diagnosticFreeze.ts +37 -0
  108. package/src/diagnosticIdentityStream.ts +37 -2
  109. package/src/diagnosticPreparation.ts +259 -26
  110. package/src/diagnosticReview.ts +49 -27
  111. package/src/diagnosticReviewSources.ts +22 -3
  112. package/src/diagnosticReviewStore.ts +139 -54
  113. package/src/diagnosticRunner.ts +1 -11
  114. package/src/exposureEarning.ts +314 -0
  115. package/src/exposureMovements.ts +78 -0
  116. package/src/exposureRevisions.ts +186 -0
  117. package/src/financialPipeline.ts +93 -0
  118. package/src/financialTerms.ts +263 -0
  119. package/src/fnvAccumulator.ts +11 -5
  120. package/src/historyPreparation.ts +645 -0
  121. package/src/index.ts +28 -1
  122. package/src/policyPeriods.ts +375 -0
  123. package/src/populations.ts +307 -0
  124. package/src/reservingAdapter.ts +98 -0
  125. package/src/version.ts +1 -1
package/README.md CHANGED
@@ -4,10 +4,15 @@ Pure, framework-free P&C actuarial math for TypeScript. It includes triangles, d
4
4
 
5
5
  The package is designed to support the actuary's compliance with the ASOPs; it does not make a work product compliant and is not “ASOP-approved.” The credentialed actuary remains responsible for data, assumptions, selections, review, and communication.
6
6
 
7
+ SDK 0.8 adds versioned loss history, irregular period and exposure contracts,
8
+ population statistics, shared financial terms, and deterministic recipe and
9
+ scenario execution. See the [0.8 adoption guide](https://github.com/yerromnitsuj/actng/blob/v0.8.1/docs/migrations/0.8-reusable-customization.md)
10
+ and [customization reference](https://github.com/yerromnitsuj/actng/blob/v0.8.1/docs/reference/reusable-customization.md).
11
+
7
12
  ## Install
8
13
 
9
14
  ```bash
10
- npm install @actuarial-ts/core@0.7.1
15
+ npm install @actuarial-ts/core@0.8.1
11
16
  ```
12
17
 
13
18
  ESM, TypeScript-first, zero runtime dependencies, Node 20+.
@@ -101,10 +106,16 @@ they are explicit compatibility choices, not a memory-saving export path.
101
106
  Cloning or parsing an owner does not recreate its authority. Compact storage is
102
107
  not a dataset-capacity or bounded-memory guarantee for an entire application.
103
108
 
109
+ SDK 0.8 adds authenticated compact selection helpers for metric, source-group,
110
+ whole-origin, and valuation/age scopes. Eligible clean aggregate preparations
111
+ share immutable cells while preserving the same fresh preparation and result
112
+ identities; an ineligible scope returns `undefined` so the data gateway can use
113
+ ordinary preparation. These functions do not issue review or execution receipts.
114
+
104
115
  These are lower-level calculation APIs. For a host import or analysis boundary
105
116
  that enforces both review and metric execution policy, use the validated gateway
106
- in `@actuarial-ts/data`. The runnable [compact adoption guide](https://github.com/yerromnitsuj/actng/blob/v0.7.1/docs/migrations/0.7-compact-diagnostics.md)
107
- covers the complete workflow and [streamed replay](https://github.com/yerromnitsuj/actng/blob/v0.7.1/docs/reference/diagnostic-replay-stream.md).
117
+ in `@actuarial-ts/data`. The runnable [compact adoption guide](https://github.com/yerromnitsuj/actng/blob/v0.8.1/docs/migrations/0.7-compact-diagnostics.md)
118
+ covers the complete workflow and [streamed replay](https://github.com/yerromnitsuj/actng/blob/v0.8.1/docs/reference/diagnostic-replay-stream.md).
108
119
 
109
120
  The six built-in formulas are basis-independent. The factory creates ten count instances plus six per amount basis (`10 + 6 × basisCount`): one basis produces 16, two produce 22. A `$250K`, primary, gross, net, or ceded calculation is represented by caller-declared amount measures and a structured `AmountBasisDefinition`; it does not need a separate capped formula. Claim-level caps use `claim-layer` derivations before aggregation. Pre-limited external values record their source/transformation instead of implying the SDK recreated an unavailable claim-level operation.
110
121
 
@@ -121,7 +132,7 @@ numeric exposure values. This is a bounded capacity, not an unlimited scale clai
121
132
 
122
133
  Compilation validates the whole graph atomically: IDs, sources, role types, compatibility groups, development semantics, derivation acyclicity, expression limits, rule operands, basis/population references, and period coordinates. Authentic compiled/prepared objects are owner-branded and frozen. Formula, calculation, definition, preparation, and result identities are deterministic FNV-1a/JCS integrity aids—not cryptographic signatures.
123
134
 
124
- See the generated [formula and instance catalog](https://github.com/yerromnitsuj/actng/blob/v0.7.1/docs/reference/diagnostic-formulas.md) and [0.6 migration guide](https://github.com/yerromnitsuj/actng/blob/v0.7.1/docs/migrations/0.6-generalized-diagnostics.md).
135
+ See the generated [formula and instance catalog](https://github.com/yerromnitsuj/actng/blob/v0.8.1/docs/reference/diagnostic-formulas.md) and [0.6 migration guide](https://github.com/yerromnitsuj/actng/blob/v0.8.1/docs/migrations/0.6-generalized-diagnostics.md).
125
136
 
126
137
  ## Main method families
127
138
 
@@ -0,0 +1,6 @@
1
+ import type { AnalysisResult, AnalysisScenarioDifference } from "./customizationContracts.js";
2
+ /** Matches exact coordinates and retains unmatched values from both results. */
3
+ export declare function compareAnalysisResults(baseline: AnalysisResult, scenario: AnalysisResult): readonly AnalysisScenarioDifference[];
4
+ /** Internal roll-forward alignment: evaluation is the comparison axis, not a join key. */
5
+ export declare function compareAnalysisEvaluations(baseline: AnalysisResult, scenario: AnalysisResult, priorEvaluationDate: string, currentEvaluationDate: string): readonly AnalysisScenarioDifference[];
6
+ //# sourceMappingURL=analysisComparison.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analysisComparison.d.ts","sourceRoot":"","sources":["../src/analysisComparison.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EAEd,0BAA0B,EAE3B,MAAM,6BAA6B,CAAC;AAmDrC,gFAAgF;AAChF,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,GAAG,SAAS,0BAA0B,EAAE,CAEhI;AAED,0FAA0F;AAC1F,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,cAAc,EACxB,mBAAmB,EAAE,MAAM,EAC3B,qBAAqB,EAAE,MAAM,GAC5B,SAAS,0BAA0B,EAAE,CAEvC"}
@@ -0,0 +1,52 @@
1
+ import { canonicalJson } from "./canonical.js";
2
+ import { snapshotDiagnosticJson } from "./diagnosticRuntime.js";
3
+ import { DiagnosticValidationError } from "./types.js";
4
+ function indexValues(result, omitted) {
5
+ const indexed = new Map();
6
+ for (const value of result.values) {
7
+ const coordinates = Object.fromEntries(Object.entries(value.coordinates).filter(([name]) => !omitted.has(name)));
8
+ const key = canonicalJson([value.measureId, coordinates]);
9
+ if (indexed.has(key))
10
+ throw new DiagnosticValidationError([{
11
+ domain: "configuration", code: "incompatible-semantics", path: "$.values",
12
+ message: "Comparison coordinates must identify one value per measure on each side",
13
+ }]);
14
+ indexed.set(key, value);
15
+ }
16
+ return indexed;
17
+ }
18
+ function compare(baseline, scenario, omitted, evaluationPair) {
19
+ const left = indexValues(baseline, omitted);
20
+ const right = indexValues(scenario, omitted);
21
+ const keys = [...new Set([...left.keys(), ...right.keys()])].sort();
22
+ return snapshotDiagnosticJson(keys.map((key) => {
23
+ const before = left.get(key);
24
+ const after = right.get(key);
25
+ const value = before ?? after;
26
+ if (before !== undefined && after !== undefined && before.unit !== after.unit)
27
+ throw new DiagnosticValidationError([{
28
+ domain: "configuration", code: "incompatible-semantics", path: `$.values.${value.measureId}.unit`,
29
+ message: `Cannot compare ${before.unit} with ${after.unit}`,
30
+ }]);
31
+ const baselineValue = before?.status === "available" ? before.value : null;
32
+ const scenarioValue = after?.status === "available" ? after.value : null;
33
+ const difference = baselineValue === null || scenarioValue === null ? null : scenarioValue - baselineValue;
34
+ const absoluteDifference = difference !== null && Number.isFinite(difference) ? difference : null;
35
+ const percentage = absoluteDifference === null || baselineValue === null || baselineValue === 0
36
+ ? null : absoluteDifference / baselineValue;
37
+ const percentageDifference = percentage !== null && Number.isFinite(percentage) ? percentage : null;
38
+ const coordinates = evaluationPair === undefined
39
+ ? value.coordinates
40
+ : { ...Object.fromEntries(Object.entries(value.coordinates).filter(([name]) => name !== "evaluationDate")), ...evaluationPair };
41
+ return { measureId: value.measureId, unit: value.unit, coordinates, baselineValue, scenarioValue, absoluteDifference, percentageDifference };
42
+ }));
43
+ }
44
+ /** Matches exact coordinates and retains unmatched values from both results. */
45
+ export function compareAnalysisResults(baseline, scenario) {
46
+ return compare(baseline, scenario, new Set());
47
+ }
48
+ /** Internal roll-forward alignment: evaluation is the comparison axis, not a join key. */
49
+ export function compareAnalysisEvaluations(baseline, scenario, priorEvaluationDate, currentEvaluationDate) {
50
+ return compare(baseline, scenario, new Set(["evaluationDate", "originLabel"]), { priorEvaluationDate, currentEvaluationDate });
51
+ }
52
+ //# sourceMappingURL=analysisComparison.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analysisComparison.js","sourceRoot":"","sources":["../src/analysisComparison.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAO/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAA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M,oBAAoB,GAAG,UAAU,KAAK,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;QACpG,MAAM,WAAW,GAA+C,cAAc,KAAK,SAAS;YAC1F,CAAC,CAAC,KAAK,CAAC,WAAW;YACnB,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,gBAAgB,CAAC,CAAC,EAAE,GAAG,cAAc,EAAE,CAAC;QAClI,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,CAAC;IAC/I,CAAC,CAAC,CAAC,CAAC;AACN,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,sBAAsB,CAAC,QAAwB,EAAE,QAAwB;IACvF,OAAO,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AAChD,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,0BAA0B,CACxC,QAAwB,EACxB,QAAwB,EACxB,mBAA2B,EAC3B,qBAA6B;IAE7B,OAAO,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,GAAG,CAAC,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC,EAAE,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,CAAC,CAAC;AACjI,CAAC"}
@@ -0,0 +1,55 @@
1
+ import type { AnalysisDefinition, AnalysisRecipe, AnalysisResult, AnalysisScenario, AnalysisScenarioGrid, AnalysisScenarioRun, AnalysisRollForward, AnalysisScenarioBridgeStep, AnalysisResultCache, CustomizationResourceLimits, CustomizationExposureObservation, ExposureAllocationTarget, ExposureRevisionSelection, HistoricalDatasetInput } from "./customizationContracts.js";
2
+ export { compareAnalysisResults } from "./analysisComparison.js";
3
+ /** Executes the closed, deterministic recipe vocabulary over loss history and exposure inputs. */
4
+ export declare function runAnalysisRecipe(input: {
5
+ readonly history: HistoricalDatasetInput;
6
+ readonly definition: AnalysisDefinition;
7
+ readonly recipe: AnalysisRecipe;
8
+ readonly exposureObservations?: readonly CustomizationExposureObservation[];
9
+ readonly exposureTargets?: readonly ExposureAllocationTarget[];
10
+ readonly exposureRevisionSelection?: ExposureRevisionSelection;
11
+ readonly evaluationDate?: string;
12
+ }): AnalysisResult;
13
+ export declare function applyAnalysisScenario(definition: AnalysisDefinition, scenario: AnalysisScenario): AnalysisDefinition;
14
+ /** Runs a bounded list of controlled scenarios against one immutable baseline. */
15
+ export declare function runAnalysisScenarios(input: {
16
+ readonly history: HistoricalDatasetInput;
17
+ readonly definition: AnalysisDefinition;
18
+ readonly recipe: AnalysisRecipe;
19
+ readonly scenarios: readonly AnalysisScenario[];
20
+ readonly limits: Pick<CustomizationResourceLimits, "maximumActiveScenarios">;
21
+ readonly exposureObservations?: readonly CustomizationExposureObservation[];
22
+ readonly exposureTargets?: readonly ExposureAllocationTarget[];
23
+ readonly exposureRevisionSelection?: ExposureRevisionSelection;
24
+ readonly evaluationDate?: string;
25
+ }): readonly AnalysisScenarioRun[];
26
+ /** Expands a closed Cartesian parameter grid after proving its product is bounded. */
27
+ export declare function expandAnalysisScenarioGrid(grid: AnalysisScenarioGrid, limits: Pick<CustomizationResourceLimits, "maximumActiveScenarios">): readonly AnalysisScenario[];
28
+ /** Expands and runs a bounded parameter grid against one immutable baseline. */
29
+ export declare function runAnalysisScenarioGrid(input: Omit<Parameters<typeof runAnalysisScenarios>[0], "scenarios"> & {
30
+ readonly grid: AnalysisScenarioGrid;
31
+ }): readonly AnalysisScenarioRun[];
32
+ /** Complete dependency identity for exact full-result reuse, including lineage. */
33
+ export declare function analysisRecipeDependencyIdentity(input: Parameters<typeof runAnalysisRecipe>[0]): string;
34
+ /** Uses caller-owned cache storage; a hit is returned only for the complete dependency identity. */
35
+ export declare function runAnalysisRecipeCached(input: Parameters<typeof runAnalysisRecipe>[0] & {
36
+ readonly cache: AnalysisResultCache;
37
+ }): {
38
+ readonly cacheStatus: "hit" | "miss";
39
+ readonly dependencyIdentity: string;
40
+ readonly result: AnalysisResult;
41
+ };
42
+ /** Preserves the prior result and recipe while executing a later immutable valuation. */
43
+ export declare function rollForwardAnalysisRecipe(input: Parameters<typeof runAnalysisRecipe>[0] & {
44
+ readonly priorEvaluationDate: string;
45
+ readonly currentEvaluationDate: string;
46
+ }): AnalysisRollForward;
47
+ /** Applies explicitly ordered, one-change scenario steps and reports each incremental bridge. */
48
+ export declare function runAnalysisScenarioBridge(input: Parameters<typeof runAnalysisRecipe>[0] & {
49
+ readonly scenarios: readonly AnalysisScenario[];
50
+ readonly limits: Pick<CustomizationResourceLimits, "maximumActiveScenarios">;
51
+ }): {
52
+ readonly baseline: AnalysisResult;
53
+ readonly steps: readonly AnalysisScenarioBridgeStep[];
54
+ };
55
+ //# sourceMappingURL=analysisRecipe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analysisRecipe.d.ts","sourceRoot":"","sources":["../src/analysisRecipe.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAElB,cAAc,EACd,cAAc,EAEd,gBAAgB,EAEhB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,0BAA0B,EAC1B,mBAAmB,EACnB,2BAA2B,EAE3B,gCAAgC,EAChC,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EAEvB,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAkIjE,kGAAkG;AAClG,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CA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