@qubit-ltd/common-decorator 3.8.9
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/LICENSE +201 -0
- package/README.md +1156 -0
- package/README.zh_CN.md +929 -0
- package/dist/common-decorator.cjs +6818 -0
- package/dist/common-decorator.cjs.map +1 -0
- package/dist/common-decorator.min.cjs +1 -0
- package/dist/common-decorator.min.cjs.map +1 -0
- package/dist/common-decorator.min.mjs +1 -0
- package/dist/common-decorator.min.mjs.map +1 -0
- package/dist/common-decorator.mjs +6792 -0
- package/dist/common-decorator.mjs.map +1 -0
- package/doc/api/DefaultAssignmentOptions.html +678 -0
- package/doc/api/DefaultOptions.html +954 -0
- package/doc/api/DefaultToJsonOptions.html +633 -0
- package/doc/api/Enum.html +1848 -0
- package/doc/api/Model.html +3607 -0
- package/doc/api/Page.html +1105 -0
- package/doc/api/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/doc/api/fonts/OpenSans-Bold-webfont.svg +1838 -0
- package/doc/api/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/doc/api/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/doc/api/fonts/OpenSans-BoldItalic-webfont.svg +1838 -0
- package/doc/api/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/doc/api/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/doc/api/fonts/OpenSans-Italic-webfont.svg +1838 -0
- package/doc/api/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/doc/api/fonts/OpenSans-Light-webfont.eot +0 -0
- package/doc/api/fonts/OpenSans-Light-webfont.svg +1839 -0
- package/doc/api/fonts/OpenSans-Light-webfont.woff +0 -0
- package/doc/api/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/doc/api/fonts/OpenSans-LightItalic-webfont.svg +1843 -0
- package/doc/api/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/doc/api/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/doc/api/fonts/OpenSans-Regular-webfont.svg +1839 -0
- package/doc/api/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/doc/api/fonts/OpenSans-Semibold-webfont.eot +0 -0
- package/doc/api/fonts/OpenSans-Semibold-webfont.svg +1838 -0
- package/doc/api/fonts/OpenSans-Semibold-webfont.ttf +0 -0
- package/doc/api/fonts/OpenSans-Semibold-webfont.woff +0 -0
- package/doc/api/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
- package/doc/api/fonts/OpenSans-SemiboldItalic-webfont.svg +1838 -0
- package/doc/api/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
- package/doc/api/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
- package/doc/api/global.html +6049 -0
- package/doc/api/index.html +1325 -0
- package/doc/api/scripts/linenumber.js +34 -0
- package/doc/api/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/doc/api/scripts/prettify/lang-css.js +2 -0
- package/doc/api/scripts/prettify/prettify.js +28 -0
- package/doc/api/styles/jsdoc-default.css +699 -0
- package/doc/api/styles/prettify-jsdoc.css +120 -0
- package/doc/api/styles/prettify-tomorrow.css +141 -0
- package/doc/common-decorator.min.visualization.html +4949 -0
- package/doc/common-decorator.visualization.html +4949 -0
- package/package.json +107 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-decorator.cjs","sources":["../node_modules/core-js/internals/global-this.js","../node_modules/core-js/internals/define-global-property.js","../node_modules/core-js/internals/shared-store.js","../node_modules/core-js/internals/shared.js","../node_modules/core-js/internals/fails.js","../node_modules/core-js/internals/function-bind-native.js","../node_modules/core-js/internals/function-uncurry-this.js","../node_modules/core-js/internals/is-null-or-undefined.js","../node_modules/core-js/internals/require-object-coercible.js","../node_modules/core-js/internals/to-object.js","../node_modules/core-js/internals/has-own-property.js","../node_modules/core-js/internals/uid.js","../node_modules/core-js/internals/environment-user-agent.js","../node_modules/core-js/internals/environment-v8-version.js","../node_modules/core-js/internals/symbol-constructor-detection.js","../node_modules/core-js/internals/use-symbol-as-uid.js","../node_modules/core-js/internals/well-known-symbol.js","../node_modules/core-js/internals/descriptors.js","../node_modules/core-js/internals/is-callable.js","../node_modules/core-js/internals/is-object.js","../node_modules/core-js/internals/document-create-element.js","../node_modules/core-js/internals/ie8-dom-define.js","../node_modules/core-js/internals/v8-prototype-define-bug.js","../node_modules/core-js/internals/an-object.js","../node_modules/core-js/internals/function-call.js","../node_modules/core-js/internals/get-built-in.js","../node_modules/core-js/internals/object-is-prototype-of.js","../node_modules/core-js/internals/is-symbol.js","../node_modules/core-js/internals/try-to-string.js","../node_modules/core-js/internals/a-callable.js","../node_modules/core-js/internals/get-method.js","../node_modules/core-js/internals/ordinary-to-primitive.js","../node_modules/core-js/internals/to-primitive.js","../node_modules/core-js/internals/to-property-key.js","../node_modules/core-js/internals/object-define-property.js","../node_modules/core-js/modules/esnext.function.metadata.js","../node_modules/core-js/internals/path.js","../node_modules/core-js/internals/well-known-symbol-wrapped.js","../node_modules/core-js/internals/well-known-symbol-define.js","../node_modules/core-js/modules/esnext.symbol.metadata.js","../src/impl/model/clone-options.js","../src/impl/default-options/default-assignment-options.js","../src/impl/default-options/default-to-json-options.js","../src/default-options.js","../src/impl/metadata-keys.js","../src/impl/class-metadata-cache.js","../src/impl/utils/get-class-metadata.js","../src/is-enum-class.js","../src/enum-normalizer.js","../src/default-normalizer.js","../src/impl/utils/get-default-instance.js","../src/impl/utils/get-exist-field-with-different-naming-style.js","../src/impl/utils/get-source-field.js","../src/impl/utils/get-collection-element-type.js","../src/impl/utils/get-field-metadata-object.js","../src/impl/utils/get-field-metadata.js","../src/impl/utils/get-field-element-type.js","../src/impl/utils/get-field-type.js","../src/impl/utils/has-prototype-function.js","../src/impl/enum/of-value-impl.js","../src/impl/model/assign-impl.js","../src/model/page.js","../src/impl/model/is-empty-impl.js","../src/impl/model/equals-impl.js","../src/impl/utils/set-class-metadata.js","../src/impl/model/generate-id-impl.js","../src/impl/utils/require-prototype-method.js","../src/impl/model/clear-impl.js","../src/impl/model/clone-impl.js","../src/impl/model/normalize-array-field.js","../src/impl/model/normalize-map-field.js","../src/impl/model/normalize-normal-field.js","../src/impl/model/normalize-nullish-field.js","../src/impl/model/normalize-set-field.js","../src/impl/utils/has-own-prototype-function.js","../src/impl/model/normalize-field-impl.js","../src/impl/model/normalize-impl.js","../src/impl/utils/get-instance-name.js","../src/impl/utils/get-field-label.js","../src/impl/utils/is-field-nullable.js","../src/impl/utils/is-field-non-empty.js","../src/impl/utils/get-element-validation-context.js","../src/impl/model/validate-empty-field.js","../src/impl/model/validate-array-field.js","../src/impl/model/validate-map-field.js","../src/impl/utils/get-validation-context.js","../src/impl/model/validate-normal-field.js","../src/impl/model/validate-set-field.js","../src/impl/model/validate-field-impl.js","../src/impl/model/validate-impl.js","../src/impl/model/create-impl.js","../src/impl/model/create-array-impl.js","../src/impl/model/is-valid-page-source.js","../src/impl/model/create-page-impl.js","../src/impl/model/is-nullish-or-empty-impl.js","../src/impl/model/parse-json-string-impl.js","../src/impl/model/to-json-impl.js","../src/impl/model/to-json-string-impl.js","../src/impl/utils/has-own-class-field.js","../src/model.js","../src/impl/utils/set-field-metadata.js","../src/type.js","../src/element-type.js","../src/impl/utils/is-decorator-context.js","../src/normalizable.js","../src/default-validator.js","../src/validatable.js","../src/nullable.js","../src/non-empty.js","../src/label.js","../src/payload.js","../src/name-field.js","../src/is-enumerator.js","../src/impl/enum/define-enumerator.js","../src/impl/enum/values-impl.js","../src/impl/enum/of-code-impl.js","../src/impl/enum/of-name-impl.js","../src/impl/enum/of-impl.js","../src/enum.js","../src/assign.js","../src/create.js","../src/create-array.js","../src/create-page.js","../src/normalize.js","../src/to-json.js","../src/to-json-string.js","../src/stringify-id.js"],"sourcesContent":["'use strict';\nvar check = function (it) {\n return it && it.Math === Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n check(typeof this == 'object' && this) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || Function('return this')();\n","'use strict';\nvar globalThis = require('../internals/global-this');\n\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(globalThis, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n globalThis[key] = value;\n } return value;\n};\n","'use strict';\nvar IS_PURE = require('../internals/is-pure');\nvar globalThis = require('../internals/global-this');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nvar SHARED = '__core-js_shared__';\nvar store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});\n\n(store.versions || (store.versions = [])).push({\n version: '3.39.0',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n","'use strict';\nvar store = require('../internals/shared-store');\n\nmodule.exports = function (key, value) {\n return store[key] || (store[key] = value || {});\n};\n","'use strict';\nmodule.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-function-prototype-bind -- safe\n var test = (function () { /* empty */ }).bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n","'use strict';\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar call = FunctionPrototype.call;\nvar uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {\n return function () {\n return call.apply(fn, arguments);\n };\n};\n","'use strict';\n// we can't use just `it == null` since of `document.all` special case\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec\nmodule.exports = function (it) {\n return it === null || it === undefined;\n};\n","'use strict';\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\n\nvar $TypeError = TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (isNullOrUndefined(it)) throw new $TypeError(\"Can't call method on \" + it);\n return it;\n};\n","'use strict';\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar $Object = Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return $Object(requireObjectCoercible(argument));\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toObject = require('../internals/to-object');\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n","'use strict';\nvar globalThis = require('../internals/global-this');\n\nvar navigator = globalThis.navigator;\nvar userAgent = navigator && navigator.userAgent;\n\nmodule.exports = userAgent ? String(userAgent) : '';\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar userAgent = require('../internals/environment-user-agent');\n\nvar process = globalThis.process;\nvar Deno = globalThis.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n","'use strict';\n/* eslint-disable es/no-symbol -- required for testing */\nvar V8_VERSION = require('../internals/environment-v8-version');\nvar fails = require('../internals/fails');\nvar globalThis = require('../internals/global-this');\n\nvar $String = globalThis.String;\n\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol('symbol detection');\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,\n // of course, fail.\n return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n","'use strict';\n/* eslint-disable es/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\nmodule.exports = NATIVE_SYMBOL &&\n !Symbol.sham &&\n typeof Symbol.iterator == 'symbol';\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar shared = require('../internals/shared');\nvar hasOwn = require('../internals/has-own-property');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar Symbol = globalThis.Symbol;\nvar WellKnownSymbolsStore = shared('wks');\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name)) {\n WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)\n ? Symbol[name]\n : createWellKnownSymbol('Symbol.' + name);\n } return WellKnownSymbolsStore[name];\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;\n});\n","'use strict';\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot\nvar documentAll = typeof document == 'object' && document.all;\n\n// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\n// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing\nmodule.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {\n return typeof argument == 'function' || argument === documentAll;\n} : function (argument) {\n return typeof argument == 'function';\n};\n","'use strict';\nvar isCallable = require('../internals/is-callable');\n\nmodule.exports = function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar isObject = require('../internals/is-object');\n\nvar document = globalThis.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a !== 7;\n});\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype !== 42;\n});\n","'use strict';\nvar isObject = require('../internals/is-object');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw new $TypeError($String(argument) + ' is not an object');\n};\n","'use strict';\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar call = Function.prototype.call;\n\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar isCallable = require('../internals/is-callable');\n\nvar aFunction = function (argument) {\n return isCallable(argument) ? argument : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(globalThis[namespace]) : globalThis[namespace] && globalThis[namespace][method];\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar $Object = Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));\n};\n","'use strict';\nvar $String = String;\n\nmodule.exports = function (argument) {\n try {\n return $String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n","'use strict';\nvar isCallable = require('../internals/is-callable');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw new $TypeError(tryToString(argument) + ' is not a function');\n};\n","'use strict';\nvar aCallable = require('../internals/a-callable');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return isNullOrUndefined(func) ? undefined : aCallable(func);\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\n\nvar $TypeError = TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw new $TypeError(\"Can't convert object to primitive value\");\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar getMethod = require('../internals/get-method');\nvar ordinaryToPrimitive = require('../internals/ordinary-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar $TypeError = TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw new $TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n","'use strict';\nvar toPrimitive = require('../internals/to-primitive');\nvar isSymbol = require('../internals/is-symbol');\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar anObject = require('../internals/an-object');\nvar toPropertyKey = require('../internals/to-property-key');\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar defineProperty = require('../internals/object-define-property').f;\n\nvar METADATA = wellKnownSymbol('metadata');\nvar FunctionPrototype = Function.prototype;\n\n// Function.prototype[@@metadata]\n// https://github.com/tc39/proposal-decorator-metadata\nif (FunctionPrototype[METADATA] === undefined) {\n defineProperty(FunctionPrototype, METADATA, {\n value: null\n });\n}\n","'use strict';\nvar globalThis = require('../internals/global-this');\n\nmodule.exports = globalThis;\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nexports.f = wellKnownSymbol;\n","'use strict';\nvar path = require('../internals/path');\nvar hasOwn = require('../internals/has-own-property');\nvar wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped');\nvar defineProperty = require('../internals/object-define-property').f;\n\nmodule.exports = function (NAME) {\n var Symbol = path.Symbol || (path.Symbol = {});\n if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, {\n value: wrappedWellKnownSymbolModule.f(NAME)\n });\n};\n","'use strict';\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.metadata` well-known symbol\n// https://github.com/tc39/proposal-decorators\ndefineWellKnownSymbol('metadata');\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Options used when calling the `clone()` function to copy attributes.\n *\n * @author Haixing Hu\n * @private\n */\nconst CLONE_OPTIONS = {\n includeAccessor: false,\n includeNonEnumerable: false,\n includeReadonly: true,\n includeNonConfigurable: true,\n};\n\nexport default CLONE_OPTIONS;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * The default options for the `Class.prototype.assign()`, `Class.create()`,\n * `Class.createArray()`, `Class.createPage()`, `Class.parseJsonString()`\n * methods of the class decorated by `@Model`.\n *\n * @author Haixing Hu\n */\nclass DefaultAssignmentOptions {\n /**\n * Indicates whether to normalize this object after the assignment.\n *\n * The default value of this option is `true`.\n *\n * @type {boolean}\n */\n normalize = true;\n\n /**\n * Indicates whether to convert the naming style of the target object.\n *\n * The default value of this option is `false`.\n *\n * @type {boolean}\n */\n convertNaming = false;\n\n /**\n * The naming style of the source object, i.e., the first argument of the\n * `assign()` method.\n *\n * The default value of this option is `LOWER_UNDERSCORE`.\n *\n * @type {string}\n */\n sourceNamingStyle = 'LOWER_UNDERSCORE';\n\n /**\n * The naming style of the target object, i.e., the object calling the\n * `assign()` method.\n *\n * The default value of this option is `LOWER_CAMEL`.\n *\n * @type {string}\n */\n targetNamingStyle = 'LOWER_CAMEL';\n\n /**\n * The additional information about types of fields of classes.\n *\n * The keys of this object are the path of the fields or sub-fields of the\n * target object, the values are the type of the fields, represented\n * as the constructor function of the type.\n *\n * For example:\n * ```js\n * @Model\n * class Child {\n * name = null;\n *\n * credential = null;\n * }\n *\n * @Model\n * class Foo {\n * id = null;\n *\n * @Type(Child)\n * child = null;\n * }\n * ```\n * In this example, in order to assign a JSON object to an instance of `Foo`,\n * we could specify the type of the `Foo.id`, `Foo.child.name`, and\n * `Foo.child.credential` as follows:\n * ```\n * const foo = Foo.create(obj, {\n * types: {\n * 'Foo.id': Number,\n * 'Foo.child.name': String,\n * 'Foo.child.credential': Credential,\n * },\n * });\n * ```\n *\n * Note that the path of the fields or sub-fields of the target object should\n * include the class name of the target object.\n *\n * The default value of this option is an empty object.\n *\n * @type {object}\n */\n types = {};\n\n /**\n * The additional information about element types of fields of the target object.\n *\n * The keys of this object are the path of the fields or sub-fields of the\n * target object, the values are the type of the fields, represented\n * as the constructor function of the type.\n *\n * For example:\n * ```js\n * @Model\n * class Child {\n * name = null;\n *\n * credentials = [];\n * }\n *\n * @Model\n * class Foo {\n * id = null;\n *\n * @Type(Child)\n * child = null;\n * }\n * ```\n * In this example, in order to assign a JSON object to an instance of `Foo`,\n * we could specify the type of the `Foo.id`, `Foo.child.name`, and\n * `Foo.child.credentials` as follows:\n * ```\n * const foo = Foo.create(obj, {\n * types: {\n * 'Foo.id': Number,\n * 'Foo.child.name': String,\n * },\n * elementTypes: {\n * 'Foo.child.credential': Credential,\n * },\n * });\n * ```\n *\n * Note that the path of the fields or sub-fields of the target object should\n * include the class name of the target object.\n *\n * The default value of this option is an empty object.\n *\n * @type {object}\n */\n elementTypes = {};\n}\n\nexport default DefaultAssignmentOptions;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * The default options for the `toJSON()` and `toJsonString()` methods of the\n * class decorated by `@Model`.\n *\n * @author Haixing Hu\n */\nclass DefaultToJsonOptions {\n /**\n * Indicates whether to normalize this object before serializing it into JSON.\n *\n * The default value of this option is `true`.\n *\n * @type {boolean}\n */\n normalize = true;\n\n /**\n * Indicates whether to remove the empty fields of the object represented by\n * the result JSON string.\n *\n * If it is `true`, the empty fields of the object will be removed before\n * serialization.\n *\n * The default value of this option is `false`.\n *\n * @type {boolean}\n */\n removeEmptyFields = false;\n\n /**\n * Indicates whether to convert the naming of properties of the object\n * represented by the result JSON string.\n *\n * The default value of this option is `false`.\n *\n * @type {boolean}\n */\n convertNaming = false;\n\n /**\n * The naming style of the source object, i.e., the object calling the\n * `toJSON()` method.\n *\n * The default value of this option is `LOWER_CAMEL`.\n *\n * @type {string}\n */\n sourceNamingStyle = 'LOWER_CAMEL';\n\n /**\n * The naming style of the target object, i.e., the object represented by the\n * result JSON string of the `toJSON()` method.\n *\n * The default value of this option is `LOWER_UNDERSCORE`.\n *\n * @type {string}\n */\n targetNamingStyle = 'LOWER_UNDERSCORE';\n\n /**\n * A string or number that's used to insert white space (including indentation,\n * line break characters, etc.) into the output JSON string for readability\n * purposes.\n *\n * If this is a number, it indicates the number of space characters to be used\n * as indentation, clamped to 10 (that is, any number greater than 10 is\n * treated as if it were 10). Values less than 1 indicate that no space should\n * be used.\n *\n * If this is a string, the string (or the first 10 characters of the string,\n * if it's longer than that) is inserted before every nested object or array.\n *\n * If space is anything other than a string or number (can be either a\n * primitive or a wrapper object) — for example, is null or not provided\n * — no white space is used.\n *\n * The default value of this option is `undefined`, indicating that no white\n * space is used.\n *\n * @type {string | number | undefined}\n */\n space = undefined;\n}\n\nexport default DefaultToJsonOptions;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport clone from '@qubit-ltd/clone';\nimport DefaultAssignmentOptions from './impl/default-options/default-assignment-options';\nimport DefaultToJsonOptions from './impl/default-options/default-to-json-options';\n\n/**\n * The map storing the default values of options of different aspects.\n *\n * The key of this map is the name of aspects, and the value of this map is an\n * object representing the default options of the aspect.\n *\n * @type {Map<string, object>}\n * @author Haixing Hu\n * @private\n */\nconst DEFAULT_OPTIONS_MAP = new Map();\n\n/**\n * The class is used to get or set the default options of different aspects of\n * this library.\n *\n * This class accesses an internal `Map` object. The key of the map is the name\n * of aspects, and the value of the map is an object representing the default\n * options of the aspect.\n *\n * For example, the default options of the `assign()` method of the class\n * decorated by `@Model` is stored in the key `assign`. That is,\n * `DefaultOption.get('assign')` returns the object representing the default\n * options of the `assign()` method.\n *\n * The program can change the default options with `DefaultOptions.set('key', options)`\n * method.\n *\n * Currently, the following aspects are supported:\n * - `assign`: the default options of the `Class.prototype.assign()`,\n * `Class.create()`, `Class.createArray()`, `Class.createPage()`,\n * `Class.parseJsonString()` methods of the class decorated by `@Model`.\n * - `toJSON`: the default options of the `Class.prototype.toJSON()`,\n * `Class.prototype.toJsonString()` methods of the class decorated by `@Model`.\n *\n * @author Haixing Hu\n */\nclass DefaultOptions {\n /**\n * Gets the default options of the specified aspect.\n *\n * ##### Usage example:\n *\n * ```js\n * const opt1 = DefaultOptions.get('assign');\n * expect(opt1.convertNaming).toBe(false);\n * opt1.convertNaming = true;\n * const opt2 = DefaultOptions.get('assign');\n * expect(opt2.convertNaming).toBe(false);\n * ```\n *\n * @param {string} aspect\n * the name of the aspect.\n * @return {object}\n * the object representing the default options of the aspect, or `undefined`\n * if the aspect does not exist. Note that the returned object is a deep\n * cloned copy of the object stored in the internal map, so that the\n * modification of the returned object will **not** affect the default\n * options stored in the internal map.\n * @see DefaultOptions.merge\n * @see DefaultOptions.set\n * @author Haixing Hu\n */\n static get(aspect) {\n const result = DEFAULT_OPTIONS_MAP.get(aspect);\n return result ? clone(result) : undefined;\n }\n\n /**\n * Gets the default options of the specified aspect, merging the provided\n * default options into the returned object.\n *\n * **NOTE:** This function does **NOT** change the default options stored in the\n * internal map, instead, it returns a new object representing the merged options.\n *\n * ##### Usage example:\n *\n * ```js\n * const opt1 = DefaultOptions.get('assign');\n * expect(opt1.convertNaming).toBe(false);\n * const opt2 = DefaultOptions.merge('assign', { convertNaming: true });\n * expect(opt2.convertNaming).toBe(true);\n * expect(opt1.convertNaming).toBe(false);\n * const opt3 = DefaultOptions.merge('assign', null);\n * expect(opt3.convertNaming).toBe(false);\n * ```\n *\n * @param {string} aspect\n * the name of the aspect.\n * @param {undefined|null|object} options\n * the provided options of the aspect.\n * @return {object}\n * the default options of the specified aspect, merging the provided\n * options into the returned object.\n * @see DefaultOptions.get\n * @see DefaultOptions.set\n * @author Haixing Hu\n */\n static merge(aspect, options) {\n const result = DEFAULT_OPTIONS_MAP.get(aspect);\n if (result === undefined) {\n return clone(options);\n } else {\n return clone({ ...result, ...options });\n }\n }\n\n /**\n * Sets the default options of the specified aspect.\n *\n * ##### Usage example:\n *\n * ```js\n * const opt1 = DefaultOptions.get('assign');\n * expect(opt1.convertNaming).toBe(false);\n * DefaultOptions.set('assign', { convertNaming: true });\n * const opt2 = DefaultOptions.get('assign');\n * expect(opt2.convertNaming).toBe(true);\n * expect(opt1.convertNaming).toBe(false);\n * ```\n *\n * @param {string} aspect\n * the name of the aspect.\n * @param {object} options\n * the new default options of the aspect to be set. This function will\n * merge the new options into the old default options of the aspect. If\n * the new options have the same property as the old default options stored\n * in the internal map, the value of the new options will override the\n * value of the old default options; otherwise, the new property will be\n * added to the old default options.\n * @see DefaultOptions.get\n * @see DefaultOptions.merge\n * @author Haixing Hu\n */\n static set(aspect, options) {\n const newOptions = clone(options);\n const oldOptions = DEFAULT_OPTIONS_MAP.get(aspect);\n if (oldOptions === undefined) {\n DEFAULT_OPTIONS_MAP.set(aspect, newOptions);\n } else {\n DEFAULT_OPTIONS_MAP.set(aspect, { ...oldOptions, ...newOptions });\n }\n }\n\n /**\n * Resets the default options to factory settings.\n *\n * @param {string|undefined} aspect\n * the name of the aspect to be reset. If this parameter is `undefined`,\n * all aspects will be reset.\n * @author Haixing Hu\n */\n static reset(aspect = undefined) {\n if (aspect) {\n switch (aspect) {\n case 'assign':\n DEFAULT_OPTIONS_MAP.set('assign', new DefaultAssignmentOptions());\n break;\n case 'toJSON':\n DEFAULT_OPTIONS_MAP.set('toJSON', new DefaultToJsonOptions());\n break;\n default:\n throw new Error(`Unknown aspect: ${aspect}`);\n }\n } else {\n DEFAULT_OPTIONS_MAP.set('assign', new DefaultAssignmentOptions());\n DEFAULT_OPTIONS_MAP.set('toJSON', new DefaultToJsonOptions());\n }\n }\n}\n\nDefaultOptions.reset();\n\nexport default DefaultOptions;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nconst KEY_CLASS_CATEGORY = '__cd_category__';\n\nconst KEY_CLASS_DEFAULT_INSTANCE = '__cd_default_instance__';\n\nconst KEY_CLASS_NEXT_ID = '__cd_next_id__';\n\nconst KEY_CLASS_NAME_FIELD = '__cd_name_field__';\n\nconst KEY_CLASS_FIELDS_METADATA = '__cd_fields_metadata__';\n\nconst KEY_FIELD_TYPE = '__type__';\n\nconst KEY_FIELD_ELEMENT_TYPE = '__element_type__';\n\nconst KEY_FIELD_NULLABLE = '__nullable__';\n\nconst KEY_FIELD_NON_EMPTY = '__empty__';\n\nconst KEY_FIELD_LABEL = '__label__';\n\nconst KEY_FIELD_PAYLOAD = '__payload__';\n\nconst KEY_FIELD_NORMALIZER = '__normalizer__';\n\nconst KEY_FIELD_VALIDATOR = '__validator__';\n\nexport {\n KEY_CLASS_CATEGORY,\n KEY_CLASS_DEFAULT_INSTANCE,\n KEY_CLASS_NEXT_ID,\n KEY_CLASS_NAME_FIELD,\n KEY_CLASS_FIELDS_METADATA,\n KEY_FIELD_TYPE,\n KEY_FIELD_ELEMENT_TYPE,\n KEY_FIELD_NULLABLE,\n KEY_FIELD_NON_EMPTY,\n KEY_FIELD_LABEL,\n KEY_FIELD_PAYLOAD,\n KEY_FIELD_NORMALIZER,\n KEY_FIELD_VALIDATOR,\n};\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\n/**\n * A map used to cache the metadata of each class.\n *\n * @type {Map<Function, Object>}\n * @author Haixing Hu\n * @private\n */\nconst METADATA_CACHE = new WeakMap();\n\n/**\n * A cache object used to get and put metadata of classes conveniently.\n *\n * This object is useful during the implementation of customized decorators,\n * since the stage 3 decorator metadata proposal specifies that \"the metadata\n * is accessible via the `Symbol.metadata` property on the class definition\n * after decoration\", therefore it is not accessible via `Class[Symbol.metadata]`\n * in the implementation of a customized decorator of the `Class` (since in that\n * time the class has not been fully decorated).\n *\n * @author Haixing Hu\n * @private\n */\nconst classMetadataCache = {\n /**\n * Gets the metadata of a class.\n *\n * @param {Function} Class\n * A class, i.e., the constructor function of a class.\n * @returns {Object}\n * The metadata associated with the class. If the class has no metadata\n * defined yet, this function will create an empty metadata and return it.\n * Therefore, the returned value will never be `undefined` nor `null`.\n */\n get(Class) {\n const result = METADATA_CACHE.get(Class);\n if (result) {\n return result;\n } else {\n const metadata = Class[Symbol.metadata];\n if (metadata) {\n METADATA_CACHE.set(Class, metadata);\n return metadata;\n } else {\n // NOTE: Class[Symbol.metadata] is readonly, so we can't set it directly.\n return {};\n }\n }\n },\n\n /**\n * Sets the metadata of a class.\n *\n * @param {Function} Class\n * A class, i.e., the constructor function of a class.\n * @param {Object} metadata\n * The metadata associated with the class.\n */\n set(Class, metadata) {\n METADATA_CACHE.set(Class, metadata);\n },\n};\n\nexport default classMetadataCache;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport classMetadataCache from '../class-metadata-cache';\n\n/**\n * Get the specified attribute value from the metadata of the specified class.\n *\n * @param {function} Class\n * The constructor of the specified class.\n * @param {string} key\n * The key of the specified attribute.\n * @return {object}\n * The value associated with the specified key in the metadata of the\n * specified class.\n * @throws Error\n * If the metadata of the specified class has not been cached.\n * @author Haixing Hu\n * @private\n */\nfunction getClassMetadata(Class, key) {\n const metadata = classMetadataCache.get(Class);\n // if (!metadata) {\n // throw new Error(`The metadata of the class \"${Class.name}\" has not been cached.`);\n // }\n if (!metadata) {\n return undefined;\n }\n return metadata[key];\n}\n\nexport default getClassMetadata;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { KEY_CLASS_CATEGORY } from './impl/metadata-keys';\nimport getClassMetadata from './impl/utils/get-class-metadata';\n\n/**\n * Tests whether a specified class is an enumeration class decorated by `@Enum`.\n *\n * @param {function} Class\n * The constructor function of a class.\n * @return {boolean}\n * `true` if the specified class is an enumeration class decorated by\n * `@Enum`; `false` otherwise.\n * @author Haixing Hu\n */\nfunction isEnumClass(Class) {\n if (typeof Class !== 'function') {\n return false;\n }\n const category = getClassMetadata(Class, KEY_CLASS_CATEGORY);\n return category === 'enum';\n}\n\nexport default isEnumClass;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport isEnumClass from './is-enum-class';\n\n/**\n * The normalizer used to normalize the value of an enumeration.\n *\n * @param {function} EnumClass\n * The constructor function of an enumeration class.\n * @return {function(string): EnumClass}\n * The normalizer function for the specified enumeration class.\n */\nfunction enumNormalizer(EnumClass) {\n return (value) => {\n if (!isEnumClass(EnumClass)) {\n throw new TypeError('The argument must be the constructor function of an '\n + 'enumeration class decorated by `@Enum`.');\n }\n return EnumClass.of(value);\n };\n}\n\nexport default enumNormalizer;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport typeInfo from '@qubit-ltd/typeinfo';\nimport enumNormalizer from './enum-normalizer';\nimport isEnumClass from './is-enum-class';\n\n/**\n * A default normalizer for a non-static class field.\n *\n * This normalizer does the following things:\n * - If the value is `undefined` or `null`, it returns the value itself;\n * - If the value is a string, it returns the trimmed string;\n * - If the value is a collection, it returns the same type of collection whose\n * elements are normalized by the default normalizer;\n * - If the value is an object, it returns the result of calling the `normalize()`\n * method of the object, if the object has such a method;\n * - Otherwise, it returns the value itself.\n *\n * Currently, the following JavaScript build-in collection types are supported:\n * - `Array`, `Int8Array`, `Uint8Array`, `Uint8ClampedArray`, `Int16Array`,\n * `Uint16Array`, `Int32Array`, `Uint32Array`, `Float32Array`, `Float64Array`,\n * `BigInt64Array`, `BigUint64Array`: the normalization function will be called\n * to normalize each element in the collection.\n * - `Set`, `WeakSet`: the normalization function will be called to normalize\n * each entry in the set.\n * - `Map`, `WeakMap`: the normalization function will be called to normalize\n * each value in the map.\n *\n * @param {any} value\n * The value to be normalized.\n * @param {object} context\n * The context of normalization. It is an object with the following fields:\n * - `path: string`, the path of the root object of this object.\n * The default value of this option is `''`.\n * - `type: function`, the type of the field to be normalized.\n * - `types: object`, the additional information about types of fields of\n * classes. The keys of this object are the path of the fields or\n * sub-fields of this object, the values are the type of the fields,\n * represented as the constructor function of the type. The path of the\n * root of this object is an empty, therefore the path of the direct field of\n * this object is of the form `'.field'`, and the path of the sub-field of\n * a field is of the form `'.field.subField'`. The default value of this\n * option is `{}`.\n * - `elementTypes: object`, the additional information about types of\n * elements of fields of classes. The keys of this object are the path of\n * the fields or sub-fields of the target object, the values are the type\n * of the elements, represented as the constructor function of the type.\n * The default value of this option is `{}`.\n * @return {any}\n * The normalized value.\n * @author Haixing Hu\n */\nfunction defaultNormalizer(value, context = {}) {\n context ??= {};\n context.path ??= '';\n const info = typeInfo(value);\n switch (info.category) {\n case 'string':\n if (isEnumClass(context.type)) {\n // special treatment for enum class\n const normalizer = enumNormalizer(context.type);\n return normalizer(value);\n } else {\n return value.trim();\n }\n case 'array': // drop down\n case 'typed-array':\n return value.map((v) => defaultNormalizer(v));\n case 'map':\n return new Map(Array.from(value, ([k, v]) => [k, defaultNormalizer(v, context)]));\n case 'set':\n return new Set(Array.from(value, (v) => defaultNormalizer(v, context)));\n default:\n if (info.isBuiltIn) {\n return value;\n }\n if (typeof value.normalize === 'function') {\n // NOTE: we CANNOT just `return value.normalize()`, because the incorrect\n // implementation of `normalize()` method may return nothing.\n const newContext = {\n path: context.path,\n types: context.types,\n elementTypes: context.elementTypes,\n };\n value.normalize('*', newContext);\n }\n return value;\n }\n}\n\nexport default defaultNormalizer;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport classMetadataCache from '../class-metadata-cache';\nimport { KEY_CLASS_DEFAULT_INSTANCE } from '../metadata-keys';\n\n/**\n * Get the default instance of the specified class, or create a new instance if\n * it does not exist.\n *\n * @param {function} Class\n * The constructor of the specified class.\n * @returns {object}\n * The default instance of the specified class, or a new instance will be\n * created if it does not exist.\n * @author Haixing Hu\n * @private\n */\nexport function getDefaultInstance(Class) {\n if (Class.prototype === Object.prototype) { // Object is a special case\n return {};\n }\n const metadata = classMetadataCache.get(Class);\n let obj = metadata[KEY_CLASS_DEFAULT_INSTANCE];\n if (!(obj instanceof Class)) {\n // Note that the metadata of a class can inherit the metadata of its parent\n // class. Therefore, if the parent class has a default instance stored in\n // its metadata, it can be accessed by the child class. That's why we have\n // to check whether the default instance is an instance of the specified\n // class.\n obj = new Class();\n metadata[KEY_CLASS_DEFAULT_INSTANCE] = obj;\n }\n return obj;\n}\n\nexport default getDefaultInstance;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { NamingStyle } from '@qubit-ltd/naming-style';\n\n/**\n * Gets the existing field of the object with different naming styles.\n *\n * @param {string} key\n * the key of the object.\n * @param {object} obj\n * the specified object.\n * @return {undefined|string}\n * If the object contains the key with different naming styles, then return the\n * name of the field with different naming styles; otherwise, return `undefined`.\n * @author Haixing Hu\n * @private\n */\nfunction getExistFieldWithDifferentNamingStyle(key, obj) {\n const styles = NamingStyle.values();\n for (const s1 of styles) {\n for (const s2 of styles) {\n const newKey = s1.to(s2, key);\n if (Object.prototype.hasOwnProperty.call(obj, newKey)) {\n return newKey;\n }\n }\n }\n return undefined;\n}\n\nexport default getExistFieldWithDifferentNamingStyle;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { NamingStyle } from '@qubit-ltd/naming-style';\n\n/**\n * Gets the name of the field of the source object from the corresponding field\n * of the target object.\n *\n * @param {string} targetField\n * The key of the target object.\n * @param {object} options\n * The options of the cloning algorithm.\n * @return {string}\n * The corresponding key of the source object.\n * @author Haixing Hu\n * @private\n */\nfunction getSourceField(targetField, options) {\n if (options?.convertNaming === true) {\n const sourceNamingStyle = NamingStyle.of(options.sourceNamingStyle);\n const targetNamingStyle = NamingStyle.of(options.targetNamingStyle);\n return targetNamingStyle.to(sourceNamingStyle, targetField);\n } else {\n return targetField;\n }\n}\n\nexport default getSourceField;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { isTypedArray, isCollection } from '@qubit-ltd/type-detect';\n\n/**\n * Gets the element types of a collection.\n *\n * @param {any} obj\n * The collection object.\n * @return {Function}\n * The element type of the collection, or `null` if the object is not a\n * collection, or the collection is empty, or the element type cannot be\n * determined.\n * @author Haixing Hu\n * @private\n */\nfunction getCollectionElementType(obj) {\n if (Array.isArray(obj) || isTypedArray(obj)) {\n if ((obj.length > 0) && (typeof obj[0]?.constructor === 'function')) {\n return obj[0].constructor;\n }\n } else if (isCollection(obj)) {\n if (obj.size > 0) {\n const first = obj.values().next().value;\n if (first && (typeof first.constructor === 'function')) {\n return first.constructor;\n }\n }\n }\n return null;\n}\n\nexport default getCollectionElementType;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { KEY_CLASS_FIELDS_METADATA } from '../metadata-keys';\n\n/**\n * Gets the metadata object for the field of the specified class, or creates a\n * new one if it does not exist.\n *\n * @param {object} metadata\n * The metadata of the specified class.\n * @param {string} field\n * The name of the specified field.\n * @returns {object}\n * The metadata object for the field of the specified class, creating a new\n * one if it does not exist.\n * @author Haixing Hu\n * @private\n */\nfunction getFieldMetadataObject(metadata, field) {\n metadata[KEY_CLASS_FIELDS_METADATA] ??= {};\n const fieldsMetadata = metadata[KEY_CLASS_FIELDS_METADATA];\n fieldsMetadata[field] ??= {};\n return fieldsMetadata[field];\n}\n\nexport default getFieldMetadataObject;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport getFieldMetadataObject from './get-field-metadata-object';\n\n/**\n * Gets the specified attribute value of the metadata of the specified field\n * of the specified class.\n *\n * @param {object} metadata\n * The metadata of the specified class.\n * @param {string} field\n * The name of the specified field.\n * @param {string} key\n * The key of the specified attribute for the specified field.\n * @return {object}\n * The attribute value associated with the specified key in the metadata of\n * the specified field of the specified class, or `undefined` if it does\n * not exist.\n * @author Haixing Hu\n * @private\n */\nfunction getFieldMetadata(metadata, field, key) {\n const md = getFieldMetadataObject(metadata, field);\n return (md ? md[key] : undefined);\n}\n\nexport default getFieldMetadata;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport classMetadataCache from '../class-metadata-cache';\nimport { KEY_FIELD_ELEMENT_TYPE } from '../metadata-keys';\nimport getCollectionElementType from './get-collection-element-type';\nimport getDefaultInstance from './get-default-instance';\nimport getFieldMetadata from './get-field-metadata';\n\n/**\n * Gets the element type of a field of an object.\n *\n * The function will first check the annotated element type information of the\n * specified field of the object. If the annotated type information is found, the\n * function will return it. Otherwise, the function will check the additional\n * type information provided by the options. If the additional type information\n * is found, the function will return it. Otherwise, the function will return\n * `null`.\n *\n * @param {function} Class\n * The constructor of the class of the object.\n * @param {string} field\n * the name of the field.\n * @param {string} path\n * the path of the field in the property tree of the original root object.\n * @param {object} options\n * the additional options for the assignment.\n * @return {function|null}\n * the element type of the specified field of the object, or `null` if the\n * field element type cannot be inferred.\n * @private\n * @author Haixing Hu\n */\nfunction getFieldElementType(Class, field, path = undefined, options = {}) {\n path ??= `.${field}`;\n options ??= {};\n // try to find the annotated element type information\n const metadata = classMetadataCache.get(Class);\n const annotatedElementType = getFieldMetadata(metadata, field, KEY_FIELD_ELEMENT_TYPE);\n if (annotatedElementType) {\n if (typeof annotatedElementType !== 'function') {\n throw new TypeError(`The annotated element type of '${Class.name}.${path}' is not a function.`);\n }\n return annotatedElementType;\n }\n // try to find the additional type information provided by the options\n if (options && options.elementTypes && options.elementTypes[path]) {\n const result = options.elementTypes[path];\n if (typeof result !== 'function') {\n throw new TypeError(`The target element type of '${Class.name}.${path}' is not a function.`);\n }\n return result;\n }\n // try to find the type information from the default field value\n const defaultInstance = getDefaultInstance(Class);\n const defaultFieldValue = defaultInstance[field];\n if ((defaultFieldValue !== undefined) && (defaultFieldValue !== null)) {\n const elementType = getCollectionElementType(defaultFieldValue);\n if (elementType !== null && elementType !== undefined) {\n return elementType;\n }\n }\n // otherwise returns null\n return null;\n}\n\nexport default getFieldElementType;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport classMetadataCache from '../class-metadata-cache';\nimport { KEY_FIELD_TYPE } from '../metadata-keys';\nimport getDefaultInstance from './get-default-instance';\nimport getFieldMetadata from './get-field-metadata';\n\n/**\n * Gets the type of the specified field of an object.\n *\n * The function will first check the annotated type information of the specified\n * field of the object. If the annotated type information is found, the function\n * will return it. Otherwise, the function will check the additional type\n * information provided by the options. If the additional type information is\n * found, the function will return it. Otherwise, the function will return\n * `null`.\n *\n * @param {function} Class\n * The constructor of the class of the object.\n * @param {string} field\n * the name of the field.\n * @param {string} path\n * the path of the field in the property tree of the original root object.\n * @param {object} options\n * the additional options for the assignment.\n * @return {function|null}\n * the type of the specified field of the object, or `null` if the field\n * type cannot be inferred.\n * @private\n * @author Haixing Hu\n */\nfunction getFieldType(Class, field, path = undefined, options = {}) {\n path ??= `.${field}`;\n options ??= {};\n // try to find the annotated type information\n const metadata = classMetadataCache.get(Class);\n const annotatedType = getFieldMetadata(metadata, field, KEY_FIELD_TYPE);\n if (annotatedType) {\n if (typeof annotatedType !== 'function') {\n throw new TypeError(`The annotated type of '${Class.name}.${path}' is not a function.`);\n }\n return annotatedType;\n }\n // try to find the additional type information provided by the options\n if (options && options.types && options.types[path]) {\n const result = options.types[path];\n if (typeof result !== 'function') {\n throw new TypeError(`The target type of '${Class.name}.${path}' is not a function.`);\n }\n return result;\n }\n // try to find the type information from the default field value\n const defaultInstance = getDefaultInstance(Class);\n const defaultFieldValue = defaultInstance[field];\n if ((defaultFieldValue !== undefined)\n && (defaultFieldValue !== null)\n && (typeof defaultFieldValue.constructor === 'function')) {\n return defaultFieldValue.constructor;\n }\n // otherwise returns null\n return null;\n}\n\nexport default getFieldType;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\n/**\n * Determine whether the prototype of a specified class has the specified\n * prototype function.\n *\n * Note that the function may be inherited from its parent class.\n *\n * @param {function} Class\n * Constructor for the specified class.\n * @param {string} name\n * The name of the specified prototype function.\n * @returns {Boolean}\n * Whether the prototype of the specified class has the specified prototype\n * function. Note that the function may be inherited from its parent class.\n * @see hasOwnPrototypeFunction\n * @author Haixing Hu\n * @private\n */\nfunction hasPrototypeFunction(Class, name) {\n return (Class !== null)\n && (Class.prototype)\n && Reflect.has(Class.prototype, name)\n && (typeof Class.prototype[name] === 'function');\n}\n\nexport default hasPrototypeFunction;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { isString } from '@qubit-ltd/type-detect';\n\n/**\n * Returns the enumerator of an enumeration class which has the specified value.\n *\n * @param {function} Class\n * The constructor of the specified enumeration class.\n * @param {string} value\n * The value of the enumerator to be returned. If the value is a primitive\n * string or a `String` object, it will be trimmed and converted to an\n * uppercase string.\n * @returns {undefined|Class}\n * The enumerator of the specified enumeration class which has the specified\n * value; or `undefined` if there is no such enumerator.\n * @author Haixing Hu\n * @private\n */\nfunction ofValueImpl(Class, value) {\n if (!isString(value)) {\n return undefined;\n }\n const key = String(value).trim().toUpperCase(); // ensure the value is a primitive string and trim it\n const e = Class[key];\n return (e instanceof Class ? e : undefined);\n}\n\nexport default ofValueImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport clone from '@qubit-ltd/clone';\nimport { isBuiltInClass } from '@qubit-ltd/type-detect';\nimport { isUndefinedOrNull } from '@qubit-ltd/common-util';\nimport CLONE_OPTIONS from './clone-options';\nimport DefaultOptions from '../../default-options';\nimport defaultNormalizer from '../../default-normalizer';\nimport getClassMetadata from '../utils/get-class-metadata';\nimport getDefaultInstance from '../utils/get-default-instance';\nimport getExistFieldWithDifferentNamingStyle from '../utils/get-exist-field-with-different-naming-style';\nimport getSourceField from '../utils/get-source-field';\nimport getFieldElementType from '../utils/get-field-element-type';\nimport getFieldType from '../utils/get-field-type';\nimport hasPrototypeFunction from '../utils/has-prototype-function';\nimport ofValueImpl from '../enum/of-value-impl';\nimport { KEY_CLASS_CATEGORY } from '../metadata-keys';\n\nconst Impl = {\n /**\n * Gets the names of all fields of the default instance of target class.\n *\n * If the parent class of the target class has an `assign()` method, the\n * `assign()` method of the parent class is called firstly, and then the\n * fields owned by the parent class are excluded.\n *\n * @param {object} target\n * The target object to be assigned to.\n * @param {object} source\n * The source object to assigned from, which can be `null` or `undefined`,\n * or a plain old JavaScript object without class information.\n * @param {function} type\n * The type of the target object, i.e., the constructor of the class of\n * the target object.\n * @param {object} options\n * the additional options for the assignment.\n * @returns {string[]}\n * The names of all fields of the default instance of the target class,\n * excluding the fields owned by the parent class of the target class if\n * the parent class has an `assign()` method.\n * @author Haixing Hu\n * @private\n */\n getAllFields(target, source, { type, options }) {\n // Get all names of fields of the default object of the `type`\n const fields = Object.keys(target);\n // call the `assign()` method in the parent classes of the target class\n const parentType = Object.getPrototypeOf(type);\n if (hasPrototypeFunction(parentType, 'assign')) {\n // If the parent class or its ancestor classes has an `assign()` method,\n // call the `assign()` method of the parent class.\n parentType.prototype.assign.call(target, source, options);\n // then exclude fields owned by the parent class\n const parentInstance = getDefaultInstance(parentType);\n const parentFields = Object.keys(parentInstance);\n return fields.filter((f) => !parentFields.includes(f));\n } else {\n return fields;\n }\n },\n\n /**\n * Copies all configurable, enumerable, and non-read-only properties of the\n * source object to the target object without naming conversion.\n *\n * @param {object} target\n * The target object.\n * @param {object} source\n * The source object, which may be `null` or `undefined`.\n * @author Haixing Hu\n * @private\n */\n copyPropertiesWithoutNamingConversion(target, source) {\n if (isUndefinedOrNull(source)) {\n return;\n }\n Object.keys(target).forEach((key) => {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = clone(source[key], CLONE_OPTIONS);\n }\n });\n },\n\n /**\n * Clones an enumeration value.\n *\n * @param {string|any} source\n * The source value being cloned.\n * @param {string} sourcePath\n * The path of the source object in the property tree of the original root\n * object.\n * @param {Function} targetType\n * The constructor of the enumeration class of the target value. Note that\n * this enumeration class **must** be decorated by `@Enum`.\n * @param {any|undefined} defaultInstance\n * The default instance of the source value.\n * @return {targetType|*|null}\n * The target value deeply cloned from the source value, whose type is\n * exactly the same as the specified type.\n * @author Haixing Hu\n * @private\n */\n cloneEnum(source, { sourcePath, targetType, defaultInstance }) {\n if (source === null) {\n return null;\n } else if (source === undefined) {\n return defaultInstance;\n } else if (source instanceof targetType) {\n return source; // enumerators are singletons\n } else if (typeof source === 'string') {\n // the blank string is treated as null enumerator\n if (source.trim().length === 0) {\n return defaultInstance;\n }\n // convert the string representation to the enumerator\n const e = ofValueImpl(targetType, source);\n if (e === undefined) {\n throw new RangeError(`The value of property '${sourcePath}' of the `\n + `source object is not an enumerator of ${targetType.name}: ${source}`);\n }\n return e;\n } else {\n throw new RangeError(`The value of property '${sourcePath}' of the source `\n + `object is not an enumerator of ${targetType.name}: ${source}`);\n }\n },\n\n /**\n * Clones an object of a known type.\n *\n * @param {object} source\n * The source object being cloned.\n * @param {string} targetPath\n * The path of the target object in the property tree of the original root\n * object.\n * @param {string} sourcePath\n * The path of the source object in the property tree of the original root\n * object.\n * @param {function} targetType\n * The constructor of the class of the cloned target object.\n * @param {object} defaultInstance\n * A default instance in the class of the target object. If a certain\n * attribute value of the target object does not exist in the source\n * object or is null, the corresponding attribute value of this default\n * instance is used to assign the corresponding attribute of the target\n * object. Note that this argument may be `null` or `undefined`.\n * @param {object} options\n * the additional options for the assignment.\n * @returns\n * A target object deeply cloned from the source object, whose type is\n * exactly the same as the specified type.\n * @author Haixing Hu\n * @private\n */\n cloneWithType(source, { targetPath, sourcePath, targetType, defaultInstance, options }) {\n if (isUndefinedOrNull(source)) {\n // If the source object is nullish, directly deep clone the default object\n // without naming conversion\n return clone(defaultInstance, CLONE_OPTIONS);\n }\n if (isBuiltInClass(targetType)) {\n // For JS built-in standard types, directly deep clone the source object\n // without naming conversion\n if (source === null) {\n return null;\n } else if (source === undefined) {\n return defaultInstance;\n } else if (source.constructor === targetType) {\n return clone(source, CLONE_OPTIONS);\n } else {\n console.warn(`The value of the property '${sourcePath}' of the source `\n + `object is not an instance of ${targetType.name}:`, source);\n // Still clone the source object even if it is not an instance of the\n // target type\n return clone(source, CLONE_OPTIONS);\n }\n }\n const category = getClassMetadata(targetType, KEY_CLASS_CATEGORY);\n switch (category) {\n case 'enum':\n return this.cloneEnum(source, {\n sourcePath,\n targetType,\n defaultInstance,\n });\n case 'model':\n default: {\n // Construct a target value based on the source type\n /* eslint-disable-next-line new-cap */\n const target = new targetType();\n // Recursively assign each attribute value of `source` to `target`\n return this.doAssign(target, source, {\n targetPath,\n sourcePath,\n targetType,\n defaultInstance,\n options,\n });\n }\n }\n },\n\n /**\n * Clones an array whose element types are known.\n *\n * @param {object} sourceArray\n * The source array being cloned.\n * @param {string} targetPath\n * The path of the target array in the property tree of the original root\n * object.\n * @param {string} sourcePath\n * The path of the source object in the property tree of the original root\n * object.\n * @param {function} elementType\n * The constructor of the class of the target array elements to be cloned.\n * @param {object} defaultArray\n * The default array, which may be `undefined` or `null`.\n * @param {object} options\n * the additional options for the assignment.\n * @returns\n * A target array deeply cloned from the source array, whose element type\n * is exactly the same as the specified element type.\n * @author Haixing Hu\n * @private\n */\n cloneArrayWithElementType(sourceArray, { targetPath, sourcePath, elementType, defaultArray, options }) {\n if (!Array.isArray(sourceArray)) {\n console.error(`The value of the property '${sourcePath}' of the source `\n + 'object should be an array:', sourceArray);\n // clone the default array without naming conversion\n return clone(defaultArray, CLONE_OPTIONS);\n }\n if (isBuiltInClass(elementType)) {\n // For JS built-in standard element types, directly deep clone the array\n // without naming conversion\n return clone(sourceArray, CLONE_OPTIONS);\n }\n const elementTypeCategory = getClassMetadata(elementType, KEY_CLASS_CATEGORY);\n switch (elementTypeCategory) {\n case 'enum':\n // For enumeration classes, because enumeration types are always\n // expressed in string form, we only need to copy the source string array.\n return sourceArray.map((sourceElement, index) => this.cloneEnum(sourceElement, {\n sourcePath: `${sourcePath}[${index}]`,\n targetType: elementType,\n defaultInstance: (defaultArray ? defaultArray[index] : undefined),\n }));\n case 'model':\n default: {\n // For non-enumerated element classes, create a target array of the same\n // element type, and assign the values in the source array to the target\n // array one by one.\n const defaultElement = getDefaultInstance(elementType);\n return sourceArray.map((sourceElement, index) => {\n if (isUndefinedOrNull(sourceElement)) {\n // If the source element is nullish, directly returns it\n return sourceElement;\n }\n // Create an element from the target array\n /* eslint-disable-next-line new-cap */\n const targetElement = new elementType();\n // Recursively assign each attribute value of `sourceElement` to `targetElement`.\n // Use `defaultElement` as default instance\n const defaultInstance = ((defaultArray && defaultArray[index]) ? defaultArray[index] : defaultElement);\n // Recursively assign each element of `sourceArray` to `targetArray`\n this.doAssign(targetElement, sourceElement, {\n targetPath: `${targetPath}[${index}]`,\n sourcePath: `${sourcePath}[${index}]`,\n targetType: elementType,\n defaultInstance,\n options,\n });\n return targetElement;\n });\n }\n }\n },\n\n /**\n * Clones an object of an unknown type.\n *\n * @param {object} source\n * The source object being cloned.\n * @param {string} targetPath\n * The path of the target object in the property tree of the original root\n * object.\n * @param {string} sourcePath\n * The path of the source object in the property tree of the original root\n * object.\n * @param {object} defaultInstance\n * A default instance in the class of the target object. If a certain\n * attribute value of the target object does not exist in the source\n * object or is null, the corresponding attribute value of this default\n * instance is used to assign the corresponding attribute of the target\n * object. Note that this argument may be `null` or `undefined`.\n * @param {object} options\n * the additional options for the assignment.\n * @returns\n * A target object deeply cloned from the source object, whose type is\n * exactly the same as the default object.\n * @author Haixing Hu\n * @private\n */\n cloneNoType(source, { targetPath, sourcePath, defaultInstance, options }) {\n // If the default instance is nullish, directly deep clone the source object\n if (isUndefinedOrNull(defaultInstance)) {\n // clone the source with naming conversion options\n return clone(source, {\n ...CLONE_OPTIONS,\n convertNaming: options.convertNaming,\n sourceNamingStyle: options.sourceNamingStyle,\n targetNamingStyle: options.targetNamingStyle,\n });\n }\n // If the property value of the target object is an object, we must create\n // an object of the same prototype and copy the property values of the\n // source object\n const Class = Object.getPrototypeOf(defaultInstance).constructor;\n const target = new Class();\n // Recursively assign each attribute value of `source` to `target`\n return this.doAssign(target, source, {\n targetPath,\n sourcePath,\n targetType: Class,\n defaultInstance,\n options,\n });\n },\n\n /**\n * Clones an array whose element type is unknown.\n *\n * @param {array} sourceArray\n * The source array being cloned.\n * @param {string} targetPath\n * The path of the target array in the property tree of the original root\n * object.\n * @param {string} sourcePath\n * The path of the source object in the property tree of the original root\n * object.\n * @param {array} defaultArray\n * The default array, which may be `undefined` or `null`.\n * @param {object} options\n * the additional options for the assignment.\n * @returns\n * A target array deeply cloned from the source array, whose element type\n * is exactly the same as the element type of the default array.\n * @author Haixing Hu\n * @private\n */\n cloneArrayNoElementType(sourceArray, { sourcePath, defaultArray, options }) {\n // TODO: If there is type information in its default field value, we can\n // construct an array of the same type based on the type information in\n // the default field value.\n if (Array.isArray(sourceArray)) {\n // clone the source array with naming conversion options\n return clone(sourceArray, {\n ...CLONE_OPTIONS,\n convertNaming: options.convertNaming,\n sourceNamingStyle: options.sourceNamingStyle,\n targetNamingStyle: options.targetNamingStyle,\n });\n } else {\n console.error(`The value of the property '${sourcePath}' of the source `\n + 'object should be an array:', sourceArray);\n // clone the default array without naming conversion\n return clone(defaultArray, CLONE_OPTIONS);\n }\n },\n\n /**\n * Copies all properties of a source object to a target object.\n *\n * @param {object} target\n * The target object to be assigned to.\n * @param {object} source\n * The source object to be assigned from, which can be `null` or `undefined`,\n * or a plain old JavaScript object without class information.\n * @param {string} targetPath\n * The path of the target object in the property tree of the original root\n * object.\n * @param {string} sourcePath\n * The path of the source object in the property tree of the original root\n * object.\n * @param {function} targetType\n * The type of the target object, i.e., the constructor of the class of\n * the target object.\n * @param {object} defaultInstance\n * A default instance in the class of the target object. If a certain\n * attribute value of the target object does not exist in the source\n * object or is null, the corresponding attribute value of this default\n * instance is used to assign the corresponding attribute of the target\n * object. Note that this argument may be `null` or `undefined`.\n * @param {object} options\n * the additional options for the assignment.\n * @returns\n * The target object after assignment.\n * @author Haixing Hu\n * @private\n */\n doAssign(target, source, { targetPath, sourcePath, targetType, defaultInstance, options }) {\n if (isUndefinedOrNull(source)) {\n // if source is nullish, assign the default object to the target object\n this.copyPropertiesWithoutNamingConversion(target, defaultInstance);\n } else {\n // Loops over all enumerable properties of the default instance,\n // excluding those inherited from the parent class\n const theDefaultInstance = defaultInstance ?? getDefaultInstance(targetType);\n const targetKeys = this.getAllFields(target, source, { type: targetType, options });\n targetKeys.forEach((targetField) => {\n const defaultFieldValue = theDefaultInstance[targetField];\n const targetFieldPath = `${targetPath}.${targetField}`;\n const sourceField = getSourceField(targetField, options);\n const sourceFieldPath = `${sourcePath}.${sourceField}`;\n const sourceFieldValue = source[sourceField];\n // If field of the target object is annotated with `@Type`, or the\n // `options.types` has the type information of the field, get the field type\n const targetFieldType = getFieldType(targetType, targetField, targetFieldPath, options);\n // If field of the target object is annotated with `@ElementType`,\n // or the `options.elementTypes` has the type information of the\n // field element, get the field element type\n const targetFieldElementType = getFieldElementType(targetType, targetField, targetFieldPath, options);\n if (!Object.prototype.hasOwnProperty.call(source, sourceField)) {\n // If the source object does not have the field\n // warn if the source object has a field with different naming style\n const existSourceField = getExistFieldWithDifferentNamingStyle(sourceField, source);\n if (existSourceField) {\n console.warn(`Cannot find the source property '${sourceFieldPath}' `\n + `for the target property '${targetFieldPath}'. `\n + `But the source object has a property '${sourcePath}.${existSourceField}'. `\n + 'A correct naming conversion may be needed.');\n console.warn('The source object:', source);\n console.warn('The target object:', target);\n }\n // and then copy the default field value directly.\n target[targetField] = clone(defaultFieldValue, CLONE_OPTIONS);\n } else if (isUndefinedOrNull(sourceFieldValue)) {\n // If the source object has the field, but the field value is nullish,\n // copy the nullish source field value directly.\n target[targetField] = sourceFieldValue;\n } else if (targetFieldElementType) {\n // If the field of the target object is annotated with `@ElementType`\n target[targetField] = this.cloneArrayWithElementType(sourceFieldValue, {\n targetPath: targetFieldPath,\n sourcePath: sourceFieldPath,\n elementType: targetFieldElementType,\n defaultArray: defaultFieldValue,\n options,\n });\n } else if (targetFieldType) {\n // If the field of the target object is annotated with `@Type`\n target[targetField] = this.cloneWithType(sourceFieldValue, {\n targetPath: targetFieldPath,\n sourcePath: sourceFieldPath,\n targetType: targetFieldType,\n defaultInstance: defaultFieldValue,\n options,\n });\n } else if (isUndefinedOrNull(defaultFieldValue)) {\n // If the field value of the default instance is nullish, but the\n // source object field value is not nullish, and the field is not\n // decorated with `@Type`, it is impossible to determine the type of\n // the attribute, therefore we directly clone the source object field\n // value.\n // clone the source field value with the naming conversion options\n target[targetField] = clone(sourceFieldValue, {\n ...CLONE_OPTIONS,\n convertNaming: options.convertNaming,\n sourceNamingStyle: options.sourceNamingStyle,\n targetNamingStyle: options.targetNamingStyle,\n });\n } else if (Array.isArray(defaultFieldValue)) {\n // If the field value of the target object is an array but has not\n // been annotated with `@ElementType`\n target[targetField] = this.cloneArrayNoElementType(sourceFieldValue, {\n targetPath: targetFieldPath,\n sourcePath: sourceFieldPath,\n defaultArray: defaultFieldValue,\n options,\n });\n } else if ((typeof defaultFieldValue) === 'object') {\n // If the property value of the target object is a non-null and\n // non-array object, we must create an object of the same prototype\n // and copy the property value of the source object\n target[targetField] = this.cloneNoType(sourceFieldValue, {\n targetPath: targetFieldPath,\n sourcePath: sourceFieldPath,\n defaultInstance: defaultFieldValue,\n options,\n });\n } else {\n // If the attribute value of the target object is not an object,\n // directly clone the attribute value of the source object and assign\n // it to the target object.\n target[targetField] = clone(sourceFieldValue, {\n ...CLONE_OPTIONS,\n convertNaming: options.convertNaming,\n sourceNamingStyle: options.sourceNamingStyle,\n targetNamingStyle: options.targetNamingStyle,\n });\n }\n });\n }\n if (options.normalize) {\n return defaultNormalizer(target);\n } else {\n return target;\n }\n },\n};\n\n/**\n * Assigns the specified source object to the specified target object.\n *\n * @param {function|ObjectConstructor} Class\n * The constructor of the class of the target object.\n * @param {object} target\n * The target object which will be assigned to. This object must be an\n * instance of the specified `Class`. Each fields of this object will be\n * assigned from the corresponding fields of the source object, recursively.\n * @param {object} source\n * The source object which will be assigned from. This object may be any\n * plain old JavaScript object without class information.\n * @param {null|undefined|object} options\n * the additional options for the assignment. If this argument is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('assign')`.\n * Available options are:\n * - `normalize: boolean`, indicates whether to normalize this object\n * after the assignment. The default value is `true`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * style of the target object. The default value is `false`.\n * - `sourceNamingStyle: string | NamingStyle`, the naming style of the\n * source object, i.e., the first argument of the `assign()` method.\n * The default value of this argument is {@link LOWER_UNDERSCORE}.\n * - `targetNamingStyle: string | NamingStyle`, the naming style of the\n * target object, i.e., the object calling the `assign()` method. The\n * default value of this argument is {@link LOWER_CAMEL}.\n * @return {Class}\n * The target object after assignment.\n * @see DefaultOptions.get('assign')\n * @author Haixing Hu\n * @private\n */\nfunction assignImpl(Class, target, source, options) {\n const opt = DefaultOptions.merge('assign', options);\n // If the source object is of the same class with the target object,\n // the naming conversion must be disabled\n if (source instanceof Class) {\n opt.convertNaming = false;\n }\n return Impl.doAssign(target, source, {\n targetPath: '',\n sourcePath: '',\n targetType: Class,\n defaultInstance: getDefaultInstance(Class),\n options: opt,\n });\n}\n\nexport default assignImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport assignImpl from '../impl/model/assign-impl';\n\n/**\n * The data page returned by the pagination list operation.\n *\n * @author Haixing Hu\n */\nclass Page {\n /**\n * The total number of records that meet the query conditions.\n *\n * @type {number}\n */\n totalCount = 0;\n\n /**\n * The total number of pages.\n *\n * @type {number}\n */\n totalPages = 0;\n\n /**\n * The index of the current page, starting from 0.\n *\n * @type {number}\n */\n pageIndex = 0;\n\n /**\n * The size of the current page, i.e., the number of records per page.\n *\n * @type {number}\n */\n pageSize = 0;\n\n /**\n * The content of the current page.\n *\n * @type {Array}\n */\n content = [];\n\n constructor(totalCount = 0, totalPages = 0, pageIndex = 0, pageSize = 0, content = []) {\n this.totalCount = totalCount;\n this.totalPages = totalPages;\n this.pageIndex = pageIndex;\n this.pageSize = pageSize;\n this.content = content;\n }\n\n /**\n * Assigns the properties of another page to this page.\n *\n * @param {object} obj\n * the data object, which may have a different prototype than this object.\n * @param {null|undefined|object} options\n * the additional options for the assignment. If this argument is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('assign')`.\n * Available options are:\n * - `normalize: boolean`, indicates whether to normalize this object\n * after the assignment. The default value is `true`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * style of the target object. The default value is `false`.\n * - `sourceNamingStyle: string`, the naming style of the source object,\n * i.e., the first argument of the `assign()` method. The default value\n * of this argument is `'LOWER_UNDERSCORE'`.\n * - `targetNamingStyle: string`, the naming style of the target object,\n * i.e., the object calling the `assign()` method. The default value\n * of this argument is `'LOWER_CAMEL'`.\n * - `types: object`, the additional information about types of\n * fields of classes. The keys of this object are the path of the fields\n * or sub-fields of the target object, the values are the type of the\n * fields, represented as the constructor function of the type.\n * The default value is `{}`.\n * - `elementTypes: object`, the additional information about types of\n * elements of fields of classes. The keys of this object are the path of\n * the fields or sub-fields of the target object, the values are the type\n * of the elements, represented as the constructor function of the type.\n * The default value is `{}`.\n * @returns {object}\n * the reference to this object.\n * @see DefaultOptions.get('assign')\n */\n assign(obj, options = undefined) {\n return assignImpl(Page, this, obj, options);\n }\n\n /**\n * Creates a empty page with the specified page size.\n *\n * @param pageSize\n * the size of the page.\n * @return {Page}\n * the created empty page.\n */\n static newEmpty(pageSize) {\n return new Page(0, 0, 0, pageSize, []);\n }\n\n /**\n * Gets a page of data from an array.\n *\n * @param {object} pageRequest\n * the page request.\n * @param {Array} array\n * the array of data.\n * @return {Page}\n * the specified page of data from the array.\n */\n static getFrom(pageRequest, array) {\n const totalCount = array.length;\n const pageSize = pageRequest.pageSize;\n const pageIndex = pageRequest.pageIndex;\n const totalPages = Math.ceil(totalCount / pageSize);\n const fromIndex = pageIndex * pageSize;\n const toIndex = Math.min(fromIndex + pageSize, totalCount);\n const content = array.slice(fromIndex, toIndex);\n return new Page(totalCount, totalPages, pageIndex, pageSize, content);\n }\n}\n\nexport default Page;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { deepEqual } from '@qubit-ltd/common-util';\nimport getDefaultInstance from '../utils/get-default-instance';\n\n/**\n * Tests whether the specified object of the specified model class is empty.\n *\n * @param {function} Class\n * The constructor of the specified model class.\n * @param {object} obj\n * The specified object in the specified model class.\n * @return {boolean}\n * `true` if the specified object is empty; otherwise, `false`.\n * @author Haixing Hu\n * @private\n */\nfunction isEmptyImpl(Class, obj) {\n const defaultInstance = getDefaultInstance(Class);\n return deepEqual(obj, defaultInstance);\n}\n\nexport default isEmptyImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { deepEqual } from '@qubit-ltd/common-util';\n\n/**\n * Determine whether two objects are logically equal.\n *\n * @param {object} lhs\n * The object on the left hand side, which **can** be `undefined` or `null`.\n * @param {object} rhs\n * The object on the right hand side, which **can** be `undefined` or `null`.\n * @return {boolean}\n * Whether the objects on the left hand side and right hand side are\n * logically equal.\n * @author Haixing Hu\n * @private\n */\nfunction equalsImpl(lhs, rhs) {\n if (lhs === rhs) {\n return true;\n } else if (rhs === undefined || rhs === null) {\n return (lhs === undefined || lhs === null);\n } else if (lhs === undefined || lhs === null) {\n return false;\n } else if (Object.getPrototypeOf(lhs) !== Object.getPrototypeOf(rhs)) {\n return false;\n } else {\n return deepEqual(lhs, rhs);\n }\n}\n\nexport default equalsImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport classMetadataCache from '../class-metadata-cache';\n\n/**\n * Sets the specified attribute value of the metadata of the specified class.\n *\n * @param {function} Class\n * The constructor of the specified class.\n * @param {string} key\n * The key of the specified attribute.\n * @param {any} value\n * The attribute value to be set.\n * @throws Error\n * If the metadata of the specified class has not been cached.\n * @author Haixing Hu\n * @private\n */\nfunction setClassMetadata(Class, key, value) {\n const metadata = classMetadataCache.get(Class);\n if (!metadata) {\n throw new Error(`The metadata of the class \"${Class.name}\" has not been cached.`);\n }\n metadata[key] = value;\n}\n\nexport default setClassMetadata;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport getClassMetadata from '../utils/get-class-metadata';\nimport setClassMetadata from '../utils/set-class-metadata';\nimport { KEY_CLASS_NEXT_ID } from '../metadata-keys';\n\n/**\n * Generates a unique ID for the specified object.\n *\n * @param {function} Class\n * The constructor of the specified class.\n * @param {object} obj\n * The specified object, whose `id` attribute will be set to the newly\n * generated ID.\n * @return {number}\n * The generated ID.\n * @author Haixing Hu\n * @private\n */\nfunction generateIdImpl(Class, obj) {\n const id = getClassMetadata(Class, KEY_CLASS_NEXT_ID);\n obj.id = id;\n setClassMetadata(Class, KEY_CLASS_NEXT_ID, id + 1);\n return obj.id;\n}\n\nexport default generateIdImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport hasPrototypeFunction from './has-prototype-function';\n\n/**\n * Checks whether the specified class or its parent classes have a prototype\n * method with the specified name.\n *\n * @param {function} Class\n * The constructor of the specified class.\n * @param {string} func\n * The name of the specified prototype method.\n * @throws TypeError\n * If the specified class and its parent classes do not have a prototype\n * method with the specified name.\n * @author Haixing Hu\n * @private\n */\nexport function requirePrototypeMethod(Class, func) {\n if (!hasPrototypeFunction(Class, func)) {\n throw new TypeError(`The class ${Class.name} does not implement the prototype method \"${func}()\".`);\n }\n}\n\nexport default requirePrototypeMethod;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport requirePrototypeMethod from '../utils/require-prototype-method';\nimport getDefaultInstance from '../utils/get-default-instance';\n\n/**\n * Clears all fields of an object.\n *\n * @param {function} Class\n * The constructor of the specified model class.\n * @param {object} obj\n * An object in the specified model class.\n * @returns {Class}\n * The cleared object.\n * @author Haixing Hu\n * @private\n */\nfunction clearImpl(Class, obj) {\n requirePrototypeMethod(Class, 'assign');\n const defaultInstance = getDefaultInstance(Class);\n // note that the following statement must NOT normalize the object after\n // assignment, since the default instance may be un-normalized.\n return obj.assign(defaultInstance, { normalize: false, convertNaming: false });\n}\n\nexport default clearImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport requirePrototypeMethod from '../utils/require-prototype-method';\n\n/**\n * Clones an object.\n *\n * @param {function} Class\n * The constructor of the specified model class.\n * @param {object} obj\n * The specified object in the specified model class.\n * @return {Class}\n * A clone of the specified object.\n * @author Haixing Hu\n * @private\n */\nfunction cloneImpl(Class, obj) {\n requirePrototypeMethod(Class, 'assign');\n // note that the following statement must NOT normalize the object after\n // assignment, since the default instance may be un-normalized.\n return new Class().assign(obj, { normalize: false, convertNaming: false });\n}\n\nexport default cloneImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { isTypedArray } from '@qubit-ltd/type-detect';\nimport getFieldElementType from '../utils/get-field-element-type';\n\n/**\n * Normalizes the specified array field of the specified object.\n *\n * @param {function} Class\n * The class of the object to be normalized.\n * @param {object} obj\n * The object to be normalized, which must be an instance of the `Class` class.\n * @param {string} field\n * The name of the specified field to be normalized. This function assumes\n * that the field exists and is normalizable.\n * @param {any} value\n * The value of the specified field of the specified object.\n * @param {object} options\n * The optional options for the normalization. Default value is an empty\n * object. Currently, the following options are supported:\n * - `path: string`, the path of the root object of this object.\n * The default value of this option is `''`.\n * - `types: object`, the additional information about types of fields of\n * classes. The keys of this object are the path of the fields or\n * sub-fields of this object, the values are the type of the fields,\n * represented as the constructor function of the type. The path of the\n * root of this object is an empty, therefore the path of the direct field of\n * this object is of the form `'.field'`, and the path of the sub-field of\n * a field is of the form `'.field.subField'`. The default value of this\n * option is `{}`.\n * - `elementTypes: object`, the additional information about types of\n * elements of fields of classes. The keys of this object are the path of\n * the fields or sub-fields of the target object, the values are the type\n * of the elements, represented as the constructor function of the type.\n * The default value of this option is `{}`.\n * @param {function} normalizer\n * The normalizer function of the specified field.\n * @returns {boolean}\n * If the field value is an array or a typed array, this function normalizes\n * the field of the specified object by calling the normalizer function on\n * each element in the array, and returns `true`; otherwise, this function\n * does nothing and returns `false`.\n * @author Haixing Hu\n * @private\n */\nfunction normalizeArrayField(Class, obj, field, value, options, normalizer) {\n if (Array.isArray(value) || isTypedArray(value)) {\n const fieldPath = `${options.path}.${field}`;\n const elementType = getFieldElementType(Class, field, fieldPath, options);\n const context = {\n type: elementType,\n path: fieldPath,\n types: options.types,\n elementTypes: options.elementTypes,\n };\n obj[field] = value.map((v) => normalizer(v, context));\n return true;\n }\n return false;\n}\n\nexport default normalizeArrayField;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport getFieldElementType from '../utils/get-field-element-type';\n\n/**\n * Normalizes the specified map field of the specified object.\n *\n * @param {function} Class\n * The class of the object to be normalized.\n * @param {object} obj\n * The object to be normalized, which must be an instance of the `Class` class.\n * @param {string} field\n * The name of the specified field to be normalized. This function assumes\n * that the field exists and is normalizable.\n * @param {any} value\n * The value of the specified field of the specified object.\n * @param {object} options\n * The optional options for the normalization. Default value is an empty\n * object. Currently, the following options are supported:\n * - `path: string`, the path of the root object of this object.\n * The default value of this option is `''`.\n * - `types: object`, the additional information about types of fields of\n * classes. The keys of this object are the path of the fields or\n * sub-fields of this object, the values are the type of the fields,\n * represented as the constructor function of the type. The path of the\n * root of this object is an empty, therefore the path of the direct field of\n * this object is of the form `'.field'`, and the path of the sub-field of\n * a field is of the form `'.field.subField'`. The default value of this\n * option is `{}`.\n * - `elementTypes: object`, the additional information about types of\n * elements of fields of classes. The keys of this object are the path of\n * the fields or sub-fields of the target object, the values are the type\n * of the elements, represented as the constructor function of the type.\n * The default value of this option is `{}`.\n * @param {function} normalizer\n * The normalizer function of the specified field.\n * @returns {boolean}\n * If the field value is a built-in map, this function normalizes the field\n * of the specified object by calling the normalizer function on each\n * element in the set, and returns `true`; otherwise, this function does\n * nothing and returns `false`.\n * @author Haixing Hu\n * @private\n */\nfunction normalizeMapField(Class, obj, field, value, options, normalizer) {\n if (value instanceof Map) {\n const fieldPath = `${options.path}.${field}`;\n const elementType = getFieldElementType(Class, field, fieldPath, options);\n const context = {\n type: elementType,\n path: fieldPath,\n types: options.types,\n elementTypes: options.elementTypes,\n };\n obj[field] = new Map(Array.from(value, ([k, v]) => [k, normalizer(v, context)]));\n return true;\n }\n return false;\n}\n\nexport default normalizeMapField;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport getFieldType from '../utils/get-field-type';\n\n/**\n * Normalizes the specified field of the specified object.\n *\n * @param {function} Class\n * The class of the object to be normalized.\n * @param {object} obj\n * The object to be normalized, which must be an instance of the `Class` class.\n * @param {string} field\n * The name of the specified field to be normalized. This function assumes\n * that the field exists and is normalizable.\n * @param {any} value\n * The value of the specified field of the specified object.\n * @param {object} options\n * The optional options for the normalization. Default value is an empty\n * object. Currently, the following options are supported:\n * - `path: string`, the path of the root object of this object.\n * The default value of this option is `''`.\n * - `types: object`, the additional information about types of fields of\n * classes. The keys of this object are the path of the fields or\n * sub-fields of this object, the values are the type of the fields,\n * represented as the constructor function of the type. The path of the\n * root of this object is an empty, therefore the path of the direct field of\n * this object is of the form `'.field'`, and the path of the sub-field of\n * a field is of the form `'.field.subField'`. The default value of this\n * option is `{}`.\n * - `elementTypes: object`, the additional information about types of\n * elements of fields of classes. The keys of this object are the path of\n * the fields or sub-fields of the target object, the values are the type\n * of the elements, represented as the constructor function of the type.\n * The default value of this option is `{}`.\n * @param {function} normalizer\n * The normalizer function of the specified field.\n * @returns {boolean}\n * This function always returns true.\n * @author Haixing Hu\n * @private\n */\nfunction normalizeNormalField(Class, obj, field, value, options, normalizer) {\n const fieldPath = `${options.path}.${field}`;\n const type = getFieldType(Class, field, fieldPath, options);\n const context = {\n type,\n path: fieldPath,\n types: options.types,\n elementTypes: options.elementTypes,\n };\n // call the normalizer function to normalize the field value.\n obj[field] = normalizer(value, context);\n return true;\n}\n\nexport default normalizeNormalField;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport getDefaultInstance from '../utils/get-default-instance';\n\n/**\n * Normalizes the specified nullish field of the specified object.\n *\n * @param {function} Class\n * The class of the object to be normalized.\n * @param {object} obj\n * The object to be normalized, which must be an instance of the `Class` class.\n * @param {string} field\n * The name of the specified field to be normalized. This function assumes\n * that the field exists and is normalizable.\n * @param {any} value\n * The value of the specified field of the specified object.\n * @returns {boolean}\n * If the field value is nullish, this function normalizes the field of the\n * specified object by setting its field value to the corresponding field\n * value of the default instance of the specified class, and returns `true`;\n * otherwise, this function does nothing and returns `false`.\n * @author Haixing Hu\n * @private\n */\nfunction normalizeNullishField(Class, obj, field, value) {\n if (value === undefined || value === null) {\n // For field values that are `undefined` or `null`, the normalized value\n // should be the default value of the field.\n const defaultInstance = getDefaultInstance(Class);\n obj[field] = defaultInstance[field];\n return true;\n }\n return false;\n}\n\nexport default normalizeNullishField;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport getFieldElementType from '../utils/get-field-element-type';\n\n/**\n * Normalizes the specified set field of the specified object.\n *\n * @param {function} Class\n * The class of the object to be normalized.\n * @param {object} obj\n * The object to be normalized, which must be an instance of the `Class` class.\n * @param {string} field\n * The name of the specified field to be normalized. This function assumes\n * that the field exists and is normalizable.\n * @param {any} value\n * The value of the specified field of the specified object.\n * @param {object} options\n * The optional options for the normalization. Default value is an empty\n * object. Currently, the following options are supported:\n * - `path: string`, the path of the root object of this object.\n * The default value of this option is `''`.\n * - `types: object`, the additional information about types of fields of\n * classes. The keys of this object are the path of the fields or\n * sub-fields of this object, the values are the type of the fields,\n * represented as the constructor function of the type. The path of the\n * root of this object is an empty, therefore the path of the direct field of\n * this object is of the form `'.field'`, and the path of the sub-field of\n * a field is of the form `'.field.subField'`. The default value of this\n * option is `{}`.\n * - `elementTypes: object`, the additional information about types of\n * elements of fields of classes. The keys of this object are the path of\n * the fields or sub-fields of the target object, the values are the type\n * of the elements, represented as the constructor function of the type.\n * The default value of this option is `{}`.\n * @param {function} normalizer\n * The normalizer function of the specified field.\n * @returns {boolean}\n * If the field value is a built-in set, this function normalizes the field\n * of the specified object by calling the normalizer function on each\n * element in the set, and returns `true`; otherwise, this function does\n * nothing and returns `false`.\n * @author Haixing Hu\n * @private\n */\nfunction normalizeSetField(Class, obj, field, value, options, normalizer) {\n if (value instanceof Set) {\n const fieldPath = `${options.path}.${field}`;\n const elementType = getFieldElementType(Class, field, fieldPath, options);\n const context = {\n type: elementType,\n path: fieldPath,\n types: options.types,\n elementTypes: options.elementTypes,\n };\n obj[field] = new Set(Array.from(value, (v) => normalizer(v, context)));\n return true;\n }\n return false;\n}\n\nexport default normalizeSetField;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\n/**\n * Determines whether the specified prototype function is defined in the\n * prototype of a specified class.\n *\n * @param {function} Class\n * Constructor for the specified class.\n * @param {string} name\n * The name of the specified prototype function.\n * @returns {Boolean}\n * Whether the specified prototype function is defined in the prototype of\n * the specified class.\n * @see hasPrototypeFunction\n * @author Haixing Hu\n * @private\n */\nfunction hasOwnPrototypeFunction(Class, name) {\n return (Class !== null)\n && (Class.prototype)\n && Object.prototype.hasOwnProperty.call(Class.prototype, name)\n && (typeof Class.prototype[name] === 'function');\n}\n\nexport default hasOwnPrototypeFunction;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport classMetadataCache from '../class-metadata-cache';\nimport { KEY_FIELD_NORMALIZER } from '../metadata-keys';\nimport normalizeArrayField from './normalize-array-field';\nimport normalizeMapField from './normalize-map-field';\nimport normalizeNormalField from './normalize-normal-field';\nimport normalizeNullishField from './normalize-nullish-field';\nimport normalizeSetField from './normalize-set-field';\nimport hasOwnPrototypeFunction from '../utils/has-own-prototype-function';\nimport getFieldMetadata from '../utils/get-field-metadata';\n\n/**\n * Normalizes the specified field of the specified object.\n *\n * @param {function} Class\n * The constructor of the class of the object to be normalized.\n * @param {object} obj\n * The object to be normalized, which must be an instance of the `Class` class.\n * @param {string} field\n * The name of the specified field to be normalized.\n * @param {object} options\n * The optional options for the normalization. Default value is an empty\n * object. Currently, the following options are supported:\n * - `path: string`, the path of the root object of this object.\n * The default value of this option is `''`.\n * - `types: object`, the additional information about types of fields of\n * classes. The keys of this object are the path of the fields or\n * sub-fields of this object, the values are the type of the fields,\n * represented as the constructor function of the type. The path of the\n * root of this object is an empty, therefore the path of the direct field of\n * this object is of the form `'.field'`, and the path of the sub-field of\n * a field is of the form `'.field.subField'`. The default value of this\n * option is `{}`.\n * - `elementTypes: object`, the additional information about types of\n * elements of fields of classes. The keys of this object are the path of\n * the fields or sub-fields of the target object, the values are the type\n * of the elements, represented as the constructor function of the type.\n * The default value of this option is `{}`.\n * @return {boolean}\n * `true` if the specified field exists and is normalizable; `false` otherwise.\n * @author Haixing Hu\n * @private\n */\nfunction normalizeFieldImpl(Class, obj, field, options) {\n options ??= {};\n options.path ??= '';\n if (!Object.prototype.hasOwnProperty.call(obj, field)) {\n // the field does not exist\n return false;\n }\n // If the class has a parent class, call the normalizeField of the parent class\n // to normalize the field.\n const Parent = Object.getPrototypeOf(Class);\n if (hasOwnPrototypeFunction(Parent, 'normalizeField')) {\n if (Parent.prototype.normalizeField.call(obj, field, options)) {\n // the field is normalized by its parent class\n return true;\n }\n }\n // Otherwise, use the normalizer function to normalize the field according to\n // the argument of the `@Normalizable` decorator of the field.\n // Note that the context metadata of a class is inherited from its ancestor\n // classes, therefore, we can use the metadata of the current class to get the\n // normalizer function.\n const metadata = classMetadataCache.get(Class);\n const normalizer = getFieldMetadata(metadata, field, KEY_FIELD_NORMALIZER);\n if (normalizer === undefined) {\n // the field is not decorated with @Normalizable\n return false;\n }\n const value = obj[field];\n return normalizeNullishField(Class, obj, field, value)\n || normalizeArrayField(Class, obj, field, value, options, normalizer)\n || normalizeSetField(Class, obj, field, value, options, normalizer)\n || normalizeMapField(Class, obj, field, value, options, normalizer)\n || normalizeNormalField(Class, obj, field, value, options, normalizer);\n}\n\nexport default normalizeFieldImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Normalizes the specified fields of the specified object。\n *\n * @param {function} Class\n * The constructor of the class of the object to be normalized.\n * @param {object} obj\n * The object to be normalized, which must be an instance of the `Class` class.\n * @param {string | array<string>} fields\n * The names of fields to be normalized. If it is `undefined`, `null`, or\n * the string `\"*\"`, all normalizable fields of the specified object will be\n * normalized; if it is an array of strings, all normalizable fields of the\n * specified object whose names in this array will be normalized.\n * @param {object} options\n * The optional options for the normalization. Default value is an empty\n * object. Currently, the following options are supported:\n * - `path: string`, the path of the root object of this object.\n * The default value of this option is `'.'`.\n * - `types: object`, the additional information about types of fields\n * of classes. The keys of this object are the path of the fields or\n * sub-fields of this object, the values are the type of the fields,\n * represented as the constructor function of the type. The path of\n * the root of this object is an empty, there the path of the direct\n * field of this object is of the form `'.field'`, and the\n * path of the sub-field of a field is of the form `'.field.subField'`.\n * The default value of this option is `{}`.\n * - `elementTypes: object`, the additional information about types of\n * elements of fields of classes. The keys of this object are the path of\n * the fields or sub-fields of the target object, the values are the type\n * of the elements, represented as the constructor function of the type.\n * The default value of this option is `{}`.\n * @return {object}\n * The normalized object.\n * @author Haixing Hu\n * @private\n */\nfunction normalizeImpl(Class, obj, fields, options) {\n if (fields === undefined || fields === null || fields === '*') {\n Object.keys(obj).forEach((f) => obj.normalizeField(f, options));\n } else if (Array.isArray(fields)) {\n fields.forEach((f) => obj.normalizeField(f, options));\n } else if (typeof fields === 'string') {\n obj.normalizeField(fields, options);\n } else {\n throw new TypeError(`The argument ${Class.name}.normalize() must be a string or an array of strings.`);\n }\n return obj;\n}\n\nexport default normalizeImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { KEY_CLASS_NAME_FIELD } from '../metadata-keys';\n\n/**\n * Gets the value of the name field of a instance.\n *\n * The name of an instance is the value of the field decorated by the `@NameField`\n * decorator.\n *\n * @param {object} metadata\n * the metadata of the class.\n * @param {object} instance\n * the instance of the class.\n * @return {string}\n * the name of the instance, or `undefined` if the instance has no field\n * decorated by the `@NameField` decorator.\n * @author Haixing Hu\n * @private\n */\nfunction getInstanceName(metadata, instance) {\n const field = metadata[KEY_CLASS_NAME_FIELD];\n if (field) {\n return instance[field];\n } else {\n return undefined;\n }\n}\n\nexport default getInstanceName;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport getFieldMetadata from './get-field-metadata';\nimport { KEY_FIELD_LABEL } from '../metadata-keys';\n\n/**\n * Gets the label of the specified field.\n *\n * @param {object} metadata\n * the metadata of the class.\n * @param {string} field\n * the name of the field.\n * @return {string}\n * the i18n label of the field, or the name of the field if it is not\n * decorated with `@Label`.\n * @author Haixing Hu\n * @private\n */\nfunction getFieldLabel(metadata, field) {\n const config = getFieldMetadata(metadata, field, KEY_FIELD_LABEL);\n if (config) {\n // TODO: i18n the label\n return config.label;\n }\n return field;\n}\n\nexport default getFieldLabel;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { KEY_FIELD_NULLABLE } from '../metadata-keys';\nimport getFieldMetadata from './get-field-metadata';\n\n/**\n * Tests whether the specified field is nullable.\n *\n * @param {object} metadata\n * the metadata of the class.\n * @param {string} field\n * the name of the specified field.\n * @returns {boolean}\n * `true` if the specified field is nullable, i.e., it is decorated with\n * `@Nullable` decorator; `false` otherwise.\n * @author Haixing Hu\n * @private\n */\nfunction isFieldNullable(metadata, field) {\n const nullable = getFieldMetadata(metadata, field, KEY_FIELD_NULLABLE);\n return (nullable === true);\n}\n\nexport default isFieldNullable;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { KEY_FIELD_NON_EMPTY } from '../metadata-keys';\nimport getFieldMetadata from './get-field-metadata';\n\n/**\n * Tests whether the specified field should be non-empty.\n *\n * @param {object} metadata\n * the metadata of the class.\n * @param {string} field\n * the name of the specified field.\n * @returns {boolean}\n * `true` if the specified field should be non-empty, i.e., it is decorated\n * with `@NonEmpty` decorator; `false` otherwise.\n * @author Haixing Hu\n * @private\n */\nfunction isFieldNonEmpty(metadata, field) {\n const nonEmpty = getFieldMetadata(metadata, field, KEY_FIELD_NON_EMPTY);\n return (nonEmpty === true);\n}\n\nexport default isFieldNonEmpty;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport getInstanceName from './get-instance-name';\nimport getFieldLabel from './get-field-label';\nimport isFieldNullable from './is-field-nullable';\nimport isFieldNonEmpty from './is-field-non-empty';\nimport getFieldElementType from './get-field-element-type';\n\n/**\n * Gets the validation context of elements in the specified collection field.\n *\n * @param {function} Class\n * The constructor of the class of the object to be validated.\n * @param {object} metadata\n * The metadata of the class of the object to be validated.\n * @param {object} obj\n * The object to be validated, which must be an instance of the `Class` class.\n * @param {string} field\n * The name of the specified field to be validated. This function assumes\n * that the field exists and is an array, set, or map.\n * @param {object} context\n * The current context of validation. It may have the following properties:\n * - `instance: object`: the object to which the field belongs.\n * - `owner: string|undefined`: the name of the owner (a person) of the field.\n * - `field: string`: the name of the field to be validated.\n * - `type: function`: the constructor of the field to be validated. If the\n * field is decorated by the `@Type` decorator, this property is the\n * argument of the decorator, otherwise it is the constructor of the\n * default value of the field. If the default value of the field is\n * `null` or `undefined`, this property is set to `undefined`.\n * - `label: string`: the display label of the field to be validated.\n * - `nullable: boolean`: whether the field to be validated is nullable.\n * - `nonEmpty: boolean`: whether the field to be validated is non-empty.\n * - `extraMessage: string`: extra error message.\n * @returns {object}\n * The validation context of the elements in the specified collection field.\n * @author Haixing Hu\n * @private\n */\nfunction getElementValidationContext(Class, metadata, obj, field, context) {\n // get the name of the instance as the owner of the field\n const owner = context.owner ?? getInstanceName(metadata, obj);\n // get the element type of the field\n const elementType = context.type ?? getFieldElementType(Class, field);\n // get the label of the field\n const label = context.label ?? getFieldLabel(metadata, field);\n // get the nullable flag of the field\n const nullable = context.nullable ?? isFieldNullable(metadata, field);\n // get the non-empty flag of the field\n const nonEmpty = context.nonEmpty ?? isFieldNonEmpty(metadata, field);\n // constructs the validation options\n const ctx = {\n instance: obj,\n owner,\n field,\n type: elementType,\n label,\n nullable,\n nonEmpty,\n };\n // merge the context\n return Object.assign(ctx, context);\n}\n\nexport default getElementValidationContext;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { isEmpty } from '@qubit-ltd/common-util';\nimport { ValidationResult } from '@qubit-ltd/common-validation-rule';\nimport getInstanceName from '../utils/get-instance-name';\nimport getFieldLabel from '../utils/get-field-label';\nimport isFieldNonEmpty from '../utils/is-field-non-empty';\n\n/**\n * Validates the specified empty field of the specified object.\n *\n * If the field value is empty, this function check whether the field is\n * decorated with `@NonEmpty`. If it is, a validation error is returned;\n * otherwise a success validation result is returned. If the field value is not\n * empty, this function does nothing and returns `null`.\n *\n * A field value is empty, if it is a string, an array, a map, a set, or any\n * object with `length` property, `size` property or `isEmpty()` function, and\n * these properties or functions return `0` or `true`.\n *\n * This function assumes that the field exists and is validatable, and is\n * non-nullish.\n *\n * @param {object} metadata\n * The metadata of the class of the object to be validated.\n * @param {object} obj\n * The object to be validated, which must be an instance of the `Class` class.\n * @param {string} field\n * The name of the specified field to be validated. This function assumes\n * that the field exists and is validatable, and is non-nullish.\n * @param {any} value\n * The value of the specified field of the specified object.\n * @param {object} context\n * The validation context.\n * @returns {ValidationResult|null}\n * The validation result if the specified field is empty; `null` otherwise.\n * @author Haixing Hu\n * @private\n */\nfunction validateEmptyField(metadata, obj, field, value, context) {\n if (isEmpty(value)) {\n if (context.nonEmpty || isFieldNonEmpty(metadata, field)) {\n const label = context.label ?? getFieldLabel(metadata, field);\n const owner = context.owner ?? getInstanceName(metadata, obj);\n // TODO: make the message i18n\n const message = owner\n ? `The ${label} of ${owner} cannot be empty.`\n : `The ${label} cannot be empty.`;\n return new ValidationResult(false, message);\n } else {\n return new ValidationResult(true);\n }\n }\n return null;\n}\n\nexport default validateEmptyField;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { isTypedArray } from '@qubit-ltd/type-detect';\nimport { ValidationResult } from '@qubit-ltd/common-validation-rule';\nimport getElementValidationContext from '../utils/get-element-validation-context';\nimport validateEmptyField from './validate-empty-field';\n\n/**\n * Validates the specified array field of the specified object.\n *\n * If the field value is an array or a typed array, this function recursively\n * validates each element in the array, and returns the combination of the\n * validation results; otherwise, this function does nothing and returns `null`.\n *\n * This function assumes that the field exists, and is validatable, not nullish\n * nor empty.\n *\n * @param {function} Class\n * The constructor of the class of the object to be validated.\n * @param {object} metadata\n * The metadata of the class of the object to be validated.\n * @param {object} obj\n * The object to be validated.\n * @param {string} field\n * The name of the specified field to be validated. This function assumes\n * that the field exists and is validatable, and is non-nullish.\n * @param {any} value\n * The value of the specified field of the specified object.\n * @param {function} validator\n * The validator function\n * @param {object} context\n * The validation context.\n * @returns {ValidationResult|null}\n * The validation result if the specified field is an array or a typed array;\n * `null` otherwise.\n * @author Haixing Hu\n * @private\n */\nfunction validateArrayField(Class, metadata, obj, field, value, validator, context) {\n if (Array.isArray(value) || isTypedArray(value)) {\n // check the empty array\n const result = validateEmptyField(metadata, obj, field, value, context);\n if (result) {\n return result;\n }\n // get the validation options\n const ctx = getElementValidationContext(Class, metadata, obj, field, context);\n // validate each element of the array\n const results = value.map((e, i) => {\n ctx.index = i;\n return validator(e, ctx);\n });\n return ValidationResult.merge(results);\n }\n return null;\n}\n\nexport default validateArrayField;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { ValidationResult } from '@qubit-ltd/common-validation-rule';\nimport getElementValidationContext from '../utils/get-element-validation-context';\nimport validateEmptyField from './validate-empty-field';\n\n/**\n * Validates the specified map field of the specified object.\n *\n * If the field value is a map, this function recursively validates each mapped\n * value in the map, and returns the combination of the validation results;\n * otherwise, this function does nothing and returns `null`.\n *\n * Note that this function only validates the value of each mapping in the map,\n * not the key.\n *\n * This function assumes that the field exists, and is validatable, not nullish\n * nor empty.\n *\n * @param {function} Class\n * The constructor of the class of the object to be validated.\n * @param {object} metadata\n * The metadata of the class of the object to be validated.\n * @param {object} obj\n * The object to be validated, which must be an instance of the `Class` class.\n * @param {string} field\n * The name of the specified field to be validated. This function assumes\n * that the field exists and is validatable, and is non-nullish.\n * @param {any} value\n * The value of the specified field of the specified object.\n * @param {function} validator\n * The validator function\n * @param {object} context\n * The validation context.\n * @returns {ValidationResult|null}\n * The validation result if the specified field is a map; `null` otherwise.\n * @author Haixing Hu\n * @private\n */\nfunction validateMapField(Class, metadata, obj, field, value, validator, context) {\n if (value instanceof Map) {\n // check the empty map\n const result = validateEmptyField(metadata, obj, field, value, context);\n if (result) {\n return result;\n }\n // get the validation options\n const ctx = getElementValidationContext(Class, metadata, obj, field, context);\n // validate each element of the set\n const results = Array.from(value, (e, i) => {\n ctx.index = i;\n return validator(e[1], ctx); // only validate the value, not the key\n });\n return ValidationResult.merge(results);\n }\n return null;\n}\n\nexport default validateMapField;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport getInstanceName from './get-instance-name';\nimport getFieldLabel from './get-field-label';\nimport isFieldNullable from './is-field-nullable';\nimport isFieldNonEmpty from './is-field-non-empty';\nimport getFieldType from './get-field-type';\n\n/**\n * Gets the validation context of the value of the specified field.\n *\n * @param {function} Class\n * The constructor of the class of the object to be validated.\n * @param {object} metadata\n * The metadata of the class of the object to be validated.\n * @param {object} obj\n * The object to be validated, which must be an instance of the `Class` class.\n * @param {string} field\n * The name of the specified field to be validated. This function assumes\n * that the field exists and is an array, set, or map.\n * @param {object} context\n * The current context of validation. It may have the following properties:\n * - `instance: object`: the object to which the field belongs.\n * - `owner: string|undefined`: the name of the owner (a person) of the field.\n * - `field: string`: the name of the field to be validated.\n * - `type: function`: the constructor of the field to be validated. If the\n * field is decorated by the `@Type` decorator, this property is the\n * argument of the decorator, otherwise it is the constructor of the\n * default value of the field. If the default value of the field is\n * `null` or `undefined`, this property is set to `undefined`.\n * - `label: string`: the display label of the field to be validated.\n * - `nullable: boolean`: whether the field to be validated is nullable.\n * - `nonEmpty: boolean`: whether the field to be validated is non-empty.\n * - `extraMessage: string`: extra error message.\n * @returns {object}\n * The validation context of the value of the specified field.\n * @author Haixing Hu\n * @private\n */\nfunction getValidationContext(Class, metadata, obj, field, context) {\n // get the name of the instance as the owner of the field\n const owner = context.owner ?? getInstanceName(metadata, obj);\n // get the element type of the field\n const type = context.type ?? getFieldType(Class, field);\n // get the label of the field\n const label = context.label ?? getFieldLabel(metadata, field);\n // get the nullable flag of the field\n const nullable = context.nullable ?? isFieldNullable(metadata, field);\n // get the non-empty flag of the field\n const nonEmpty = context.nonEmpty ?? isFieldNonEmpty(metadata, field);\n // constructs the validation context\n const ctx = {\n instance: obj,\n owner,\n field,\n type,\n label,\n nullable,\n nonEmpty,\n };\n // merge the context\n return Object.assign(ctx, context);\n}\n\nexport default getValidationContext;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport getValidationContext from '../utils/get-validation-context';\n\n/**\n * Validates the specified field of the specified object.\n *\n * This function simply calls the validator function provided by the `@Validatable`\n * decorator of the field to validate the field.\n *\n * This function assumes that the field exists, is validatable, is non-nullish,\n * is non-empty, and is not an array, nor a set, nor a map.\n *\n * @param {function} Class\n * The constructor of the class of the object to be validated.\n * @param {object} metadata\n * The metadata of the class of the object to be validated.\n * @param {object} obj\n * The object to be validated, which must be an instance of the `Class` class.\n * @param {string} field\n * The name of the specified field to be validated. This function assumes\n * that the field exists and is validatable, and is non-nullish.\n * @param {any} value\n * The value of the specified field of the specified object.\n * @param {function} validator\n * The validator function\n * @param {object} context\n * The validation context.\n * @returns {ValidationResult|null}\n * The validation result if the specified field is an array or a typed array;\n * `null` otherwise.\n * @author Haixing Hu\n * @private\n */\nfunction validateNormalField(Class, metadata, obj, field, value, validator, context) {\n // get the validation context\n const ctx = getValidationContext(Class, metadata, obj, field, context);\n // call the validator\n return validator(value, ctx);\n}\n\nexport default validateNormalField;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { ValidationResult } from '@qubit-ltd/common-validation-rule';\nimport getElementValidationContext from '../utils/get-element-validation-context';\nimport validateEmptyField from './validate-empty-field';\n\n/**\n * Validates the specified set field of the specified object.\n *\n * If the field value is a set, this function recursively validates each element\n * in the set, and returns the combination of the validation results;\n * otherwise, this function does nothing and returns `null`.\n *\n * This function assumes that the field exists, and is validatable, not nullish\n * nor empty.\n *\n * @param {function} Class\n * The constructor of the class of the object to be validated.\n * @param {object} metadata\n * The metadata of the class of the object to be validated.\n * @param {object} obj\n * The object to be validated, which must be an instance of the `Class` class.\n * @param {string} field\n * The name of the specified field to be validated. This function assumes\n * that the field exists and is validatable, and is non-nullish.\n * @param {any} value\n * The value of the specified field of the specified object.\n * @param {function} validator\n * The validator function\n * @param {object} context\n * The validation context.\n * @returns {ValidationResult|null}\n * The validation result if the specified field is a set; `null` otherwise.\n * @author Haixing Hu\n * @private\n */\nfunction validateSetField(Class, metadata, obj, field, value, validator, context) {\n if (value instanceof Set) {\n // check the empty set\n const result = validateEmptyField(metadata, obj, field, value, context);\n if (result) {\n return result;\n }\n // get the validation options\n const ctx = getElementValidationContext(Class, metadata, obj, field, context);\n // validate each element of the set\n const results = Array.from(value, (e, i) => {\n ctx.index = i;\n return validator(e, ctx);\n });\n return ValidationResult.merge(results);\n }\n return null;\n}\n\nexport default validateSetField;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { ValidationResult } from '@qubit-ltd/common-validation-rule';\nimport classMetadataCache from '../class-metadata-cache';\nimport { KEY_FIELD_VALIDATOR } from '../metadata-keys';\nimport validateArrayField from './validate-array-field';\nimport validateMapField from './validate-map-field';\nimport validateNormalField from './validate-normal-field';\nimport validateSetField from './validate-set-field';\nimport hasOwnPrototypeFunction from '../utils/has-own-prototype-function';\nimport getFieldMetadata from '../utils/get-field-metadata';\n\n/**\n * Validates the specified field of the specified object.\n *\n * @param {function} Class\n * The constructor of the class of the object to be validated.\n * @param {object} obj\n * The object to be validated, which must be an instance of the `Class` class.\n * @param {string} field\n * The name of the specified field to be validated.\n * @param {object} context\n * The validation context.\n * @returns {ValidationResult|null}\n * The validation result if the specified field exists; `null` otherwise.\n * If the specified field exist but is non-validatable, returns the success\n * validation result.\n * @author Haixing Hu\n * @private\n */\nfunction validateFieldImpl(Class, obj, field, context) {\n if (!Object.prototype.hasOwnProperty.call(obj, field)) {\n // the field does not exist\n return null;\n }\n // If the class has a parent class, call the validateField of the parent class\n // to validate the field.\n const Parent = Object.getPrototypeOf(Class);\n if (hasOwnPrototypeFunction(Parent, 'validateField')) {\n const result = Parent.prototype.validateField.call(obj, field, context);\n if (result !== null) {\n // the field is validated by its parent class\n return result;\n }\n }\n // Otherwise, use the validator function to validate the field according to\n // the argument of the `@Validatable` decorator of the field.\n // Note that the context metadata of a class is inherited from its ancestor\n // classes, therefore, we can use the metadata of the current class to get the\n // validator function.\n const metadata = classMetadataCache.get(Class);\n const validator = getFieldMetadata(metadata, field, KEY_FIELD_VALIDATOR);\n if (validator === undefined) {\n // the field is not decorated with @Validatable\n return new ValidationResult(true);\n }\n const value = obj[field];\n return validateArrayField(Class, metadata, obj, field, value, validator, context)\n ?? validateSetField(Class, metadata, obj, field, value, validator, context)\n ?? validateMapField(Class, metadata, obj, field, value, validator, context)\n ?? validateNormalField(Class, metadata, obj, field, value, validator, context);\n}\n\nexport default validateFieldImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { ValidationResult } from '@qubit-ltd/common-validation-rule';\n\n/**\n * Validates the specified fields of the specified object。\n *\n * @param {function} Class\n * The constructor of the class of the object to be validated.\n * @param {object} obj\n * The object to be validated, which must be an instance of the `Class` class.\n * @param {string | array<string>} fields\n * The names of fields to be validated. If it is `undefined`, `null`, or\n * the string `\"*\"`, all validatable fields of the specified object will be\n * validated; if it is an array of strings, all validatable fields of the\n * specified object whose names in this array will be validated.\n * @param {object} context\n * The validation context.\n * @return {object}\n * The validated object.\n * @author Haixing Hu\n * @private\n */\nfunction validateImpl(Class, obj, fields, context) {\n if (fields === undefined || fields === null || fields === '*') {\n const results = Object.keys(obj).map((f) => obj.validateField(f, context));\n return ValidationResult.merge(results);\n } else if (Array.isArray(fields)) {\n const results = fields.map((f) => obj.validateField(f, context));\n return ValidationResult.merge(results);\n } else if (typeof fields === 'string') {\n const result = obj.validateField(fields, context);\n return result ?? new ValidationResult(true);\n } else {\n throw new TypeError(`The argument of ${Class.name}.validate()`\n + ' must be a string or an array of strings.');\n }\n}\n\nexport default validateImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport assignImpl from './assign-impl';\nimport hasPrototypeFunction from '../utils/has-prototype-function';\n\n/**\n * Creates an instance of a model class.\n *\n * @param {function} Class\n * The constructor of a model class.\n * @param {object} obj\n * The data object, usually obtained from a JSON object.\n * @param {object} options\n * the additional options for the creation. If this argument is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('assign')`.\n * Available options are:\n * - `normalize: boolean`, indicates whether to normalize this object\n * after the assignment. The default value is `true`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * style of the target object. The default value is `false`.\n * - `sourceNamingStyle: NamingStyle`, the naming style of the source\n * object. The default value is {@link LOWER_UNDERSCORE}.\n * - `targetNamingStyle: NamingStyle`, the naming style of the target\n * object. The default value is {@link LOWER_CAMEL}.\n * @returns {Class | null}\n * If the `obj` is `undefined` or `null`, returns `null`; otherwise, returns\n * a new instance of the model class whose fields are initialized with the\n * data in the `obj`.\n * @see DefaultOptions.get('assign')\n * @author Haixing Hu\n * @private\n */\nfunction createImpl(Class, obj, options) {\n if (obj === undefined || obj === null) {\n return null;\n } else if (typeof obj !== 'object') {\n throw new TypeError(`The first argument of ${Class.name}.create() must be an object.`);\n } else if (hasPrototypeFunction(Class, 'assign')) {\n const result = new Class();\n result.assign(obj, options);\n return result;\n } else {\n const result = new Class();\n return assignImpl(Class, result, obj, options);\n }\n}\n\nexport default createImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport createImpl from './create-impl';\n\n/**\n * Creates a new instance array based on the given object array.\n *\n * Each element of the created array is an instance of the specified class,\n * whose fields are initialized with the corresponding element of the specified\n * object array.\n *\n * @param {function} Class\n * The constructor of the specified class.\n * @param {array} array\n * The specified array of objects.\n * @param {object} options\n * the additional options for the creation. If this argument is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('assign')`.\n * Available options are:\n * - `normalize: boolean`, indicates whether to normalize this object\n * after the assignment. The default value is `true`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * style of the target object. The default value is `false`.\n * - `sourceNamingStyle: NamingStyle`, the naming style of the source\n * object. The default value is {@link LOWER_UNDERSCORE}.\n * - `targetNamingStyle: NamingStyle`, the naming style of the target\n * object. The default value is {@link LOWER_CAMEL}.\n * @return {array}\n * A new array of instances of the specified class, or `null` if the\n * specified array is `undefined` or `null`. Each element of the created\n * array is an instance of the specified class, whose fields are initialized\n * with the corresponding element of the specified object array.\n * @author Haixing Hu\n * @private\n */\nfunction createArrayImpl(Class, array, options) {\n if (array === undefined || array === null) {\n return null;\n }\n if (Array.isArray(array)) {\n // Handle standard arrays\n return array.map((e) => createImpl(Class, e, options));\n // No special handling required for Vue-managed arrays\n // } else if (Object.prototype.toString.call(array) === '[object Array]') {\n // // 处理Vue托管数组\n // const result = [];\n // for (let index in array) {\n // const e = array[index];\n // const obj = Class.create(e, normalizable);\n // result.push(obj);\n // }\n // return result;\n } else {\n throw new TypeError(`The first argument of ${Class.name}.createArray() must be an array.`);\n }\n}\n\nexport default createArrayImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport getSourceField from '../utils/get-source-field';\nimport DefaultOptions from '../../default-options';\n\n/**\n * Tests whether the specified object is a valid page object.\n *\n * @param {any} page\n * The object to be tested.\n * @param {object} options\n * The options of the assignment.\n * @return {boolean}\n * `true` if the specified object is a valid page source object; `false` otherwise.\n */\nfunction isValidPageSource(page, options) {\n const opt = DefaultOptions.merge('assign', options);\n return (page !== undefined)\n && (page !== null)\n && (typeof page === 'object')\n && (typeof page[getSourceField('totalCount', opt)] === 'number')\n && (typeof page[getSourceField('totalPages', opt)] === 'number')\n && (typeof page[getSourceField('pageIndex', opt)] === 'number')\n && (typeof page[getSourceField('pageSize', opt)] === 'number')\n && Array.isArray(page[getSourceField('content', opt)]);\n}\n\nexport default isValidPageSource;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport Json from '@qubit-ltd/json';\nimport Page from '../../model/page';\nimport assignImpl from './assign-impl';\nimport isValidPageSource from './is-valid-page-source';\n\n/**\n * Creates a Page object from the specified data.\n *\n * @param {function} Class\n * The constructor of the class of the page content.\n * @param {object} page\n * The data of the page.\n * @param {object} options\n * the additional options for the creation. If this argument is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('assign')`.\n * Available options are:\n * - `normalize: boolean`, indicates whether to normalize this object\n * after the assignment. The default value is `true`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * style of the target object. The default value is `false`.\n * - `sourceNamingStyle: NamingStyle`, the naming style of the source\n * object. The default value is {@link LOWER_UNDERSCORE}.\n * - `targetNamingStyle: NamingStyle`, the naming style of the target\n * object. The default value is {@link LOWER_CAMEL}.\n * - `types: object`, the additional information about types of\n * fields of classes. The keys of this object are the path of the fields\n * or sub-fields of the target object, the values are the type of the\n * fields, represented as the constructor function of the type.\n * The default value is `{}`.\n * - `elementTypes: object`, the additional information about types of\n * elements of fields of classes. The keys of this object are the path of\n * the fields or sub-fields of the target object, the values are the type\n * of the elements, represented as the constructor function of the type.\n * The default value is `{}`.\n * @returns {Page}\n * The created `Page` object.\n * @see Page\n * @author Haixing Hu\n * @private\n */\nfunction createPageImpl(Class, page, options) {\n if (page === undefined || page === null) {\n return null;\n } else if (isValidPageSource(page, options)) {\n const result = new Page();\n const opt = { ...options };\n if (opt.elementTypes) {\n opt.elementTypes['.content'] = Class;\n } else {\n opt.elementTypes = { '.content': Class };\n }\n return assignImpl(Page, result, page, opt);\n } else {\n throw new TypeError(`Invalid page format: ${Json.stringify(page)}`);\n }\n}\n\nexport default createPageImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport requirePrototypeMethod from '../utils/require-prototype-method';\n\n/**\n * Tests whether an object of the specified model class is nullish or empty.\n *\n * If the specified object is not nullish, this function will test whether\n * the object is an instance of the specified model class, and then call\n * the `isEmpty()` method of the object to determine whether the object is\n * empty.\n *\n * @param {function} Class\n * The constructor of the model class.\n * @param {object} obj\n * The object to be tested.\n * @return {boolean}\n * `true` if the object is nullish or empty; `false` otherwise.\n * @author Haixing Hu\n * @private\n */\nfunction isNullishOrEmptyImpl(Class, obj) {\n requirePrototypeMethod(Class, 'isEmpty');\n if (obj === null || obj === undefined) {\n return true;\n }\n if (!(obj instanceof Class)) {\n throw new TypeError(`The object must be an instance of the class ${Class.name}.`);\n }\n return obj.isEmpty();\n}\n\nexport default isNullishOrEmptyImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport Json from '@qubit-ltd/json';\nimport assignImpl from './assign-impl';\n\n/**\n * Parses the specified object from a JSON string.\n *\n * @param {Function} Class\n * the constructor of the model class of the object.\n * @param {string} json\n * the JSON string to be parsed.\n * @param {null|undefined|object} options\n * the additional options for the parsing. If this argument is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('assign')`.\n * Available options are:\n * - `normalize: boolean`, indicates whether to normalize this object\n * after the assignment. The default value is `true`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * style of the target object. The default value is `false`.\n * - `sourceNamingStyle: string | NamingStyle`, the naming style of the\n * source object, i.e., the first argument of the `assign()` method.\n * The default value of this argument is {@link LOWER_UNDERSCORE}.\n * - `targetNamingStyle: string | NamingStyle`, the naming style of the\n * target object, i.e., the object calling the `assign()` method. The\n * default value of this argument is {@link LOWER_CAMEL}.\n * @returns {object}\n * the object deserialized from the specified JSON string.\n * @see DefaultOptions.get('assign')\n * @author Haixing Hu\n * @private\n */\nfunction parseJsonStringImpl(Class, json, options) {\n const obj = Json.parse(json);\n const result = new Class();\n return assignImpl(Class, result, obj, options);\n}\n\nexport default parseJsonStringImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport clone from '@qubit-ltd/clone';\nimport defaultNormalizer from '../../default-normalizer';\nimport DefaultOptions from '../../default-options';\nimport CLONE_OPTIONS from './clone-options';\n\n/**\n * Gets the object to be serialized by `JSON.stringify()`.\n *\n * If the value has a `toJSON()` method, it's responsible to define what\n * data will be serialized. Instead of the object being serialized, the value\n * returned by the `toJSON()` method when called will be serialized.\n *\n * @param {object} obj\n * the object to be serialized.\n * @param {string} key\n * `JSON.stringify()` calls `toJSON()` with one parameter, the `key`,\n * which takes the following values:\n * - if this object is a property value, this argument is the property\n * name;\n * - if this object is in an array, this argument is the index in the\n * array, as a string;\n * - if `JSON.stringify()` was directly called on this object, this\n * argument is an empty string.\n * @param {null|undefined|object} options\n * the additional options for the serialization. If this argument is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('toJSON')`.\n * Available options are:\n * - `normalize: boolean`, indicates whether to normalize this object\n * before serializing. The default value is `true`.\n * - `removeEmptyFields: boolean`, indicates whether to remove the empty\n * fields of the object. The default value is `false`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * of properties of the object represented by the result JSON string.\n * The default value is `false`.\n * - `sourceNamingStyle: string | NamingStyle`, the naming style of the\n * source object, i.e., the object calling the `toJSON()` method.\n * The default value of this argument is {@link LOWER_CAMEL}.\n * - `targetNamingStyle: string | NamingStyle`, the naming style of the\n * target object, i.e., the object represented by the result JSON\n * string of the `toJSON()` method. The default value of this argument\n * is {@link LOWER_UNDERSCORE}.\n * - `space: string | number`, a string or number that's used to insert\n * white space (including indentation, line break characters, etc.) into\n * the output JSON string for readability purposes. If this is a number,\n * it indicates the number of space characters to be used as indentation,\n * clamped to 10 (that is, any number greater than 10 is treated as if\n * it were 10). Values less than 1 indicate that no space should be used.\n * If this is a string, the string (or the first 10 characters of the\n * string, if it's longer than that) is inserted before every nested\n * object or array. If this is anything other than a string or number\n * (can be either a primitive or a wrapper object) — for example, is\n * `null` or not provided — no white space is used. The default value\n * of this option is `null`.\n * @returns {object}\n * the object to be serialized by `JSON.stringify()`, which may be a\n * modify copy of this object.\n * @see DefaultOptions.get('toJSON')\n * @author Haixing Hu\n * @private\n */\nfunction toJsonImpl(obj, key, options) {\n const opt = DefaultOptions.merge('toJSON', options);\n // normalize the object if necessary\n if (opt.normalize) {\n obj = defaultNormalizer(obj);\n }\n const cloneOptions = {\n ...CLONE_OPTIONS,\n pojo: true,\n disableHooks: true,\n useToJSON: true,\n convertNaming: opt.convertNaming,\n sourceNamingStyle: opt.sourceNamingStyle,\n targetNamingStyle: opt.targetNamingStyle,\n removeEmptyFields: opt.removeEmptyFields,\n skipRootToJSON: opt.skipRootToJSON,\n };\n return clone(obj, cloneOptions);\n}\n\nexport default toJsonImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport Json from '@qubit-ltd/json';\nimport DefaultOptions from '../../default-options';\n\n/**\n * Serializes this object into a JSON string.\n *\n * @param {Function} Class\n * the constructor of the model class of the object.\n * @param {object} obj\n * the object to be serialized.\n * @param {null|undefined|object} options\n * the additional options for the serialization. If this argument is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('toJSON')`.\n * Available options are:\n * - `normalize: boolean`, indicates whether to normalize this object\n * before serializing. The default value is `true`.\n * - `removeEmptyFields: boolean`, indicates whether to ignore the empty\n * fields of the object. If it is `true`, the empty fields of the object\n * will be removed before serialization. The default value is `false`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * of properties of the object represented by the result JSON string.\n * The default value is `false`.\n * - `sourceNamingStyle: string | NamingStyle`, the naming style of the\n * source object, i.e., the object calling the `toJSON()` method.\n * The default value of this argument is {@link LOWER_CAMEL}.\n * - `targetNamingStyle: string | NamingStyle`, the naming style of the\n * target object, i.e., the object represented by the result JSON\n * string of the `toJSON()` method. The default value of this argument\n * is {@link LOWER_UNDERSCORE}.\n * - `space: string | number`, a string or number that's used to insert\n * white space (including indentation, line break characters, etc.) into\n * the output JSON string for readability purposes. If this is a number,\n * it indicates the number of space characters to be used as indentation,\n * clamped to 10 (that is, any number greater than 10 is treated as if\n * it were 10). Values less than 1 indicate that no space should be used.\n * If this is a string, the string (or the first 10 characters of the\n * string, if it's longer than that) is inserted before every nested\n * object or array. If this is anything other than a string or number\n * (can be either a primitive or a wrapper object) — for example, is\n * `null` or not provided — no white space is used. The default value\n * of this option is `null`.\n * @returns {string}\n * the JSON string serialized from this object, as `JSON.stringify()`\n * does, except that this function provides additional stringification\n * options.\n * @see DefaultOptions.get('toJSON')\n * @author Haixing Hu\n * @private\n */\nfunction toJsonStringImpl(Class, obj, options) {\n const opt = DefaultOptions.merge('toJSON', options);\n const target = obj.toJSON('', opt);\n return Json.stringify(target, null, opt.space);\n}\n\nexport default toJsonStringImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport getDefaultInstance from './get-default-instance';\n\n/**\n * Tests whether the specified class has the specified field.\n *\n * @param {function} Class\n * The constructor of the specified class.\n * @param {string} field\n * The name of the specified field.\n * @returns {boolean}\n * Whether the specified class has the specified field defined in its\n * prototype or its default instance.\n * @author Haixing Hu\n * @private\n */\nfunction hasOwnClassField(Class, field) {\n if (!Class || !Class.prototype) {\n return false;\n }\n if (Object.prototype.hasOwnProperty.call(Class.prototype, field)) {\n return true;\n } else {\n const defaultInstance = getDefaultInstance(Class);\n return Object.prototype.hasOwnProperty.call(defaultInstance, field);\n }\n}\n\nexport default hasOwnClassField;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport classMetadataCache from './impl/class-metadata-cache';\nimport { KEY_CLASS_CATEGORY, KEY_CLASS_NEXT_ID } from './impl/metadata-keys';\nimport assignImpl from './impl/model/assign-impl';\nimport isEmptyImpl from './impl/model/is-empty-impl';\nimport equalsImpl from './impl/model/equals-impl';\nimport generateIdImpl from './impl/model/generate-id-impl';\nimport clearImpl from './impl/model/clear-impl';\nimport cloneImpl from './impl/model/clone-impl';\nimport normalizeFieldImpl from './impl/model/normalize-field-impl';\nimport normalizeImpl from './impl/model/normalize-impl';\nimport validateFieldImpl from './impl/model/validate-field-impl';\nimport validateImpl from './impl/model/validate-impl';\nimport createImpl from './impl/model/create-impl';\nimport createArrayImpl from './impl/model/create-array-impl';\nimport createPageImpl from './impl/model/create-page-impl';\nimport isNullishOrEmptyImpl from './impl/model/is-nullish-or-empty-impl';\nimport parseJsonStringImpl from './impl/model/parse-json-string-impl';\nimport toJsonImpl from './impl/model/to-json-impl';\nimport toJsonStringImpl from './impl/model/to-json-string-impl';\nimport setClassMetadata from './impl/utils/set-class-metadata';\nimport hasOwnClassField from './impl/utils/has-own-class-field';\nimport hasOwnPrototypeFunction from './impl/utils/has-own-prototype-function';\nimport hasPrototypeFunction from './impl/utils/has-prototype-function';\n\n/**\n * This decorator is used to add common methods to a domain model class.\n *\n * It must decorate a class.\n *\n * It adds the following methods to the decorated class:\n *\n * - Instance method `assign(obj, options)`: Copies the properties of the object\n * `obj` to this object, only copying properties defined in the class of this\n * object. If a property in the `obj` object is `undefined` or `null`, it sets\n * the property of this object to the default value. The function returns this\n * object itself. Note that `obj` can have a different prototype than this object.\n * The `options` parameter is the additional options for the assignment.\n * Available options will be explained below. If the `options` parameter is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('assign')`.\n * - Instance method `clear()`: Sets all the properties of this object to their\n * default values.\n * - Instance method `clone()`: Returns a deep clone of this object.\n * - Instance method `isEmpty()`: Checks if this object is empty, meaning that all\n * of its properties have default values.\n * - Instance method `equals(obj)`: Determines if this object is deeply equal\n * to `obj`.\n * - Instance method `normalize(fields)`: Normalizes specified fields of this\n * object. The `fields` parameter specifies the names of fields to be normalized.\n * If `fields` is `undefined`, `null`, or the string `\"*\"`, it normalizes all\n * the fields that can be normalized for this object. If `fields` is an array of\n * strings, it normalizes all the fields specified in the array. Note that a\n * field is normalizable if and only if it is decorated with the\n * `@{@link Normalizable}` decorator.\n * - Instance method `normalizeField(field)`: Normalizes the specified field of\n * this object. The `field` parameter specifies the name of the field to be\n * normalized. If the specified exists and is normalizable, the function\n * normalizes it and returns `true`; otherwise, the function does nothing and\n * returns `false`.\n * - Instance method `validate(fields, options)`: Validates the specified fields of\n * this object. The `fields` parameter is the names of the fields to be validated.\n * If `fields` is `undefined`, `null`, or the string `\"*\"`, it validates all the\n * fields that can be validated for this object. If `fields` is an array of\n * strings, it validates all the fields specified in the array. Note that a field\n * must be specified as validatable using the `@{@link Validatable}` decorator.\n * The `options` parameter is an object comprising additional parameters, and its\n * property values are passed as the second argument to the validation function.\n * Refer to the documentation of `@{@link Validatable}` for more details.\n * - Instance method `generateId()`: If the decorated class defines a property\n * named `id`, this decorator automatically adds a `generateId()` instance method.\n * Each call to this method generates a globally unique ID (represented as an\n * integer) for the class of this object, sets it to this object and returns\n * the generated ID. Note that if a parent class `A` defines the `id` field,\n * and a subclass `B` inherits the `id` field but does not define its own\n * `id` field, the `generateId()` method is only added to class `A`, not to\n * class `B`.\n * - Static class method `create(obj, options)`: Creates a new instance object\n * based on the `obj` object. It copies the property values from the corresponding\n * properties of `obj`, maintaining the same prototype and class definition. This\n * method is used to transform a plain JSON object into the specified domain\n * object. The `options` parameter is the additional options for the creation,\n * which is the same as the `options` parameter of the `create()` method.\n * - Static class method `createArray(array, options)`: Creates a new instance\n * array based on an object array `array`, where each element's property values\n * are copied from the corresponding elements in `array`, maintaining the same\n * prototype and class definition. This method is used to transform an array of\n * plain JSON objects into an array of specified domain objects. The `options`\n * parameter is the additional options for the creation, which is the same\n * as the `options` parameter of the `create()` method.\n * - Static class method `createPage(page, options)`: Creates a new page object\n * based on a `page` pagination object. Typically, `page` is a list of domain\n * objects obtained from a server using the GET method, and the object should\n * conform to the `{@link Page}` class definition. This static class method\n * returns a new `{@link Page}` object, with the `content` property being the\n * result of `createArray(page.content, options)`, and the other properties\n * matching those of the `page` object. If the input is not a valid\n * `{@link Page}` object, it returns `null`. The `options` parameter is the\n * additional options for the creation, which is the same as the `options`\n * parameter of the `create()` method.\n * - Static class method `isNullishOrEmpty(obj)`: Determines if the given instance\n * is `undefined`, `null`, or an empty object constructed with default values.\n *\n * **NOTE:** If the decorated class already implements any of the above methods,\n * this decorator will not override the methods already implemented by the\n * decorated class.\n *\n * ##### Usage example:\n *\n * ```js\n * @Model\n * class Credential {\n *\n * @Normalizable\n * @Validator(validateCredentialTypeField)\n * @Type(CredentialType)\n * @Label('证件类型')\n * type = CredentialType.IDENTITY_CARD;\n *\n * @Normalizable(trimUppercaseString)\n * @Validator(validateCredentialNumberField)\n * @Label('证件号码')\n * number = '';\n *\n * constructor(type = CredentialType.DEFAULT.value, number = '') {\n * this.type = type;\n * this.number = number;\n * }\n *\n * isIdentityCard() {\n * return (this.type === 'IDENTITY_CARD');\n * }\n * }\n *\n * @Model\n * class Person {\n *\n * @Normalizable(trimString)\n * @Label('ID')\n * id = null;\n *\n * @Normalizable(trimUppercaseString)\n * @Validatable(validatePersonNameField)\n * @Label('姓名')\n * name = '';\n *\n * @Normalizable\n * @DefaultValidator\n * @Type(Credential)\n * @Label('证件')\n * credential = null;\n *\n * @Normalizable\n * @Validatable(validatePersonGenderField)\n * @Type(Gender)\n * @Label('性别')\n * gender = '';\n *\n * @Normalizable(trimString)\n * @Validatable(validatePersonBirthdayField)\n * @Label('出生日期')\n * birthday = '';\n *\n * @Normalizable(trimUppercaseString)\n * @Validatable(validateMobileField)\n * @Label('手机号码')\n * mobile = '';\n *\n * @Normalizable(trimString)\n * @Validatable(validateEmailField)\n * @Label('电子邮件地址')\n * @Nullable\n * email = '';\n *\n * equals(other) {\n * if (!(other instanceof PersonWithEquals)) {\n * return false;\n * }\n * if ((this.credential === null) || (other.credential === null)) {\n * // If one of the two people does not have an ID information, it is\n * // impossible to compare whether they are the same person thus they\n * // will be considered different.\n * return false;\n * }\n * // Two persons are logically equals if and only if they have the same\n * // credential.\n * return (this.credential.type === other.credential.type)\n * && (this.credential.number === other.credential.number);\n * }\n * }\n * ```\n *\n * After applying the `@Model` decorator, the following methods will be\n * automatically added:\n *\n * - `Credential.prototype.assign(obj, options = undefined)`\n * - `Credential.prototype.clear()`\n * - `Credential.prototype.clone()`\n * - `Credential.prototype.isEmpty()`\n * - `Credential.prototype.equals(obj)`\n * - `Credential.prototype.normalize(fields)`\n * - `Credential.prototype.validate(fields, options)`\n * - `Credential.prototype.toJSON(key, options = undefined)`\n * - `Credential.prototype.toJsonString(options = undefined)`\n * - `Credential.create(obj, options = undefined)`\n * - `Credential.createArray(array, options = undefined)`\n * - `Credential.createPage(page, options = undefined)`\n * - `Credential.isNullishOrEmpty(obj)`\n * - `Credential.parseJsonString(json, options = undefined)`\n * - `Person.prototype.assign(obj, normalized)`\n * - `Person.prototype.clear()`\n * - `Person.prototype.clone()`\n * - `Person.prototype.isEmpty()`\n * - `Person.prototype.normalize(fields)`\n * - `Person.prototype.validate(fields, options)`\n * - `Person.prototype.generateId()`\n * - `Person.prototype.toJSON(key, options = undefined)`\n * - `Person.prototype.toJsonString(options = undefined)`\n * - `Person.create(obj, options = undefined)`\n * - `Person.createArray(array, options = undefined)`\n * - `Person.createPage(page, options = undefined)`\n * - `Person.isNullishOrEmpty(obj)`\n * - `Person.parseJsonString(json, options = undefined)`\n *\n * **NOTE:**\n *\n * - Because the `Credential` class does not have an `id` attribute, the `@Model`\n * decorator does not add a `generateId()` instance method to it.\n * - Because `Person` already implements the `Person.prototype.equals()` method,\n * the `@Model` decorator will **not** override its own implementation of\n * the `Person.prototype.equals()` method.\n *\n * @param {function} Class\n * The constructor of the class being decorated.\n * @param {object} context\n * The context object containing information about the class being decorated.\n * @namespace\n * @see Type\n * @see ElementType\n * @see Nullable\n * @see Label\n * @see NameField\n * @see Normalizable\n * @see Validatable\n * @see ValidationResult\n * @see DefaultOptions.get('assign')\n * @see DefaultOptions.get('toJSON')\n * @author Haixing Hu\n */\nfunction Model(Class, context) {\n if (context === null || typeof context !== 'object') {\n throw new TypeError('The context must be an object.');\n }\n if (typeof Class !== 'function' || context.kind !== 'class') {\n throw new TypeError('The `@Model` can only decorate a class.');\n }\n // put the context.metadata to the cache\n classMetadataCache.set(Class, context.metadata);\n // The category of the class modified by `@Model` is set to 'model'\n setClassMetadata(Class, KEY_CLASS_CATEGORY, 'model');\n // Add the instance method `assign()`\n if (!hasOwnPrototypeFunction(Class, 'assign')) {\n /**\n * Copies the properties from a specified data object to this object, only\n * copying properties defined in the class of this object.\n *\n * If a property in the data object is `undefined` or `null`, the function\n * sets the property of this object to the default value.\n *\n * Note that the data object may have a different prototype than this object.\n *\n * @param {object} obj\n * the data object, which may have a different prototype than this object.\n * @param {null|undefined|object} options\n * the additional options for the assignment. If this argument is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('assign')`.\n * Available options are:\n * - `normalize: boolean`, indicates whether to normalize this object\n * after the assignment. The default value is `true`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * style of the target object. The default value is `false`.\n * - `sourceNamingStyle: string`, the naming style of the source object,\n * i.e., the first argument of the `assign()` method. The default value\n * of this argument is `'LOWER_UNDERSCORE'`.\n * - `targetNamingStyle: string`, the naming style of the target object,\n * i.e., the object calling the `assign()` method. The default value\n * of this argument is `'LOWER_CAMEL'`.\n * - `types: object`, the additional information about types of\n * fields of classes. The keys of this object are the path of the fields\n * or sub-fields of the target object, the values are the type of the\n * fields, represented as the constructor function of the type.\n * The default value is `{}`.\n * - `elementTypes: object`, the additional information about types of\n * elements of fields of classes. The keys of this object are the path of\n * the fields or sub-fields of the target object, the values are the type\n * of the elements, represented as the constructor function of the type.\n * The default value is `{}`.\n * @returns {object}\n * the reference to this object.\n * @see DefaultOptions.get('assign')\n * @method\n * @name Model#assign\n * @memberof Model\n */\n Class.prototype.assign = function assign(obj, options = undefined) {\n return assignImpl(Class, this, obj, options);\n };\n }\n // Add the instance method `clear()`\n if (!hasOwnPrototypeFunction(Class, 'clear')) {\n /**\n * Sets all the properties of this object to their default values.\n *\n * @returns {object}\n * the reference to this object.\n * @method\n * @name Model#clear\n * @memberof Model\n */\n Class.prototype.clear = function clear() {\n return clearImpl(Class, this);\n };\n }\n // Add the instance method `clone()`\n if (!hasOwnPrototypeFunction(Class, 'clone')) {\n /**\n * Clones this object.\n *\n * @returns {object}\n * the cloned copy of this object.\n * @method\n * @name Model#clone\n * @memberof Model\n */\n Class.prototype.clone = function clone() {\n return cloneImpl(Class, this);\n };\n }\n // Add the instance method `isEmpty()`\n if (!hasOwnPrototypeFunction(Class, 'isEmpty')) {\n /**\n * Checks whether this object is empty, i.e., whether all of its properties\n * have default values.\n *\n * @returns {boolean}\n * `true` if this object is empty; `false` otherwise.\n * @method\n * @name Model#isEmpty\n * @memberof Model\n */\n Class.prototype.isEmpty = function isEmpty() {\n return isEmptyImpl(Class, this);\n };\n }\n // Add the instance method `equals()`\n if (!hasOwnPrototypeFunction(Class, 'equals')) {\n /**\n * Determines whether this object is deeply equal to the other object.\n *\n * @param {object} obj\n * the other object.\n * @returns {boolean}\n * `true` if this object is deeply equal to the other object; `false`\n * otherwise.\n * @method\n * @name Model#equals\n * @memberof Model\n */\n Class.prototype.equals = function equals(obj) {\n return equalsImpl(this, obj);\n };\n }\n // Add the instance method `normalize()`\n if (!hasOwnPrototypeFunction(Class, 'normalize')) {\n /**\n * Normalizes all normalizable fields or specified normalizable fields of\n * this object.\n *\n * A field is normalizable if and only if it is decorated with the\n * `@{@link Normalizable}` decorator.\n *\n * @param {undefined|string|array} fields\n * the names of fields to be normalized. If this argument is not specified,\n * or `undefined`, or `null`, or a string `'*'`, this function normalizes\n * all normalizable fields of this object; If this argument is an array of\n * strings, this function normalizes all normalizable fields specified\n * in the array. If this argument is a string other than `'*'`, this\n * function normalizes the field with the name equals to this argument;\n * if the specified field does not exist nor non-normalizable, this\n * function does nothing.\n * @param {object} options\n * The optional options for the normalization. Default value is an empty\n * object. Currently, the following options are supported:\n * - `path: string`, the path of the root object of this object.\n * The default value of this option is `'.'`.\n * - `types: object`, the additional information about types of fields\n * of classes. The keys of this object are the path of the fields or\n * sub-fields of this object, the values are the type of the fields,\n * represented as the constructor function of the type. The path of\n * the root of this object is an empty, therefore the path of the direct\n * field of this object is of the form `'.field'`, and the\n * path of the sub-field of a field is of the form `'.field.subField'`.\n * The default value of this option is `{}`.\n * - `elementTypes: object`, the additional information about types of\n * elements of fields of classes. The keys of this object are the path of\n * the fields or sub-fields of the target object, the values are the type\n * of the elements, represented as the constructor function of the type.\n * The default value of this option is `{}`.\n * @returns {object}\n * the reference to this object.\n * @method\n * @name Model#normalize\n * @memberof Model\n */\n Class.prototype.normalize = function normalize(fields = '*', options = {}) {\n return normalizeImpl(Class, this, fields, options);\n };\n }\n // Add the instance method `normalizeField()`\n if (!hasOwnPrototypeFunction(Class, 'normalizeField')) {\n /**\n * Normalizes the specified normalizable fields of this object.\n *\n * A field is normalizable if and only if it is decorated with the\n * `@{@link Normalizable}` decorator.\n *\n * @param {string} field\n * the names of fields to be normalized. If the specified field does not\n * exist nor non-normalizable, this function does nothing and returns\n * `false`.\n * @param {object} options\n * The optional options for the normalization. Default value is an empty\n * object. Currently, the following options are supported:\n * - `path: string`, the path of the root object of this object.\n * The default value of this option is `'.'`.\n * - `types: object`, the additional information about types of fields\n * of classes. The keys of this object are the path of the fields or\n * sub-fields of this object, the values are the type of the fields,\n * represented as the constructor function of the type. The path of\n * the root of this object is an empty, therefore the path of the direct\n * field of this object is of the form `'.field'`, and the\n * path of the sub-field of a field is of the form `'.field.subField'`.\n * The default value of this option is `{}`.\n * - `elementTypes: object`, the additional information about types of\n * elements of fields of classes. The keys of this object are the path of\n * the fields or sub-fields of the target object, the values are the type\n * of the elements, represented as the constructor function of the type.\n * The default value of this option is `{}`.\n * @returns {boolean}\n * `true` if the specified field exists and is normalizable; `false`\n * otherwise.\n * @method\n * @name Model#normalizeField\n * @memberof Model\n */\n Class.prototype.normalizeField = function normalizeField(field, options = {}) {\n return normalizeFieldImpl(Class, this, field, options);\n };\n }\n // Add the instance method `validate()`\n if (!hasOwnPrototypeFunction(Class, 'validate')) {\n /**\n * Validates this object.\n *\n * @param {undefined|string|array} fields\n * the names of fields to be validated. If this argument is not specified,\n * or `undefined`, or `null`, or a string `'*'`, this function validates\n * all validatable fields of this object; If this argument is an array of\n * strings, this function validates all validatable fields specified\n * in the array. If this argument is a string other than `'*'`, this\n * function validates the field with the name equals to this argument;\n * if the specified field does not exist nor non-validatable, this\n * function does nothing.\n * @param {object} context\n * The validation context. If this argument is not specified, an empty\n * context is used.\n * @returns {ValidationResult}\n * The result of validation.\n * @method\n * @name Model#validate\n * @memberof Model\n */\n Class.prototype.validate = function validate(fields = '*', context = {}) {\n return validateImpl(Class, this, fields, context);\n };\n }\n // Add the instance method `validateField()`\n if (!hasOwnPrototypeFunction(Class, 'validateField')) {\n /**\n * Validates the specified validatable fields of this object.\n *\n * A field is validatable if and only if it is decorated with the\n * `@{@link Validatable}` decorator.\n *\n * @param {string} field\n * the names of fields to be validated. If the specified field does not\n * exist nor non-validatable, this function does nothing and returns\n * `null`.\n * @param {object} context\n * The validation context. If this argument is not specified, an empty\n * context is used.\n * @returns {ValidationResult|null}\n * The validation result if the specified field exists; `null` otherwise.\n * If the specified field exist but is non-validatable, returns the success\n * validation result.\n * @method\n * @name Model#validateField\n * @memberof Model\n */\n Class.prototype.validateField = function validateField(field, context = {}) {\n return validateFieldImpl(Class, this, field, context);\n };\n }\n // Add the instance method `generateId()` to the class containing the `id` field\n if (hasOwnClassField(Class, 'id') && !hasPrototypeFunction(Class, 'generateId')) {\n // If its own instance has an `id` field, and there is no `generateId()`\n // method on itself or its parent class prototype\n setClassMetadata(Class, KEY_CLASS_NEXT_ID, 0);\n /**\n * Generates the next unique identifier for instances of this class and set\n * it to this object.\n *\n * Each call to this method generates a globally unique ID (represented as\n * an integer) for the class of this object, sets it to this object and\n * returns the generated ID.\n *\n * Note hat if a parent class `A` defines the `id` field, and a subclass `B`\n * inherits the `id` field but does not define its own `id` field, the\n * `generateId()` method is only added to class `A`, not to class `B`.\n *\n * @returns {number}\n * the generated unique ID.\n * @method\n * @name Model#generateId\n * @memberof Model\n */\n Class.prototype.generateId = function generateId() {\n return generateIdImpl(Class, this);\n };\n }\n // Add the instance method `toJSON()`\n if (!hasOwnPrototypeFunction(Class, 'toJSON')) {\n /**\n * Gets the object to be serialized by `JSON.stringify()`.\n *\n * If the value has a `toJSON()` method, it's responsible to define what\n * data will be serialized. Instead of the object being serialized, the value\n * returned by the `toJSON()` method when called will be serialized.\n *\n * **NOTE:** this function returns an object to be serialized by\n * `JSON.stringify()`, instead of a JSON string. Use `JSON.stringify()`\n * or `this.toJsonString()` methods to serialize this object into a JSON\n * string.\n *\n * @param {string} key\n * `JSON.stringify()` calls `toJSON()` with one parameter, the `key`,\n * which takes the following values:\n * - if this object is a property value, this argument is the property\n * name;\n * - if this object is in an array, this argument is the index in the\n * array, as a string;\n * - if `JSON.stringify()` was directly called on this object, this\n * argument is an empty string.\n * @param {null|undefined|object} options\n * the additional options for the serialization. If this argument is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('toJSON')`.\n * Available options are:\n * - `normalize: boolean`, indicates whether to normalize this object\n * before serializing. The default value is `true`.\n * - `removeEmptyFields: boolean`, indicates whether to ignore the empty\n * fields of the object. If it is `true`, the empty fields of the object\n * will be removed before serialization. The default value is `false`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * of properties of the object represented by the result JSON string.\n * The default value is `false`.\n * - `sourceNamingStyle: string`, the naming style of the source object,\n * i.e., the object calling the `toJSON()` method. The default value\n * of this argument is `'LOWER_CAMEL'`.\n * - `targetNamingStyle: string`, the naming style of the target object,\n * i.e., the object represented by the result JSON string of the\n * `toJSON()` method. The default value of this argument is\n * `'LOWER_UNDERSCORE'`.\n * - `space: string | number`, a string or number that's used to insert\n * white space (including indentation, line break characters, etc.) into\n * the output JSON string for readability purposes. If this is a number,\n * it indicates the number of space characters to be used as indentation,\n * clamped to 10 (that is, any number greater than 10 is treated as if\n * it were 10). Values less than 1 indicate that no space should be used.\n * If this is a string, the string (or the first 10 characters of the\n * string, if it's longer than that) is inserted before every nested\n * object or array. If this is anything other than a string or number\n * (can be either a primitive or a wrapper object) — for example, is\n * `null` or not provided — no white space is used. The default value\n * of this option is `null`.\n * @returns {object}\n * the object to be serialized by `JSON.stringify()`, which may be a\n * modify copy of this object.\n * @see toJsonString()\n * @see DefaultOptions.get('toJSON')\n * @method\n * @name Model#toJSON\n * @memberof Model\n */\n Class.prototype.toJSON = function toJSON(key, options = undefined) {\n return toJsonImpl(this, key, {\n ...options,\n skipRootToJSON: true,\n });\n };\n }\n // Add the instance method `toJSON()`\n if (!hasOwnPrototypeFunction(Class, 'toJsonString')) {\n /**\n * Serializes this object into a JSON string.\n *\n * **NOTE:** This method supports native `bigint` value. For example, the\n * `bigint` value `9223372036854775807n` will be stringify as\n * `9223372036854775807`.\n *\n * @param {null|undefined|object} options\n * the additional options for the serialization. If this argument is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('toJSON')`.\n * Available options are:\n * - `normalize: boolean`, indicates whether to normalize this object\n * before serializing. The default value is `true`.\n * - `removeEmptyFields: boolean`, indicates whether to ignore the empty\n * fields of the object. If it is `true`, the empty fields of the object\n * will be removed before serialization. The default value is `false`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * of properties of the object represented by the result JSON string.\n * The default value is `false`.\n * - `sourceNamingStyle: string`, the naming style of the source object,\n * i.e., the object calling the `toJSON()` method. The default value\n * of this argument is `'LOWER_CAMEL'`.\n * - `targetNamingStyle: string`, the naming style of the target object,\n * i.e., the object represented by the result JSON string of the\n * `toJSON()` method. The default value of this argument is\n * `'LOWER_UNDERSCORE'`.\n * - `space: string | number`, a string or number that's used to insert\n * white space (including indentation, line break characters, etc.) into\n * the output JSON string for readability purposes. If this is a number,\n * it indicates the number of space characters to be used as indentation,\n * clamped to 10 (that is, any number greater than 10 is treated as if\n * it were 10). Values less than 1 indicate that no space should be used.\n * If this is a string, the string (or the first 10 characters of the\n * string, if it's longer than that) is inserted before every nested\n * object or array. If this is anything other than a string or number\n * (can be either a primitive or a wrapper object) — for example, is\n * `null` or not provided — no white space is used. The default value\n * of this option is `null`.\n * @returns {string}\n * the JSON string serialized from this object, as `JSON.stringify()`\n * does, except that this function provides additional stringification\n * options.\n * @see toJSON()\n * @see DefaultOptions.get('toJSON')\n * @method\n * @name Model#toJsonString\n * @memberof Model\n */\n Class.prototype.toJsonString = function toJsonString(options = undefined) {\n return toJsonStringImpl(Class, this, options);\n };\n }\n // Add the class method `create()`\n if (!Object.prototype.hasOwnProperty.call(Class, 'create')) {\n /**\n * Creates a new instance of this class based on the specified data object.\n *\n * It copies the property values from the corresponding properties of the\n * specified data object maintaining the same prototype and class definition.\n *\n * If a property in the data object is `undefined` or `null`, the function\n * sets the property of the created instance to the default value.\n *\n * This method is usually used to transform a plain JSON object into the\n * specified domain object.\n *\n * @param {object} obj\n * the specified data object.\n * @param {null|undefined|object} options\n * the additional options for the creation. If this argument is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('assign')`.\n * Available options are:\n * - `normalize: boolean`, indicates whether to normalize this object\n * after the assignment. The default value is `true`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * style of the target object. The default value is `false`.\n * - `sourceNamingStyle: string`, the naming style of the source object,\n * i.e., the first argument of the `create()` method. The default\n * value of this argument is `'LOWER_UNDERSCORE'`.\n * - `targetNamingStyle: string`, the naming style of the target object,\n * i.e., the object returned by the `create()` method. The default\n * value of this argument is `'LOWER_CAMEL'`.\n * - `types: object`, the additional information about types of\n * fields of classes. The keys of this object are the path of the fields\n * or sub-fields of the target object, the values are the type of the\n * fields, represented as the constructor function of the type.\n * The default value is `{}`.\n * - `elementTypes: object`, the additional information about types of\n * elements of fields of classes. The keys of this object are the path of\n * the fields or sub-fields of the target object, the values are the type\n * of the elements, represented as the constructor function of the type.\n * The default value is `{}`.\n * @returns {Class|null}\n * the new instance of this class created from the specified data object,\n * or `null` if the specified object is `null` or `undefined`.\n * @see DefaultOptions.get('assign')\n * @method\n * @memberof Model\n */\n Class.create = function create(obj, options = undefined) {\n return createImpl(Class, obj, options);\n };\n }\n // Add the class method `createArray()`\n if (!Object.prototype.hasOwnProperty.call(Class, 'createArray')) {\n /**\n * Creates a new array of instances of this class based on an array of data\n * objects.\n *\n * The property values of each element in the created instances array are\n * copied from the corresponding elements in the data object array,\n * maintaining the same prototype and class definition.\n *\n * This method is usually used to transform an array of plain JSON objects\n * into an array of specified domain objects.\n *\n * @param {Array<object>} array\n * the specified array of data objects.\n * @param {null|undefined|object} options\n * the additional options for the creation. If this argument is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('assign')`.\n * Available options are:\n * - `normalize: boolean`, indicates whether to normalize this object\n * after the assignment. The default value is `true`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * style of the target object. The default value is `false`.\n * - `sourceNamingStyle: string`, the naming style of the source object,\n * i.e., the elements in the first argument of the `createArray()`\n * method. The default value of this argument is `'LOWER_UNDERSCORE'`.\n * - `targetNamingStyle: string`, the naming style of the target object,\n * i.e., the elements in the array returned by the `createArray()`\n * method. The default value of this argument is `'LOWER_CAMEL'`.\n * - `types: object`, the additional information about types of\n * fields of classes. The keys of this object are the path of the fields\n * or sub-fields of the target object, the values are the type of the\n * fields, represented as the constructor function of the type.\n * The default value is `{}`.\n * - `elementTypes: object`, the additional information about types of\n * elements of fields of classes. The keys of this object are the path of\n * the fields or sub-fields of the target object, the values are the type\n * of the elements, represented as the constructor function of the type.\n * The default value is `{}`.\n * @returns {Array<Class>|null}\n * the new array of instances of this class created from the specified\n * data object array, or `null` if the specified data object array is\n * `null` or `undefined`.\n * @see DefaultOptions.get('assign')\n * @method\n * @memberof Model\n */\n Class.createArray = function createArray(array, options = undefined) {\n return createArrayImpl(Class, array, options);\n };\n }\n // Add the class method `createPage()`\n if (!Object.prototype.hasOwnProperty.call(Class, 'createPage')) {\n /**\n * Creates a new page object based on the specified pagination data object.\n *\n * Typically, the pagination data object is the JSON representation of a\n * list of domain objects obtained from a server using the GET method, and\n * the object should conform to the `Page` class definition.\n *\n * @param {object} page\n * the specified pagination data object, which must conform to the\n * `Page` class definition.\n * @param {null|undefined|object} options\n * the additional options for the creation. If this argument is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('assign')`.\n * Available options are:\n * - `normalize: boolean`, indicates whether to normalize this object\n * after the assignment. The default value is `true`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * style of the target object. The default value is `false`.\n * - `sourceNamingStyle: string`, the naming style of the source object,\n * i.e., the elements in the `content` array of the first argument of\n * the `createPage()` method. The default value of this argument is\n * `'LOWER_UNDERSCORE'`.\n * - `targetNamingStyle: string`, the naming style of the target object,\n * i.e., the elements in the `content` array of the `Page` object\n * returned by the `createPage()` method. The default value of this\n * argument is `'LOWER_CAMEL'`.\n * - `types: object`, the additional information about types of\n * fields of classes. The keys of this object are the path of the fields\n * or sub-fields of the target object, the values are the type of the\n * fields, represented as the constructor function of the type.\n * The default value is `{}`.\n * - `elementTypes: object`, the additional information about types of\n * elements of fields of classes. The keys of this object are the path of\n * the fields or sub-fields of the target object, the values are the type\n * of the elements, represented as the constructor function of the type.\n * The default value is `{}`.\n * @returns {Page|null}\n * A new `Page` object, whose `content` property is the result of\n * `this.createArray(page.content, true)`, and the other properties\n * matching those of the `page` object. If the argument `page` is not a\n * valid `Page` object, this function returns `null`.\n * @see DefaultOptions.get('assign')\n * @method\n * @memberof Model\n */\n Class.createPage = function createPage(page, options = undefined) {\n return createPageImpl(Class, page, options);\n };\n }\n // Add the class method `isNullishOrEmpty()`\n if (!Object.prototype.hasOwnProperty.call(Class, 'isNullishOrEmpty')) {\n /**\n * Determines whether the given instance of this class is `undefined`,\n * `null`, or an empty object constructed with default values.\n *\n * @param {object} obj\n * the specified object.\n * @returns {boolean}\n * `true` if the specified object is `undefined`, or `null` or an empty\n * instance of this class; `false` otherwise.\n * @throws TypeError\n * if the specified object is not nullish and is not a instance of this\n * class.\n * @method\n * @memberof Model\n */\n Class.isNullishOrEmpty = function isNullishOrEmpty(obj) {\n return isNullishOrEmptyImpl(Class, obj);\n };\n }\n // Add the class method `parseJsonString()`\n if (!Object.prototype.hasOwnProperty.call(Class, 'parseJsonString')) {\n /**\n * Parses an object of this class from a JSON string.\n *\n * **NOTE:** This method supports integer values fall out of IEEE 754 integer\n * precision. For example, the integer value `9223372036854775807` will be\n * parsed as the native `bigint` value `9223372036854775807n`.\n *\n * @param {string} json\n * the JSON string to be parsed.\n * @param {null|undefined|object} options\n * the additional options for the parsing. If this argument is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('assign')`.\n * Available options are:\n * - `normalize: boolean`, indicates whether to normalize this object\n * after the assignment. The default value is `true`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * style of the target object. The default value is `false`.\n * - `sourceNamingStyle: string`, the naming style of the source object,\n * i.e., the first argument of the `assign()` method. The default\n * value of this argument is `'LOWER_UNDERSCORE'`.\n * - `targetNamingStyle: string`, the naming style of the target object,\n * i.e., the object calling the `assign()` method. The default value\n * of this argument is `'LOWER_CAMEL'`.\n * @returns {object}\n * the object deserialized from the specified JSON string.\n * @see toJsonString()\n * @method\n * @memberof Model\n */\n Class.parseJsonString = function parseJsonString(json, options = undefined) {\n return parseJsonStringImpl(Class, json, options);\n };\n }\n}\n\nexport default Model;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport getFieldMetadataObject from './get-field-metadata-object';\n\n/**\n * Sets the specified attribute value of the metadata for the specified field\n * of the specified class.\n *\n * @param {object} metadata\n * The metadata of the specified class.\n * @param {string} field\n * The name of the specified field.\n * @param {string} key\n * The key of the specified attribute for the specified field.\n * @param {any} value\n * The attribute value to be set.\n * @author Haixing Hu\n * @private\n */\nfunction setFieldMetadata(metadata, field, key, value) {\n const md = getFieldMetadataObject(metadata, field);\n if (md) {\n md[key] = value;\n } else {\n throw new Error(`The metadata of the field \"${field}\" of the class`);\n }\n}\n\nexport default setFieldMetadata;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { KEY_FIELD_TYPE } from './impl/metadata-keys';\nimport setFieldMetadata from './impl/utils/set-field-metadata';\n\n/**\n * Decorates a class field to mark it as an object of the specified type.\n *\n * The decorated target must be a field of a class.\n *\n * ##### Usage example:\n *\n * ```js\n * class Foo {\n * @Type(ItemType)\n * item = null;\n * }\n * ```\n *\n * @param {function} type\n * The constructor of the class to which the decorated field belongs.\n * @returns {function}\n * The field decorating function, which returns `void`.\n * @author Haixing Hu\n * @see Model\n * @see ElementType\n */\nfunction Type(type) {\n return function decorate(field, { kind, name, metadata }) {\n if (kind !== 'field') {\n throw new SyntaxError(`The decorator @Type can only decorate a class field: ${name}`);\n }\n if (typeof type !== 'function') {\n throw new TypeError(`The argument of @Type decorated on \"${name}\" must be the constructor of a class.`);\n }\n setFieldMetadata(metadata, name, KEY_FIELD_TYPE, type);\n };\n}\n\nexport default Type;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { KEY_FIELD_ELEMENT_TYPE } from './impl/metadata-keys';\nimport setFieldMetadata from './impl/utils/set-field-metadata';\n\n/**\n * Decorates a class field to mark it as an array of the specified type.\n *\n * The decorated target must be a field of a class.\n *\n * ##### Usage example:\n *\n * ```js\n * class Foo {\n * @ElementType(ItemType)\n * items = [];\n * }\n * ```\n *\n * @param {function} elementType\n * The constructor of the class of the element in the decorated field.\n * @returns {function}\n * The field decorating function, which returns `void`.\n * @author Haixing Hu\n * @see Model\n * @see Type\n */\nfunction ElementType(elementType) {\n return function decorate(field, { kind, name, metadata }) {\n if (kind !== 'field') {\n throw new SyntaxError(`The decorator @ElementType can only decorate a class field: ${name}`);\n }\n if (typeof elementType !== 'function') {\n throw new TypeError(`The argument of @ElementType decorated on \"${name}\" must be the constructor of a class.`);\n }\n setFieldMetadata(metadata, name, KEY_FIELD_ELEMENT_TYPE, elementType);\n return (initialValue) => {\n if ((initialValue !== undefined) && (initialValue !== null) && (!Array.isArray(initialValue))) {\n throw new TypeError(`The field \"${name}\" decorated by @ElementType must be initialized with an array.`);\n }\n return initialValue;\n };\n };\n}\n\nexport default ElementType;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Tests whether an object is a decorator context.\n *\n * @param {any} obj\n * The object to be tested.\n * @returns {boolean}\n * `true` if the specified object is a decorator context; otherwise, `false`.\n * @author Haixing Hu\n * @private\n */\nfunction isDecoratorContext(obj) {\n return (obj !== null)\n && (typeof obj === 'object')\n && (obj.metadata !== null)\n && (typeof obj.metadata === 'object')\n && (typeof obj.kind === 'string')\n && (typeof obj.name === 'string');\n}\n\nexport default isDecoratorContext;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport defaultNormalizer from './default-normalizer';\nimport isDecoratorContext from './impl/utils/is-decorator-context';\nimport { KEY_FIELD_NORMALIZER } from './impl/metadata-keys';\nimport setFieldMetadata from './impl/utils/set-field-metadata';\n\n/**\n * Sets the normalizer of a decorated field.\n *\n * @param {undefined} field\n * The decorated target. In the case of decorating a class field, this\n * argument is always `undefined` and is ignored.\n * @param {object} metadata\n * The metadata in the context of the decorated target.\n * @param {string} kind\n * The kind of the decorated target.\n * @param {string} name\n * The name of the decorated target.\n * @param {function} normalizer\n * The normalizer to set.\n * @author Haixing Hu\n * @private\n */\nfunction setNormalizer(field, { metadata, kind, name }, normalizer) {\n if (kind !== 'field') {\n throw new SyntaxError(`The @Normalizable must decorate a class field: ${name}`);\n }\n if (typeof normalizer !== 'function') {\n throw new TypeError(\n `The argument of @Normalizable decorated on the \"${name}\" field must be a function, but it is a ${typeof normalizer}.`,\n );\n }\n setFieldMetadata(metadata, name, KEY_FIELD_NORMALIZER, normalizer);\n}\n\n/**\n * Decorates a class field to specify a normalization function for it.\n *\n * The decorated target must be a non-static field of a class.\n *\n * ##### Usage example:\n *\n * ```js\n * class Foo {\n * @Normalizable(trimUppercaseString)\n * number = '';\n * }\n * ```\n *\n * The argument of this decorator must be a normalization function in the\n * following form:\n * ```js\n * function normalize(value) {\n * ...\n * return result;\n * }\n * ```\n * where\n * - The argument `value` is the field value to be normalized;\n * - The returned value of the function is the result of normalization of the\n * input argument, whose type depends on the type of the decorated field.\n *\n * **NOTE:** If the field is a collection field, such as `Array`, `Set`, `Map`,\n * the normalization function will be called to normalize each element in the\n * collection. Currently, the following JavaScript build-in collection types are\n * supported:\n * - `Array`, `Int8Array`, `Uint8Array`, `Uint8ClampedArray`, `Int16Array`,\n * `Uint16Array`, `Int32Array`, `Uint32Array`, `Float32Array`, `Float64Array`,\n * `BigInt64Array`, `BigUint64Array`: the normalization function will be\n * called to normalize each element in the array.\n * - `Set`: the normalization function will be called to normalize each entry in\n * the set.\n * - `Map`: the normalization function will be called to normalize each value in\n * the map.\n *\n * The decorator can also be used without any arguments, in which case the\n * {@link defaultNormalizer} function will be used. For example,\n * ```js\n * class Foo {\n * @Normalizable\n * code = '';\n *\n * @Normalizable\n * names = [];\n *\n * @Normalizable\n * person = new Person();\n * }\n * ```\n * The default normalization function does the following things:\n * - If the value is `undefined` or `null`, it returns the value itself;\n * - If the value is a string, it returns the trimmed string;\n * - If the value is an array, it returns an array whose elements are normalized\n * by the default normalizer;\n * - If the value is an object, it returns the result of calling the `normalize()`\n * method of the object, if the object has such a method;\n * - Otherwise, it returns the value itself.\n *\n * @param {...any} args\n * The array of arguments for calling this decorator. If it has only one\n * argument, the only argument is the specified normalizer of this\n * decorator, and this function should return another function which is the\n * decorator of a class; If it has two arguments, the first argument is the\n * decorated target (in the case of decorating a class field, this argument\n * should always be `undefined`), and the second argument is the context\n * object containing information about the decorated target.\n * @return {Function|undefined}\n * If this function has only one argument, this function returns another\n * function which is the decorator of a field; otherwise, this function\n * sets the normalizer of the decorated field and returns nothing.\n * @author Haixing Hu\n * @see defaultNormalizer\n * @see Model\n */\nfunction Normalizable(...args) {\n if (args.length === 1) {\n const normalizer = args[0] ?? defaultNormalizer;\n return (field, context) => setNormalizer(field, context, normalizer);\n } else if ((args.length === 2) && isDecoratorContext(args[1])) {\n setNormalizer(args[0], args[1], defaultNormalizer);\n } else {\n throw new SyntaxError('Invalid use of @Normalizable decorator.');\n }\n}\n\nexport default Normalizable;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { isEmpty } from '@qubit-ltd/common-util';\nimport { ValidationResult } from '@qubit-ltd/common-validation-rule';\nimport isEnumClass from './is-enum-class';\n\n/**\n * A default validator for a non-static class field.\n *\n * This validator does the following things:\n * - If the field value is `undefined` or `null`, and the field is not decorated\n * with `@Nullable`, an error is reported.\n * - If the field value is an empty string or an empty collection, and the field\n * is decorated with `@NonEmpty`, an error is reported.\n * - If the field value is a collection, it recursively validates each element\n * in the collection.\n * - If the field value has an initial value, it validates whether the field\n * value has the same type with its initial value.\n * - If the field is decorated with `@Type`, it validates whether the field\n * value has the type specified by the `@Type`.\n * - If the field is a collection and is decorated with `@ElementType`, it\n * validates whether each element of the field value has the type specified by\n * the `@ElementType`.\n * - If the value is an object with the `validate()` method, it returns the\n * result of calling the `validate()` method of the object.\n * - Otherwise, it does nothing and returns a success validation result.\n *\n * @param {any} value\n * the value to be validated.\n * @param {object} context\n * the validation context.\n * @returns {ValidationResult}\n * the validation result.\n * @author Haixing Hu\n * @see Model\n * @see Validatable\n * @see ValidationResult\n */\nfunction defaultValidator(value, { owner, type, label, nullable, nonEmpty }) {\n if (value === undefined || value === null) {\n if (nullable) {\n return new ValidationResult(true);\n } else {\n // TODO: make the message i18n\n // const message = owner\n // ? `The ${label} of ${owner} must be specified.`\n // : `The ${label} must be specified.`;\n const message = owner\n ? `必须设置${owner}的${label}的值`\n : `必须设置${label}的值`;\n return new ValidationResult(false, message);\n }\n }\n if (isEmpty(value)) {\n if (nonEmpty) {\n // TODO: make the message i18n\n // const message = owner\n // ? `The ${label} of ${owner} cannot be empty.`\n // : `The ${label} cannot be empty.`;\n const message = owner\n ? `${owner}的${label}不能为空`\n : `${label}不能为空`;\n return new ValidationResult(false, message);\n }\n }\n if (type) { // validate the type\n // special deal with the case that the type is an enumeration class\n if (isEnumClass(type) && (typeof value === 'string')) {\n if (type.hasValue(value)) {\n return new ValidationResult(true);\n } else {\n // TODO: i18n the following message\n // const message = owner\n // ? `The ${label} of ${owner} is not supported: ${value}`\n // : `The ${label} is not supported: ${value}`;\n const message = owner\n ? `${owner}的${label}的值不受支持: ${value}`\n : `${label}的值不受支持: ${value}`;\n return new ValidationResult(false, message);\n }\n }\n // note that the following test also covers the case that the value is a primitive\n if (value.constructor !== type) {\n // TODO: i18n the following message\n // const message = owner\n // ? `The ${label} of ${owner} must be of the type ${type.name}.`\n // : `The ${label} must be of the type ${type.name}.`;\n const message = owner\n ? `${owner}的${label}必须是 ${type.name} 类型`\n : `${label}必须是 ${type.name} 类型`;\n return new ValidationResult(false, message);\n }\n }\n if ((typeof value === 'object') && (typeof value.validate === 'function')) {\n return value.validate('*', { owner });\n }\n return new ValidationResult(true);\n}\n\nexport default defaultValidator;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { KEY_FIELD_VALIDATOR } from './impl/metadata-keys';\nimport setFieldMetadata from './impl/utils/set-field-metadata';\nimport isDecoratorContext from './impl/utils/is-decorator-context';\nimport defaultValidator from './default-validator';\n\n/**\n * Sets the validator of a decorated field.\n *\n * @param {undefined} field\n * The decorated target. In the case of decorating a class field, this\n * argument is always `undefined` and is ignored.\n * @param {object} metadata\n * The metadata in the context of the decorated target.\n * @param {string} kind\n * The kind of the decorated target.\n * @param {string} name\n * The name of the decorated target.\n * @param {function} validator\n * The validator to set.\n * @author Haixing Hu\n * @private\n */\nfunction setValidator(field, { metadata, kind, name }, validator) {\n if (kind !== 'field') {\n throw new SyntaxError(`The @Validatable must decorate a class field: ${name}`);\n }\n if (typeof validator !== 'function') {\n throw new TypeError(`The argument of @Validatable decorated on the \"${name}\" field must be a function, but it is a ${typeof validator}.`);\n }\n setFieldMetadata(metadata, name, KEY_FIELD_VALIDATOR, validator);\n}\n\n/**\n * Decorates a class field to specify a verification function for it.\n *\n * The decorated target must be a field of a class.\n *\n * ##### Usage example:\n *\n * ```js\n * class Foo {\n * @Validatable(validateNameField)\n * @Label('Name', 'i18n.field.name')\n * name = '';\n *\n * @Validatable(validateIntegerField)\n * @Label('Number', 'i18n.field.number')\n * number = 0;\n *\n * @Validatable(validateIntegerField)\n * @Label('Series', 'i18n.field.series')\n * @ElementType(Number)\n * series = [12, 13, 14];\n *\n * @Validatable\n * bar = new Bar();\n * }\n * ```\n *\n * The verification function in the above example is roughly implemented as\n * follows:\n * ```js\n * function validateNameField(value, context) {\n * if (NAME_PATTERN.test(value)) {\n * return new ValidationResult(true);\n * } else {\n * return new ValidationResult(false, `Please enter the correct ${context.label}`);\n * }\n * }\n *\n * function validateIntegerField(value, context) {\n * if ((typeof value === 'number') && Number.isInteger(value)) {\n * return new ValidationResult(true);\n * } else if ((typeof value === 'string') && /^\\s*[+-]?\\d+\\s*$/.test(value)) {\n * return new ValidationResult(true);\n * }\n * return new ValidationResult(false, `${context.label} must be an integer`);\n * }\n * ```\n *\n * The parameter of this decorator is a verification function, which should have\n * the following form:\n * ```js\n * function validate(value, context) {\n * ...\n * return new ValidationResult(true);\n * }\n * ```\n * Where\n * - The parameter `value` is the field value to be verified;\n * - The parameter `context` is an `Object`, representing the validation context.\n * It may have the following properties:\n * - `instance: object`: the object to which the field belongs.\n * - `owner: string|undefined`: the name of the owner (a person) of the field.\n * - `field: string`: the name of the field to be validated.\n * - `type: function`: the constructor of the field to be validated. If the\n * field is decorated by the `@Type` decorator, this property is the\n * argument of the decorator, otherwise it is the constructor of the\n * default value of the field. If the default value of the field is\n * `null` or `undefined`, this property is set to `undefined`.\n * - `label: string`: the display label of the field to be validated.\n * - `nullable: boolean`: whether the field to be validated is nullable.\n * - `nonEmpty: boolean`: whether the field to be validated is non-empty.\n * - `extraMessage: string`: extra error message.\n * - The return value of the function must be a `ValidationResult` object,\n * representing the verification result.\n *\n * @param {...any} args\n * The array of arguments for calling this decorator. If it has only one\n * argument, the only argument is the specified validator of this\n * decorator, and this function should return another function which is the\n * decorator of a class; If it has two arguments, the first argument is the\n * decorated target (in the case of decorating a class field, this argument\n * should always be `undefined`), and the second argument is the context\n * object containing information about the decorated target.\n * @return {Function|undefined}\n * If this function has only one argument, this function returns another\n * function which is the decorator of a field; otherwise, this function\n * sets the normalizer of the decorated field and returns nothing.\n * @author Haixing Hu\n * @see defaultValidator\n * @see Model\n */\nfunction Validatable(...args) {\n if (args.length === 1) {\n const validator = args[0] ?? defaultValidator;\n return (field, context) => setValidator(field, context, validator);\n } else if ((args.length === 2) && isDecoratorContext(args[1])) {\n setValidator(args[0], args[1], defaultValidator);\n } else {\n throw new SyntaxError('Invalid use of @Validatable decorator.');\n }\n}\n\nexport default Validatable;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { KEY_FIELD_NULLABLE } from './impl/metadata-keys';\nimport setFieldMetadata from './impl/utils/set-field-metadata';\n\n/**\n * Decorates the class field to indicate that it can be `null`.\n *\n * The decorated target must be a field of a class.\n *\n * ##### Usage example:\n *\n * ```js\n * class Employee {\n * @Validatable(nameValidator)\n * @Label('Name', 'i18n.field.name')\n * name = '';\n *\n * @Validatable(integerValidator)\n * @Label('Level', 'i18n.field.level')\n * @Nullable\n * level = 0;\n * }\n * ```\n *\n * @param {undefined} field\n * The decorated target. This argument should be `undefined` if this\n * decorator decorates a class field.\n * @param {string} kind\n * The kind of decorated target. This argument should be `field` if this\n * decorator decorates a class field.\n * @param {string} name\n * The name of the decorated target. This argument should be the name of a\n * class field if this decorator decorates a class field.\n * @param {object} metadata\n * The metadata associated to the class the decorated target belongs to.\n * @author Haixing Hu\n * @see Validatable\n * @see Model\n */\nfunction Nullable(field, { kind, name, metadata }) {\n if (kind !== 'field') {\n throw new SyntaxError(`The decorator @Nullable can only decorate a class field: ${name}`);\n }\n setFieldMetadata(metadata, name, KEY_FIELD_NULLABLE, true);\n}\n\nexport default Nullable;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { KEY_FIELD_NON_EMPTY } from './impl/metadata-keys';\nimport setFieldMetadata from './impl/utils/set-field-metadata';\n\n/**\n * Decorates the class field to indicate that it can be empty.\n *\n * The decorated target must be a field of a class.\n *\n * The decorator can decorate string fields, array fields, map fields, or set\n * fields. Decorating other non-string, non-collection fields has no effect.\n *\n * ##### Usage example:\n *\n * ```js\n * class Employee {\n * @Validatable\n * @Label('Name', 'i18n.field.name')\n * @NonEmpty\n * name = '';\n *\n * @Validatable\n * @Label('Titles', 'i18n.field.titles')\n * @NonEmpty\n * titles = [];\n * }\n * ```\n *\n * @param {undefined} field\n * The decorated target. This argument should be `undefined` if this\n * decorator decorates a class field.\n * @param {string} kind\n * The kind of decorated target. This argument should be `field` if this\n * decorator decorates a class field.\n * @param {string} name\n * The name of the decorated target. This argument should be the name of a\n * class field if this decorator decorates a class field.\n * @param {object} metadata\n * The metadata associated to the class the decorated target belongs to.\n * @author Haixing Hu\n * @see Validatable\n * @see Model\n */\nfunction NonEmpty(field, { kind, name, metadata }) {\n if (kind !== 'field') {\n throw new SyntaxError(`The decorator @NonEmpty can only decorate a class field: ${name}`);\n }\n setFieldMetadata(metadata, name, KEY_FIELD_NON_EMPTY, true);\n}\n\nexport default NonEmpty;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { KEY_FIELD_LABEL } from './impl/metadata-keys';\nimport setFieldMetadata from './impl/utils/set-field-metadata';\n\n/**\n * Decorates a class field to specify its label, i.e., the display name of the\n * field in the UI.\n *\n * The decorated target must be a field of a class.\n *\n * ##### Usage example:\n *\n * ```js\n * class Foo {\n * @Validator(nameValidator)\n * @Label('Foo name')\n * name = '';\n *\n * @Validator(integerValidator)\n * @Label('number', 'i18n.foo.number')\n * number = 0;\n * }\n * ```\n *\n * @param {string} label\n * The label of the field.\n * @param {string} i18n\n * The i18n key of the label. If this parameter is not specified, then the\n * label is not internationalized.\n * @returns {function}\n * The field decorating function, which returns `void`.\n * @author Haixing Hu\n * @see Model\n * @see Enum\n */\nfunction Label(label, i18n = undefined) {\n return function decorate(field, { kind, name, metadata }) {\n if (kind !== 'field') {\n throw new SyntaxError(`The decorator @Label can only decorate a class field: ${name}`);\n }\n if (typeof label !== 'string') {\n throw new TypeError(`The first argument of @Label decorated on \"${name}\" must be a string.`);\n }\n if ((i18n !== undefined) && (typeof i18n !== 'string')) {\n throw new TypeError(`The second argument of @Label decorated on \"${name}\" must be a string.`);\n }\n setFieldMetadata(metadata, name, KEY_FIELD_LABEL, { label, i18n });\n };\n}\n\nexport default Label;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { KEY_FIELD_PAYLOAD } from './impl/metadata-keys';\nimport setFieldMetadata from './impl/utils/set-field-metadata';\n\n/**\n * Decorates a static filed of an enumeration class to specify the payload of\n * the static field, i.e., the extra properties attached to the enumerator\n * corresponding to the static field.\n *\n * The decorated target must be a static field of a class.\n *\n * ##### Usage example:\n *\n * ```js\n * @Enum\n * class Gender {\n * @Label('Male', 'i18n.gender.male')\n * @Payload({ code: '001', data: 0 })\n * static MALE;\n *\n * @Label('Female', 'i18n.gender.female')\n * @Payload({ code: '002', data: 1 })\n * static FEMALE;\n * }\n * ```\n *\n * @param {object} payload\n * The object containing payload properties to be set. Note that the\n * properties `name`, `label`, and `i18n` cannot be included in this object,\n * since they are already used by the `@Enum` and `@Label` decorator.\n * @returns {function}\n * The field decorating function, which returns `void`.\n * @author Haixing Hu\n * @see Enum\n */\nfunction Payload(payload) {\n return function decorate(field, { kind, name, metadata }) {\n if (kind !== 'field') {\n throw new TypeError(`The decorator @Payload can only decorate a class field: ${name}`);\n }\n if (payload === null || typeof payload !== 'object') {\n throw new TypeError(`The argument of @Payload decorated on \"${name}\" must be a non-null object.`);\n }\n if (Object.prototype.hasOwnProperty.call(payload, 'name')) {\n throw new TypeError(`The argument of @Payload decorated on \"${name}\" cannot contain the reserved property \"name\".`);\n }\n if (Object.prototype.hasOwnProperty.call(payload, 'label')) {\n throw new TypeError(`The argument of @Payload decorated on \"${name}\" cannot contain the reserved property \"label\".`);\n }\n if (Object.prototype.hasOwnProperty.call(payload, 'i18n')) {\n throw new TypeError(`The argument of @Payload decorated on \"${name}\" cannot contain the reserved property \"i18n\".`);\n }\n setFieldMetadata(metadata, name, KEY_FIELD_PAYLOAD, payload);\n };\n}\n\nexport default Payload;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { KEY_CLASS_NAME_FIELD } from './impl/metadata-keys';\n\n/**\n * Decorates a class field to specify it as the \"name\" of the object.\n *\n * The decorated target must be a field of a class.\n *\n * ##### Usage example:\n *\n * ```js\n * class Foo {\n * @Validatable(nameValidator)\n * @Label('Name')\n * @NameField\n * name = '';\n *\n * @Validatable\n * @Label('Gender')\n * @Type(Gender)\n * @Nullable\n * gender = null;\n *\n * @Validatable(validatePersonBirthday)\n * @Label('Birthday')\n * @Nullable\n * birthday = '';\n * }\n * ```\n *\n * @param {undefined} field\n * The decorated target. This argument should be `undefined` if this\n * decorator decorates a class field.\n * @param {string} kind\n * The kind of decorated target. This argument should be `field` if this\n * decorator decorates a class field.\n * @param {string} name\n * The name of the decorated target. This argument should be the name of a\n * class field if this decorator decorates a class field.\n * @param {object} metadata\n * The metadata associated to the class the decorated target belongs to.\n * @author Haixing Hu\n * @see Model\n */\nfunction NameField(field, { kind, name, metadata }) {\n if (kind !== 'field') {\n throw new SyntaxError(`The decorator @NameField can only decorate a class field: ${name}`);\n }\n // Set the name of the decorated field as the name field of the class\n const oldField = metadata[KEY_CLASS_NAME_FIELD];\n if (oldField) {\n throw new SyntaxError(`@NameField cannot decorate on \"${name}\", since it has already decorated on \"${oldField}\".`);\n }\n metadata[KEY_CLASS_NAME_FIELD] = name;\n}\n\nexport default NameField;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { KEY_CLASS_CATEGORY } from './impl/metadata-keys';\nimport getClassMetadata from './impl/utils/get-class-metadata';\n\n/**\n * Tests whether a specified value is an enumerator of an enumeration class,\n * i.e., the static constants of a class decorated by `@Enum`.\n *\n * @param {any} value\n * The specified value.\n * @return {boolean}\n * `true` if the specified value is an enumerator of an enumeration class,\n * i.e., the static constants of a class decorated by `@Enum`; `false`\n * otherwise.\n * @author Haixing Hu\n */\nfunction isEnumerator(value) {\n if (value === undefined || value === null || (typeof value !== 'object')) {\n return false;\n }\n const Class = Object.getPrototypeOf(value).constructor;\n const category = getClassMetadata(Class, KEY_CLASS_CATEGORY);\n return category === 'enum';\n}\n\nexport default isEnumerator;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Defines an enumerator of an enumeration class.\n *\n * This function will modify the specified static field of the specified class\n * to be an instance of the enumeration class, and then freeze it.\n *\n * @param {function} Class\n * The constructor of the specified class.\n * @param {string} field\n * The name of the static field corresponding to the enumerator to be defined.\n * @author Haixing Hu\n * @private\n */\nfunction defineEnumerator(Class, field) {\n const defaultValue = Class[field];\n // redefine the static field to be an instance of the enumeration class\n const enumerator = new Class();\n enumerator.value = field;\n if (defaultValue === undefined || defaultValue === null) {\n enumerator.name = field;\n } else if (typeof defaultValue === 'string') {\n enumerator.name = defaultValue;\n } else if (typeof defaultValue === 'object') {\n Object.assign(enumerator, defaultValue);\n // if (enumerator.i18n) {\n // TODO: add i18n support\n // }\n } else {\n throw new TypeError('The default value of the enumerator '\n + `${Class.name}.${field} should be either a string or an object.`);\n }\n Object.freeze(enumerator);\n Class[field] = enumerator;\n}\n\nexport default defineEnumerator;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Returns the array of all enumerators of an enumeration class.\n *\n * @param {function} Class\n * The constructor of the specified enumeration class.\n * @return {Array<object>}\n * The array of all enumerators of the specified enumeration class.\n * @author Haixing Hu\n * @private\n */\nfunction valuesImpl(Class) {\n return Object.keys(Class)\n .filter((key) => (Class[key] instanceof Class))\n .map((key) => Class[key]);\n}\n\nexport default valuesImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { isString } from '@qubit-ltd/type-detect';\n\n/**\n * Returns the enumerator of an enumeration class which has the specified code.\n *\n * @param {function} Class\n * The constructor of the specified enumeration class.\n * @param {string} code\n * The code of the enumerator to be returned. If the code is a primitive\n * string or a `String` object, it will be trimmed.\n * @returns {undefined|Class}\n * The enumerator of the specified enumeration class which has the specified\n * code; or `undefined` if there is no such enumerator.\n * @author Haixing Hu\n * @private\n */\nfunction ofCodeImpl(Class, code) {\n if (!isString(code)) {\n return undefined;\n }\n const target = String(code).trim(); // ensure the code is a primitive string and trim it\n const item = Object.keys(Class)\n .filter((key) => (Class[key] instanceof Class))\n .find((key) => Class[key]?.code === target);\n return (item ? Class[item] : undefined);\n}\n\nexport default ofCodeImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { isString } from '@qubit-ltd/type-detect';\n\n/**\n * Returns the enumerator of an enumeration class which has the specified name.\n *\n * @param {function} Class\n * The constructor of the specified enumeration class.\n * @param {string} name\n * The name of the enumerator to be returned. If the name is a primitive\n * string or a `String` object, it will be trimmed.\n * @returns {undefined|Class}\n * The enumerator of the specified enumeration class which has the specified\n * name; or `undefined` if there is no such enumerator.\n * @author Haixing Hu\n * @private\n */\nfunction ofNameImpl(Class, name) {\n if (!isString(name)) {\n return undefined;\n }\n const target = String(name).trim(); // ensure the name is a primitive string and trim it\n const item = Object.keys(Class)\n .filter((key) => (Class[key] instanceof Class))\n .find((key) => Class[key]?.name === target);\n return (item ? Class[item] : undefined);\n}\n\nexport default ofNameImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { isString } from '@qubit-ltd/type-detect';\nimport ofCodeImpl from './of-code-impl';\nimport ofNameImpl from './of-name-impl';\nimport ofValueImpl from './of-value-impl';\n\n/**\n * Returns the enumerator of an enumeration class corresponding to the specified\n * value.\n *\n * The value could be an enumerator of the enumeration class, or the value of an\n * enumerator of the enumeration class, or the name of an enumerator of the\n * enumeration class, or the code of an enumerator of the enumeration class.\n *\n * @param {function} Class\n * The constructor of the specified enumeration class.\n * @param {object|string} value\n * The specified value.\n * @returns {undefined|object}\n * The enumerator corresponding to the specified value.; or `undefined` if\n * there is no such enumerator.\n * @author Haixing Hu\n * @private\n */\nfunction ofImpl(Class, value) {\n if ((value === undefined) || (value === null)) {\n return undefined;\n }\n if (value instanceof Class) {\n return value;\n }\n if (isString(value)) {\n return ofValueImpl(Class, value)\n ?? ofNameImpl(Class, value)\n ?? ofCodeImpl(Class, value);\n }\n return undefined;\n}\n\nexport default ofImpl;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { registerCloneHook } from '@qubit-ltd/clone';\nimport isEnumerator from './is-enumerator';\nimport classMetadataCache from './impl/class-metadata-cache';\nimport setClassMetadata from './impl/utils/set-class-metadata';\nimport { KEY_CLASS_CATEGORY } from './impl/metadata-keys';\nimport defineEnumerator from './impl/enum/define-enumerator';\nimport ofValueImpl from './impl/enum/of-value-impl';\nimport valuesImpl from './impl/enum/values-impl';\nimport ofCodeImpl from './impl/enum/of-code-impl';\nimport ofNameImpl from './impl/enum/of-name-impl';\nimport ofImpl from './impl/enum/of-impl';\n\n/**\n * This decorator is used to decorate an enumeration class.\n *\n * It must decorate a class.\n *\n * An enumeration class is a class whose instances are enumerators. An enumerator\n * is an object with the following properties:\n * - `value`:the value of the enumerator, which is exactly the name of the\n * static field of the enumeration class that corresponds to the enumerator.\n * - `name`: the display name of the enumerator, which could be specified\n * by the default string or object value of the static field of the\n * enumeration class that corresponds to the enumerator. It the default value\n * is not specified, the name of the enumerator is the same as its value.\n * - `i18n`: the i18n key of the enumerator, which is an optional property. It\n * could be specified by the default object value of the static field of the\n * enumeration class that corresponds to the enumerator. If this property is\n * specified, the `name` property will be transformed to a `getter`, which will\n * get the i18n value of the enumerator from the i18n resource bundle.\n * - `code`: the code of the enumerator, which is an optional property. It could\n * be specified by the default object value of the static field of the\n * enumeration class that corresponds to the enumerator.\n * - other properties: other properties of the enumerator could be specified\n * by the default object value of the static field of the enumeration class\n * that corresponds to the enumerator.\n *\n * An enumerator also has the following prototype method:\n * - `toString()`: returns the value of the enumerator.\n * - `toJSON()`: also returns the value of the enumerator.\n *\n * The enumeration class will have the following static methods:\n * - `values()`: returns the array of all enumerators of this enumeration class.\n * - `ofValue(value): returns the enumerator whose value is `value`, or\n * `undefined` if no such enumerator exists.\n * - `hasValue(value): returns `true` if there is an enumerator whose value is\n * `value`, or `false` otherwise.\n * - `ofName(name): returns the enumerator whose name is `name`, or `undefined`\n * if no such enumerator exists.\n * - `hasName(name): returns `true` if there is an enumerator whose name is\n * `name`, or `false` otherwise.\n * - `ofCode(code): returns the enumerator whose code is `code`, or `undefined`\n * if no such enumerator exists.\n * - `hasCode(code): returns `true` if there is an enumerator whose code is\n * `code`, or `false` otherwise.\n * - `of(expr): returns the enumerator corresponding to the specified expression.\n * The expression could be one of the following:\n * - an enumerator of this enumeration class;\n * - or the value of an enumerator of this enumeration class;\n * - or the name of an enumerator of this enumeration class;\n * - or the code of an enumerator of this enumeration class.\n * - `has(value): returns `true` if there is an enumerator corresponding to the\n * specified expression; or `false` otherwise. The expression could be one of\n * the following:\n * - an enumerator of this enumeration class;\n * - or the value of an enumerator of this enumeration class;\n * - or the name of an enumerator of this enumeration class;\n * - or the code of an enumerator of this enumeration class.\n *\n * ##### Usage example:\n *\n * ```js\n * @Enum\n * class Gender {\n * static MALE = 'Male';\n * static FEMALE = 'Female';\n * }\n * ```\n * The above code is equivalent to the following code:\n * ```js\n * class Gender {\n * static MALE = Object.freeze(new Gender('MALE', 'Male'));\n *\n * static FEMALE = Object.freeze(new Gender('FEMALE', 'Female'));\n *\n * static values() {\n * return [ Gender.MALE, Gender.FEMALE ];\n * }\n *\n * static ofValue(value) {\n * switch (value) {\n * case 'MALE':\n * return Gender.MALE;\n * case 'FEMALE':\n * return Gender.FEMALE;\n * default:\n * return undefined;\n * }\n * }\n *\n * static hasValue(value) {\n * return Gender.ofValue(value) !== undefined;\n * }\n *\n * static ofName(name) {\n * return Gender.values().find((e) => e.name === name);\n * }\n *\n * static hasName(name) {\n * return Gender.ofName(name) !== undefined;\n * }\n *\n * static ofCode(code) {\n * return Gender.values().find((e) => e.code === code);\n * }\n *\n * static hasCode(code) {\n * return Gender.ofCode(code) !== undefined;\n * }\n *\n * static of(expr) {\n * if (expr instanceof Gender) {\n * return expr;\n * } else {\n * return Gender.ofValue(expr) ?? Gender.ofName(expr) ?? Gender.ofCode(expr);\n * }\n * }\n *\n * static has(expr) {\n * return Gender.of(expr) !== undefined;\n * }\n *\n * constructor(value, name) {\n * this.value = value;\n * this.name = name;\n * }\n *\n * toString() {\n * return this.value;\n * }\n *\n * toJSON() {\n * return this.value;\n * }\n * }\n * ```\n *\n * The static fields of the enumeration class could also be specified as objects,\n * which will be used to initialize the enumerators. For example:\n * ```js\n * @Enum\n * class Gender {\n * static MALE = { name: 'Male', i18n: 'i18n.gender.male', code: '001', data: { value: 0 } };\n *\n * static FEMALE = { name: 'Female', i18n: 'i18n.gender.female', code: '002', data: { value: 1 } };\n * }\n * ```\n * The above code is equivalent to the following code:\n * ```js\n * class Gender {\n * static MALE = Object.freeze(new Gender('MALE', 'Male',\n * { i18n: 'i18n.gender.male', code: '001', data: {value: 0 } }));\n *\n * static FEMALE = Object.freeze(new Gender('FEMALE', 'Female',\n * { i18n: 'i18n.gender.female', code: '002', data: {value: 1 } }));\n *\n * ...\n *\n * constructor(value, name, payload) {\n * this.value = value;\n * this.name = name;\n * Object.assign(this, payload);\n * }\n *\n * ...\n * }\n * ```\n * Note that the enumerator in the above `Gender` class has a `code`, `i18n`\n * and `data` properties. Since it has `i18n` property which specifies the i18n\n * key of the enumerator in the resource bundle, the `name` property of the\n * enumerator will be transformed to a `getter` which will get the i18n value\n * corresponding to the i18n key from the i18n resource bundle.\n *\n * The enumerators can also be defined without default values, for example:\n * ```js\n * @Enum\n * class Gender {\n * static MALE;\n * static FEMALE;\n * }\n * ```\n * The above code is equivalent to the following code:\n * ```js\n * class Gender {\n * static MALE = Object.freeze(new Gender('MALE'));\n *\n * static FEMALE = Object.freeze(new Gender('FEMALE'));\n *\n * ...\n *\n * constructor(value) {\n * this.value = value;\n * this.name = value;\n * }\n *\n * ...\n * }\n * ```\n * That is, the name of the enumerator is exactly its value.\n *\n * @param {function} Class\n * The constructor of the class being decorated.\n * @param {object} context\n * The context object containing information about the class being decorated.\n * @namespace\n * @author Haixing Hu\n */\nfunction Enum(Class, context) {\n if (context === null || typeof context !== 'object') {\n throw new TypeError('The context must be an object.');\n }\n if (typeof Class !== 'function' || context.kind !== 'class') {\n throw new TypeError('The `@Enum` can only decorate a class.');\n }\n // put the context.metadata to the cache\n classMetadataCache.set(Class, context.metadata);\n // The category of the class modified by `@Enum` is set to 'enum'\n setClassMetadata(Class, KEY_CLASS_CATEGORY, 'enum');\n // Loops through all static fields of the `Class` and defines them as enumerators\n context.addInitializer(() => {\n // NOTE that we must perform the following code in the `context.addInitializer()`\n // function, since the decorator @Enum is applied **BEFORE** the static fields\n // of the class were defined, but the `context.addInitializer()` function is\n // called **AFTER** the static fields of the class were defined.\n // see https://github.com/tc39/proposal-decorators#adding-initialization-logic-with-addinitializer\n Object.keys(Class).forEach((field) => {\n if (typeof Class[field] !== 'function') {\n defineEnumerator(Class, field);\n }\n });\n // freeze the enumeration class\n Object.freeze(Class);\n });\n // Add prototype method toString()\n Class.prototype.toString = function toString() {\n return this.value;\n };\n // Add prototype method toJSON()\n Class.prototype.toJSON = function toJSON() {\n return this.value;\n };\n\n /**\n * Returns the array of all enumerators of this enumeration class.\n *\n * @returns {Array<object>}\n * The array of all enumerators of this enumeration class.\n * @method\n * @memberof Enum\n */\n Class.values = function values() {\n return valuesImpl(Class);\n };\n\n /**\n * Returns the enumerator of this enumeration class which has the specified\n * value.\n *\n * @param {string} value\n * The value of the enumerator to be returned. If the value is a primitive\n * string or a `String` object, it will be trimmed and converted to an\n * uppercase string.\n * @returns {undefined|Class}\n * The enumerator of this enumeration class which has the specified value;\n * or `undefined` if there is no such enumerator.\n * @author Haixing Hu\n * @method\n * @memberof Enum\n */\n Class.ofValue = function ofValue(value) {\n return ofValueImpl(Class, value);\n };\n\n /**\n * Tests whether there is an enumerator of this enumeration class which has\n * the specified value.\n *\n * @param {string} value\n * The value of the enumerator to be tested. If the value is a primitive\n * string or a `String` object, it will be trimmed and converted to an\n * uppercase string.\n * @returns {boolean}\n * `true` if there is an enumerator of this enumeration class which has\n * the specified value; `false` otherwise.\n * @author Haixing Hu\n * @method\n * @memberof Enum\n */\n Class.hasValue = function hasValue(value) {\n return (ofValueImpl(Class, value) !== undefined);\n };\n\n /**\n * Returns the enumerator of this enumeration class which has the specified\n * name.\n *\n * @param {string} name\n * The name of the enumerator to be returned. If the name is a primitive\n * string or a `String` object, it will be trimmed.\n * @returns {undefined|Class}\n * The enumerator of this enumeration class which has the specified name;\n * or `undefined` if there is no such enumerator.\n * @author Haixing Hu\n * @method\n * @memberof Enum\n */\n Class.ofName = function ofName(name) {\n return ofNameImpl(Class, name);\n };\n\n /**\n * Tests whether there is an enumerator of this enumeration class which has\n * the specified name.\n *\n * @param {string} name\n * The specified name. If the name is a primitive string or a `String`\n * object, it will be trimmed.\n * @returns {boolean}\n * `true` if there is an enumerator of this enumeration class which has\n * the specified name; `false` otherwise.\n * @author Haixing Hu\n * @method\n * @memberof Enum\n */\n Class.hasName = function hasName(name) {\n return (ofNameImpl(Class, name) !== undefined);\n };\n\n /**\n * Returns the enumerator of this enumeration class which has the specified\n * code.\n *\n * @param {string} code\n * The code of the enumerator to be returned. If the code is a primitive\n * string or a `String` object, it will be trimmed.\n * @returns {undefined|Class}\n * The enumerator of this enumeration class which has the specified code;\n * or `undefined` if there is no such enumerator.\n * @author Haixing Hu\n * @method\n * @memberof Enum\n */\n Class.ofCode = function ofCode(code) {\n return ofCodeImpl(Class, code);\n };\n\n /**\n * Tests whether there is an enumerator of this enumeration class which has\n * the specified code.\n *\n * @param {string} code\n * The specified code. If the code is a primitive string or a `String`\n * object, it will be trimmed.\n * @returns {boolean}\n * `true` if there is an enumerator of this enumeration class which has\n * the specified code; `false` otherwise.\n * @author Haixing Hu\n * @method\n * @memberof Enum\n */\n Class.hasCode = function hasCode(code) {\n return (ofCodeImpl(Class, code) !== undefined);\n };\n\n /**\n * Returns the enumerator of this enumeration class corresponding to the\n * specified expression.\n *\n * The expression could be one of the following:\n * - an enumerator of this enumeration class;\n * - or the value of an enumerator of this enumeration class;\n * - or the name of an enumerator of this enumeration class;\n * - or the code of an enumerator of this enumeration class.\n *\n * @param {object|string} expr\n * The specified value, which could be an enumerator object, the value of\n * an enumerator, the name of an enumerator, or the code of an enumerator.\n * @returns {undefined|object}\n * The enumerator corresponding to the specified enumerator, value, name\n * or code; or `undefined` if there is no such enumerator.\n * @author Haixing Hu\n * @method\n * @memberof Enum\n */\n Class.of = function of(expr) {\n return ofImpl(Class, expr);\n };\n\n /**\n * Tests whether there is an enumerator of this enumeration class corresponding\n * to the specified expression.\n *\n * The expression could be one of the following:\n * - an enumerator of this enumeration class;\n * - or the value of an enumerator of this enumeration class;\n * - or the name of an enumerator of this enumeration class;\n * - or the code of an enumerator of this enumeration class.\n *\n * @param {object|string} expr\n * The specified expression, which could be an enumerator object, the value\n * of an enumerator, the name of an enumerator, or the code of an enumerator.\n * @returns {boolean}\n * `true` if there is an enumerator corresponding to the specified\n * enumerator, value, name or code; `false` otherwise.\n * @author Haixing Hu\n * @method\n * @memberof Enum\n */\n Class.has = function has(expr) {\n return (ofImpl(Class, expr) !== undefined);\n };\n}\n\n// Globally register the clone hook of enumerators.\nregisterCloneHook((info, obj) => {\n if (isEnumerator(obj)) {\n return obj; // the enumerator should not be cloned\n }\n return null;\n});\n\nexport default Enum;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport assignImpl from './impl/model/assign-impl';\n\n/**\n * Copies the properties from a source data object to the target object, only\n * copying properties defined in the class of the target object.\n *\n * If a property in the data object is `undefined` or `null`, the function\n * sets the property of the target object to the default value.\n *\n * Note that the data object may have a different prototype than the target object.\n *\n * @param {object} target\n * The target object which will be assigned to. This object must be an\n * instance of the specified `Class`. Each fields of this object will be\n * assigned from the corresponding fields of the source object, recursively.\n * @param {object} source\n * The source object which will be assigned from. This object may be any\n * plain old JavaScript object without class information.\n * @param {null|undefined|object} options\n * the optional options for the assignment. If this argument is `undefined`\n * or `null`, the default options will be used. The default options can be\n * retrieved by calling `DefaultOptions.get('assign')`.\n * Available options are:\n * - `normalize: boolean`, indicates whether to normalize this object\n * after the assignment. The default value is `true`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * style of the target object. The default value is `false`.\n * - `sourceNamingStyle: string | NamingStyle`, the naming style of the\n * source object, i.e., the first argument of the `assign()` method.\n * The default value of this argument is {@link LOWER_UNDERSCORE}.\n * - `targetNamingStyle: string | NamingStyle`, the naming style of the\n * target object, i.e., the object calling the `assign()` method. The\n * default value of this argument is {@link LOWER_CAMEL}.\n * - `types: object`, the additional information about types of\n * fields of classes. The keys of this object are the path of the fields\n * or sub-fields of the target object, the values are the type of the\n * fields, represented as the constructor function of the type.\n * The default value is `{}`.\n * - `elementTypes: object`, the additional information about types of\n * elements of fields of classes. The keys of this object are the path of\n * the fields or sub-fields of the target object, the values are the type\n * of the elements, represented as the constructor function of the type.\n * The default value is `{}`.\n * @return {Class}\n * The target object after assignment.\n * @see DefaultOptions.get('assign')\n * @author Haixing Hu\n */\nfunction assign(target, source, options = undefined) {\n if (typeof target !== 'object') {\n throw new TypeError('The target object must be an object.');\n }\n const Class = target.constructor;\n return assignImpl(Class, target, source, options);\n}\n\nexport default assign;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport createImpl from './impl/model/create-impl';\n\n/**\n * Creates a new instance of the specified class based on a data object.\n *\n * It copies the property values from the corresponding properties of the\n * specified data object maintaining the same prototype and class definition.\n *\n * If a property in the data object is `undefined` or `null`, the function\n * sets the property of the created instance to the default value.\n *\n * This method is usually used to transform a plain JSON object into the\n * specified domain object.\n *\n * @param {function} Class\n * The constructor of a class.\n * @param {object} obj\n * The data object, usually obtained from a JSON object.\n * @param {object} options\n * the additional options for the creation. If this argument is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('assign')`.\n * Available options are:\n * - `normalize: boolean`, indicates whether to normalize this object\n * after the assignment. The default value is `true`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * style of the target object. The default value is `false`.\n * - `sourceNamingStyle: NamingStyle`, the naming style of the source\n * object. The default value is {@link LOWER_UNDERSCORE}.\n * - `targetNamingStyle: NamingStyle`, the naming style of the target\n * object. The default value is {@link LOWER_CAMEL}.\n * - `types: object`, the additional information about types of\n * fields of classes. The keys of this object are the path of the fields\n * or sub-fields of the target object, the values are the type of the\n * fields, represented as the constructor function of the type.\n * The default value is `{}`.\n * - `elementTypes: object`, the additional information about types of\n * elements of fields of classes. The keys of this object are the path of\n * the fields or sub-fields of the target object, the values are the type\n * of the elements, represented as the constructor function of the type.\n * The default value is `{}`.\n * @returns {Class | null}\n * If the `obj` is `undefined` or `null`, returns `null`; otherwise, returns\n * a new instance of the model class whose fields are initialized with the\n * data in the `obj`.\n * @see DefaultOptions.get('assign')\n * @author Haixing Hu\n */\nfunction create(Class, obj, options = undefined) {\n return createImpl(Class, obj, options);\n}\n\nexport default create;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport createArrayImpl from './impl/model/create-array-impl';\n\n/**\n * Creates a new array of instances of the specified class based on an array of\n * data objects.\n *\n * The property values of each element in the created instances array are\n * copied from the corresponding elements in the data object array,\n * maintaining the same prototype and class definition.\n *\n * This method is usually used to transform an array of plain JSON objects\n * into an array of specified domain objects.\n *\n * @param {function} Class\n * The constructor of the specified class.\n * @param {array} array\n * The specified array of objects.\n * @param {object} options\n * the additional options for the creation. If this argument is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('assign')`.\n * Available options are:\n * - `normalize: boolean`, indicates whether to normalize this object\n * after the assignment. The default value is `true`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * style of the target object. The default value is `false`.\n * - `sourceNamingStyle: NamingStyle`, the naming style of the source\n * object. The default value is {@link LOWER_UNDERSCORE}.\n * - `targetNamingStyle: NamingStyle`, the naming style of the target\n * object. The default value is {@link LOWER_CAMEL}.\n * - `types: object`, the additional information about types of\n * fields of classes. The keys of this object are the path of the fields\n * or sub-fields of the target object, the values are the type of the\n * fields, represented as the constructor function of the type.\n * The default value is `{}`.\n * - `elementTypes: object`, the additional information about types of\n * elements of fields of classes. The keys of this object are the path of\n * the fields or sub-fields of the target object, the values are the type\n * of the elements, represented as the constructor function of the type.\n * The default value is `{}`.\n * @return {array}\n * A new array of instances of the specified class, or `null` if the\n * specified array is `undefined` or `null`. Each element of the created\n * array is an instance of the specified class, whose fields are initialized\n * with the corresponding element of the specified object array.\n * @see DefaultOptions.get('assign')\n * @author Haixing Hu\n */\nfunction createArray(Class, array, options = undefined) {\n return createArrayImpl(Class, array, options);\n}\n\nexport default createArray;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport createPageImpl from './impl/model/create-page-impl';\n\n/**\n * Creates a new page object based on the specified pagination data object.\n *\n * Typically, the pagination data object is the JSON representation of a\n * list of domain objects obtained from a server using the GET method, and\n * the object should conform to the `Page` class definition.\n *\n * @param {function} Class\n * The constructor of the class of the page content.\n * @param {object} page\n * The data of the page.\n * @param {object} options\n * the additional options for the creation. If this argument is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('assign')`.\n * Available options are:\n * - `normalize: boolean`, indicates whether to normalize this object\n * after the assignment. The default value is `true`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * style of the target object. The default value is `false`.\n * - `sourceNamingStyle: NamingStyle`, the naming style of the source\n * object. The default value is {@link LOWER_UNDERSCORE}.\n * - `targetNamingStyle: NamingStyle`, the naming style of the target\n * object. The default value is {@link LOWER_CAMEL}.\n * - `types: object`, the additional information about types of\n * fields of classes. The keys of this object are the path of the fields\n * or sub-fields of the target object, the values are the type of the\n * fields, represented as the constructor function of the type.\n * The default value is `{}`.\n * - `elementTypes: object`, the additional information about types of\n * elements of fields of classes. The keys of this object are the path of\n * the fields or sub-fields of the target object, the values are the type\n * of the elements, represented as the constructor function of the type.\n * The default value is `{}`.\n * @returns {Page}\n * The created `Page` object.\n * @see DefaultOptions.get('assign')\n * @see Page\n * @author Haixing Hu\n */\nfunction createPage(Class, page, options = undefined) {\n return createPageImpl(Class, page, options);\n}\n\nexport default createPage;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport defaultNormalizer from './default-normalizer';\n\n/**\n * Normalizes a value with the default normalizer.\n *\n * This function does the following things:\n * - If the value is `undefined` or `null`, it returns the value itself;\n * - If the value is a string, it returns the trimmed string;\n * - If the value is a collection, it returns the same type of collection whose\n * elements are normalized by the default normalizer;\n * - If the value is an object, it returns the result of calling the `normalize()`\n * method of the object, if the object has such a method;\n * - Otherwise, it returns the value itself.\n *\n * Currently, the following JavaScript build-in collection types are supported:\n * - `Array`, `Int8Array`, `Uint8Array`, `Uint8ClampedArray`, `Int16Array`,\n * `Uint16Array`, `Int32Array`, `Uint32Array`, `Float32Array`, `Float64Array`,\n * `BigInt64Array`, `BigUint64Array`: the normalization function will be called\n * to normalize each element in the collection.\n * - `Set`, `WeakSet`: the normalization function will be called to normalize\n * each entry in the set.\n * - `Map`, `WeakMap`: the normalization function will be called to normalize\n * each value in the map.\n *\n * @param {any} value\n * The value to be normalized.\n * @return {any}\n * The normalized value.\n * @author Haixing Hu\n */\nfunction normalize(value) {\n return defaultNormalizer(value);\n}\n\nexport default normalize;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport toJsonImpl from './impl/model/to-json-impl';\n\n/**\n * Converts an object to the object to be serialized by `JSON.stringify()`.\n *\n * If the value has a `toJSON()` method, it's responsible to define what\n * data will be serialized. Instead of the object being serialized, the value\n * returned by the `toJSON()` method when called will be serialized.\n *\n * **NOTE:** this function returns an object to be serialized by\n * `JSON.stringify()`, instead of a JSON string. Use `JSON.stringify()`\n * or `this.toJsonString()` methods to serialize this object into a JSON\n * string.\n *\n * @param {any} value\n * the value to be serialized.\n * @param {null|undefined|object} options\n * the additional options for the serialization. If this argument is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('toJSON')`.\n * Available options are:\n *\n * - `normalize: boolean`, indicates whether to normalize this object\n * before serializing. The default value is `true`.\n * - `removeEmptyFields: boolean`, indicates whether to ignore the empty\n * fields of the object. If it is `true`, the empty fields of the object\n * will be removed before serialization. The default value is `false`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * of properties of the object represented by the result JSON string.\n * The default value is `false`.\n * - `sourceNamingStyle: string | NamingStyle`, the naming style of the\n * source object, i.e., the object calling the `toJSON()` method.\n * The default value of this argument is {@link LOWER_CAMEL}.\n * - `targetNamingStyle: string | NamingStyle`, the naming style of the\n * target object, i.e., the object represented by the result JSON\n * string of the `toJSON()` method. The default value of this argument\n * is {@link LOWER_UNDERSCORE}.\n * - `space: string | number`, a string or number that's used to insert\n * white space (including indentation, line break characters, etc.) into\n * the output JSON string for readability purposes. If this is a number,\n * it indicates the number of space characters to be used as indentation,\n * clamped to 10 (that is, any number greater than 10 is treated as if\n * it were 10). Values less than 1 indicate that no space should be used.\n * If this is a string, the string (or the first 10 characters of the\n * string, if it's longer than that) is inserted before every nested\n * object or array. If this is anything other than a string or number\n * (can be either a primitive or a wrapper object) — for example, is\n * `null` or not provided — no white space is used. The default value\n * of this option is `null`.\n * @returns {object}\n * the plain old JavaScript object to be serialized by `JSON.stringify()`.\n * @see DefaultOptions.get('toJSON')\n * @author Haixing Hu\n */\nfunction toJSON(value, options = {}) {\n return toJsonImpl(value, '', {\n ...options,\n skipRootToJSON: false, // always use the toJSON() method of the root object\n });\n}\n\nexport default toJSON;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport toJsonStringImpl from './impl/model/to-json-string-impl';\n\n/**\n * Serializes the specified into a JSON string.\n *\n * **NOTE:** This method supports native `bigint` value. For example, the\n * `bigint` value `9223372036854775807n` will be stringify as\n * `9223372036854775807`.\n *\n * @param {object} obj\n * the object to be serialized.\n * @param {null|undefined|object} options\n * the additional options for the serialization. If this argument is\n * `undefined` or `null`, the default options will be used. The default\n * options can be retrieved by calling `DefaultOptions.get('toJSON')`.\n * Available options are:\n *\n * - `normalize: boolean`, indicates whether to normalize this object\n * before serializing. The default value is `true`.\n * - `removeEmptyFields: boolean`, indicates whether to ignore the empty\n * fields of the object. If it is `true`, the empty fields of the object\n * will be removed before serialization. The default value is `false`.\n * - `convertNaming: boolean`, indicates whether to convert the naming\n * of properties of the object represented by the result JSON string.\n * The default value is `false`.\n * - `sourceNamingStyle: string | NamingStyle`, the naming style of the\n * source object, i.e., the object calling the `toJSON()` method.\n * The default value of this argument is {@link LOWER_CAMEL}.\n * - `targetNamingStyle: string | NamingStyle`, the naming style of the\n * target object, i.e., the object represented by the result JSON\n * string of the `toJSON()` method. The default value of this argument\n * is {@link LOWER_UNDERSCORE}.\n * - `space: string | number`, a string or number that's used to insert\n * white space (including indentation, line break characters, etc.) into\n * the output JSON string for readability purposes. If this is a number,\n * it indicates the number of space characters to be used as indentation,\n * clamped to 10 (that is, any number greater than 10 is treated as if\n * it were 10). Values less than 1 indicate that no space should be used.\n * If this is a string, the string (or the first 10 characters of the\n * string, if it's longer than that) is inserted before every nested\n * object or array. If this is anything other than a string or number\n * (can be either a primitive or a wrapper object) — for example, is\n * `null` or not provided — no white space is used. The default value\n * of this option is `null`.\n * @returns {string}\n * the JSON string serialized from this object, as `JSON.stringify()`\n * does, except that this function provides additional stringification\n * options.\n * @see DefaultOptions.get('toJSON')\n * @author Haixing Hu\n */\nfunction toJsonString(obj, options) {\n if (typeof obj !== 'object') {\n throw new TypeError('The object to be serialized must be an object.');\n }\n const Class = obj.constructor;\n return toJsonStringImpl(Class, obj, options);\n}\n\nexport default toJsonString;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { isString } from '@qubit-ltd/type-detect';\nimport Json from '@qubit-ltd/json';\n\n/**\n * Convert an id to a string.\n *\n * @param {string|number|bigint} id\n * The id to be converted.\n * @return {string}\n * The string representation of the id, or an empty string if the id is\n * `null` or `undefined`.\n */\nfunction stringifyId(id) {\n if (id === null || id === undefined) {\n return '';\n }\n if (isString(id)) {\n return id;\n }\n return Json.stringify(id);\n}\n\nexport default stringifyId;\n"],"names":["global","this","globalThis","require$$0","defineProperty","defineGlobalProperty","require$$1","require$$2","store","sharedStoreModule","shared","fails","NATIVE_BIND","FunctionPrototype","call","isNullOrUndefined","$TypeError","requireObjectCoercible","$Object","toObject","uncurryThis","uid","userAgent","$String","NATIVE_SYMBOL","hasOwn","require$$3","require$$4","USE_SYMBOL_AS_UID","require$$5","Symbol","wellKnownSymbol","isCallable","isObject","document","DESCRIPTORS","anObject","getBuiltIn","isSymbol","tryToString","aCallable","getMethod","ordinaryToPrimitive","toPrimitive","toPropertyKey","path","CLONE_OPTIONS","includeAccessor","includeNonEnumerable","includeReadonly","includeNonConfigurable","DefaultAssignmentOptions","_createClass","_classCallCheck","_defineProperty","DefaultToJsonOptions","undefined","DEFAULT_OPTIONS_MAP","Map","DefaultOptions","key","value","get","aspect","result","clone","merge","options","_objectSpread","set","newOptions","oldOptions","reset","arguments","length","Error","concat","KEY_CLASS_CATEGORY","KEY_CLASS_DEFAULT_INSTANCE","KEY_CLASS_NEXT_ID","KEY_CLASS_NAME_FIELD","KEY_CLASS_FIELDS_METADATA","KEY_FIELD_TYPE","KEY_FIELD_ELEMENT_TYPE","KEY_FIELD_NULLABLE","KEY_FIELD_NON_EMPTY","KEY_FIELD_LABEL","KEY_FIELD_PAYLOAD","KEY_FIELD_NORMALIZER","KEY_FIELD_VALIDATOR","METADATA_CACHE","WeakMap","classMetadataCache","Class","metadata","getClassMetadata","isEnumClass","category","enumNormalizer","EnumClass","TypeError","of","defaultNormalizer","_context","_context2","_context2$path","context","info","typeInfo","type","normalizer","trim","map","v","Array","from","_ref","_ref2","_slicedToArray","k","Set","isBuiltIn","normalize","newContext","types","elementTypes","getDefaultInstance","prototype","Object","obj","getExistFieldWithDifferentNamingStyle","styles","NamingStyle","values","_iterator","_createForOfIteratorHelper","_step","s","n","done","s1","_iterator2","_step2","s2","newKey","to","hasOwnProperty","err","e","f","getSourceField","targetField","convertNaming","sourceNamingStyle","targetNamingStyle","getCollectionElementType","isArray","isTypedArray","_obj$","constructor","isCollection","size","first","next","getFieldMetadataObject","field","_metadata$KEY_CLASS_F","_fieldsMetadata$field","fieldsMetadata","getFieldMetadata","md","getFieldElementType","_path","_options","annotatedElementType","name","defaultInstance","defaultFieldValue","elementType","getFieldType","annotatedType","hasPrototypeFunction","Reflect","has","ofValueImpl","isString","String","toUpperCase","Impl","getAllFields","target","source","fields","keys","parentType","getPrototypeOf","assign","parentInstance","parentFields","filter","includes","copyPropertiesWithoutNamingConversion","isUndefinedOrNull","forEach","cloneEnum","sourcePath","targetType","RangeError","cloneWithType","_ref3","targetPath","isBuiltInClass","console","warn","doAssign","cloneArrayWithElementType","sourceArray","_ref4","_this","defaultArray","error","elementTypeCategory","sourceElement","index","defaultElement","targetElement","cloneNoType","_ref5","cloneArrayNoElementType","_ref6","_ref7","_this2","theDefaultInstance","targetKeys","targetFieldPath","sourceField","sourceFieldPath","sourceFieldValue","targetFieldType","targetFieldElementType","existSourceField","_typeof","assignImpl","opt","Page","totalCount","totalPages","pageIndex","pageSize","content","newEmpty","getFrom","pageRequest","array","Math","ceil","fromIndex","toIndex","min","slice","isEmptyImpl","deepEqual","equalsImpl","lhs","rhs","setClassMetadata","generateIdImpl","id","requirePrototypeMethod","func","clearImpl","cloneImpl","normalizeArrayField","fieldPath","normalizeMapField","normalizeNormalField","normalizeNullishField","normalizeSetField","hasOwnPrototypeFunction","normalizeFieldImpl","_options2","_options2$path","Parent","normalizeField","normalizeImpl","getInstanceName","instance","getFieldLabel","config","label","isFieldNullable","nullable","isFieldNonEmpty","nonEmpty","getElementValidationContext","_context$owner","_context$type","_context$label","_context$nullable","_context$nonEmpty","owner","ctx","validateEmptyField","isEmpty","message","ValidationResult","validateArrayField","validator","results","i","validateMapField","getValidationContext","validateNormalField","validateSetField","validateFieldImpl","_validateArrayField","validateField","validateImpl","createImpl","createArrayImpl","isValidPageSource","page","createPageImpl","Json","stringify","isNullishOrEmptyImpl","parseJsonStringImpl","json","parse","toJsonImpl","cloneOptions","pojo","disableHooks","useToJSON","removeEmptyFields","skipRootToJSON","toJsonStringImpl","toJSON","space","hasOwnClassField","Model","kind","clear","equals","validate","generateId","toJsonString","create","createArray","createPage","isNullishOrEmpty","parseJsonString","setFieldMetadata","Type","decorate","SyntaxError","ElementType","initialValue","isDecoratorContext","setNormalizer","Normalizable","defaultValidator","hasValue","setValidator","Validatable","Nullable","NonEmpty","Label","i18n","Payload","payload","NameField","oldField","isEnumerator","defineEnumerator","defaultValue","enumerator","freeze","valuesImpl","ofCodeImpl","code","item","find","_Class$key","ofNameImpl","ofImpl","_ofValueImpl","Enum","addInitializer","toString","ofValue","ofName","hasName","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AAI,qBAAqB,GAAGvB,qBAAgD;;AAE5E;AACA;AACA,qBAAqB,CAAC,UAAU,CAAC;;ACLjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAM2C,aAAa,GAAG;AACpBC,EAAAA,eAAe,EAAE,KAAK;AACtBC,EAAAA,oBAAoB,EAAE,KAAK;AAC3BC,EAAAA,eAAe,EAAE,IAAI;AACrBC,EAAAA,sBAAsB,EAAE;AAC1B,CAAC;;ACpBD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAOMC,wBAAwB,gBAAAC,YAAA,CAAA,SAAAD,wBAAA,GAAA;AAAAE,EAAAA,eAAA,OAAAF,wBAAA,CAAA;AAC5B;AACF;AACA;AACA;AACA;AACA;AACA;AANEG,EAAAA,eAAA,oBAOY,IAAI,CAAA;AAEhB;AACF;AACA;AACA;AACA;AACA;AACA;AANEA,EAAAA,eAAA,wBAOgB,KAAK,CAAA;AAErB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AAPEA,EAAAA,eAAA,4BAQoB,kBAAkB,CAAA;AAEtC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AAPEA,EAAAA,eAAA,4BAQoB,aAAa,CAAA;AAEjC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA3CEA,eAAA,CAAA,IAAA,EAAA,OAAA,EA4CQ,EAAE,CAAA;AAEV;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA7CEA,eAAA,CAAA,IAAA,EAAA,cAAA,EA8Ce,EAAE,CAAA;AAAA,CAAA,CAAA;;ACnJnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AALA,IAMMC,oBAAoB,gBAAAH,YAAA,CAAA,SAAAG,oBAAA,GAAA;AAAAF,EAAAA,eAAA,OAAAE,oBAAA,CAAA;AACxB;AACF;AACA;AACA;AACA;AACA;AACA;AANED,EAAAA,eAAA,oBAOY,IAAI,CAAA;AAEhB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVEA,EAAAA,eAAA,4BAWoB,KAAK,CAAA;AAEzB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AAPEA,EAAAA,eAAA,wBAQgB,KAAK,CAAA;AAErB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AAPEA,EAAAA,eAAA,4BAQoB,aAAa,CAAA;AAEjC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AAPEA,EAAAA,eAAA,4BAQoB,kBAAkB,CAAA;AAEtC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AArBEA,EAAAA,eAAA,gBAsBQE,SAAS,CAAA;AAAA,CAAA,CAAA;;;;;AC9EnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMC,mBAAmB,GAAG,IAAIC,GAAG,EAAE;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAxBA,IAyBMC,cAAc,gBAAA,YAAA;AAAA,EAAA,SAAAA,cAAA,GAAA;AAAAN,IAAAA,eAAA,OAAAM,cA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AC,MAAM;AACL,IAAA,OAAO7G,SAAS;AAClB;AACF;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASuO,aAAaA,CAACjM,QAAQ,EAAEuE,KAAK,EAAE;EACtC,IAAM2H,MAAM,GAAGvH,gBAAgB,CAAC3E,QAAQ,EAAEuE,KAAK,EAAE/E,eAAe,CAAC;AACjE,EAAA,IAAI0M,MAAM,EAAE;AACV;IACA,OAAOA,MAAM,CAACC,KAAK;AACrB;AACA,EAAA,OAAO5H,KAAK;AACd;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS6H,eAAeA,CAACpM,QAAQ,EAAEuE,KAAK,EAAE;EACxC,IAAM8H,QAAQ,GAAG1H,gBAAgB,CAAC3E,QAAQ,EAAEuE,KAAK,EAAEjF,kBAAkB,CAAC;EACtE,OAAQ+M,QAAQ,KAAK,IAAI;AAC3B;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,eAAeA,CAACtM,QAAQ,EAAEuE,KAAK,EAAE;EACxC,IAAMgI,QAAQ,GAAG5H,gBAAgB,CAAC3E,QAAQ,EAAEuE,KAAK,EAAEhF,mBAAmB,CAAC;EACvE,OAAQgN,QAAQ,KAAK,IAAI;AAC3B;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,2BAA2BA,CAACzM,KAAK,EAAEC,QAAQ,EAA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AAxB,8CAAAA,CAAAA,MAAA,CAAgDiB,KAAK,CAACkF,IAAI,EAAA,GAAA,CAAG,CAAC;AACnF;AACA,EAAA,OAAO9C,GAAG,CAAC8K,OAAO,EAAE;AACtB;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASuB,mBAAmBA,CAACzO,KAAK,EAAE0O,IAAI,EAAEpQ,OAAO,EAAE;AACjD,EAAA,IAAM8D,GAAG,GAAGkM,IAAI,CAACK,KAAK,CAACD,IAAI,CAAC;AAC5B,EAAA,IAAMvQ,MAAM,GAAG,IAAI6B,KAAK,EAAE;EAC1B,OAAOqJ,UAAU,CAACrJ,KAAK,EAAE7B,MAAM,EAAEiE,GAAG,EAAE9D,OAAO,CAAC;AAChD;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASsQ,UAAUA,CAACxM,GAAG,EAAErE,GAAG,EAAEO,OAAO,EAAE;EACrC,IAAMgL,GAAG,GAAGxL,cAAc,CAACO,KAAK,CAAC,QAAQ,EAAEC,OAAO,CAAC;AACnD;EACA,IAAIgL,GAAG,CAACzH,SAAS,EAAE;AACjBO,IAAAA,GAAG,GAAG3B,iBAAiB,CAAC2B,GAAG,CAAC;AAC9B;AACA,EAAA,IAAMyM,YAAY,GAAAtQ,eAAA,CAAAA,eAAA,KACbtB,aAAa,CAAA,EAAA,EAAA,EAAA;A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AA,OAAO,KAAK;AACd;AACA,EAAA,IAAIC,MAAM,CAACD,SAAS,CAACmB,cAAc,CAACpI,IAAI,CAAC+E,KAAK,CAACkC,SAAS,EAAEsC,KAAK,CAAC,EAAE;AAChE,IAAA,OAAO,IAAI;AACb,GAAC,MAAM;AACL,IAAA,IAAMW,eAAe,GAAGlD,kBAAkB,CAACjC,KAAK,CAAC;IACjD,OAAOmC,MAAM,CAACD,SAAS,CAACmB,cAAc,CAACpI,IAAI,CAACkK,eAAe,EAAEX,KAAK,CAAC;AACrE;AACF;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIA,KAAK,CAACkC,SAAS,CAAC2N,YAAY,GAAG,SAASA,YAAYA,GAAsB;AAAA,MAAA,IAArBvR,OAAO,GAAAM,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAjB,SAAA,GAAAiB,SAAA,CAAA,CAAA,CAAA,GAAGjB,SAAS;AACtE,MAAA,OAAOwR,gBAAgB,CAACnP,KAAK,EAAE,IAAI,EAAE1B,OAAO,CAAC;KAC9C;AACH;AACA;AACA,EAAA,IAAI,CAAC6D,MAAM,CAACD,SAAS,CAACmB,cAAc,CAACpI,IAAI,CAAC+E,KAAK,EAAE,QAAQ,CAAC,EAAE;AAC1D;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACIA,IAAAA,KAAK,CAAC8P,MAAM,GAAG,SAASA,MAAMA,CAAC1N,GAAG,EAAuB;AAAA,MAAA,IAArB9D,OAAO,GAAAM,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAjB,SAAA,GAAAiB,SAAA,CAAA,CAAA,CAAA,GAAGjB,SAAS;AACrD,MAAA,OAAOsQ,UAAU,CAACjO,KAAK,EAAEoC,GAAG,EAAE9D,OAAO,CAAC;KACvC;AACH;AACA;AACA,EAAA,IAAI,CAAC6D,MAAM,CAACD,SAAS,CAACmB,cAAc,CAACpI,IAAI,CAAC+E,KAAK,EAAE,aAAa,CAAC,EAAE;AAC/D;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACIA,IAAAA,KAAK,CAAC+P,WAAW,GAAG,SAASA,WAAWA,CAAC/F,KAAK,EAAuB;AAAA,MAAA,IAArB1L,OAAO,GAAAM,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAjB,SAAA,GAAAiB,SAAA,CAAA,CAAA,CAAA,GAAGjB,SAAS;AACjE,MAAA,OAAOuQ,eAAe,CAAClO,KAAK,EAAEgK,KAAK,EAAE1L,OAAO,CAAC;KAC9C;AACH;AACA;AACA,EAAA,IAAI,CAAC6D,MAAM,CAACD,SAAS,CAACmB,cAAc,CAACpI,IAAI,CAAC+E,KAAK,EAAE,YAAY,CAAC,EAAE;AAC9D;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACIA,IAAAA,KAAK,CAACgQ,UAAU,GAAG,SAASA,UAAUA,CAAC5B,IAAI,EAAuB;AAAA,MAAA,IAArB9P,OAAO,GAAAM,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAjB,SAAA,GAAAiB,SAAA,CAAA,CAAA,CAAA,GAAGjB,SAAS;AAC9D,MAAA,OAAO0Q,cAAc,CAACrO,KAA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S;AACrC;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASwL,aAAaA,CAAClM,KAAK,EAAAjD,IAAA,EAA4BN,UAAU,EAAE;AAAA,EAAA,IAApChB,QAAQ,GAAAsB,IAAA,CAARtB,QAAQ;IAAEuP,IAAI,GAAAjO,IAAA,CAAJiO,IAAI;IAAEtK,IAAI,GAAA3D,IAAA,CAAJ2D,IAAI;EAClD,IAAIsK,IAAI,KAAK,OAAO,EAAE;AACpB,IAAA,MAAM,IAAIc,WAAW,CAAA,iDAAA,CAAAvR,MAAA,CAAmDmG,IAAI,CAAE,CAAC;AACjF;AACA,EAAA,IAAI,OAAOjE,UAAU,KAAK,UAAU,EAAE;AACpC,IAAA,MAAM,IAAIV,SAAS,CAAAxB,mDAAAA,CAAAA,MAAA,CACkCmG,IAAI,EAAAnG,2CAAAA,CAAAA,CAAAA,MAAA,CAAAqK,OAAA,CAAkDnI,UAAU,OACrH,CAAC;AACH;EACAkP,gBAAgB,CAAClQ,QAAQ,EAAEiF,IAAI,EAAEvF,oBAAoB,EAAEsB,UAAU,CAAC;AACpE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS0P,YAAYA,GAAU;AAC7B,EAAA,IAAI/R,SAAA,CAAKC,MAAM,KAAK,CAAC,EAAE;AAAA,IAAA,IAAA2C,KAAA;AACrB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A,OAAOL,SAAS;AAClB;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS2U,IAAIA,CAACtS,KAAK,EAAEa,OAAO,EAAE;EAC5B,IAAIA,OAAO,KAAK,IAAI,IAAIuI,OAAA,CAAOvI,OAAO,CAAK,KAAA,QAAQ,EAAE;AACnD,IAAA,MAAM,IAAIN,SAAS,CAAC,gCAAgC,CAAC;AACvD;EACA,IAAI,OAAOP,KAAK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GACjC;;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEgC,EAAAA,KAAK,CAAC6Q,QAAQ,GAAG,SAASA,QAAQA,CAAC7S,KAAK,EAAE;AACxC,IAAA,OAAQ2H,WAAW,CAAC3F,KAAK,EAAEhC,KAAK,CAAC,KAAKL,SAAS;GAChD;;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEqC,EAAAA,KAAK,CAAC0S,MAAM,GAAG,SAASA,MAAMA,CAACxN,IAAI,EAAE;AACnC,IAAA,OAAOiN,UAAU,CAACnS,KAAK,EAAEkF,IAAI,CAAC;GAC/B;;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACElF,EAAAA,KAAK,CAAC2S,OAAO,GAAG,SAASA,OAAOA,CAACzN,IAAI,EAAE;AACrC,IAAA,OAAQiN,UAAU,CAACnS,KAAK,EAAEkF,IAAI,CAAC,KAAKvH,SAAS;GAC9C;;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEqC,EAAAA,KAAK,CAAC4S,MAAM,GAAG,SAASA,MAAMA,CAACb,IAAI,EAAE;AACnC,IAAA,OAAOD,UAAU,CAAC9R,KAAK,EAAE+R,IAAI,CAAC;GAC/B;;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACE/R,EAAAA,KAAK,CAAC6S,OAAO,GAAG,SAASA,OAAOA,CAACd,IAAI,EAAE;AACrC,IAAA,OAAQD,UAAU,CAAC9R,KAAK,EAAE+R,IAAI,CAAC,KAAKpU,SAAS;GAC9C;;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEqC,EAAAA,KAAK,CAACQ,EAAE,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H,OAAO,CAAC;AACnD;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASwR,MAAMA,CAAC9P,KAAK,EAAEoC,GAAG,EAAuB;AAAA,EAAA,IAArB9D,OAAO,GAAAM,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAjB,SAAA,GAAAiB,SAAA,CAAA,CAAA,CAAA,GAAGjB,SAAS;AAC7C,EAAA,OAAOsQ,UAAU,CAACjO,KAAK,EAAEoC,GAAG,EAAE9D,OAAO,CAAC;AACxC;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASyR,WAAWA,CAAC/P,KAAK,EAAEgK,KAAK,EAAuB;AAAA,EAAA,IAArB1L,OAAO,GAAAM,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAjB,SAAA,GAAAiB,SAAA,CAAA,CAAA,CAAA,GAAGjB,SAAS;AACpD,EAAA,OAAOuQ,eAAe,CAAClO,KAAK,EAAEgK,KAAK,EAAE1L,OAAO,CAAC;AAC/C;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS0R,UAAUA,CAAChQ,KAAK,EAAEoO,IAAI,EAAuB;AAAA,EAAA,IAArB9P,OAAO,GAAAM,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAjB,SAAA,GAAAiB,SAAA,CAAA,CAAA,CAAA,GAAGjB,SAAS;AAClD,EAAA,OAAO0Q,cAAc,CAACrO,KAAK,EAAEoO,IAAI,EAAE9P,OAAO,CAAC;AAC7C;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASuD,SAASA,CAAC7D,KAAK,EAAE;EACxB,OAAOyC,iBAAiB,CAACzC,KAAK,CAAC;AACjC;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASoR,MAAMA,CAACpR,KAAK,EAAgB;AAAA,EAAA,IAAdM,OAAO,GAAAM,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAjB,SAAA,GAAAiB,SAAA,CAAA,CAAA,CAAA,GAAG,EAAE;EACjC,OAAOgQ,UAAU,CAAC5Q,KAAK,EAAE,EAAE,EAAAO,aAAA,CAAAA,aAAA,CAAA,EAAA,EACtBD,OAAO,CAAA,EAAA,EAAA,EAAA;IACV4Q,cAAc,EAAE,KAAK;AAAK,GAAA,CAC3B,CAAC;AACJ;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASW,YAAYA,CAACzN,GAAG,EAAE9D,OAAO,EAAE;AAClC,EAAA,IAAI8K,OAAA,CAAOhH,GAAG,CAAA,KAAK,QAAQ,EAAE;AAC3B,IAAA,MAAM,IAAI7B,SAAS,CAAC,gDAAgD,CAAC;AACvE;AACA,EAAA,IAAMP,KAAK,GAAGoC,GAAG,CAAC8B,WAAW;AAC7B,EAAA,OAAOiL,gBAAgB,CAACnP,KAAK,EAAEoC,GAAG,EAAE9D,OAAO,CAAC;AAC9C;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS0U,WAAWA,CAAClI,EAAE,EAAE;AACvB,EAAA,IAAIA,EAAE,KAAK,IAAI,IAAIA,EAAE,KAAKnN,SAAS,EAAE;AACnC,IAAA,OAAO,EAAE;AACX;AACA,EAAA,IAAIiI,mBAAQ,CAACkF,EAAE,CAAC,EAAE;AAChB,IAAA,OAAOA,EAAE;AACX;AACA,EAAA,OAAOwD,IAAI,CAACC,SAAS,CAACzD,EAAE,CAAC;AAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39]}
|