@defra/forms-model 3.0.2
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.
- package/LICENCE +8 -0
- package/README.md +22 -0
- package/dist/browser/components/component-types.d.ts +3 -0
- package/dist/browser/components/component-types.d.ts.map +1 -0
- package/dist/browser/components/component-types.js +220 -0
- package/dist/browser/components/component-types.js.map +1 -0
- package/dist/browser/components/conditional-component-types.d.ts +3 -0
- package/dist/browser/components/conditional-component-types.d.ts.map +1 -0
- package/dist/browser/components/conditional-component-types.js +28 -0
- package/dist/browser/components/conditional-component-types.js.map +1 -0
- package/dist/browser/components/index.d.ts +4 -0
- package/dist/browser/components/index.d.ts.map +1 -0
- package/dist/browser/components/index.js +45 -0
- package/dist/browser/components/index.js.map +1 -0
- package/dist/browser/components/types.d.ts +244 -0
- package/dist/browser/components/types.d.ts.map +1 -0
- package/dist/browser/components/types.js +56 -0
- package/dist/browser/components/types.js.map +1 -0
- package/dist/browser/conditions/condition-abstract.d.ts +16 -0
- package/dist/browser/conditions/condition-abstract.d.ts.map +1 -0
- package/dist/browser/conditions/condition-abstract.js +62 -0
- package/dist/browser/conditions/condition-abstract.js.map +1 -0
- package/dist/browser/conditions/condition-field.d.ts +13 -0
- package/dist/browser/conditions/condition-field.d.ts.map +1 -0
- package/dist/browser/conditions/condition-field.js +45 -0
- package/dist/browser/conditions/condition-field.js.map +1 -0
- package/dist/browser/conditions/condition-group-def.d.ts +10 -0
- package/dist/browser/conditions/condition-group-def.d.ts.map +1 -0
- package/dist/browser/conditions/condition-group-def.js +45 -0
- package/dist/browser/conditions/condition-group-def.js.map +1 -0
- package/dist/browser/conditions/condition-group.d.ts +15 -0
- package/dist/browser/conditions/condition-group.d.ts.map +1 -0
- package/dist/browser/conditions/condition-group.js +64 -0
- package/dist/browser/conditions/condition-group.js.map +1 -0
- package/dist/browser/conditions/condition-model.d.ts +41 -0
- package/dist/browser/conditions/condition-model.d.ts.map +1 -0
- package/dist/browser/conditions/condition-model.js +214 -0
- package/dist/browser/conditions/condition-model.js.map +1 -0
- package/dist/browser/conditions/condition-operators.d.ts +248 -0
- package/dist/browser/conditions/condition-operators.d.ts.map +1 -0
- package/dist/browser/conditions/condition-operators.js +132 -0
- package/dist/browser/conditions/condition-operators.js.map +1 -0
- package/dist/browser/conditions/condition-ref.d.ts +12 -0
- package/dist/browser/conditions/condition-ref.d.ts.map +1 -0
- package/dist/browser/conditions/condition-ref.js +51 -0
- package/dist/browser/conditions/condition-ref.js.map +1 -0
- package/dist/browser/conditions/condition-value-abstract.d.ts +8 -0
- package/dist/browser/conditions/condition-value-abstract.d.ts.map +1 -0
- package/dist/browser/conditions/condition-value-abstract.js +41 -0
- package/dist/browser/conditions/condition-value-abstract.js.map +1 -0
- package/dist/browser/conditions/condition-value-registration.d.ts +10 -0
- package/dist/browser/conditions/condition-value-registration.d.ts.map +1 -0
- package/dist/browser/conditions/condition-value-registration.js +37 -0
- package/dist/browser/conditions/condition-value-registration.js.map +1 -0
- package/dist/browser/conditions/condition-values.d.ts +38 -0
- package/dist/browser/conditions/condition-values.d.ts.map +1 -0
- package/dist/browser/conditions/condition-values.js +127 -0
- package/dist/browser/conditions/condition-values.js.map +1 -0
- package/dist/browser/conditions/condition.d.ts +15 -0
- package/dist/browser/conditions/condition.d.ts.map +1 -0
- package/dist/browser/conditions/condition.js +56 -0
- package/dist/browser/conditions/condition.js.map +1 -0
- package/dist/browser/conditions/helpers.d.ts +3 -0
- package/dist/browser/conditions/helpers.d.ts.map +1 -0
- package/dist/browser/conditions/helpers.js +26 -0
- package/dist/browser/conditions/helpers.js.map +1 -0
- package/dist/browser/conditions/index.d.ts +11 -0
- package/dist/browser/conditions/index.d.ts.map +1 -0
- package/dist/browser/conditions/index.js +144 -0
- package/dist/browser/conditions/index.js.map +1 -0
- package/dist/browser/conditions/inline-condition-model.d.ts +86 -0
- package/dist/browser/conditions/inline-condition-model.d.ts.map +1 -0
- package/dist/browser/conditions/inline-condition-model.js +418 -0
- package/dist/browser/conditions/inline-condition-model.js.map +1 -0
- package/dist/browser/conditions/inline-condition-operators.d.ts +175 -0
- package/dist/browser/conditions/inline-condition-operators.d.ts.map +1 -0
- package/dist/browser/conditions/inline-condition-operators.js +132 -0
- package/dist/browser/conditions/inline-condition-operators.js.map +1 -0
- package/dist/browser/conditions/inline-condition-values.d.ts +93 -0
- package/dist/browser/conditions/inline-condition-values.d.ts.map +1 -0
- package/dist/browser/conditions/inline-condition-values.js +159 -0
- package/dist/browser/conditions/inline-condition-values.js.map +1 -0
- package/dist/browser/conditions/types.d.ts +38 -0
- package/dist/browser/conditions/types.d.ts.map +1 -0
- package/dist/browser/conditions/types.js +24 -0
- package/dist/browser/conditions/types.js.map +1 -0
- package/dist/browser/data-model/conditions-wrapper.d.ts +19 -0
- package/dist/browser/data-model/conditions-wrapper.d.ts.map +1 -0
- package/dist/browser/data-model/conditions-wrapper.js +49 -0
- package/dist/browser/data-model/conditions-wrapper.js.map +1 -0
- package/dist/browser/data-model/index.d.ts +4 -0
- package/dist/browser/data-model/index.d.ts.map +1 -0
- package/dist/browser/data-model/index.js +66 -0
- package/dist/browser/data-model/index.js.map +1 -0
- package/dist/browser/data-model/input-wrapper.d.ts +16 -0
- package/dist/browser/data-model/input-wrapper.d.ts.map +1 -0
- package/dist/browser/data-model/input-wrapper.js +49 -0
- package/dist/browser/data-model/input-wrapper.js.map +1 -0
- package/dist/browser/data-model/types.d.ts +153 -0
- package/dist/browser/data-model/types.d.ts.map +1 -0
- package/dist/browser/data-model/types.js +34 -0
- package/dist/browser/data-model/types.js.map +1 -0
- package/dist/browser/form/form-configuration.d.ts +8 -0
- package/dist/browser/form/form-configuration.d.ts.map +1 -0
- package/dist/browser/form/form-configuration.js +38 -0
- package/dist/browser/form/form-configuration.js.map +1 -0
- package/dist/browser/form/index.d.ts +2 -0
- package/dist/browser/form/index.d.ts.map +1 -0
- package/dist/browser/form/index.js +24 -0
- package/dist/browser/form/index.js.map +1 -0
- package/dist/browser/index.d.ts +12 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +138 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/migration/index.d.ts +2 -0
- package/dist/browser/migration/index.d.ts.map +1 -0
- package/dist/browser/migration/index.js +24 -0
- package/dist/browser/migration/index.js.map +1 -0
- package/dist/browser/migration/migration.0-2.d.ts +3 -0
- package/dist/browser/migration/migration.0-2.d.ts.map +1 -0
- package/dist/browser/migration/migration.0-2.js +65 -0
- package/dist/browser/migration/migration.0-2.js.map +1 -0
- package/dist/browser/migration/migration.1-2.d.ts +3 -0
- package/dist/browser/migration/migration.1-2.d.ts.map +1 -0
- package/dist/browser/migration/migration.1-2.js +108 -0
- package/dist/browser/migration/migration.1-2.js.map +1 -0
- package/dist/browser/migration/types.d.ts +2 -0
- package/dist/browser/migration/types.d.ts.map +1 -0
- package/dist/browser/migration/types.js +16 -0
- package/dist/browser/migration/types.js.map +1 -0
- package/dist/browser/migration/whichMigrations.d.ts +7 -0
- package/dist/browser/migration/whichMigrations.d.ts.map +1 -0
- package/dist/browser/migration/whichMigrations.js +38 -0
- package/dist/browser/migration/whichMigrations.js.map +1 -0
- package/dist/browser/schema/index.d.ts +2 -0
- package/dist/browser/schema/index.d.ts.map +1 -0
- package/dist/browser/schema/index.js +30 -0
- package/dist/browser/schema/index.js.map +1 -0
- package/dist/browser/schema/schema.d.ts +20 -0
- package/dist/browser/schema/schema.d.ts.map +1 -0
- package/dist/browser/schema/schema.js +255 -0
- package/dist/browser/schema/schema.js.map +1 -0
- package/dist/browser/utils/helpers.d.ts +9 -0
- package/dist/browser/utils/helpers.d.ts.map +1 -0
- package/dist/browser/utils/helpers.js +48 -0
- package/dist/browser/utils/helpers.js.map +1 -0
- package/dist/browser/utils/logger.d.ts +11 -0
- package/dist/browser/utils/logger.d.ts.map +1 -0
- package/dist/browser/utils/logger.js +46 -0
- package/dist/browser/utils/logger.js.map +1 -0
- package/dist/module/components/component-types.d.ts +3 -0
- package/dist/module/components/component-types.d.ts.map +1 -0
- package/dist/module/components/component-types.js +206 -0
- package/dist/module/components/component-types.js.map +1 -0
- package/dist/module/components/conditional-component-types.d.ts +3 -0
- package/dist/module/components/conditional-component-types.d.ts.map +1 -0
- package/dist/module/components/conditional-component-types.js +14 -0
- package/dist/module/components/conditional-component-types.js.map +1 -0
- package/dist/module/components/index.d.ts +4 -0
- package/dist/module/components/index.d.ts.map +1 -0
- package/dist/module/components/index.js +34 -0
- package/dist/module/components/index.js.map +1 -0
- package/dist/module/components/types.d.ts +244 -0
- package/dist/module/components/types.d.ts.map +1 -0
- package/dist/module/components/types.js +42 -0
- package/dist/module/components/types.js.map +1 -0
- package/dist/module/conditions/condition-abstract.d.ts +16 -0
- package/dist/module/conditions/condition-abstract.d.ts.map +1 -0
- package/dist/module/conditions/condition-abstract.js +45 -0
- package/dist/module/conditions/condition-abstract.js.map +1 -0
- package/dist/module/conditions/condition-field.d.ts +13 -0
- package/dist/module/conditions/condition-field.d.ts.map +1 -0
- package/dist/module/conditions/condition-field.js +26 -0
- package/dist/module/conditions/condition-field.js.map +1 -0
- package/dist/module/conditions/condition-group-def.d.ts +10 -0
- package/dist/module/conditions/condition-group-def.d.ts.map +1 -0
- package/dist/module/conditions/condition-group-def.js +26 -0
- package/dist/module/conditions/condition-group-def.js.map +1 -0
- package/dist/module/conditions/condition-group.d.ts +15 -0
- package/dist/module/conditions/condition-group.d.ts.map +1 -0
- package/dist/module/conditions/condition-group.js +47 -0
- package/dist/module/conditions/condition-group.js.map +1 -0
- package/dist/module/conditions/condition-model.d.ts +41 -0
- package/dist/module/conditions/condition-model.d.ts.map +1 -0
- package/dist/module/conditions/condition-model.js +199 -0
- package/dist/module/conditions/condition-model.js.map +1 -0
- package/dist/module/conditions/condition-operators.d.ts +248 -0
- package/dist/module/conditions/condition-operators.d.ts.map +1 -0
- package/dist/module/conditions/condition-operators.js +119 -0
- package/dist/module/conditions/condition-operators.js.map +1 -0
- package/dist/module/conditions/condition-ref.d.ts +12 -0
- package/dist/module/conditions/condition-ref.d.ts.map +1 -0
- package/dist/module/conditions/condition-ref.js +33 -0
- package/dist/module/conditions/condition-ref.js.map +1 -0
- package/dist/module/conditions/condition-value-abstract.d.ts +8 -0
- package/dist/module/conditions/condition-value-abstract.d.ts.map +1 -0
- package/dist/module/conditions/condition-value-abstract.js +24 -0
- package/dist/module/conditions/condition-value-abstract.js.map +1 -0
- package/dist/module/conditions/condition-value-registration.d.ts +10 -0
- package/dist/module/conditions/condition-value-registration.d.ts.map +1 -0
- package/dist/module/conditions/condition-value-registration.js +19 -0
- package/dist/module/conditions/condition-value-registration.js.map +1 -0
- package/dist/module/conditions/condition-values.d.ts +38 -0
- package/dist/module/conditions/condition-values.d.ts.map +1 -0
- package/dist/module/conditions/condition-values.js +106 -0
- package/dist/module/conditions/condition-values.js.map +1 -0
- package/dist/module/conditions/condition.d.ts +15 -0
- package/dist/module/conditions/condition.d.ts.map +1 -0
- package/dist/module/conditions/condition.js +40 -0
- package/dist/module/conditions/condition.js.map +1 -0
- package/dist/module/conditions/helpers.d.ts +3 -0
- package/dist/module/conditions/helpers.d.ts.map +1 -0
- package/dist/module/conditions/helpers.js +12 -0
- package/dist/module/conditions/helpers.js.map +1 -0
- package/dist/module/conditions/index.d.ts +11 -0
- package/dist/module/conditions/index.d.ts.map +1 -0
- package/dist/module/conditions/index.js +140 -0
- package/dist/module/conditions/index.js.map +1 -0
- package/dist/module/conditions/inline-condition-model.d.ts +86 -0
- package/dist/module/conditions/inline-condition-model.d.ts.map +1 -0
- package/dist/module/conditions/inline-condition-model.js +384 -0
- package/dist/module/conditions/inline-condition-model.js.map +1 -0
- package/dist/module/conditions/inline-condition-operators.d.ts +175 -0
- package/dist/module/conditions/inline-condition-operators.d.ts.map +1 -0
- package/dist/module/conditions/inline-condition-operators.js +119 -0
- package/dist/module/conditions/inline-condition-operators.js.map +1 -0
- package/dist/module/conditions/inline-condition-values.d.ts +93 -0
- package/dist/module/conditions/inline-condition-values.d.ts.map +1 -0
- package/dist/module/conditions/inline-condition-values.js +134 -0
- package/dist/module/conditions/inline-condition-values.js.map +1 -0
- package/dist/module/conditions/types.d.ts +38 -0
- package/dist/module/conditions/types.d.ts.map +1 -0
- package/dist/module/conditions/types.js +10 -0
- package/dist/module/conditions/types.js.map +1 -0
- package/dist/module/data-model/conditions-wrapper.d.ts +19 -0
- package/dist/module/data-model/conditions-wrapper.d.ts.map +1 -0
- package/dist/module/data-model/conditions-wrapper.js +30 -0
- package/dist/module/data-model/conditions-wrapper.js.map +1 -0
- package/dist/module/data-model/index.d.ts +4 -0
- package/dist/module/data-model/index.d.ts.map +1 -0
- package/dist/module/data-model/index.js +55 -0
- package/dist/module/data-model/index.js.map +1 -0
- package/dist/module/data-model/input-wrapper.d.ts +16 -0
- package/dist/module/data-model/input-wrapper.d.ts.map +1 -0
- package/dist/module/data-model/input-wrapper.js +25 -0
- package/dist/module/data-model/input-wrapper.js.map +1 -0
- package/dist/module/data-model/types.d.ts +153 -0
- package/dist/module/data-model/types.d.ts.map +1 -0
- package/dist/module/data-model/types.js +20 -0
- package/dist/module/data-model/types.js.map +1 -0
- package/dist/module/form/form-configuration.d.ts +8 -0
- package/dist/module/form/form-configuration.d.ts.map +1 -0
- package/dist/module/form/form-configuration.js +17 -0
- package/dist/module/form/form-configuration.js.map +1 -0
- package/dist/module/form/index.d.ts +2 -0
- package/dist/module/form/index.d.ts.map +1 -0
- package/dist/module/form/index.js +11 -0
- package/dist/module/form/index.js.map +1 -0
- package/dist/module/index.d.ts +12 -0
- package/dist/module/index.d.ts.map +1 -0
- package/dist/module/index.js +135 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/migration/index.d.ts +2 -0
- package/dist/module/migration/index.d.ts.map +1 -0
- package/dist/module/migration/index.js +11 -0
- package/dist/module/migration/index.js.map +1 -0
- package/dist/module/migration/migration.0-2.d.ts +3 -0
- package/dist/module/migration/migration.0-2.d.ts.map +1 -0
- package/dist/module/migration/migration.0-2.js +42 -0
- package/dist/module/migration/migration.0-2.js.map +1 -0
- package/dist/module/migration/migration.1-2.d.ts +3 -0
- package/dist/module/migration/migration.1-2.d.ts.map +1 -0
- package/dist/module/migration/migration.1-2.js +90 -0
- package/dist/module/migration/migration.1-2.js.map +1 -0
- package/dist/module/migration/types.d.ts +2 -0
- package/dist/module/migration/types.d.ts.map +1 -0
- package/dist/module/migration/types.js +1 -0
- package/dist/module/migration/types.js.map +1 -0
- package/dist/module/migration/whichMigrations.d.ts +7 -0
- package/dist/module/migration/whichMigrations.d.ts.map +1 -0
- package/dist/module/migration/whichMigrations.js +26 -0
- package/dist/module/migration/whichMigrations.js.map +1 -0
- package/dist/module/schema/index.d.ts +2 -0
- package/dist/module/schema/index.d.ts.map +1 -0
- package/dist/module/schema/index.js +17 -0
- package/dist/module/schema/index.js.map +1 -0
- package/dist/module/schema/schema.d.ts +20 -0
- package/dist/module/schema/schema.d.ts.map +1 -0
- package/dist/module/schema/schema.js +239 -0
- package/dist/module/schema/schema.js.map +1 -0
- package/dist/module/utils/helpers.d.ts +9 -0
- package/dist/module/utils/helpers.d.ts.map +1 -0
- package/dist/module/utils/helpers.js +35 -0
- package/dist/module/utils/helpers.js.map +1 -0
- package/dist/module/utils/logger.d.ts +11 -0
- package/dist/module/utils/logger.d.ts.map +1 -0
- package/dist/module/utils/logger.js +27 -0
- package/dist/module/utils/logger.js.map +1 -0
- package/package.json +35 -0
- package/src/components/component-types.ts +229 -0
- package/src/components/conditional-component-types.ts +14 -0
- package/src/components/index.ts +3 -0
- package/src/components/types.ts +362 -0
- package/src/conditions/condition-abstract.ts +59 -0
- package/src/conditions/condition-field.ts +29 -0
- package/src/conditions/condition-group-def.ts +29 -0
- package/src/conditions/condition-group.ts +61 -0
- package/src/conditions/condition-model.ts +314 -0
- package/src/conditions/condition-operators.ts +176 -0
- package/src/conditions/condition-ref.ts +47 -0
- package/src/conditions/condition-value-abstract.ts +31 -0
- package/src/conditions/condition-value-registration.ts +18 -0
- package/src/conditions/condition-values.ts +146 -0
- package/src/conditions/condition.ts +64 -0
- package/src/conditions/helpers.ts +7 -0
- package/src/conditions/index.ts +27 -0
- package/src/conditions/inline-condition-model.ts +550 -0
- package/src/conditions/inline-condition-operators.ts +166 -0
- package/src/conditions/inline-condition-values.ts +153 -0
- package/src/conditions/types.ts +30 -0
- package/src/data-model/conditions-wrapper.ts +42 -0
- package/src/data-model/index.ts +3 -0
- package/src/data-model/input-wrapper.ts +40 -0
- package/src/data-model/types.ts +179 -0
- package/src/form/form-configuration.ts +21 -0
- package/src/form/index.ts +1 -0
- package/src/index.ts +11 -0
- package/src/migration/index.ts +1 -0
- package/src/migration/migration.0-2.ts +29 -0
- package/src/migration/migration.1-2.ts +105 -0
- package/src/migration/types.ts +1 -0
- package/src/migration/whichMigrations.ts +23 -0
- package/src/schema/index.ts +1 -0
- package/src/schema/schema.ts +300 -0
- package/src/utils/helpers.ts +37 -0
- package/src/utils/logger.ts +29 -0
@@ -0,0 +1,214 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
if (typeof define === "function" && define.amd) {
|
3
|
+
define(["exports", "./condition-field", "./condition-group-def", "./condition", "./condition-ref", "./condition-group", "./condition-values", "./helpers", "./types"], factory);
|
4
|
+
} else if (typeof exports !== "undefined") {
|
5
|
+
factory(exports, require("./condition-field"), require("./condition-group-def"), require("./condition"), require("./condition-ref"), require("./condition-group"), require("./condition-values"), require("./helpers"), require("./types"));
|
6
|
+
} else {
|
7
|
+
var mod = {
|
8
|
+
exports: {}
|
9
|
+
};
|
10
|
+
factory(mod.exports, global.conditionField, global.conditionGroupDef, global.condition, global.conditionRef, global.conditionGroup, global.conditionValues, global.helpers, global.types);
|
11
|
+
global.conditionModel = mod.exports;
|
12
|
+
}
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _conditionField, _conditionGroupDef, _condition2, _conditionRef, _conditionGroup, _conditionValues, _helpers, _types) {
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
_exports.__esModule = true;
|
17
|
+
_exports.ConditionsModel = void 0;
|
18
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
19
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
20
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
21
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
22
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
23
|
+
var _groupedConditions = /*#__PURE__*/new WeakMap();
|
24
|
+
var _userGroupedConditions = /*#__PURE__*/new WeakMap();
|
25
|
+
var _conditionName = /*#__PURE__*/new WeakMap();
|
26
|
+
class ConditionsModel {
|
27
|
+
constructor(_conditionsObject) {
|
28
|
+
_classPrivateFieldInitSpec(this, _groupedConditions, []);
|
29
|
+
_classPrivateFieldInitSpec(this, _userGroupedConditions, []);
|
30
|
+
_classPrivateFieldInitSpec(this, _conditionName, undefined);
|
31
|
+
}
|
32
|
+
clone() {
|
33
|
+
const toReturn = new ConditionsModel();
|
34
|
+
_classPrivateFieldSet(_groupedConditions, toReturn, _classPrivateFieldGet(_groupedConditions, this).map(it => it.clone()));
|
35
|
+
_classPrivateFieldSet(_userGroupedConditions, toReturn, _classPrivateFieldGet(_userGroupedConditions, this).map(it => it.clone()));
|
36
|
+
_classPrivateFieldSet(_conditionName, toReturn, _classPrivateFieldGet(_conditionName, this));
|
37
|
+
return toReturn;
|
38
|
+
}
|
39
|
+
clear() {
|
40
|
+
_classPrivateFieldSet(_userGroupedConditions, this, []);
|
41
|
+
_classPrivateFieldSet(_groupedConditions, this, []);
|
42
|
+
_classPrivateFieldSet(_conditionName, this, undefined);
|
43
|
+
return this;
|
44
|
+
}
|
45
|
+
set name(name) {
|
46
|
+
_classPrivateFieldSet(_conditionName, this, name);
|
47
|
+
}
|
48
|
+
get name() {
|
49
|
+
return _classPrivateFieldGet(_conditionName, this);
|
50
|
+
}
|
51
|
+
add(condition) {
|
52
|
+
const coordinatorExpected = _classPrivateFieldGet(_userGroupedConditions, this).length !== 0;
|
53
|
+
if (condition.getCoordinator() && !coordinatorExpected) {
|
54
|
+
throw Error('No coordinator allowed on the first condition');
|
55
|
+
} else if (!condition.getCoordinator() && coordinatorExpected) {
|
56
|
+
throw Error('Coordinator must be present on subsequent conditions');
|
57
|
+
}
|
58
|
+
_classPrivateFieldGet(_userGroupedConditions, this).push(condition);
|
59
|
+
_classPrivateFieldSet(_groupedConditions, this, this._applyGroups(_classPrivateFieldGet(_userGroupedConditions, this)));
|
60
|
+
return this;
|
61
|
+
}
|
62
|
+
replace(index, condition) {
|
63
|
+
const coordinatorExpected = index !== 0;
|
64
|
+
if (condition.getCoordinator() && !coordinatorExpected) {
|
65
|
+
throw Error('No coordinator allowed on the first condition');
|
66
|
+
} else if (!condition.getCoordinator() && coordinatorExpected) {
|
67
|
+
throw Error('Coordinator must be present on subsequent conditions');
|
68
|
+
} else if (index >= _classPrivateFieldGet(_userGroupedConditions, this).length) {
|
69
|
+
throw Error(`Cannot replace condition ${index} as no such condition exists`);
|
70
|
+
}
|
71
|
+
_classPrivateFieldGet(_userGroupedConditions, this).splice(index, 1, condition);
|
72
|
+
_classPrivateFieldSet(_groupedConditions, this, this._applyGroups(_classPrivateFieldGet(_userGroupedConditions, this)));
|
73
|
+
return this;
|
74
|
+
}
|
75
|
+
remove(indexes) {
|
76
|
+
_classPrivateFieldSet(_userGroupedConditions, this, _classPrivateFieldGet(_userGroupedConditions, this).filter((_condition, index) => !indexes.includes(index)).map((condition, index) => index === 0 ? condition.asFirstCondition() : condition));
|
77
|
+
_classPrivateFieldSet(_groupedConditions, this, this._applyGroups(_classPrivateFieldGet(_userGroupedConditions, this)));
|
78
|
+
return this;
|
79
|
+
}
|
80
|
+
addGroups(groupDefs) {
|
81
|
+
_classPrivateFieldSet(_userGroupedConditions, this, this._group(_classPrivateFieldGet(_userGroupedConditions, this), groupDefs));
|
82
|
+
_classPrivateFieldSet(_groupedConditions, this, this._applyGroups(_classPrivateFieldGet(_userGroupedConditions, this)));
|
83
|
+
return this;
|
84
|
+
}
|
85
|
+
splitGroup(index) {
|
86
|
+
_classPrivateFieldSet(_userGroupedConditions, this, this._ungroup(_classPrivateFieldGet(_userGroupedConditions, this), index));
|
87
|
+
_classPrivateFieldSet(_groupedConditions, this, this._applyGroups(_classPrivateFieldGet(_userGroupedConditions, this)));
|
88
|
+
return this;
|
89
|
+
}
|
90
|
+
moveEarlier(index) {
|
91
|
+
if (index > 0 && index < _classPrivateFieldGet(_userGroupedConditions, this).length) {
|
92
|
+
_classPrivateFieldGet(_userGroupedConditions, this).splice(index - 1, 0, _classPrivateFieldGet(_userGroupedConditions, this).splice(index, 1)[0]);
|
93
|
+
if (index === 1) {
|
94
|
+
this.switchCoordinators();
|
95
|
+
}
|
96
|
+
_classPrivateFieldSet(_groupedConditions, this, this._applyGroups(_classPrivateFieldGet(_userGroupedConditions, this)));
|
97
|
+
}
|
98
|
+
return this;
|
99
|
+
}
|
100
|
+
moveLater(index) {
|
101
|
+
if (index >= 0 && index < _classPrivateFieldGet(_userGroupedConditions, this).length - 1) {
|
102
|
+
_classPrivateFieldGet(_userGroupedConditions, this).splice(index + 1, 0, _classPrivateFieldGet(_userGroupedConditions, this).splice(index, 1)[0]);
|
103
|
+
if (index === 0) {
|
104
|
+
this.switchCoordinators();
|
105
|
+
}
|
106
|
+
_classPrivateFieldSet(_groupedConditions, this, this._applyGroups(_classPrivateFieldGet(_userGroupedConditions, this)));
|
107
|
+
}
|
108
|
+
return this;
|
109
|
+
}
|
110
|
+
switchCoordinators() {
|
111
|
+
_classPrivateFieldGet(_userGroupedConditions, this)[1].setCoordinator(_classPrivateFieldGet(_userGroupedConditions, this)[0].getCoordinator());
|
112
|
+
_classPrivateFieldGet(_userGroupedConditions, this)[0].setCoordinator(undefined);
|
113
|
+
}
|
114
|
+
get asPerUserGroupings() {
|
115
|
+
return [..._classPrivateFieldGet(_userGroupedConditions, this)];
|
116
|
+
}
|
117
|
+
get hasConditions() {
|
118
|
+
return _classPrivateFieldGet(_userGroupedConditions, this).length > 0;
|
119
|
+
}
|
120
|
+
get lastIndex() {
|
121
|
+
return _classPrivateFieldGet(_userGroupedConditions, this).length - 1;
|
122
|
+
}
|
123
|
+
toPresentationString() {
|
124
|
+
return _classPrivateFieldGet(_groupedConditions, this).map(condition => (0, _helpers.toPresentationString)(condition)).join(' ');
|
125
|
+
}
|
126
|
+
toExpression() {
|
127
|
+
return _classPrivateFieldGet(_groupedConditions, this).map(condition => (0, _helpers.toExpression)(condition)).join(' ');
|
128
|
+
}
|
129
|
+
_applyGroups(userGroupedConditions) {
|
130
|
+
const correctedUserGroups = userGroupedConditions.map(condition => condition instanceof _conditionGroup.ConditionGroup && condition.conditions.length > 2 ? new _conditionGroup.ConditionGroup(this._group(condition.conditions, this._autoGroupDefs(condition.conditions))) : condition);
|
131
|
+
return this._group(correctedUserGroups, this._autoGroupDefs(correctedUserGroups));
|
132
|
+
}
|
133
|
+
_group(conditions, groupDefs) {
|
134
|
+
return conditions.reduce((groups, condition, index, conditions) => {
|
135
|
+
const groupDef = groupDefs.find(groupDef => groupDef.contains(index));
|
136
|
+
if (groupDef) {
|
137
|
+
if (groupDef.startsWith(index)) {
|
138
|
+
const groupConditions = groupDef.applyTo(conditions);
|
139
|
+
groups.push(new _conditionGroup.ConditionGroup(groupConditions));
|
140
|
+
}
|
141
|
+
} else {
|
142
|
+
groups.push(condition);
|
143
|
+
}
|
144
|
+
return groups;
|
145
|
+
}, []);
|
146
|
+
}
|
147
|
+
_ungroup(conditions, splitIndex) {
|
148
|
+
if (conditions[splitIndex].isGroup()) {
|
149
|
+
const copy = [...conditions];
|
150
|
+
copy.splice(splitIndex, 1, ...conditions[splitIndex].getGroupedConditions());
|
151
|
+
return copy;
|
152
|
+
}
|
153
|
+
return conditions;
|
154
|
+
}
|
155
|
+
_autoGroupDefs(conditions) {
|
156
|
+
const orPositions = [];
|
157
|
+
conditions.forEach((condition, index) => {
|
158
|
+
if (condition.getCoordinator() === _types.Coordinator.OR) {
|
159
|
+
orPositions.push(index);
|
160
|
+
}
|
161
|
+
});
|
162
|
+
const hasOr = orPositions.length > 0;
|
163
|
+
const hasAnd = !!conditions.find(condition => condition.getCoordinator() === _types.Coordinator.AND);
|
164
|
+
if (hasAnd && hasOr) {
|
165
|
+
let start = 0;
|
166
|
+
const groupDefs = [];
|
167
|
+
orPositions.forEach((position, index) => {
|
168
|
+
if (start < position - 1) {
|
169
|
+
groupDefs.push(new _conditionGroupDef.ConditionGroupDef(start, position - 1));
|
170
|
+
}
|
171
|
+
const thisIsTheLastOr = orPositions.length === index + 1;
|
172
|
+
const thereAreMoreConditions = conditions.length - 1 > position;
|
173
|
+
if (thisIsTheLastOr && thereAreMoreConditions) {
|
174
|
+
groupDefs.push(new _conditionGroupDef.ConditionGroupDef(position, conditions.length - 1));
|
175
|
+
}
|
176
|
+
start = position;
|
177
|
+
});
|
178
|
+
return groupDefs;
|
179
|
+
}
|
180
|
+
return [];
|
181
|
+
}
|
182
|
+
toJSON() {
|
183
|
+
const name = _classPrivateFieldGet(_conditionName, this);
|
184
|
+
const conditions = _classPrivateFieldGet(_userGroupedConditions, this);
|
185
|
+
return {
|
186
|
+
name,
|
187
|
+
conditions: conditions.map(it => it.clone())
|
188
|
+
};
|
189
|
+
}
|
190
|
+
|
191
|
+
// TODO:- why is this not a constructor?
|
192
|
+
static from(obj) {
|
193
|
+
if (obj instanceof ConditionsModel) {
|
194
|
+
return obj;
|
195
|
+
}
|
196
|
+
const toReturn = new ConditionsModel();
|
197
|
+
_classPrivateFieldSet(_conditionName, toReturn, obj.name);
|
198
|
+
_classPrivateFieldSet(_userGroupedConditions, toReturn, obj.conditions.map(condition => conditionFrom(condition)));
|
199
|
+
_classPrivateFieldSet(_groupedConditions, toReturn, toReturn._applyGroups(_classPrivateFieldGet(_userGroupedConditions, toReturn)));
|
200
|
+
return toReturn;
|
201
|
+
}
|
202
|
+
}
|
203
|
+
_exports.ConditionsModel = ConditionsModel;
|
204
|
+
const conditionFrom = function conditionFrom(it) {
|
205
|
+
if ('conditions' in it) {
|
206
|
+
return new _conditionGroup.ConditionGroup(it.conditions.map(condition => conditionFrom(condition)));
|
207
|
+
}
|
208
|
+
if ('conditionName' in it) {
|
209
|
+
return new _conditionRef.ConditionRef(it.conditionName, it.conditionDisplayName, it.coordinator);
|
210
|
+
}
|
211
|
+
return new _condition2.Condition(_conditionField.ConditionField.from(it.field), it.operator, (0, _conditionValues.conditionValueFrom)(it.value), it.coordinator);
|
212
|
+
};
|
213
|
+
});
|
214
|
+
//# sourceMappingURL=condition-model.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"condition-model.js","names":["ConditionsModel","constructor","_conditionsObject","_classPrivateFieldInitSpec","_groupedConditions","_userGroupedConditions","_conditionName","undefined","clone","toReturn","_classPrivateFieldSet","_classPrivateFieldGet","map","it","clear","name","add","condition","coordinatorExpected","length","getCoordinator","Error","push","_applyGroups","replace","index","splice","remove","indexes","filter","_condition","includes","asFirstCondition","addGroups","groupDefs","_group","splitGroup","_ungroup","moveEarlier","switchCoordinators","moveLater","setCoordinator","asPerUserGroupings","hasConditions","lastIndex","toPresentationString","join","toExpression","userGroupedConditions","correctedUserGroups","ConditionGroup","conditions","_autoGroupDefs","reduce","groups","groupDef","find","contains","startsWith","groupConditions","applyTo","splitIndex","isGroup","copy","getGroupedConditions","orPositions","forEach","Coordinator","OR","hasOr","hasAnd","AND","start","position","ConditionGroupDef","thisIsTheLastOr","thereAreMoreConditions","toJSON","from","obj","conditionFrom","_exports","ConditionRef","conditionName","conditionDisplayName","coordinator","Condition","ConditionField","field","operator","conditionValueFrom","value"],"sources":["../../../src/conditions/condition-model.ts"],"sourcesContent":["import { ConditionField } from './condition-field'\nimport { ConditionGroupDef } from './condition-group-def'\nimport { Condition } from './condition'\nimport { ConditionRef } from './condition-ref'\nimport { ConditionGroup } from './condition-group'\nimport { conditionValueFrom } from './condition-values'\nimport { toPresentationString, toExpression } from './helpers'\nimport { Coordinator, ConditionsArray } from './types'\n\ntype ConditionRawObject =\n | ConditionsModel\n | {\n name: string\n conditions: Condition[]\n }\n\nexport class ConditionsModel {\n #groupedConditions: ConditionsArray = []\n #userGroupedConditions: ConditionsArray = []\n #conditionName: string | undefined = undefined\n\n constructor(_conditionsObject?: ConditionRawObject) {}\n\n clone() {\n const toReturn = new ConditionsModel()\n toReturn.#groupedConditions = this.#groupedConditions.map((it) =>\n it.clone()\n )\n toReturn.#userGroupedConditions = this.#userGroupedConditions.map((it) =>\n it.clone()\n )\n toReturn.#conditionName = this.#conditionName\n return toReturn\n }\n\n clear() {\n this.#userGroupedConditions = []\n this.#groupedConditions = []\n this.#conditionName = undefined\n return this\n }\n\n set name(name) {\n this.#conditionName = name\n }\n\n get name() {\n return this.#conditionName\n }\n\n add(condition: Condition) {\n const coordinatorExpected = this.#userGroupedConditions.length !== 0\n\n if (condition.getCoordinator() && !coordinatorExpected) {\n throw Error('No coordinator allowed on the first condition')\n } else if (!condition.getCoordinator() && coordinatorExpected) {\n throw Error('Coordinator must be present on subsequent conditions')\n }\n\n this.#userGroupedConditions.push(condition)\n this.#groupedConditions = this._applyGroups(this.#userGroupedConditions)\n\n return this\n }\n\n replace(index: number, condition: Condition) {\n const coordinatorExpected = index !== 0\n\n if (condition.getCoordinator() && !coordinatorExpected) {\n throw Error('No coordinator allowed on the first condition')\n } else if (!condition.getCoordinator() && coordinatorExpected) {\n throw Error('Coordinator must be present on subsequent conditions')\n } else if (index >= this.#userGroupedConditions.length) {\n throw Error(\n `Cannot replace condition ${index} as no such condition exists`\n )\n }\n\n this.#userGroupedConditions.splice(index, 1, condition)\n this.#groupedConditions = this._applyGroups(this.#userGroupedConditions)\n\n return this\n }\n\n remove(indexes: number[]) {\n this.#userGroupedConditions = this.#userGroupedConditions\n .filter((_condition, index) => !indexes.includes(index))\n .map((condition, index) =>\n index === 0 ? condition.asFirstCondition() : condition\n )\n\n this.#groupedConditions = this._applyGroups(this.#userGroupedConditions)\n return this\n }\n\n addGroups(groupDefs: ConditionGroupDef[]) {\n this.#userGroupedConditions = this._group(\n this.#userGroupedConditions,\n groupDefs\n )\n this.#groupedConditions = this._applyGroups(this.#userGroupedConditions)\n return this\n }\n\n splitGroup(index: number) {\n this.#userGroupedConditions = this._ungroup(\n this.#userGroupedConditions,\n index\n )\n this.#groupedConditions = this._applyGroups(this.#userGroupedConditions)\n return this\n }\n\n moveEarlier(index: number) {\n if (index > 0 && index < this.#userGroupedConditions.length) {\n this.#userGroupedConditions.splice(\n index - 1,\n 0,\n this.#userGroupedConditions.splice(index, 1)[0]\n )\n if (index === 1) {\n this.switchCoordinators()\n }\n this.#groupedConditions = this._applyGroups(this.#userGroupedConditions)\n }\n return this\n }\n\n moveLater(index: number) {\n if (index >= 0 && index < this.#userGroupedConditions.length - 1) {\n this.#userGroupedConditions.splice(\n index + 1,\n 0,\n this.#userGroupedConditions.splice(index, 1)[0]\n )\n if (index === 0) {\n this.switchCoordinators()\n }\n this.#groupedConditions = this._applyGroups(this.#userGroupedConditions)\n }\n return this\n }\n\n switchCoordinators() {\n this.#userGroupedConditions[1].setCoordinator(\n this.#userGroupedConditions[0].getCoordinator()\n )\n this.#userGroupedConditions[0].setCoordinator(undefined)\n }\n\n get asPerUserGroupings() {\n return [...this.#userGroupedConditions]\n }\n\n get hasConditions() {\n return this.#userGroupedConditions.length > 0\n }\n\n get lastIndex() {\n return this.#userGroupedConditions.length - 1\n }\n\n toPresentationString() {\n return this.#groupedConditions\n .map((condition) => toPresentationString(condition))\n .join(' ')\n }\n\n toExpression() {\n return this.#groupedConditions\n .map((condition) => toExpression(condition))\n .join(' ')\n }\n\n _applyGroups(\n userGroupedConditions: (Condition | ConditionGroup | ConditionRef)[]\n ) {\n const correctedUserGroups = userGroupedConditions.map((condition) =>\n condition instanceof ConditionGroup && condition.conditions.length > 2\n ? new ConditionGroup(\n this._group(\n condition.conditions,\n this._autoGroupDefs(condition.conditions)\n )\n )\n : condition\n )\n\n return this._group(\n correctedUserGroups,\n this._autoGroupDefs(correctedUserGroups)\n )\n }\n\n _group(conditions: ConditionsArray, groupDefs: ConditionGroupDef[]) {\n return conditions.reduce((groups, condition, index, conditions) => {\n const groupDef = groupDefs.find((groupDef) => groupDef.contains(index))\n\n if (groupDef) {\n if (groupDef.startsWith(index)) {\n const groupConditions = groupDef.applyTo(conditions)\n groups.push(new ConditionGroup(groupConditions))\n }\n } else {\n groups.push(condition)\n }\n\n return groups\n }, [] as ConditionsArray)\n }\n\n _ungroup(conditions: ConditionsArray, splitIndex: number) {\n if (conditions[splitIndex].isGroup()) {\n const copy = [...conditions]\n copy.splice(\n splitIndex,\n 1,\n ...conditions[splitIndex].getGroupedConditions()\n )\n return copy\n }\n return conditions\n }\n\n _autoGroupDefs(conditions: ConditionsArray) {\n const orPositions: number[] = []\n\n conditions.forEach((condition, index) => {\n if (condition.getCoordinator() === Coordinator.OR) {\n orPositions.push(index)\n }\n })\n\n const hasOr = orPositions.length > 0\n const hasAnd = !!conditions.find(\n (condition) => condition.getCoordinator() === Coordinator.AND\n )\n\n if (hasAnd && hasOr) {\n let start = 0\n const groupDefs: ConditionGroupDef[] = []\n orPositions.forEach((position, index) => {\n if (start < position - 1) {\n groupDefs.push(new ConditionGroupDef(start, position - 1))\n }\n const thisIsTheLastOr = orPositions.length === index + 1\n const thereAreMoreConditions = conditions.length - 1 > position\n if (thisIsTheLastOr && thereAreMoreConditions) {\n groupDefs.push(new ConditionGroupDef(position, conditions.length - 1))\n }\n start = position\n })\n return groupDefs\n }\n\n return []\n }\n\n toJSON() {\n const name = this.#conditionName\n const conditions = this.#userGroupedConditions\n return {\n name,\n conditions: conditions.map((it) => it.clone())\n }\n }\n\n // TODO:- why is this not a constructor?\n static from(obj: ConditionRawObject | ConditionsModel) {\n if (obj instanceof ConditionsModel) {\n return obj\n }\n const toReturn = new ConditionsModel()\n toReturn.#conditionName = obj.name\n toReturn.#userGroupedConditions = obj.conditions.map((condition) =>\n conditionFrom(condition)\n )\n toReturn.#groupedConditions = toReturn._applyGroups(\n toReturn.#userGroupedConditions\n )\n return toReturn\n }\n}\n\ninterface ConditionFrom {\n (\n it: Condition | ConditionRef | ConditionGroup\n ): Condition | ConditionRef | ConditionGroup\n}\n\nconst conditionFrom: ConditionFrom = function (it) {\n if ('conditions' in it) {\n return new ConditionGroup(\n (it as ConditionGroup).conditions.map((condition) =>\n conditionFrom(condition)\n )\n )\n }\n\n if ('conditionName' in it) {\n return new ConditionRef(\n it.conditionName,\n it.conditionDisplayName,\n it.coordinator\n )\n }\n\n return new Condition(\n ConditionField.from(it.field),\n it.operator,\n conditionValueFrom(it.value),\n it.coordinator\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAgBO,MAAMA,eAAe,CAAC;IAK3BC,WAAWA,CAACC,iBAAsC,EAAE;MAAAC,0BAAA,OAAAC,kBAAA,EAJd,EAAE;MAAAD,0BAAA,OAAAE,sBAAA,EACE,EAAE;MAAAF,0BAAA,OAAAG,cAAA,EACPC,SAAS;IAEO;IAErDC,KAAKA,CAAA,EAAG;MACN,MAAMC,QAAQ,GAAG,IAAIT,eAAe,CAAC,CAAC;MACtCU,qBAAA,CAAAN,kBAAA,EAAAK,QAAQ,EAAsBE,qBAAA,CAAAP,kBAAA,MAAI,EAAoBQ,GAAG,CAAEC,EAAE,IAC3DA,EAAE,CAACL,KAAK,CAAC,CACX,CAAC;MACDE,qBAAA,CAAAL,sBAAA,EAAAI,QAAQ,EAA0BE,qBAAA,CAAAN,sBAAA,MAAI,EAAwBO,GAAG,CAAEC,EAAE,IACnEA,EAAE,CAACL,KAAK,CAAC,CACX,CAAC;MACDE,qBAAA,CAAAJ,cAAA,EAAAG,QAAQ,EAAAE,qBAAA,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;MACzB,OAAO,IAAIqE,0BAAY,CACrBrE,EAAE,CAACsE,aAAa,EAChBtE,EAAE,CAACuE,oBAAoB,EACvBvE,EAAE,CAACwE,WACL,CAAC;IACH;IAEA,OAAO,IAAIC,qBAAS,CAClBC,8BAAc,CAACT,IAAI,CAACjE,EAAE,CAAC2E,KAAK,CAAC,EAC7B3E,EAAE,CAAC4E,QAAQ,EACX,IAAAC,mCAAkB,EAAC7E,EAAE,CAAC8E,KAAK,CAAC,EAC5B9E,EAAE,CAACwE,WACL,CAAC;EACH,CAAC;AAAA"}
|
@@ -0,0 +1,248 @@
|
|
1
|
+
import { ComponentType, ComponentDef } from '../components';
|
2
|
+
import { ConditionValueAbstract } from './condition-value-abstract';
|
3
|
+
export declare const customOperators: {
|
4
|
+
CheckboxesField: {
|
5
|
+
contains: {
|
6
|
+
expression: (field: ComponentDef, value: any) => string;
|
7
|
+
};
|
8
|
+
'does not contain': {
|
9
|
+
expression: (field: ComponentDef, value: any) => string;
|
10
|
+
};
|
11
|
+
};
|
12
|
+
NumberField: {
|
13
|
+
'is at least': {
|
14
|
+
expression: (field: ComponentDef, value: any) => string;
|
15
|
+
};
|
16
|
+
'is at most': {
|
17
|
+
expression: (field: ComponentDef, value: any) => string;
|
18
|
+
};
|
19
|
+
'is less than': {
|
20
|
+
expression: (field: ComponentDef, value: any) => string;
|
21
|
+
};
|
22
|
+
'is more than': {
|
23
|
+
expression: (field: ComponentDef, value: any) => string;
|
24
|
+
};
|
25
|
+
} & {
|
26
|
+
is: {
|
27
|
+
expression: (field: ComponentDef, value: any) => string;
|
28
|
+
};
|
29
|
+
'is not': {
|
30
|
+
expression: (field: ComponentDef, value: any) => string;
|
31
|
+
};
|
32
|
+
};
|
33
|
+
DateField: {
|
34
|
+
is: {
|
35
|
+
expression: (field: ComponentDef, value: any) => string;
|
36
|
+
};
|
37
|
+
'is not': {
|
38
|
+
expression: (field: ComponentDef, value: any) => string;
|
39
|
+
};
|
40
|
+
'is before': {
|
41
|
+
expression: (field: ComponentDef, value: any) => string;
|
42
|
+
};
|
43
|
+
'is after': {
|
44
|
+
expression: (field: ComponentDef, value: any) => string;
|
45
|
+
};
|
46
|
+
} & {
|
47
|
+
'is at least': {
|
48
|
+
units: any;
|
49
|
+
expression: (field: ComponentDef, value: any) => string;
|
50
|
+
};
|
51
|
+
'is at most': {
|
52
|
+
units: any;
|
53
|
+
expression: (field: ComponentDef, value: any) => string;
|
54
|
+
};
|
55
|
+
'is less than': {
|
56
|
+
units: any;
|
57
|
+
expression: (field: ComponentDef, value: any) => string;
|
58
|
+
};
|
59
|
+
'is more than': {
|
60
|
+
units: any;
|
61
|
+
expression: (field: ComponentDef, value: any) => string;
|
62
|
+
};
|
63
|
+
};
|
64
|
+
TimeField: {
|
65
|
+
is: {
|
66
|
+
expression: (field: ComponentDef, value: any) => string;
|
67
|
+
};
|
68
|
+
'is not': {
|
69
|
+
expression: (field: ComponentDef, value: any) => string;
|
70
|
+
};
|
71
|
+
'is before': {
|
72
|
+
expression: (field: ComponentDef, value: any) => string;
|
73
|
+
};
|
74
|
+
'is after': {
|
75
|
+
expression: (field: ComponentDef, value: any) => string;
|
76
|
+
};
|
77
|
+
} & {
|
78
|
+
'is at least': {
|
79
|
+
units: any;
|
80
|
+
expression: (field: ComponentDef, value: any) => string;
|
81
|
+
};
|
82
|
+
'is at most': {
|
83
|
+
units: any;
|
84
|
+
expression: (field: ComponentDef, value: any) => string;
|
85
|
+
};
|
86
|
+
'is less than': {
|
87
|
+
units: any;
|
88
|
+
expression: (field: ComponentDef, value: any) => string;
|
89
|
+
};
|
90
|
+
'is more than': {
|
91
|
+
units: any;
|
92
|
+
expression: (field: ComponentDef, value: any) => string;
|
93
|
+
};
|
94
|
+
};
|
95
|
+
DatePartsField: {
|
96
|
+
is: {
|
97
|
+
expression: (field: ComponentDef, value: any) => string;
|
98
|
+
};
|
99
|
+
'is not': {
|
100
|
+
expression: (field: ComponentDef, value: any) => string;
|
101
|
+
};
|
102
|
+
'is before': {
|
103
|
+
expression: (field: ComponentDef, value: any) => string;
|
104
|
+
};
|
105
|
+
'is after': {
|
106
|
+
expression: (field: ComponentDef, value: any) => string;
|
107
|
+
};
|
108
|
+
} & {
|
109
|
+
'is at least': {
|
110
|
+
units: any;
|
111
|
+
expression: (field: ComponentDef, value: any) => string;
|
112
|
+
};
|
113
|
+
'is at most': {
|
114
|
+
units: any;
|
115
|
+
expression: (field: ComponentDef, value: any) => string;
|
116
|
+
};
|
117
|
+
'is less than': {
|
118
|
+
units: any;
|
119
|
+
expression: (field: ComponentDef, value: any) => string;
|
120
|
+
};
|
121
|
+
'is more than': {
|
122
|
+
units: any;
|
123
|
+
expression: (field: ComponentDef, value: any) => string;
|
124
|
+
};
|
125
|
+
};
|
126
|
+
DateTimeField: {
|
127
|
+
is: {
|
128
|
+
expression: (field: ComponentDef, value: any) => string;
|
129
|
+
};
|
130
|
+
'is not': {
|
131
|
+
expression: (field: ComponentDef, value: any) => string;
|
132
|
+
};
|
133
|
+
'is before': {
|
134
|
+
expression: (field: ComponentDef, value: any) => string;
|
135
|
+
};
|
136
|
+
'is after': {
|
137
|
+
expression: (field: ComponentDef, value: any) => string;
|
138
|
+
};
|
139
|
+
} & {
|
140
|
+
'is at least': {
|
141
|
+
units: any;
|
142
|
+
expression: (field: ComponentDef, value: any) => string;
|
143
|
+
};
|
144
|
+
'is at most': {
|
145
|
+
units: any;
|
146
|
+
expression: (field: ComponentDef, value: any) => string;
|
147
|
+
};
|
148
|
+
'is less than': {
|
149
|
+
units: any;
|
150
|
+
expression: (field: ComponentDef, value: any) => string;
|
151
|
+
};
|
152
|
+
'is more than': {
|
153
|
+
units: any;
|
154
|
+
expression: (field: ComponentDef, value: any) => string;
|
155
|
+
};
|
156
|
+
};
|
157
|
+
DateTimePartsField: {
|
158
|
+
is: {
|
159
|
+
expression: (field: ComponentDef, value: any) => string;
|
160
|
+
};
|
161
|
+
'is not': {
|
162
|
+
expression: (field: ComponentDef, value: any) => string;
|
163
|
+
};
|
164
|
+
'is before': {
|
165
|
+
expression: (field: ComponentDef, value: any) => string;
|
166
|
+
};
|
167
|
+
'is after': {
|
168
|
+
expression: (field: ComponentDef, value: any) => string;
|
169
|
+
};
|
170
|
+
} & {
|
171
|
+
'is at least': {
|
172
|
+
units: any;
|
173
|
+
expression: (field: ComponentDef, value: any) => string;
|
174
|
+
};
|
175
|
+
'is at most': {
|
176
|
+
units: any;
|
177
|
+
expression: (field: ComponentDef, value: any) => string;
|
178
|
+
};
|
179
|
+
'is less than': {
|
180
|
+
units: any;
|
181
|
+
expression: (field: ComponentDef, value: any) => string;
|
182
|
+
};
|
183
|
+
'is more than': {
|
184
|
+
units: any;
|
185
|
+
expression: (field: ComponentDef, value: any) => string;
|
186
|
+
};
|
187
|
+
};
|
188
|
+
TextField: {
|
189
|
+
'is longer than': {
|
190
|
+
expression: (field: ComponentDef, value: any) => string;
|
191
|
+
};
|
192
|
+
'is shorter than': {
|
193
|
+
expression: (field: ComponentDef, value: any) => string;
|
194
|
+
};
|
195
|
+
'has length': {
|
196
|
+
expression: (field: ComponentDef, value: any) => string;
|
197
|
+
};
|
198
|
+
} & {
|
199
|
+
is: {
|
200
|
+
expression: (field: ComponentDef, value: any) => string;
|
201
|
+
};
|
202
|
+
'is not': {
|
203
|
+
expression: (field: ComponentDef, value: any) => string;
|
204
|
+
};
|
205
|
+
};
|
206
|
+
MultilineTextField: {
|
207
|
+
'is longer than': {
|
208
|
+
expression: (field: ComponentDef, value: any) => string;
|
209
|
+
};
|
210
|
+
'is shorter than': {
|
211
|
+
expression: (field: ComponentDef, value: any) => string;
|
212
|
+
};
|
213
|
+
'has length': {
|
214
|
+
expression: (field: ComponentDef, value: any) => string;
|
215
|
+
};
|
216
|
+
} & {
|
217
|
+
is: {
|
218
|
+
expression: (field: ComponentDef, value: any) => string;
|
219
|
+
};
|
220
|
+
'is not': {
|
221
|
+
expression: (field: ComponentDef, value: any) => string;
|
222
|
+
};
|
223
|
+
};
|
224
|
+
EmailAddressField: {
|
225
|
+
'is longer than': {
|
226
|
+
expression: (field: ComponentDef, value: any) => string;
|
227
|
+
};
|
228
|
+
'is shorter than': {
|
229
|
+
expression: (field: ComponentDef, value: any) => string;
|
230
|
+
};
|
231
|
+
'has length': {
|
232
|
+
expression: (field: ComponentDef, value: any) => string;
|
233
|
+
};
|
234
|
+
} & {
|
235
|
+
is: {
|
236
|
+
expression: (field: ComponentDef, value: any) => string;
|
237
|
+
};
|
238
|
+
'is not': {
|
239
|
+
expression: (field: ComponentDef, value: any) => string;
|
240
|
+
};
|
241
|
+
};
|
242
|
+
};
|
243
|
+
export declare function getOperatorNames(fieldType: any): string[];
|
244
|
+
export declare function getExpression(fieldType: ComponentType, fieldName: string, operator: string, value: ConditionValueAbstract): any;
|
245
|
+
export declare function getOperatorConfig(fieldType: ComponentType, operator: any): any;
|
246
|
+
export declare const absoluteDateOrTimeOperatorNames: string[];
|
247
|
+
export declare const relativeDateOrTimeOperatorNames: string[];
|
248
|
+
//# sourceMappingURL=condition-operators.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"condition-operators.d.ts","sourceRoot":"","sources":["../../../src/conditions/condition-operators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AA0CnE,eAAO,MAAM,eAAe;;;gCAiFJ,YAAY;;;gCAOZ,YAAY;;;;;gCArBZ,YAAY;;;gCAAZ,YAAY;;;gCAAZ,YAAY;;;gCAAZ,YAAY;;;;gCAAZ,YAAY;;;gCAAZ,YAAY;;;;;gCA0CZ,YAAY;;;gCAAZ,YAAY;;;gCAAZ,YAAY;;;gCAAZ,YAAY;;;;;gCAYZ,YAAY;;;;gCAAZ,YAAY;;;;gCAAZ,YAAY;;;;gCAAZ,YAAY;;;;;gCAZZ,YAAY;;;gCAAZ,YAAY;;;gCAAZ,YAAY;;;gCAAZ,YA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+
} else if (typeof exports !== "undefined") {
|
5
|
+
factory(exports, require("./condition-values"));
|
6
|
+
} else {
|
7
|
+
var mod = {
|
8
|
+
exports: {}
|
9
|
+
};
|
10
|
+
factory(mod.exports, global.conditionValues);
|
11
|
+
global.conditionOperators = mod.exports;
|
12
|
+
}
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _conditionValues) {
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
_exports.__esModule = true;
|
17
|
+
_exports.customOperators = _exports.absoluteDateOrTimeOperatorNames = void 0;
|
18
|
+
_exports.getExpression = getExpression;
|
19
|
+
_exports.getOperatorConfig = getOperatorConfig;
|
20
|
+
_exports.getOperatorNames = getOperatorNames;
|
21
|
+
_exports.relativeDateOrTimeOperatorNames = void 0;
|
22
|
+
const defaultOperators = {
|
23
|
+
is: inline('=='),
|
24
|
+
'is not': inline('!=')
|
25
|
+
};
|
26
|
+
function withDefaults(param) {
|
27
|
+
return Object.assign({}, param, defaultOperators);
|
28
|
+
}
|
29
|
+
const textBasedFieldCustomisations = {
|
30
|
+
'is longer than': lengthIs('>'),
|
31
|
+
'is shorter than': lengthIs('<'),
|
32
|
+
'has length': lengthIs('==')
|
33
|
+
};
|
34
|
+
const absoluteDateTimeOperators = {
|
35
|
+
is: absoluteDateTime('=='),
|
36
|
+
'is not': absoluteDateTime('!='),
|
37
|
+
'is before': absoluteDateTime('<'),
|
38
|
+
'is after': absoluteDateTime('>')
|
39
|
+
};
|
40
|
+
const relativeTimeOperators = units => ({
|
41
|
+
'is at least': relativeTime('<=', '>=', units),
|
42
|
+
'is at most': relativeTime('>=', '<=', units),
|
43
|
+
'is less than': relativeTime('>', '<', units),
|
44
|
+
'is more than': relativeTime('<', '>', units)
|
45
|
+
});
|
46
|
+
const customOperators = _exports.customOperators = {
|
47
|
+
CheckboxesField: {
|
48
|
+
contains: reverseInline('in'),
|
49
|
+
'does not contain': not(reverseInline('in'))
|
50
|
+
},
|
51
|
+
NumberField: withDefaults({
|
52
|
+
'is at least': inline('>='),
|
53
|
+
'is at most': inline('<='),
|
54
|
+
'is less than': inline('<'),
|
55
|
+
'is more than': inline('>')
|
56
|
+
}),
|
57
|
+
DateField: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(_conditionValues.dateUnits)),
|
58
|
+
TimeField: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(_conditionValues.timeUnits)),
|
59
|
+
DatePartsField: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(_conditionValues.dateUnits)),
|
60
|
+
DateTimeField: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(_conditionValues.dateTimeUnits)),
|
61
|
+
DateTimePartsField: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(_conditionValues.dateTimeUnits)),
|
62
|
+
TextField: withDefaults(textBasedFieldCustomisations),
|
63
|
+
MultilineTextField: withDefaults(textBasedFieldCustomisations),
|
64
|
+
EmailAddressField: withDefaults(textBasedFieldCustomisations)
|
65
|
+
};
|
66
|
+
function getOperatorNames(fieldType) {
|
67
|
+
return Object.keys(getConditionals(fieldType)).sort();
|
68
|
+
}
|
69
|
+
function getExpression(fieldType, fieldName, operator, value) {
|
70
|
+
return getConditionals(fieldType)[operator].expression({
|
71
|
+
type: fieldType,
|
72
|
+
name: fieldName
|
73
|
+
}, value);
|
74
|
+
}
|
75
|
+
function getOperatorConfig(fieldType, operator) {
|
76
|
+
return getConditionals(fieldType)[operator];
|
77
|
+
}
|
78
|
+
function getConditionals(fieldType) {
|
79
|
+
return customOperators[fieldType] || defaultOperators;
|
80
|
+
}
|
81
|
+
function inline(operator) {
|
82
|
+
return {
|
83
|
+
expression: (field, value) => `${field.name} ${operator} ${formatValue(field.type, value.value)}`
|
84
|
+
};
|
85
|
+
}
|
86
|
+
function lengthIs(operator) {
|
87
|
+
return {
|
88
|
+
expression: (field, value) => `length(${field.name}) ${operator} ${value.value}`
|
89
|
+
};
|
90
|
+
}
|
91
|
+
function reverseInline(operator) {
|
92
|
+
return {
|
93
|
+
expression: (field, value) => `${formatValue(field.type, value.value)} ${operator} ${field.name}`
|
94
|
+
};
|
95
|
+
}
|
96
|
+
function not(operatorDefinition) {
|
97
|
+
return {
|
98
|
+
expression: (field, value) => `not (${operatorDefinition.expression(field, value)})`
|
99
|
+
};
|
100
|
+
}
|
101
|
+
function formatValue(fieldType, value) {
|
102
|
+
if (fieldType === 'NumberField' || fieldType === 'YesNoField') {
|
103
|
+
return value;
|
104
|
+
}
|
105
|
+
return `'${value}'`;
|
106
|
+
}
|
107
|
+
const absoluteDateOrTimeOperatorNames = _exports.absoluteDateOrTimeOperatorNames = Object.keys(absoluteDateTimeOperators);
|
108
|
+
const relativeDateOrTimeOperatorNames = _exports.relativeDateOrTimeOperatorNames = Object.keys(relativeTimeOperators(_conditionValues.dateTimeUnits));
|
109
|
+
function absoluteDateTime(operator) {
|
110
|
+
return {
|
111
|
+
expression: (field, value) => {
|
112
|
+
if (value instanceof _conditionValues.ConditionValue) {
|
113
|
+
return `${field.name} ${operator} '${value.toExpression()}'`;
|
114
|
+
}
|
115
|
+
throw Error('only Value types are supported');
|
116
|
+
}
|
117
|
+
};
|
118
|
+
}
|
119
|
+
function relativeTime(pastOperator, futureOperator, units) {
|
120
|
+
return {
|
121
|
+
units,
|
122
|
+
expression: (field, value) => {
|
123
|
+
if (value instanceof _conditionValues.RelativeTimeValue) {
|
124
|
+
const operator = value.direction === _conditionValues.DateDirections.PAST ? pastOperator : futureOperator;
|
125
|
+
return `${field.name} ${operator} ${value.toExpression()}`;
|
126
|
+
}
|
127
|
+
throw Error('time shift requires a TimeShiftValue');
|
128
|
+
}
|
129
|
+
};
|
130
|
+
}
|
131
|
+
});
|
132
|
+
//# sourceMappingURL=condition-operators.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"condition-operators.js","names":["defaultOperators","is","inline","withDefaults","param","Object","assign","textBasedFieldCustomisations","lengthIs","absoluteDateTimeOperators","absoluteDateTime","relativeTimeOperators","units","relativeTime","customOperators","_exports","CheckboxesField","contains","reverseInline","not","NumberField","DateField","dateUnits","TimeField","timeUnits","DatePartsField","DateTimeField","dateTimeUnits","DateTimePartsField","TextField","MultilineTextField","EmailAddressField","getOperatorNames","fieldType","keys","getConditionals","sort","getExpression","fieldName","operator","value","expression","type","name","getOperatorConfig","field","formatValue","operatorDefinition","absoluteDateOrTimeOperatorNames","relativeDateOrTimeOperatorNames","ConditionValue","toExpression","Error","pastOperator","futureOperator","RelativeTimeValue","direction","DateDirections","PAST"],"sources":["../../../src/conditions/condition-operators.ts"],"sourcesContent":["import { ComponentType, ComponentDef } from '../components'\nimport { ConditionValueAbstract } from './condition-value-abstract'\n\nimport {\n timeUnits,\n dateUnits,\n dateTimeUnits,\n ConditionValue,\n DateDirections,\n RelativeTimeValue\n} from './condition-values'\n\ntype Operator = '==' | '!=' | '>=' | '<=' | '<' | '>'\n\nconst defaultOperators = {\n is: inline('=='),\n 'is not': inline('!=')\n}\n\nfunction withDefaults<T>(param: T) {\n return Object.assign({}, param, defaultOperators)\n}\n\nconst textBasedFieldCustomisations = {\n 'is longer than': lengthIs('>'),\n 'is shorter than': lengthIs('<'),\n 'has length': lengthIs('==')\n}\n\nconst absoluteDateTimeOperators = {\n is: absoluteDateTime('=='),\n 'is not': absoluteDateTime('!='),\n 'is before': absoluteDateTime('<'),\n 'is after': absoluteDateTime('>')\n}\n\nconst relativeTimeOperators = (units) => ({\n 'is at least': relativeTime('<=', '>=', units),\n 'is at most': relativeTime('>=', '<=', units),\n 'is less than': relativeTime('>', '<', units),\n 'is more than': relativeTime('<', '>', units)\n})\n\nexport const customOperators = {\n CheckboxesField: {\n contains: reverseInline('in'),\n 'does not contain': not(reverseInline('in'))\n },\n NumberField: withDefaults({\n 'is at least': inline('>='),\n 'is at most': inline('<='),\n 'is less than': inline('<'),\n 'is more than': inline('>')\n }),\n DateField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateUnits)\n ),\n TimeField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(timeUnits)\n ),\n DatePartsField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateUnits)\n ),\n DateTimeField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateTimeUnits)\n ),\n DateTimePartsField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateTimeUnits)\n ),\n TextField: withDefaults(textBasedFieldCustomisations),\n MultilineTextField: withDefaults(textBasedFieldCustomisations),\n EmailAddressField: withDefaults(textBasedFieldCustomisations)\n}\n\nexport function getOperatorNames(fieldType) {\n return Object.keys(getConditionals(fieldType)).sort()\n}\n\nexport function getExpression(\n fieldType: ComponentType,\n fieldName: string,\n operator: string,\n value: ConditionValueAbstract\n) {\n return getConditionals(fieldType)[operator].expression(\n { type: fieldType, name: fieldName },\n value\n )\n}\n\nexport function getOperatorConfig(fieldType: ComponentType, operator) {\n return getConditionals(fieldType)[operator]\n}\n\nfunction getConditionals(fieldType: ComponentType) {\n return customOperators[fieldType] || defaultOperators\n}\n\nfunction inline(operator: Operator) {\n return {\n expression: (field: ComponentDef, value) =>\n `${field.name} ${operator} ${formatValue(field.type, value.value)}`\n }\n}\n\nfunction lengthIs(operator: Operator) {\n return {\n expression: (field: ComponentDef, value) =>\n `length(${field.name}) ${operator} ${value.value}`\n }\n}\n\nfunction reverseInline(operator: 'in') {\n return {\n expression: (field: ComponentDef, value) =>\n `${formatValue(field.type, value.value)} ${operator} ${field.name}`\n }\n}\n\nfunction not(operatorDefinition) {\n return {\n expression: (field: ComponentDef, value) =>\n `not (${operatorDefinition.expression(field, value)})`\n }\n}\n\nfunction formatValue(fieldType: ComponentType, value) {\n if (fieldType === 'NumberField' || fieldType === 'YesNoField') {\n return value\n }\n return `'${value}'`\n}\n\nexport const absoluteDateOrTimeOperatorNames = Object.keys(\n absoluteDateTimeOperators\n)\nexport const relativeDateOrTimeOperatorNames = Object.keys(\n relativeTimeOperators(dateTimeUnits)\n)\n\nfunction absoluteDateTime(operator: Operator) {\n return {\n expression: (field: ComponentDef, value) => {\n if (value instanceof ConditionValue) {\n return `${field.name} ${operator} '${value.toExpression()}'`\n }\n throw Error('only Value types are supported')\n }\n }\n}\n\nfunction relativeTime(pastOperator, futureOperator, units) {\n return {\n units,\n expression: (field: ComponentDef, value) => {\n if (value instanceof RelativeTimeValue) {\n const operator =\n value.direction === DateDirections.PAST\n ? pastOperator\n : futureOperator\n return `${field.name} ${operator} ${value.toExpression()}`\n }\n throw Error('time shift requires a TimeShiftValue')\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAcA,MAAMA,gBAAgB,GAAG;IACvBC,EAAE,EAAEC,MAAM,CAAC,IAAI,CAAC;IAChB,QAAQ,EAAEA,MAAM,CAAC,IAAI;EACvB,CAAC;EAED,SAASC,YAAYA,CAAIC,KAAQ,EAAE;IACjC,OAAOC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEF,KAAK,EAAEJ,gBAAgB,CAAC;EACnD;EAEA,MAAMO,4BAA4B,GAAG;IACnC,gBAAgB,EAAEC,QAAQ,CAAC,GAAG,CAAC;IAC/B,iBAAiB,EAAEA,QAAQ,CAAC,GAAG,CAAC;IAChC,YAAY,EAAEA,QAAQ,CAAC,IAAI;EAC7B,CAAC;EAED,MAAMC,yBAAyB,GAAG;IAChCR,EAAE,EAAES,gBAAgB,CAAC,IAAI,CAAC;IAC1B,QAAQ,EAAEA,gBAAgB,CAAC,IAAI,CAAC;IAChC,WAAW,EAAEA,gBAAgB,CAAC,GAAG,CAAC;IAClC,UAAU,EAAEA,gBAAgB,CAAC,GAAG;EAClC,CAAC;EAED,MAAMC,qBAAqB,GAAIC,KAAK,KAAM;IACxC,aAAa,EAAEC,YAAY,CAAC,IAAI,EAAE,IAAI,EAAED,KAAK,CAAC;IAC9C,YAAY,EAAEC,YAAY,CAAC,IAAI,EAAE,IAAI,EAAED,KAAK,CAA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