{"version":3,"sources":["../src/constants/env.constants.ts","../src/global/A-Feature/A-Feature.types.ts","../src/global/A-Meta/A-Meta.class.ts","../src/global/A-Component/A-Component.meta.ts","../src/global/A-Container/A-Container.class.ts","../src/global/A-Container/A-Container.meta.ts","../src/helpers/A_Formatter.helper.ts","../src/helpers/A_Identity.helper.ts","../src/global/A-Error/A_Error.constants.ts","../src/global/A-Error/A_Error.class.ts","../src/global/ASEID/ASEID.error.ts","../src/global/ASEID/ASEID.class.ts","../src/global/A-Entity/A-Entity.error.ts","../src/global/A-Entity/A-Entity.class.ts","../src/global/A-Entity/A-Entity.meta.ts","../src/global/A-Fragment/A-Fragment.class.ts","../src/helpers/A_Common.helper.ts","../src/global/A-Scope/A-Scope.error.ts","../src/global/A-Scope/A-Scope.class.ts","../src/global/A-Caller/A_Caller.error.ts","../src/global/A-Caller/A_Caller.class.ts","../src/helpers/A_TypeGuards.helper.ts","../src/global/A-Feature/A-Feature.error.ts","../src/global/A-Feature/A-Feature-Define.decorator.ts","../src/global/A-Feature/A-Feature-Extend.decorator.ts","../src/global/A-Stage/A-Stage.types.ts","../src/global/A-Stage/A-Stage.error.ts","../src/global/A-Stage/A-Stage.class.ts","../src/global/A-StepManager/A-StepManager.error.ts","../src/global/A-StepManager/A-StepManager.class.ts","../src/global/A-Feature/A-Feature.class.ts","../src/global/A-Component/A-Component.class.ts","../src/global/A-Context/A-Context.error.ts","../src/global/A-Context/A-Context.class.ts","../src/global/A-Abstraction/A-Abstraction.error.ts","../src/global/A-Abstraction/A-Abstraction-Extend.decorator.ts","../src/global/A-Abstraction/A-Abstraction.class.ts","../src/global/A-Concept/A-Concept.class.ts","../src/global/A-Concept/A-Concept.meta.ts","../src/global/A-Dependency/A-Dependency.error.ts","../src/global/A-Dependency/A-Dependency-Default.decorator.ts","../src/global/A-Dependency/A-Dependency-Load.decorator.ts","../src/global/A-Dependency/A-Dependency-Require.decorator.ts","../src/global/A-Dependency/A-Dependency.class.ts","../src/global/A-Inject/A-Inject.error.ts","../src/global/A-Inject/A-Inject.decorator.ts"],"names":["A_CONSTANTS__DEFAULT_ENV_VARIABLES","A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY","A_TYPES__FeatureState","_A_Meta","iterator","__name","meta","key","value","inheritedValue","name","results","regex","A_Meta","_A_ComponentMeta","handler","feature","steps","extensions","extension","abstraction","abstractions","injections","args","A_ComponentMeta","_A_Container","A_Context","config","scope","A_Feature","A_Container","_A_ContainerMeta","A_ContainerMeta","_A_FormatterHelper","str","match","letter","camelCase","A_FormatterHelper","_A_IdentityHelper","parts","time","random","id","timePart","randomPart","number","maxZeros","formattedNumber","A_IdentityHelper","A_CONSTANTS__ERROR_CODES","A_CONSTANTS__ERROR_DESCRIPTION","_A_Error","param1","param2","A_TypeGuards","error","ASEID","message","title","description","params","A_Error","_ASEID_Error","ASEID_Error","_ASEID","identity","concept","body","version","entity","idCandidate","shard","_A_Entity_Error","A_Entity_Error","_A_Entity","props","x","aseid","newEntity","serialized","A_Entity","_A_EntityMeta","A_EntityMeta","_A_Fragment","param","data","newName","cloned","acc","A_Fragment","_A_CommonHelper","resolve","childClass","parentClass","current","input","paths","result","removeProperties","target","currPath","currKey","path","pathKeys","item","source","visited","clone","component","UNKNOWN","ANONYMOUS","fnAny","objAny","A_CommonHelper","_A_ScopeError","A_ScopeError","_A_Scope","_components","_errors","_entities","ent","_fragments","fragment","parent","circularCheck","ctor","found","c","f","e","anotherScope","instructions","componentName","issuer","query","count","fragmentInstancePresented","resolvedArgs","arg","dependency","require","create","defaultArgs","newDependency","newComponent","el","A_Component","inheritanceChain","chain","A_Scope","_A_CallerError","A_CallerError","_A_Caller","A_Caller","_A_TypeGuards","instance","_A_FeatureError","A_FeatureError","A_Feature_Define","propertyKey","descriptor","metaKey","existedMeta","invoke","originalMethod","A_Feature_Extend","targetRegexp","behavior","before","after","override","include","exclude","throwOnError","buildTargetRegexp","existedDefinitions","existedMetaValue","existedIndex","includePart","excludePart","pattern","A_TYPES__A_Stage_Status","_A_StageError","A_StageError","_A_Stage","step","resolverConstructor","callArgs","targetScope","reject","wrappedError","A_Stage","_A_StepManagerError","A_StepManagerError","_A_StepsManager","entities","i","self","s","entityId","node","neighbor","A_StepsManager","_A_Feature","componentScope","externalScope","template","stage","stageIndex","reason","_A_Component","_A_ContextError","A_ContextError","_A_Context","testEnvironment","importing","newScope","property","metaType","inheritMeta","callName","cmp","declaration","items","currentClass","other","otherClass","_A_AbstractionError","A_AbstractionError","A_Abstraction_Extend","setName","_A_Abstraction","container","A_Abstraction","_A_Concept","method","A_Concept","_A_ConceptMeta","containers","A_ConceptMeta","_A_DependencyError","A_DependencyError","A_Dependency_Default","methodName","parameterIndex","paramsArray","A_Dependency_Load","A_Dependency_Require","_A_Dependency","A_Dependency","_A_InjectError","A_InjectError","A_Inject"],"mappings":"aAAO,IAAA,EAAA,CAAA,MAAA,CAAA,cAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,EAAA,CAAA,CAAA,CAAA,MAAA,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,YAAA,CAAA,IAAA,CAAA,CAAA,CAAA,IAAMA,EAAqC,CAa9C,cAAA,CAAgB,gBAAA,CAQhB,oBAAA,CAAsB,uBAItB,qBAAA,CAAuB,uBAAA,CAKvB,qBAAA,CAAuB,uBAAA,CAIvB,4BAA6B,6BACjC,CAAA,CAOaC,GAA2C,CACpDD,CAAAA,CAAmC,eACnCA,CAAAA,CAAmC,oBAAA,CACnCA,CAAAA,CAAmC,qBAAA,CACnCA,EAAmC,qBAAA,CAEnCA,CAAAA,CAAmC,2BACvC,MCqCYE,EAAAA,CAAAA,CAAAA,CAAAA,GAIRA,CAAAA,CAAA,WAAA,CAAc,aAAA,CAIdA,EAAA,UAAA,CAAa,YAAA,CAIbA,EAAA,SAAA,CAAY,WAAA,CAIZA,EAAA,WAAA,CAAc,aAAA,CAIdA,CAAAA,CAAA,MAAA,CAAS,SApBDA,CAAAA,CAAAA,EAAAA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A,EACvF8D,CAAAA,CAAU,wBAAA,CACV,MAEJ,KAAK3G,CAAAA,CAAa,mBAAA,CAAoB6C,CAAM,CAAA,CACxC8D,EAAU,wBAAA,CACV,MAEJ,KAAK3G,CAAAA,CAAa,iBAAiB6C,CAAM,CAAA,CACrC8D,EAAU,wBAAA,CACV,KACR,CAGA,IAAMC,CAAAA,CAAczI,CAAAA,CAAU,IAAA,CAAK0E,CAAM,CAAA,CAAE,GAAA,CAAI8D,CAAO,CAAA,EAAK,IAAIrJ,CAAAA,CAEzDyO,CAAAA,CAA+CnF,CAAAA,CAAY,GAAA,CAAIyE,CAAM,CAAA,EAAK,GAGhFU,CAAAA,CAAYD,CAAc,EAAI,CAC1B,MAAA,CAAQhM,CAAAA,CACR,YAAA,CAAcC,CAClB,CAAA,CAEA6G,CAAAA,CAAY,IAAIyE,CAAAA,CAAQU,CAAW,EAGnC5N,CAAAA,CACK,IAAA,CAAK0E,CAAM,CAAA,CACX,IACG8D,CAAAA,CACAC,CACJ,EACR,CACJ,CApEgB9J,EAAAwP,EAAAA,CAAA,UAAA,CAAA","file":"index.cjs","sourcesContent":["export const A_CONSTANTS__DEFAULT_ENV_VARIABLES = {\n    // ----------------------------------------------------------\n    // A-Concept Core Environment Variables\n    // ----------------------------------------------------------\n    // These environment variables are used by A-Concept core to configure the application\n    // ----------------------------------------------------------\n    /**\n     * Name of the application\n     * \n     * DEFAULT value is 'a-concept'\n     * \n     * [!] Provided name will be used for all aseids in the application by default\n     */\n    A_CONCEPT_NAME: 'A_CONCEPT_NAME',\n    /**\n     * Root scope of the application\n     * \n     * DEFAULT value is 'root'\n     * \n     * [!] Provided name will be used for all aseids in the application by default\n     */\n    A_CONCEPT_ROOT_SCOPE: 'A_CONCEPT_ROOT_SCOPE',\n    /**\n     * Environment of the application e.g. development, production, staging\n     */\n    A_CONCEPT_ENVIRONMENT: 'A_CONCEPT_ENVIRONMENT',\n    /**\n     * Root folder of the application\n     * [!] Automatically set by A-Concept when the application starts\n     */\n    A_CONCEPT_ROOT_FOLDER: 'A_CONCEPT_ROOT_FOLDER',\n    /**\n     * Allows to define a default error description for errors thrown without a description\n     */\n    A_ERROR_DEFAULT_DESCRIPTION: 'A_ERROR_DEFAULT_DESCRIPTION',\n} as const\n\n\n//should be an array\nexport type A_TYPES__ConceptENVVariables = (typeof A_CONSTANTS__DEFAULT_ENV_VARIABLES)[keyof typeof A_CONSTANTS__DEFAULT_ENV_VARIABLES][];\n\n\nexport const A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY = [\n    A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_CONCEPT_NAME,\n    A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_CONCEPT_ROOT_SCOPE,\n    A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_CONCEPT_ENVIRONMENT,\n    A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_CONCEPT_ROOT_FOLDER,\n\n    A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_ERROR_DEFAULT_DESCRIPTION,\n] as const;\n\n","import { A_TYPES__A_StageStep, A_TYPES_StageExecutionBehavior } from \"../A-Stage/A-Stage.types\"\nimport { A_Fragment } from \"../A-Fragment/A-Fragment.class\"\nimport { A_Entity } from \"@adaas/a-concept/global/A-Entity/A-Entity.class\"\nimport { A_Container } from \"../A-Container/A-Container.class\"\nimport { A_Component } from \"../A-Component/A-Component.class\"\nimport { A_TYPES__Component_Constructor } from \"../A-Component/A-Component.types\"\nimport { A_TYPES__Container_Constructor } from \"../A-Container/A-Container.types\"\nimport { A_TYPES__Entity_Constructor } from \"../A-Entity/A-Entity.types\"\nimport { A_Feature } from \"./A-Feature.class\"\nimport { A_TYPES__Required } from \"@adaas/a-concept/types/A_Common.types\"\nimport { A_Scope } from \"../A-Scope/A-Scope.class\"\nimport { A_Stage } from \"../A-Stage/A-Stage.class\"\nimport { A_TYPES__Error_Init } from \"../A-Error/A_Error.types\"\n\n\n// ============================================================================\n// --------------------------- Primary Types ----------------------------------\n// ============================================================================\n/**\n * Feature constructor type\n * Uses the generic type T to specify the type of the feature\n */\nexport type A_TYPES__Feature_Constructor<T = A_Feature> = new (...args: any[]) => T;\n/**\n * Feature initialization type\n */\nexport type A_TYPES__Feature_Init<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents> = A_TYPES__Feature_InitWithComponent<T> | A_TYPES__Feature_InitWithTemplate<T>\n/**\n * Feature initialization type using component\n */\nexport type A_TYPES__Feature_InitWithComponent<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents> = {\n    /**\n     * Feature Name\n     */\n    name: string,\n    /**\n     * The component from where the feature is calling. It's important for proper scoping. \n     * Based on the component would be retrieved connected components, entities and containers.\n     * \n     * [!] Could be Container, Entity, Component or Command\n     */\n    component: T,\n\n    /**\n     * In case when Entity is not attached to the scope can be used to transparently show dependencies\n     * \n     * \n     */\n    scope?: A_Scope\n}\n/**\n * Feature initialization type using template\n */\nexport type A_TYPES__Feature_InitWithTemplate<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents> = {\n    /**\n     * Feature Name\n     */\n    name: string,\n    /**\n     * The scope from where to retrieve dependent components, entities and containers. \n     * \n     * [!] Important for proper scoping. \n     */\n    scope: A_Scope\n    /**\n     * The component from where the feature is calling. It's important for proper scoping. \n     * Based on the component would be retrieved connected components, entities and containers.\n     * \n     * [!] Could be Container, Entity, Component or Command\n     */\n    component?: T,\n    /**\n     * Optional Feature template to be used instead of building it from decorators\n     */\n    template: Array<A_TYPES__FeatureDefineDecoratorTemplateItem>\n}\n\n/**\n * Feature serialized type\n */\nexport type A_TYPES__Feature_Serialized = {}\n\n\n/**\n * Feature lifecycle states\n */\nexport enum A_TYPES__FeatureState {\n    /**\n     * The feature has been initialized\n     */\n    INITIALIZED = \"INITIALIZED\",\n    /**\n     * The feature is currently being processed\n     */\n    PROCESSING = \"PROCESSING\",\n    /**\n     * The feature has been completed\n     */\n    COMPLETED = \"COMPLETED\",\n    /**\n     * The feature has been interrupted\n     */\n    INTERRUPTED = \"INTERRUPTED\",\n    /**\n     * The feature has failed\n     */\n    FAILED = \"FAILED\"\n}\n\n// ===========================================================================\n// --------------------------- Error Types ------------------------------------\n// ===========================================================================\n\nexport type A_TYPES__FeatureError_Init = {\n    /**\n     * Stage where the error occurred\n     */\n    stage?: A_Stage\n\n} & A_TYPES__Error_Init\n\n\n\n// ===========================================================================-\n// --------------------------- Available Types -------------------------------\n// ===========================================================================\n\n/**\n * A list of component where features can be Defined\n * \n * [!] On this component Feature Definition is Available\n */\nexport type A_TYPES__FeatureAvailableComponents = InstanceType<A_TYPES__FeatureAvailableConstructors>\n/**\n * A list of constructors where features can be Defined\n * \n * [!] On this component Feature Definition is Available\n */\nexport type A_TYPES__FeatureAvailableConstructors = A_TYPES__Component_Constructor\n    | A_TYPES__Entity_Constructor\n    | A_TYPES__Container_Constructor\n\n\n\n// ===========================================================================\n// --------------------------- Decorator Types -------------------------------\n// ===========================================================================\n// ---------------------------------------------------------------------------\n// --------------------Feature Define Decorator Types-------------------------\n// ---------------------------------------------------------------------------\n/**\n * Indicates a type of Feature Define decorator\n */\nexport type A_TYPES__FeatureDefineDecoratorDescriptor =\n    TypedPropertyDescriptor<(...args: any[]) => any>\n    | TypedPropertyDescriptor<(...args: any[]) => any>\n    | TypedPropertyDescriptor<(...args: any[]) => Promise<any>>\n    | TypedPropertyDescriptor<(...args: any[]) => Promise<any>>\n/**\n * Describes additional configuration properties to be used in Feature Define decorator\n */\nexport type A_TYPES__FeatureDefineDecoratorConfig = {\n    /**\n     * Feature name\n     * \n     * [!] By default uses the method name\n     */\n    name: string,\n    /**\n     * Indicates a default behavior of the feature. If true the feature will be automatically attached to the execution.\n     * \n     * [!] Before feature execution the method itself will be called to prepare the feature template\n     * [!] Default is false\n     */\n    invoke: boolean,\n    /**\n     * Allows to add a default behavior or number of steps that will be part of the feature\n     */\n    template: Array<A_TYPES__FeatureDefineDecoratorTemplateItem>\n}\n/**\n * Describes a single template item used in Feature Define decorator\n */\nexport type A_TYPES__FeatureDefineDecoratorTemplateItem = A_TYPES__Required<Partial<A_TYPES__A_StageStep>, ['name', 'handler', 'component']>\n/**\n * Describes a target where Feature Define decorator can be applied\n * \n * [!] The feature can be defined on Container, Entity, Component or Command\n */\nexport type A_TYPES__FeatureDefineDecoratorTarget = A_Container\n    | A_Entity\n    | A_Component\n/**\n * A type of Meta information stored by Feature Define decorator\n * This information then uses by A-Context to build a proper feature template\n */\nexport type A_TYPES__FeatureDefineDecoratorMeta = {\n    /**\n     * Feature name\n     * mainly it's a unique combination of the class name and method name\n     */\n    name: string,\n    /**\n     * Actual method name in the class\n     */\n    handler: string,\n    /**\n     * Indicates a default behavior of the feature. If true the feature will be automatically attached to the execution.\n     * \n     * [!] Before feature execution the method itself will be called to prepare the feature template\n     * [!] Default is false\n     */\n    invoke: boolean,\n    /**\n     * Allows to add a default behavior or number of steps that will be part of the feature\n     */\n    template: Array<A_TYPES__A_StageStep>\n}\n// ---------------------------------------------------------------------------\n// --------------------Feature Extend Decorator Types-------------------------\n// ---------------------------------------------------------------------------\n/**\n * Descriptor type for A_Extend decorator\n */\nexport type A_TYPES__FeatureExtendDecoratorDescriptor =\n    TypedPropertyDescriptor<() => any>\n    | TypedPropertyDescriptor<(...args: any[]) => any>\n    | TypedPropertyDescriptor<(...args: any[]) => Promise<any>>\n    | TypedPropertyDescriptor<() => Promise<any>>\n/**\n * Target type for A_Extend decorator\n * \n * [!] Can be applied only on A-Components\n */\nexport type A_TYPES__FeatureExtendDecoratorTarget = A_Component | A_Container | A_Entity\n\n/**\n * Configuration type for A_Extend decorator\n * \n * This is an INPUT parameter provided by the user\n */\nexport type A_TYPES__FeatureExtendDecoratorConfig = {\n    /**\n     * Name of the container Lifecycle method to be extended.\n     * \n     * [!] If not provided will be used the name of the method.\n     * [!!] If name contains \".\" dot it will be considered as a path to the method.\n     */\n    name: string,\n    /**\n     * Container class or container name uses to identify the proper container in case when the name is not unique.\n     * \n     * [!] If not provided will be applied to all containers with the same name.\n     * [!!] By default uses OR to join all provided items. If you need more complex Logic, please use Regexp instead\n     * \n     * [!!!] In case if you need to exclude some containers, entities or components, please use \"exclude\" property\n     * \n     * Example:\n     * \n     * ```ts\n     *  @A_Feature.Extend({\n     *      name: 'load',\n     *      scope: {\n     *          include: [A_Container1, A_Entity1],\n     *          exclude: [A_Component1]\n     *      }\n     *  })\n     * ```\n     */\n    scope: Array<A_TYPES__FeatureExtendDecoratorScopeItem> | Partial<A_TYPES__FeatureExtendDecoratorScopeConfig>,\n    /**\n     * The behavior of the method. \n     * In case its async it will be executed independently from the main thread.\n     * \n     * [!] However, in case of sync, it will be executed in the main thread.in the order of the declaration.\n     * \n     */\n    behavior: A_TYPES_StageExecutionBehavior\n    /**\n     * Allows to define the order of the execution of the method.\n     * \n     * [!] It applies for the following structure :'Component.methodName'\n     * [!] In case the method has circular dependencies it will Throw an error.\n     * \n     * Example:\n     * ```ts\n     *  @A_Feature.Extend({\n     *      name: 'load',\n     *      before: ['Component1.methodName', 'Component2.methodName2']\n     *  })\n     *  // OR\n     *  @A_Feature.Extend({\n     *      name: 'load',\n     *      before: /Component2\\..+/\n     *  })\n     * ```\n     */\n    before: Array<string> | RegExp\n\n    /**\n     * Allows to define the order of the execution of the method.\n     * \n     * [!] It applies for the following structure :'Component.methodName'\n     * [!] In case the method has circular dependencies it will Throw an error.\n     * \n     * Example:\n     * ```ts\n     *  @A_Feature.Extend({\n     *      name: 'load',\n     *      after: ['Component1.methodName', 'Component2.methodName2']\n     *  })\n     *  // OR\n     *  @A_Feature.Extend({\n     *      name: 'load',\n     *      after: /Component2\\..+/\n     *  })\n     * ```\n     * \n     */\n    after: Array<string> | RegExp\n    /**\n     * Indicates whether to throw an error if the step fails.\n     * \n     * [!] By default is true\n     */\n    throwOnError: boolean\n\n    /**\n     * Allows to override particular steps in the feature sequence by provided names [Component].[Method] or by regexp\n     */\n    override: Array<string> | RegExp\n}\n/**\n * Scope item that can be used in A_Extend decorator configuration\n */\nexport type A_TYPES__FeatureExtendDecoratorScopeConfig = {\n    /**\n     * A list of components, entities or containers to include in the scope of the extension\n     */\n    include?: Array<A_TYPES__FeatureExtendDecoratorScopeItem>,\n    /**\n     * A list of components, entities or containers to exclude from the scope of the extension\n     */\n    exclude?: Array<A_TYPES__FeatureExtendDecoratorScopeItem>\n}\n/**\n * A single item that can be used in scope configuration\n */\nexport type A_TYPES__FeatureExtendDecoratorScopeItem = A_TYPES__Container_Constructor\n    | A_TYPES__Entity_Constructor\n    | A_TYPES__Component_Constructor\n\n\n\n// =======================================================================\n// --------------------------META TYPES-----------------------------------\n// =======================================================================\n/**\n * Meta type for A_Extend decorator\n */\nexport type A_TYPES__FeatureExtendDecoratorMeta = {\n    /**\n     * Original Feature Extension name\n     * \n     * [!] could be string or regex\n     */\n    name: string,\n    /**\n     * Actual method name in the class\n     */\n    handler: string\n    /**\n     * The behavior of the method. \n     * In case its async it will be executed independently from the main thread.\n     * \n     * [!] However, in case of sync, it will be executed in the main thread.in the order of the declaration.\n     * \n     */\n    behavior: A_TYPES_StageExecutionBehavior\n    /**\n     * Allows to define the order of the execution of the method.\n     * \n     * [!] In case the method has circular dependencies it will Throw an error.\n     * \n     */\n    before: string\n    /**\n     * Allows to define the order of the execution of the method.\n     * \n     * [!] In case the method has circular dependencies it will Throw an error.\n     * \n     */\n    after: string\n    /**\n     * Indicates whether to throw an error if the step fails.\n     * \n     * [!] By default is true\n     */\n    throwOnError: boolean,\n    /**\n     * Allows to override particular steps in the feature sequence by provided names [Component].[Method] or by regexp\n     */\n    override: string\n}\n\n\n","/**\n * A Meta is an entity that stores all the metadata for the specific entity like container, component, feature, etc. \n * \n * [!] Meta can be different depending on the type of input data\n */\nexport class A_Meta<\n    _StorageItems extends Record<string, any> = any\n// _StorageItems extends Record<string, Map<string | Symbol, any> | Array<any> | A_TYPES__Dictionary<any>>\n> implements Iterable<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]> {\n\n    protected meta: Map<keyof _StorageItems, _StorageItems[keyof _StorageItems]> = new Map();\n\n\n    /**\n     * Method to get the iterator for the meta object\n     * \n     * @returns \n     */\n    [Symbol.iterator](): Iterator<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]> {\n        const iterator = this.meta.entries();\n        return {\n            next: () => iterator.next()\n        };\n    }\n\n\n\n    // ===================================================================================================\n    // ================================ META OPERATIONS ==================================================\n    // ===================================================================================================\n    /**\n     * Allows to replicate received meta object by replacing internal meta to the received one\n     * \n     * @param meta \n     * @returns \n     */\n    from(\n        meta: A_Meta<_StorageItems>\n    ): A_Meta<_StorageItems> {\n        this.meta = new Map(meta.meta);\n\n        return this;\n    }\n\n\n    /**\n     * Method to set values in the map\n     * \n     * @param key \n     * @param value \n     */\n    set<K extends keyof _StorageItems>(key: K, value: _StorageItems[K]) {\n\n        const inheritedValue = this.meta.get(key)\n            || Array.isArray(value)\n            ? []\n            : (value as any) instanceof Map\n                ? new Map()\n                : {};\n        const targetValue = this.meta.get(key)\n            || Array.isArray(value)\n            ? [\n                ...inheritedValue as any\n            ] : (value as any) instanceof Map\n                ? new Map(inheritedValue as any)\n                : { ...inheritedValue };\n\n        this.meta.set(key, value);\n\n    }\n\n\n\n    /**\n     * Method to get values from the map\n     * \n     * @param key \n     * @returns \n     */\n    get<K extends keyof _StorageItems>(key: K): _StorageItems[K] | undefined {\n        return this.meta.get(key) as _StorageItems[K];\n    }\n\n\n    /**\n     * Method to delete values from the map\n     * \n     * @param key \n     * @returns \n     */\n    delete(key: keyof _StorageItems): boolean {\n        return this.meta.delete(key);\n    }\n\n\n    /**\n     * Method to get the size of the map\n     * \n     * @returns \n     */\n    size(): number {\n        return this.meta.size;\n    }\n\n\n    /**\n     * This method is needed to convert the key to a regular expression and cover cases like: \n     * \n     * simple * e.g. \"a*\" instead of \"a.*\"\n     * \n     * simple ? e.g. \"a?\" instead of \"a.\"\n     * \n     * etc. \n     * \n     * @param key \n     * @returns \n     */\n    private convertToRegExp(key: string | RegExp): RegExp {\n        return key instanceof RegExp\n            ? key\n            : new RegExp(key);\n    }\n\n\n    /**\n     * Method to find values in the map by name.\n     * \n     * Converts the Key in Map to a regular expression and then compares to the name\n     * \n     * @param name \n     * @returns \n     */\n    find(name: string) {\n        const results: Array<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]> = [];\n        for (const [key, value] of this.meta.entries()) {\n            if (this.convertToRegExp(String(key)).test(name)) {\n                results.push([key, value]);\n            }\n        }\n        return results;\n    }\n\n\n    /**\n     * Method to find values in the map by regular expression\n     * \n     * Compares Map Key to the input regular expression\n     * \n     * @param regex \n     * @returns \n     */\n    findByRegex(regex: RegExp): Array<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]> {\n        const results: Array<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]> = [];\n        for (const [key, value] of this.meta.entries()) {\n            if (regex.test(String(key))) {\n                results.push([key, value]);\n            }\n        }\n        return results;\n    }\n\n\n    /**\n     * Method to check if the map has a specific key\n     * \n     * @param key \n     * @returns \n     */\n    has(key: keyof _StorageItems): boolean {\n        return this.meta.has(key);\n    }\n\n\n    /**\n     * Method to get the size of the map\n     * \n     * @returns \n     */\n    entries(): IterableIterator<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]> {\n        return this.meta.entries();\n    }\n\n\n    /**\n     * Method to clear the map\n     */\n    clear(): void {\n        this.meta.clear();\n    }\n\n\n    toArray(): Array<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]> {\n        return Array.from(this.meta.entries());\n    }\n}","import { A_TYPES__A_InjectDecorator_Meta } from \"@adaas/a-concept/global/A-Inject/A-Inject.types\";\nimport { A_TYPES__ConceptAbstractionMeta } from \"../A-Concept/A-Concept.types\";\nimport { A_Meta } from \"../A-Meta/A-Meta.class\";\nimport { A_TYPES__ComponentMeta, A_TYPES__ComponentMetaExtension } from \"./A-Component.types\";\nimport { A_TYPES__ComponentMetaKey } from \"./A-Component.constants\";\nimport { A_TYPES__FeatureDefineDecoratorMeta } from \"../A-Feature/A-Feature.types\";\n\n\nexport class A_ComponentMeta extends A_Meta<A_TYPES__ComponentMeta> {\n\n    /**\n     * Allows to get all the injections for a given handler\n     * \n     * @param handler \n     * @returns \n     */\n    injections(\n        handler: string\n    ): A_TYPES__A_InjectDecorator_Meta {\n        const injections = this.get(A_TYPES__ComponentMetaKey.INJECTIONS);\n\n        const args = injections?.get(handler) || [];\n\n        return args;\n    }\n\n    /**\n     * Allows to get all the extensions for a given feature\n     * \n     * @param feature \n     * @returns \n     */\n    extensions(\n        feature: string\n    ): A_TYPES__ComponentMetaExtension[] {\n        const steps: A_TYPES__ComponentMetaExtension[] = [];\n\n        const extensions = this.get(A_TYPES__ComponentMetaKey.EXTENSIONS);\n\n        extensions\n            // returns all extensions that match the feature\n            ?.find(feature)\n            .forEach(([handler, extensions]) => {\n                extensions.forEach(extension => {\n                    steps.push({\n                        // component: constructor,\n                        name: extension.name,\n                        handler: extension.handler,\n                        behavior: extension.behavior,\n                        before: extension.before || '',\n                        after: extension.after || '',\n                        throwOnError: extension.throwOnError || true,\n                        override:''\n                    });\n\n                });\n            });\n\n\n        return steps;\n    }\n\n    /**\n     * Returns all features defined in the Component\n     * \n     * @returns \n     */\n    features(): Array<A_TYPES__FeatureDefineDecoratorMeta> {\n\n        const features = this.get(A_TYPES__ComponentMetaKey.FEATURES);\n\n        return features?.toArray()\n            // returns all extensions that match the feature\n            .map(([, feature]) => feature) || [];\n    }\n\n    /**\n     * Returns a set of instructions to run proper methods in Component during A-Concept Stage\n     * \n     * @param stage \n     * @returns \n     */\n    abstractions(\n        abstraction: any\n    ): A_TYPES__ConceptAbstractionMeta[] {\n        const steps: A_TYPES__ConceptAbstractionMeta[] = [];\n\n        const abstractions = this.get(A_TYPES__ComponentMetaKey.ABSTRACTIONS);\n        const injections = this.get(A_TYPES__ComponentMetaKey.INJECTIONS);\n\n        abstractions\n            // returns all extensions that match the feature\n            ?.find(`CONCEPT_ABSTRACTION::${abstraction}`)\n            .forEach(([handler, extensions]) => {\n                extensions.forEach(extension => {\n                    const args = injections?.get(extension.handler) || [];\n\n                    steps.push({\n                        ...extension,\n                        // component: constructor,\n                        args,\n                    });\n\n                });\n            });\n\n\n        return steps;\n    }\n}","import { A_Context } from \"../A-Context/A-Context.class\";\nimport { A_Feature } from \"../A-Feature/A-Feature.class\";\nimport { A_Scope } from \"../A-Scope/A-Scope.class\";\nimport { A_TYPES__Container_Init } from \"./A-Container.types\";\n\n\n\nexport class A_Container {\n\n    /**\n     * Configuration of the container that will be used to run it.\n     */\n    protected readonly config!: Partial<A_TYPES__Container_Init>;\n    /**\n     * Name of the container\n     */\n    get name() {\n        return this.config?.name || this.constructor.name;\n    }\n    /**\n     * Returns the scope where the container is registered\n     */\n    get scope(): A_Scope {\n        return A_Context.scope(this);\n    }\n\n\n    /**\n     * This class should combine Components to achieve the goal withing Concept\n     * \n     * Container is a direct container that should be \"run\" to make Concept work. \n     * So because of that Container can be:\n     * - HTTP Server\n     * - BASH Script\n     * - Database Connection\n     * - Microservice\n     * - etc.\n     * \n     * @param config - Configuration of the container that will be used to run it.\n     */\n    constructor(\n        /**\n         * Configuration of the container that will be used to run it.\n         */\n        config: Partial<A_TYPES__Container_Init> = {}\n    ) {\n        this.config = config;\n\n        A_Context.allocate(this, this.config);\n    }\n\n\n    /**\n     * Calls the feature with the given name in the given scope\n     * \n     * [!] Note: This method creates a new instance of the feature every time it is called\n     * \n     * @param feature - the name of the feature to call\n     * @param scope  - the scope in which to call the feature\n     * @returns  - void\n     */\n    async call(\n        /**\n         * Name of the feature to call\n         */\n        feature: string,\n        /**\n         * scope in which the feature will be executed\n         */\n        scope?: A_Scope\n    ) {\n        const newFeature = new A_Feature({\n            name: feature,\n            component: this\n        });\n\n        return await newFeature.process(scope);\n    }\n}","import { A_TYPES__ContainerMeta, A_TYPES__ContainerMetaExtension, } from \"./A-Container.types\";\nimport { A_TYPES__A_InjectDecorator_Meta } from \"@adaas/a-concept/global/A-Inject/A-Inject.types\";\nimport { A_TYPES__ConceptAbstraction, A_TYPES__ConceptAbstractionMeta } from \"../A-Concept/A-Concept.types\";\nimport { A_Meta } from \"../A-Meta/A-Meta.class\";\nimport { A_TYPES__ContainerMetaKey } from \"./A-Container.constants\";\nimport { A_TYPES__FeatureDefineDecoratorMeta } from \"../A-Feature/A-Feature.types\";\nimport { A_TYPES__ConceptAbstractions } from \"../A-Concept/A-Concept.constants\";\n\n\n\nexport class A_ContainerMeta extends A_Meta<A_TYPES__ContainerMeta> {\n\n\n\n    /**\n     * Allows to get all the injections for a given handler\n     * \n     * @param handler \n     * @returns \n     */\n    injections(\n        handler: string\n    ): A_TYPES__A_InjectDecorator_Meta {\n        const injections = this.get(A_TYPES__ContainerMetaKey.INJECTIONS);\n\n        const args = injections?.get(handler) || [];\n\n        return args;\n    }\n\n    /**\n     * Returns all features defined in the Container\n     * \n     * @returns \n     */\n    features(): Array<A_TYPES__FeatureDefineDecoratorMeta> {\n\n        const features = this.get(A_TYPES__ContainerMetaKey.FEATURES);\n\n        return features?.toArray()\n            // returns all extensions that match the feature\n            .map(([, feature]) => feature) || [];\n    }\n\n    /**\n     * Returns a set of instructions to run proper methods in Container during A-Concept Stage\n     * \n     * @param stage \n     * @returns \n     */\n    abstractions(\n        abstraction: A_TYPES__ConceptAbstractions\n    ): A_TYPES__ConceptAbstractionMeta[] {\n        const steps: A_TYPES__ConceptAbstractionMeta[] = [];\n\n        const abstractions = this.get(A_TYPES__ContainerMetaKey.ABSTRACTIONS);\n        const injections = this.get(A_TYPES__ContainerMetaKey.INJECTIONS);\n\n        abstractions\n            // returns all extensions that match the feature\n            ?.find(`CONCEPT_ABSTRACTION::${abstraction}`)\n            .forEach(([handler, extensions]) => {\n                extensions.forEach(extension => {\n                    const args = injections?.get(extension.handler) || [];\n\n                    steps.push({\n                        ...extension,\n                        args,\n                    });\n\n                });\n            });\n\n\n        return steps;\n    }\n\n\n    /**\n     * Allows to get all the extensions for a given feature\n     * \n     * @param feature \n     * @returns \n     */\n    extensions(\n        feature: string\n    ): A_TYPES__ContainerMetaExtension[] {\n        const steps: A_TYPES__ContainerMetaExtension[] = [];\n\n        const extensions = this.get(A_TYPES__ContainerMetaKey.EXTENSIONS);\n\n        extensions\n            // returns all extensions that match the feature\n            ?.find(feature)\n            .forEach(([handler, extensions]) => {\n                extensions.forEach(extension => {\n                    steps.push({\n                        // component: constructor,\n                        name: extension.name,\n                        handler: extension.handler,\n                        behavior: extension.behavior,\n                        before: extension.before || '',\n                        after: extension.after || '',\n                        throwOnError: extension.throwOnError || true,\n                        override: ''\n\n                    });\n\n                });\n            });\n\n\n        return steps;\n    }\n\n}","\n/**\n * A_FormatterHelper\n * \n * Helper class for formatting strings into different cases.\n */\nexport class A_FormatterHelper {\n    /**\n     * Convert string to UPPER_SNAKE_CASE\n     * \n     * @param str \n     * @returns \n     */\n    static toUpperSnakeCase(str: string): string {\n        return str\n            .replace(/([a-z])([A-Z])/g, '$1_$2')  // Handle lowercase followed by uppercase\n            .replace(/[-\\s]([A-Z])/g, '_$1')      // Handle non-alphabetical followed by uppercase\n            .replace(/-/g, '_')\n            .toUpperCase();\n    }\n    /**\n     * Convert string to camelCase\n     * \n     * @param str \n     * @returns \n     */\n    static toCamelCase(str: string): string {\n        return str.toLowerCase().replace(/_([a-z])/g, (match, letter) => letter.toUpperCase());\n    }\n    /**\n     * Convert string to PascalCase\n     * \n     * @param str \n     * @returns \n     */\n    static toPascalCase(str: string): string {\n        const camelCase = this.toCamelCase(str);\n        return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);\n    }\n    /**\n     * Convert string to kebab-case\n     * \n     * @param str \n     * @returns \n     */\n    static toKebabCase(str: string): string {\n        return str\n            // 1. Replace all non-alphanumeric (underscore, dot, etc.) with a space\n            .replace(/[^a-zA-Z0-9]+/g, ' ')\n            // 2. Insert space before any uppercase preceded by lowercase or digit\n            .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n            // 3. Trim spaces at both ends and replace remaining spaces with dashes\n            .trim()\n            .replace(/\\s+/g, '-')\n            // 4. Lowercase everything\n            .toLowerCase();\n    }\n}","\nexport type A_ID_TYPES__TimeId_Parts = {\n    timestamp: Date;\n    random: string;\n}\n\n\nexport class A_IdentityHelper {\n    /**\n   * Generates a short, time-based unique ID.\n   * Encodes current time (ms since epoch) and random bits in base36.\n   * Example: \"mb4f1g-7f9a1c\"\n   */\n    static generateTimeId(\n        parts: A_ID_TYPES__TimeId_Parts = { timestamp: new Date(), random: Math.random().toString(36).slice(2, 8) }\n    ): string {\n        const time = parts.timestamp.getTime().toString(36); // base36-encoded timestamp\n        const random = parts.random; // use provided random string\n        return `${time}-${random}`;\n    }\n\n    /**\n     * Parses a short ID back into its parts.\n     * Returns an object with the original timestamp (as Date) and random string.\n     */\n    static parseTimeId(id: string): A_ID_TYPES__TimeId_Parts {\n        const [timePart, randomPart] = id.split('-');\n        const timestamp = new Date(parseInt(timePart, 36));\n        return { timestamp, random: randomPart };\n    }\n\n\n    /**\n     *  Format a number with leading zeros to a fixed length\n     * \n     * @param number \n     * @param maxZeros \n     * @returns \n     */\n    static formatWithLeadingZeros(number, maxZeros = 10) {\n        const formattedNumber = String(number).padStart(maxZeros + 1, '0');\n        return formattedNumber.slice(-maxZeros);\n    }\n\n    /**\n     * Remove leading zeros from a formatted number\n     */\n    static removeLeadingZeros(formattedNumber) {\n        return String(Number(formattedNumber)); // Convert to number and back to string to remove leading zeros\n    }\n\n\n}","\n\n\nexport const A_CONSTANTS__ERROR_CODES = {\n    UNEXPECTED_ERROR: 'A-Error Unexpected Error',\n    VALIDATION_ERROR: 'A-Error Validation Error',\n} as const;\n\n\n\nexport const A_CONSTANTS__ERROR_DESCRIPTION = 'If you see this error please let us know.'","import {\n    A_TYPES__Error_Init,\n    A_TYPES__Error_Serialized\n} from './A_Error.types';\nimport {\n    A_CONSTANTS__ERROR_CODES,\n    A_CONSTANTS__ERROR_DESCRIPTION\n} from './A_Error.constants';\nimport { A_FormatterHelper } from '@adaas/a-concept/helpers/A_Formatter.helper';\nimport { A_Context } from '../A-Context/A-Context.class';\nimport { A_TypeGuards } from '@adaas/a-concept/helpers/A_TypeGuards.helper';\nimport { ASEID } from '../ASEID/ASEID.class';\nimport { A_CONSTANTS__DEFAULT_ENV_VARIABLES } from '@adaas/a-concept/constants/env.constants';\n\n\nexport class A_Error<\n    _ConstructorType extends A_TYPES__Error_Init = A_TYPES__Error_Init,\n    _SerializedType extends A_TYPES__Error_Serialized = A_TYPES__Error_Serialized\n> extends Error {\n    // ====================================================================\n    // ================== Static A-Error Information ======================\n    // ====================================================================\n    /**\n     * Error Identifier that corresponds to the class name\n     */\n    static get entity(): string {\n        return A_FormatterHelper.toKebabCase(this.name);\n    }\n    /**\n     * DEFAULT Namespace of the error from environment variable A_CONCEPT_NAMESPACE\n     * \n     * [!] If environment variable is not set, it will default to 'a-concept'\n     */\n    static get concept(): string {\n        return A_Context.concept;\n    }\n    /**\n     * DEFAULT Scope of the entity from environment variable A_CONCEPT_DEFAULT_SCOPE\n     * \n     * [!] If environment variable is not set, it will default to 'core'\n     * [!] Scope is an application specific identifier that can be used to group entities together\n     * [!] e.g. 'default', 'core', 'public', 'internal', etc\n     */\n    static get scope(): string {\n        return A_Context.root.name;\n    }\n\n    // ====================================================================\n    // ================== Hidden A-Error Information ======================\n    // ====================================================================\n    /**\n     * ASEID of the error instance\n     */\n    protected _aseid!: ASEID;\n    /**\n     * Title of the error\n     */\n    protected _title!: string;\n    /**\n     * Possible Scope if needed to identify the error by it's execution environment\n     */\n    protected _scope?: string;\n    /**\n     * Unique code representing the type of error\n     */\n    protected _code?: string;\n    /**\n     * Detailed description of the error\n     */\n    protected _description?: string;\n    /**\n     * Original Error if any\n     */\n    protected _originalError?: Error | any\n    /**\n     * Link to the documentation or support page for the error\n     */\n    protected _link?: string;\n\n\n\n    /**\n     * A_Error is a custom error class for A_Concept framework.\n     * This error allows to have more structured error handling.\n     * Each error has a unique code, description and a link to the documentation.\n     * \n     * Example of usage: \n     * ```typescript\n     * \n     * // 1) all parameters will be used as provided\n     * throw new A_Error({\n     *    message: 'User not found',\n     *    code: 'USER_NOT_FOUND',\n     *    description: 'The user with the given ID was not found.',\n     *    link: 'https://support.adaas.org/error/USER_NOT_FOUND'\n     * });\n     * \n     * // or\n     * // 2) only message is provided, other parameters will be set to default values:\n     * //     - code: 'user-not-found' (kebab-case of the message)\n     * //     - description: 'User not found' (same as message)\n     * //     - link: Empty\n     * throw new A_Error('User not found');\n     * \n     * // or\n     * // 3) Provided Message and Description, other parameters will be set to default values:\n     * //     - code: 'user-not-found' (kebab-case of the message)\n     * //     - description: 'The user with the given ID was not found.' (as provided)\n     * //     - link: Empty\n     * throw new A_Error('User not found', 'The user with the given ID was not found.');\n     * \n     * \n     * ```\n     * [!] Note: The behavior of A_Error is similar to the A_Entity however it cannot have own A_Features.\n     * [!] Note: This class can be inherited to create custom error classes.\n     * \n     * @param message \n     */\n    constructor(\n        /**\n         * A_Error Constructor params\n         */\n        params: _ConstructorType\n    )\n    constructor(\n        /**\n         * Error message\n         */\n        message: string\n    )\n    constructor(\n        /**\n         * Original JS Error\n         */\n        error: Error\n    )\n    constructor(\n        /**\n         * Error message\n         */\n        title: string,\n        /**\n         * Detailed description of the error\n         */\n        description: string\n    )\n    constructor(\n        param1: _ConstructorType | Error | string | A_Error,\n        param2?: string\n    ) {\n        //  to prevent errors accumulation in the stack trace it returns the original error if provided param1 is A_Error\n        switch (true) {\n            case param1 instanceof A_Error:\n                return param1 as A_Error<_ConstructorType, _SerializedType>;\n\n            case param1 instanceof Error:\n                super(param1.message);\n                break;\n\n            case A_TypeGuards.isConstructorType<_ConstructorType>(param1) && 'description' in param1:\n                super(`[${param1.title}]: ${param1.description}`);\n                break;\n\n            case A_TypeGuards.isConstructorType<_ConstructorType>(param1) && !('description' in param1):\n                super(param1.title);\n                break;\n\n            case A_TypeGuards.isString(param1) && !param2:\n                super(param1);\n                break;\n\n            case A_TypeGuards.isString(param1) && !!param2:\n                super(`[${param1}]: ${param2}`);\n                break;\n\n            default:\n                throw new A_Error(\n                    A_CONSTANTS__ERROR_CODES.VALIDATION_ERROR,\n                    'Invalid parameters provided to A_Error constructor'\n                );\n        }\n\n        const initializer = this.getInitializer(param1, param2);\n        // the returned initializer is already bound to `this` (we used .bind(this)),\n        // so calling it will run the appropriate logic on this instance:\n        initializer.call(this, param1, param2);\n    }\n\n\n\n    // ====================================================================\n    // ================== Public A-Error Information ======================\n    // ====================================================================\n    /**\n     * Returns the ASEID of the error instance\n     */\n    get aseid(): ASEID {\n        return this._aseid;\n    }\n    /**\n     * Returns the title of the error\n     * \n     * Example: 'User not found', 'Validation error', 'Unauthorized access', etc.\n     * \n     * [!] Note: This title should be short and concise, less than 60 characters\n     * [!] Note: If title exceeds 60 characters, there would be an error thrown\n     * [!] Note: This title is intended to be human-readable and can be displayed in UI or logs\n     */\n    get title(): string {\n        return this._title;\n    }\n    /**\n     * Returns an Error message what is a brief title of the error\n     * \n     */\n    get message(): string {\n        return super.message;\n    }\n    /**\n     * Returns a unique code representing the type of error\n     * \n     * If code is not provided, it will generate a kebab-case of the message\n     * \n     * Example: 'validation-error', 'not-found', 'user-not-found', 'unauthorized' etc.\n     * \n     * [!] Note: It is recommended to use kebab-case for error codes\n     * [!] Note: If not provided would be used a kebab-case message of the error\n     */\n    get code(): string {\n        return this._code || A_FormatterHelper.toKebabCase(this.title);\n    }\n    /**\n     * Returns the type of the error which corresponds to the static entity of the class\n     * \n     * Example: 'a-error', 'validation-error', 'not-found-error', 'user-error', etc.\n     * \n     * Defaults to the kebab-case of the class name\n     * \n     * [!] Note: naming ad separation are fully dependent on the architecture of the application\n     * [!] Note: It is recommended to use kebab-case for error types\n     * [!] Note: This type is intended to group similar errors together\n     */\n    get type() {\n        return (this.constructor as typeof A_Error).entity;\n    }\n    /**\n     * Returns a link with possible documentation or support page for the error\n     * If link is not provided, it will generate a link based on the ASEID of the error that points to the A-Concept support page\n     * \n     * Example: https://adaas.support/a-concept/errors/{ASEID}\n     * \n     * [!] Note: ASEID is generated based on the static properties of the class (concept, scope, entity) and the code of the error\n     */\n    get link() {\n        if (this._link)\n            return this._link;\n\n        const url = new URL(`https://adaas.support/a-concept/errors/${this.aseid.toString()}`);\n\n        return url.toString();\n    }\n    /**\n     * The scope name of the error instance\n     * \n     * If scope is not provided, it will use the static scope of the class\n     * \n     * [!] Note: Scope is an application specific identifier that can be used to group entities together\n     * [!] e.g. 'default', 'core', 'public', 'internal', etc\n     */\n    get scope() {\n        return this._aseid.scope\n    }\n    /**\n     * A detailed description of the error\n     * If description is not provided, it will use the environment variable A_ERROR_DEFAULT_DESCRIPTION or a generic message\n     * \n     * Example: 'The user with the given ID was not found.', 'The provided data is invalid.', 'You do not have permission to access this resource.', etc.\n     * \n     * [!] Note: This description is intended to provide more context about the error and can be used for debugging or logging purposes\n     */\n    get description(): string {\n        return this._description || process.env[A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_ERROR_DEFAULT_DESCRIPTION] || A_CONSTANTS__ERROR_DESCRIPTION;\n    }\n    /**\n     * Returns the original error if any\n     * \n     * This can be useful for debugging purposes to see the original stack trace or error message\n     * \n     * [!] Note: Original error is optional and may not be present in all cases\n     */\n    get originalError(): Error | any | undefined {\n        return this._originalError;\n    }\n\n\n\n    /**\n     * Determines which initializer method to use based on the type of the first parameter.\n     * \n     * @param param1 \n     * @returns\n     */\n    protected getInitializer(\n        param1: _ConstructorType | Error | string | any,\n        param2?: string\n    ): (param1: any, param2: any) => void | (() => void) {\n        switch (true) {\n            case A_TypeGuards.isString(param1) && !param2:\n                return this.fromMessage;\n\n            case A_TypeGuards.isString(param1) && !!param2:\n                return this.fromTitle;\n\n            case param1 instanceof Error:\n                return this.fromError;\n\n\n            case A_TypeGuards.isConstructorType<_ConstructorType>(param1):\n                return this.fromConstructor;\n\n            default: {\n                console.log('INVALID PARAMS PROVIDED TO A_ERROR CONSTRUCTOR: ', param1);\n\n                throw new A_Error(\n                    A_CONSTANTS__ERROR_CODES.VALIDATION_ERROR,\n                    'Invalid parameters provided to A_Error constructor'\n                );\n            }\n        }\n    }\n\n    /**\n     * Initializes the A_Error instance from a standard Error object.\n     * \n     * @param error \n     */\n    protected fromError(error: Error): void {\n        this._title = A_CONSTANTS__ERROR_CODES.UNEXPECTED_ERROR;\n\n        this._aseid = new ASEID({\n            concept: (this.constructor as typeof A_Error).concept,\n            scope: (this.constructor as typeof A_Error).scope,\n            entity: (this.constructor as typeof A_Error).entity,\n            id: this.code\n        });\n\n        this._originalError = error;\n    }\n    /**\n     * Initializes the A_Error instance from a message.\n     * \n     * @param title \n     * @param description \n     */\n    protected fromMessage(message: string): void {\n        this._title = A_CONSTANTS__ERROR_CODES.UNEXPECTED_ERROR;\n\n        this._aseid = new ASEID({\n            concept: (this.constructor as typeof A_Error).concept,\n            scope: this._scope || (this.constructor as typeof A_Error).scope,\n            entity: (this.constructor as typeof A_Error).entity,\n            id: this.code\n        });\n\n        this._link = undefined;\n        this._originalError = undefined;\n    }\n\n\n    fromTitle(title: string, description: string): void {\n        this.validateTitle(title);\n\n        this._title = title;\n        this._description = description;\n\n        this._aseid = new ASEID({\n            concept: (this.constructor as typeof A_Error).concept,\n            scope: this._scope || (this.constructor as typeof A_Error).scope,\n            entity: (this.constructor as typeof A_Error).entity,\n            id: this.code\n        });\n\n        this._link = undefined;\n        this._originalError = undefined;\n    }\n    /**\n     * Initializes the A_Error instance from a constructor parameters object.\n     * \n     * @param params \n     */\n    protected fromConstructor(params: _ConstructorType): void {\n        this.validateTitle(params.title);\n\n        this._title = params.title;\n        this._code = params.code;\n        this._scope = params.scope ? (A_TypeGuards.isScopeInstance(params.scope) ? params.scope.name : params.scope) : undefined;\n\n        this._aseid = new ASEID({\n            concept: (this.constructor as typeof A_Error).concept,\n            scope: this._scope || (this.constructor as typeof A_Error).scope,\n            entity: (this.constructor as typeof A_Error).entity,\n            id: this.code\n        });\n\n        this._description = params.description;\n        this._link = params.link;\n        this._originalError = params.originalError;\n    }\n\n    /**\n     * Serializes the A_Error instance to a plain object.\n     * \n     * \n     * @returns \n     */\n    toJSON(): _SerializedType {\n        return {\n            aseid: this.aseid.toString(),\n            title: this.title,\n            code: this.code,\n            type: this.type,\n            message: this.message,\n            link: this.link,\n            scope: this.scope,\n            description: this.description,\n            originalError: this.originalError?.message\n        } as _SerializedType;\n    }\n\n\n\n    // --------------------------------------------------------------------------\n    // ----------------------- PROTECTED HELPERS --------------------------------\n    // --------------------------------------------------------------------------\n    /**\n     * Checks if the provided title exceeds 60 characters.\n     * If it does, throws a validation A_Error.\n     * \n     * @param title \n     */\n    protected validateTitle(title: string) {\n        if (title.length > 60) {\n            throw new A_Error(\n                A_CONSTANTS__ERROR_CODES.VALIDATION_ERROR,\n                'A-Error title exceeds 60 characters limit.'\n            );\n        }\n        if (title.length === 0) {\n            throw new A_Error(\n                A_CONSTANTS__ERROR_CODES.VALIDATION_ERROR,\n                'A-Error title cannot be empty.'\n            );\n        }\n    }\n}\n\n\n\n\n\n// message = title + description for better printing in the console\n// description = detailed information about the error\n// code = kebabcase (title)\n\n","import { A_Error } from \"../A-Error/A_Error.class\";\n\n\n\nexport class ASEID_Error extends A_Error {\n\n\n    static readonly ASEIDInitializationError = 'ASEID Initialization Error';\n    \n    static readonly ASEIDValidationError = 'ASEID Validation Error';\n\n}","import {\n    A_TYPES__ASEID_Constructor,\n    A_TYPES__ASEID_JSON\n} from \"./ASEID.types\";\nimport { A_IdentityHelper } from \"@adaas/a-concept/helpers/A_Identity.helper\";\nimport { A_TypeGuards } from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_Context } from \"../A-Context/A-Context.class\";\nimport { ASEID_Error } from \"./ASEID.error\";\nimport { A_TYPES__Required } from \"@adaas/a-concept/types/A_Common.types\";\n\n\n\nexport class ASEID {\n\n\n    //==========================================================================\n    //============================= STATIC METHODS ===========================\n    //==========================================================================\n    /**\n     * ASEID Regular Expression\n     */\n    static readonly regexp: RegExp = new RegExp(`^[a-z|A-Z|0-9|-]+@[a-z|A-Z|0-9|\\-]+:[a-z|A-Z|0-9|\\-]+:[a-z|A-Z|0-9|\\\\.|-]+(@v[0-9|\\\\.]+|@lts)?$`)\n    /**\n     * Tests if the identity string is an ASEID\n     * \n     * @param identity \n     * @returns \n     */\n    static isASEID(identity: string): boolean {\n        return this.regexp.test(identity)\n    }\n\n\n\n    // ====================================================================\n    // ==================== Hidden ASEID Information ======================\n    // ====================================================================\n    /**\n     * Concept for the ASEID\n     * Generally it is the application name or code, should correspond to the concept where the entity is used\n     * Could be ID or ASEID\n     */\n    private _concept!: string;\n    /**\n     * Entity Scope the primary location of the resource \n     * Organization, or organization Unit\n     * Could be ID or ASEID\n     * \n     */\n    private _scope!: string\n    /**\n     * Entity Type the type of the resource\n     */\n    private _entity!: string\n    /**\n     * Entity ID the unique identifier of the resource\n     */\n    private _id!: string\n    /**\n     * Version of the entity (optional)\n     */\n    private _version?: string\n    /**\n     * Shard of the entity (optional)\n     */\n    private _shard?: string\n\n\n\n\n\n\n    /**\n     * ASEID is a structured identifier for entities in the A-Concept system. \n     * using the format:\n     *  A - A-Concept\n     *  S - System \n     *  E - Entity\n     *  I - Identifier\n     *  D - iDentifier\n     * \n     * Structure: CONCEPT_NAME + @ + SCOPE + : ENTITY_NAME + : + ID + @ + VERSION \n     * \n     * Example:\n     *  - root@core:usr:0000000001\n     * \n     * [!] Concept is optional, if not provided will be used the current concept name\n     * [!] Scope is optional, if not provided will be used the root scope of the current concept\n     * [!] Version is optional, if not provided will be considered as latest version\n     * \n     * @param aseid - ASEID string representation or ASEID components as object\n     */\n    constructor(\n        /**\n         * ASEID string representation\n         */\n        aseid: string\n    )\n    constructor(\n        /**\n         * ASEID components as object \n         */\n        props: A_TYPES__Required<Partial<A_TYPES__ASEID_Constructor>, ['id', 'entity']>\n    )\n    constructor(param1: string | A_TYPES__Required<Partial<A_TYPES__ASEID_Constructor>, ['id', 'entity']>) {\n        this.verifyInput(param1);\n\n        const initializer = this.getInitializer(param1);\n        // the returned initializer is already bound to `this` (we used .bind(this)),\n        // so calling it will run the appropriate logic on this instance:\n        initializer.call(this, param1);\n    }\n\n    /**\n     * Getters for ASEID components\n     */\n    get concept(): string {\n        return this._concept || A_Context.concept;\n    }\n    /**\n     * Get the scope of the ASEID\n     */\n    get scope(): string {\n        return this._scope || A_Context.root.name;\n    }\n    /**\n     * Get the entity of the ASEID\n     */\n    get entity(): string {\n        return this._entity;\n    }\n    /**\n     * Get the id of the ASEID\n     */\n    get id(): string {\n        return this._id;\n    }\n    /**\n     * Get the version of the ASEID (if any)\n     */\n    get version(): string | undefined {\n        return this._version;\n    }\n    /**\n     * Get the shard of the ASEID (if any)\n     */\n    get shard(): string | undefined {\n        return this._shard;\n    }\n\n    /**\n     * get Internal Initializer based on the type of the parameter provided\n     * \n     * @param param1 \n     * @returns \n     */\n    private getInitializer(\n        param1: string | A_TYPES__Required<Partial<A_TYPES__ASEID_Constructor>, ['id', 'entity']>\n    ): (param1: any) => void | (() => void) {\n        switch (true) {\n            case A_TypeGuards.isString(param1):\n                return this.fromString;\n\n            case A_TypeGuards.isObject<A_TYPES__ASEID_Constructor>(param1):\n                return this.fromObject;\n\n            default:\n                throw new ASEID_Error(\n                    ASEID_Error.ASEIDInitializationError,\n                    'Invalid parameters provided to ASEID constructor'\n                );\n        }\n    }\n\n\n    /**\n     * Initialize ASEID from string\n     * \n     * @param param1 \n     */\n    private fromString(param1: string) {\n        const [concept, body, version] = param1.split('@');\n        const [scope, entity, idCandidate] = body.split(':');\n\n        const shard = idCandidate.includes('.') ? idCandidate.split('.')[0] : undefined;\n        const id = idCandidate.includes('.') ? idCandidate.split('.')[1] : idCandidate;\n\n        this._concept = concept || A_Context.root.name;\n        this._scope = scope || A_Context.root.name;\n        this._entity = entity;\n        this._id = id;\n        this._version = version;\n        this._shard = shard;\n    }\n    /**\n     * Initialize ASEID from object\n     * \n     * @param param1 \n     */\n    private fromObject(param1: A_TYPES__Required<Partial<A_TYPES__ASEID_Constructor>, ['id', 'entity']>) {\n        this._concept = param1.concept\n            ? ASEID.isASEID(param1.concept)\n                ? new ASEID(param1.concept).id\n                : param1.concept\n            : A_Context.concept;\n\n        this._scope = param1.scope\n            ? A_TypeGuards.isNumber(param1.scope)\n                ? A_IdentityHelper.formatWithLeadingZeros(param1.scope) :\n                ASEID.isASEID(param1.scope)\n                    ? new ASEID(param1.scope).id\n                    : param1.scope\n            : A_Context.root.name\n\n        this._entity = param1.entity;\n\n        this._id = A_TypeGuards.isNumber(param1.id)\n            ? A_IdentityHelper.formatWithLeadingZeros(param1.id)\n            : param1.id;\n\n        this._version = param1.version;\n        this._shard = param1.shard;\n    }\n\n\n    /**\n     * String representation of the ASEID\n     * \n     * @returns \n     */\n    toString(): string {\n        return `${this.concept}@${this.scope}:${this.entity}:${this.shard ? (this.shard + '.' + this.id) : this.id}${this.version ? ('@' + this.version) : ''}`\n    }\n\n    /**\n     * JSON representation of the ASEID\n     * \n     * @returns \n     */\n    toJSON(): A_TYPES__ASEID_JSON {\n        return {\n            concept: this._concept,\n            scope: this._scope,\n            entity: this._entity,\n            id: this._id,\n            version: this._version,\n            shard: this._shard\n        }\n    }\n\n    // --------------------------------------------------------------------------\n    // ----------------------- PROTECTED HELPERS --------------------------------\n    // --------------------------------------------------------------------------\n\n\n    protected verifyInput(param1: string | A_TYPES__Required<Partial<A_TYPES__ASEID_Constructor>, ['id', 'entity']>) {\n\n        switch (true) {\n            // 1) check for string and validate it as ASEID\n            case A_TypeGuards.isString(param1) && !ASEID.isASEID(param1):\n                throw new ASEID_Error(ASEID_Error.ASEIDValidationError, 'Invalid ASEID format provided')\n\n            // 2) check for object and validate required fields\n            case A_TypeGuards.isObject<A_TYPES__ASEID_Constructor>(param1) && !param1.id:\n                throw new ASEID_Error(ASEID_Error.ASEIDValidationError, 'ASEID id is required')\n\n            // 3) check for object and validate required fields\n            case A_TypeGuards.isObject<A_TYPES__ASEID_Constructor>(param1) && !param1.entity:\n                throw new ASEID_Error(ASEID_Error.ASEIDValidationError, 'ASEID entity is required')\n\n        }\n    }\n}","import { A_Error } from \"../A-Error/A_Error.class\";\n\n\n\nexport class A_Entity_Error extends A_Error {\n\n    /**\n     * Error code for validation errors.\n     */\n    static readonly ValidationError = 'A-Entity Validation Error';\n\n}","import {\n    A_TYPES__Entity_Serialized,\n    A_TYPES__Entity_Init,\n    A_TYPES__IEntity,\n} from \"./A-Entity.types\";\nimport { A_Context } from \"../A-Context/A-Context.class\";\nimport { A_Scope } from \"../A-Scope/A-Scope.class\";\nimport { A_FormatterHelper } from \"@adaas/a-concept/helpers/A_Formatter.helper\";\nimport { ASEID } from \"../ASEID/ASEID.class\";\nimport { A_IdentityHelper } from \"@adaas/a-concept/helpers/A_Identity.helper\";\nimport { A_Entity_Error } from \"./A-Entity.error\";\nimport { A_Feature } from \"../A-Feature/A-Feature.class\";\n\n\n/**\n * A_Entity is another abstraction that describes all major participants in the system business logic.\n * Each Entity should have a clear definition and a clear set of responsibilities. \n * However, entity may hide some of its responsibilities behind the interface to prevent overload. \n * \n * Each entity should be connected to the ContextFragment (Scope) and should be able to communicate with other entities.\n */\nexport class A_Entity<\n    _ConstructorType extends A_TYPES__Entity_Init = A_TYPES__Entity_Init,\n    _SerializedType extends A_TYPES__Entity_Serialized = A_TYPES__Entity_Serialized\n>\n    implements A_TYPES__IEntity {\n\n    // ====================================================================\n    // ================== Static A-Entity Information ============================\n    // ====================================================================\n    /**\n     * Entity Identifier that corresponds to the class name\n     */\n    static get entity(): string {\n        return A_FormatterHelper.toKebabCase(this.name);\n    }\n    /**\n     * DEFAULT Concept Name (Application Name) of the entity from environment variable A_CONCEPT_NAME\n     * [!] If environment variable is not set, it will default to 'a-concept'\n     */\n    static get concept(): string {\n        return A_Context.concept;\n    }\n    /**\n     * DEFAULT Scope of the entity from environment variable A_CONCEPT_DEFAULT_SCOPE\n     * [!] If environment variable is not set, it will default to 'core'\n     * [!] Scope is an application specific identifier that can be used to group entities together\n     * [!] e.g. 'default', 'core', 'public', 'internal', etc\n     */\n    static get scope(): string {\n        return A_Context.root.name;\n    }\n\n\n\n    // ====================================================================\n    // ================== Instance A-Entity Information ====================\n    // ====================================================================\n\n    /**\n     * ASEID is an entity identifier that is unique across the system\n     * A - A_Concept or Application\n     * S - System or Scope\n     * E - Entity\n     * ID - Identifier\n     * \n     * [!] ASEID is immutable and should not be changed after the entity is created\n     * \n     * [!] ASEID is composed of the following parts:\n     * - concept: an application specific identifier from where the entity is coming from\n     * - scope: the scope of the entity from concept\n     * - entity: the name of the entity from concept\n     * - id: the unique identifier of the entity\n     *\n     * [!] For more information about ASEID, please refer to the ASEID class documentation]\n     */\n    aseid!: ASEID;\n\n\n\n    /**\n     * Create a new A_entity instance from Aseid String\n     * e.g. project@scope:entity:0000000001\n     * \n     * @param aseid \n     */\n    constructor(\n        /**\n         * ASEID string that represents the entity\n         */\n        aseid?: string\n    )\n    /**\n     * Create a new A_entity instance from Aseid instance\n     * e.g. new ASEID({concept: 'project', scope: 'default', entity: 'entity', id: '0000000001'})\n     * \n     * @param aseid \n     */\n    constructor(\n        /**\n         * ASEID instance that represents the entity\n         */\n        aseid: ASEID\n    )\n    /**\n     * Create a new A_entity instance from serialized object\n     * \n     * @param serialized \n     */\n    constructor(\n        /**\n         * Serialized object that represents the entity\n         */\n        serialized: _SerializedType\n    )\n    /**\n     * Create a new A_entity instance from constructor object\n     * \n     * @param newEntity \n     */\n    constructor(\n        /**\n         * Constructor object that represents the entity\n         */\n        newEntity?: _ConstructorType\n    )\n    constructor(props?: string | ASEID | _SerializedType | _ConstructorType) {\n\n        const initializer = this.getInitializer(props);\n        // the returned initializer is already bound to `this` (we used .bind(this)),\n        // so calling it will run the appropriate logic on this instance:\n        initializer.call(this, props);\n    }\n    // ====================================================================\n    // ================== DUPLICATED ASEID Getters ========================\n    // ====================================================================\n\n    /**\n     * Extracts the ID from the ASEID\n     * ID is the unique identifier of the entity\n     */\n    get id(): string | number {\n        return this.aseid.id;\n    }\n\n    // ====================================================================\n    // ================== Constructor Helpers =============================\n    // ====================================================================\n\n\n    // --- Type guards used to classify `props` properly ---\n    protected isStringASEID(x: unknown): x is string {\n        return typeof x === \"string\" && ASEID.isASEID(x);\n    }\n\n    protected isASEIDInstance(x: unknown): x is ASEID {\n        return x instanceof ASEID;\n    }\n\n    /**\n     * A \"serialized\" object is considered such if it is a non-null object \n     * and contains an \"aseid\" property (this mirrors your original check). \n     * \n     * @param x \n     * @returns \n     */\n    protected isSerializedObject(x: unknown): x is _SerializedType {\n        return !!x && typeof x === \"object\" && \"aseid\" in (x as object);\n    }\n\n    /**\n     * Constructor-style props = a plain object which does NOT contain \"aseid\".\n     * This is the \"create from provided fields\" case.\n     * \n     * @param x \n     * @returns \n     */\n    protected isConstructorProps(x: unknown): x is _ConstructorType {\n        return !!x && typeof x === \"object\" && !(\"aseid\" in (x as object));\n    }\n\n    /**\n     * Determines the appropriate initializer method based on the type of `props`.\n     * The method checks if `props` is:  \n     * 1) a string that matches ASEID format -> fromASEID\n     * 2) an ASEID instance -> fromASEID\n     * 3) a serialized object (has 'aseid') -> fromJSON\n     * 4) a plain object with no 'aseid' -> treat as constructor props -> fromNew\n     * \n     * [!] If `props` is undefined, it will call fromUndefined method\n     * \n     * If none of the above, it throws an error indicating incorrect constructor usage.\n     * \n     * \n     * To get a custom initializer, override this method in the child class.\n     * Example:\n     * ```typescript\n     * protected getInitializer(\n     *   props?: string | ASEID | _SerializedType | _ConstructorType\n     * ): (props: any) => void | (() => void) {\n     *   if('customField' in props) {\n     *       return this.fromCustomField.bind(this);\n     *   }\n     *   return super.getInitializer(props);\n     * }\n     * ```\n     * @param props\n     * @returns The appropriate initializer method\n     */\n    protected getInitializer(\n        props?: string | ASEID | _SerializedType | _ConstructorType\n    ): (props: any) => void | (() => void) {\n\n        if (!props) {\n            return this.fromUndefined\n        }\n\n        // 1) string that matches ASEID format -> fromASEID\n        if (this.isStringASEID(props)) {\n            return this.fromASEID as (p: string) => void;\n        }\n\n        // 2) ASEID instance -> fromASEID\n        if (this.isASEIDInstance(props)) {\n            return this.fromASEID as (p: ASEID) => void;\n        }\n\n        // 3) serialized object (has 'aseid') -> fromJSON\n        if (this.isSerializedObject(props)) {\n            return this.fromJSON as (p: _SerializedType) => void;\n        }\n\n        // 4) plain object with no 'aseid' -> treat as constructor props -> fromNew\n        if (this.isConstructorProps(props)) {\n            return this.fromNew as (p: _ConstructorType) => void;\n        }\n\n        // none of the above -> throw consistent error\n        throw new A_Entity_Error(A_Entity_Error.ValidationError, 'Unable to determine A-Entity constructor initialization method. Please check the provided parameters.');\n    }\n\n\n    /**\n     * Call a feature of the component with the provided scope\n     * \n     * [!] If the provided scope is not inherited from the entity scope, it will be inherited\n     * \n     * @param lifecycleMethod \n     * @param args \n     */\n    async call(\n        feature: string,\n        scope?: A_Scope\n    ) {\n        const newFeature = new A_Feature({\n            name: feature,\n            component: this,\n            scope\n        });\n\n        return await newFeature.process(scope);\n    }\n\n\n    // ====================================================================\n    // ================== Entity Base Methods =============================\n    // ====================================================================\n\n    /**\n     * The default method that can be called and extended to load entity data.\n     */\n    async load(\n        scope?: A_Scope,\n    ) {\n        return this.call('load', scope);\n    }\n\n    /**\n     * The default method that can be called and extended to destroy entity data.\n     */\n    async destroy(scope?: A_Scope) {\n        return this.call('destroy', scope);\n    }\n\n    /**\n     * The default method that can be called and extended to save entity data.\n     */\n    async save(scope?: A_Scope) {\n        return this.call('save', scope);\n    }\n\n\n\n    // ====================================================================\n    // ================== Entity Serialization ============================\n    // ====================================================================\n\n    /**\n     * Create a new entity from ASEID string or instance\n     * [!] Executed when the constructor is called with a string or ASEID instance that represents the ASEID\n     * [!] Executes By Default with new A_Entity('aseid-string') or new A_Entity(new ASEID(...)) if getInitializer has not been overridden\n     * \n     * @param aseid \n     */\n    fromASEID(aseid: string | ASEID): void {\n        if (aseid instanceof ASEID)\n            this.aseid = aseid;\n        else\n            this.aseid = new ASEID(aseid);\n    }\n\n    /**\n     * Handles the case when no props are provided to the constructor.\n     * This method can be overridden in child classes to set default values or perform specific initialization logic.\n     * By default, it does nothing.\n     * \n     * \n     * @returns \n     */\n    fromUndefined(): void {\n        this.aseid = new ASEID({\n            concept: (this.constructor as typeof A_Entity).concept,\n            scope: (this.constructor as typeof A_Entity).scope,\n            entity: (this.constructor as typeof A_Entity).entity,\n            id: A_IdentityHelper.generateTimeId()\n        });\n        return;\n    }\n\n    /**\n     * Create a new entity from constructor object\n     * [!] Executed when the constructor is called with an object that does not contain \"aseid\" property\n     * [!] Executes By Default with new A_Entity({}) if getInitializer has not been overridden\n     * \n     * @param newEntity \n     * @returns \n     */\n    fromNew(newEntity: _ConstructorType): void {\n        this.aseid = new ASEID({\n            concept: (this.constructor as typeof A_Entity).concept,\n            scope: (this.constructor as typeof A_Entity).scope,\n            entity: (this.constructor as typeof A_Entity).entity,\n            id: A_IdentityHelper.generateTimeId()\n        });\n\n        return;\n    }\n\n\n    /**\n     * Creates a new entity from serialized object\n     * \n     * [!] Executed when the constructor is called with an object that contains \"aseid\" property\n     * [!] Executes By Default with new A_Entity({ aseid: '...' }) if getInitializer has not been overridden\n     * \n     * \n     * @param serialized \n     * @returns \n     */\n    fromJSON(serialized: _SerializedType): void {\n        this.aseid = new ASEID(serialized.aseid);\n        return;\n    }\n\n\n\n    /**\n     * Converts the entity to a JSON object \n     * [!] This method should be extended in the child classes to include all properties of the entity\n     * [!] Includes aseid by default \n     * \n     * \n     * @returns \n     */\n    toJSON(): _SerializedType {\n        return {\n            aseid: this.aseid.toString()\n        } as _SerializedType;\n    }\n\n\n    /**\n     * Returns the string representation of the entity\n     * what is basically the ASEID string\n     * \n     * @returns \n     */\n    toString(): string {\n        return this.aseid ? this.aseid.toString() : this.constructor.name;\n    }\n}","import { A_Meta } from \"../A-Meta/A-Meta.class\";\nimport { A_TYPES__EntityMeta } from \"./A-Entity.types\";\nimport { A_TYPES__EntityMetaKey } from \"./A-Entity.constants\";\nimport { A_TYPES__FeatureDefineDecoratorMeta } from \"../A-Feature/A-Feature.types\";\nimport { A_TYPES__A_InjectDecorator_Meta } from \"../A-Inject/A-Inject.types\";\n\n\nexport class A_EntityMeta extends A_Meta<A_TYPES__EntityMeta> {\n\n    /**\n     * Returns all features defined in the Container\n     * \n     * @returns \n     */\n    features(): Array<A_TYPES__FeatureDefineDecoratorMeta> {\n\n        const features = this.get(A_TYPES__EntityMetaKey.FEATURES);\n\n        return features?.toArray()\n            // returns all extensions that match the feature\n            .map(([, feature]) => feature) || [];\n    }\n\n\n    /**\n     * Allows to get all the injections for a given handler\n     * \n     * @param handler \n     * @returns \n     */\n    injections(\n        handler: string\n    ): A_TYPES__A_InjectDecorator_Meta {\n        const injections = this.get(A_TYPES__EntityMetaKey.INJECTIONS);\n\n        const args = injections?.get(handler) || [];\n\n        return args;\n    }\n\n}","import { A_TYPES__DeepPartial } from \"@adaas/a-concept/types/A_Common.types\";\nimport { A_Meta } from \"../A-Meta/A-Meta.class\";\nimport { A_TYPES__Fragment_Init, A_TYPES__Fragment_Serialized } from \"./A-Fragment.types\";\n\n\n/**\n * A_Fragment is a core architectural component that represents a singleton execution context\n * within the A-Concept framework. It serves as a shared memory container that can be passed\n * between Components, Entities, and Commands throughout the application pipeline.\n * \n * Key Features:\n * - Singleton pattern: Only one instance per fragment type per scope\n * - Meta storage: Built-in key-value storage for pipeline data\n * - Type-safe: Full TypeScript generics support for meta items and serialization\n * - Serializable: Can be converted to JSON for persistence or transmission\n * \n * @template _MetaItems - Type definition for the meta storage structure\n * @template _SerializedType - Type definition for the serialized output format\n * \n * @example\n * ```typescript\n * // Basic usage with typed meta\n * class UserFragment extends A_Fragment<{ userId: string; role: string }> {\n *   constructor() {\n *     super({ name: 'UserFragment' });\n *   }\n * }\n * \n * // Custom serialization\n * class SessionFragment extends A_Fragment<\n *   { sessionId: string; timestamp: number },\n *   { name: string; sessionData: string }\n * > {\n *   toJSON() {\n *     return {\n *       name: this.name,\n *       sessionData: `${this.get('sessionId')}-${this.get('timestamp')}`\n *     };\n *   }\n * }\n * ```\n */\nexport class A_Fragment<\n    _MetaItems extends Record<string, any> = any,\n    _SerializedType extends A_TYPES__Fragment_Serialized = A_TYPES__Fragment_Serialized & _MetaItems\n> {\n    /**\n     * The unique identifier/name for this fragment instance.\n     * Used for identification and debugging purposes.\n     */\n    protected _name: string;\n\n    /**\n     * Internal meta storage using A_Meta for type-safe key-value operations.\n     * This stores all the fragment's runtime data that can be accessed and modified\n     * throughout the execution pipeline.\n     */\n    protected _meta: A_Meta<_MetaItems> = new A_Meta<_MetaItems>();\n\n\n    /**\n     * Creates a new A_Fragment instance.\n     * \n     * A_Fragment implements the singleton pattern for execution contexts, allowing\n     * shared state management across different parts of the application pipeline.\n     * Each fragment serves as a memory container that can store typed data and be\n     * serialized for persistence or transmission.\n     * \n     * Key Benefits:\n     * - Centralized state management for related operations\n     * - Type-safe meta operations with full IntelliSense support\n     * - Serialization support for data persistence\n     * - Singleton pattern ensures consistent state within scope\n     * \n     * @param params - Initialization parameters\n     * @param params.name - Optional custom name for the fragment (defaults to class name)\n     * \n     * @example\n     * ```typescript\n     * const fragment = new A_Fragment<{ userId: string }>({ \n     *   name: 'UserSessionFragment' \n     * });\n     * fragment.set('userId', '12345');\n     * ```\n     */\n    constructor(params: Partial<A_TYPES__Fragment_Init> = {}) {\n        this._name = params.name || this.constructor.name;\n    }\n\n    /**\n     * Gets the fragment's unique name/identifier.\n     * \n     * @returns The fragment name\n     */\n    get name(): string {\n        return this._name;\n    }\n\n    /**\n     * Gets direct access to the underlying Meta object for advanced meta operations.\n     * \n     * Use this when you need to perform bulk operations or access Meta-specific methods.\n     * For simple get/set operations, prefer using the direct methods on the fragment.\n     * \n     * @returns The Meta instance containing the fragment's meta\n     * \n     * @example\n     * ```typescript\n     * const fragment = new A_Fragment<{ users: string[], count: number }>();\n     * \n     * // Advanced operations using meta\n     * fragment.meta.setMultiple({\n     *   users: ['alice', 'bob'],\n     *   count: 2\n     * });\n     * \n     * // Get all keys\n     * const keys = fragment.meta.keys();\n     * ```\n     */\n    get meta(): A_Meta<_MetaItems> {\n        return this._meta;\n    }\n\n    /**\n     * Checks if a specific meta key exists in the fragment.\n     * \n     * @param param - The key to check for existence\n     * @returns True if the key exists, false otherwise\n     * \n     * @example\n     * ```typescript\n     * if (fragment.has('userId')) {\n     *   console.log('User ID is set');\n     * }\n     * ```\n     */\n    has(param: keyof _MetaItems): boolean {\n        return this._meta.has(param);\n    }\n\n    /**\n     * Retrieves a value from the fragment's meta.\n     * \n     * @param param - The key to retrieve\n     * @returns The value associated with the key, or undefined if not found\n     * \n     * @example\n     * ```typescript\n     * const userId = fragment.get('userId');\n     * if (userId) {\n     *   console.log(`Current user: ${userId}`);\n     * }\n     * ```\n     */\n    get(param: keyof _MetaItems): _MetaItems[typeof param] | undefined {\n        return this._meta.get(param);\n    }\n\n    /**\n     * Stores a value in the fragment's meta.\n     * \n     * @param param - The key to store the value under\n     * @param value - The value to store\n     * \n     * @example\n     * ```typescript\n     * fragment.set('userId', '12345');\n     * fragment.set('role', 'admin');\n     * ```\n     */\n    set(param: keyof _MetaItems, value: _MetaItems[typeof param]): void {\n        this._meta.set(param, value);\n    }\n\n    /**\n     * Removes a specific key from the fragment's meta.\n     * \n     * @param param - The key to remove\n     * \n     * @example\n     * ```typescript\n     * fragment.drop('temporaryData');\n     * ```\n     */\n    drop(param: keyof _MetaItems): void {\n        this._meta.delete(param);\n    }\n\n    /**\n     * Clears all data from the fragment's meta.\n     * \n     * Use with caution as this will remove all stored data in the fragment.\n     * \n     * @example\n     * ```typescript\n     * fragment.clear(); // All meta data is now gone\n     * ```\n     */\n    clear(): void {\n        this._meta.clear();\n    }\n\n    /**\n     * Gets the number of items stored in the fragment's meta.\n     * \n     * @returns The count of stored meta items\n     * \n     * @example\n     * ```typescript\n     * console.log(`Fragment contains ${fragment.size()} items`);\n     * ```\n     */\n    size(): number {\n        return this._meta.size();\n    }\n\n    /**\n     * Gets all keys currently stored in the fragment's meta.\n     * \n     * @returns Array of all meta keys\n     * \n     * @example\n     * ```typescript\n     * const keys = fragment.keys();\n     * console.log('Stored keys:', keys);\n     * ```\n     */\n    keys(): (keyof _MetaItems)[] {\n        return this._meta.toArray().map(([key]) => key);\n    }\n\n    /**\n     * Sets multiple values at once in the fragment's meta.\n     * \n     * @param data - Object containing key-value pairs to set\n     * \n     * @example\n     * ```typescript\n     * fragment.setMultiple({\n     *   userId: '12345',\n     *   role: 'admin',\n     *   lastLogin: new Date()\n     * });\n     * ```\n     */\n    setMultiple(data: A_TYPES__DeepPartial<_MetaItems>): void {\n        Object.entries(data).forEach(([key, value]) => {\n            if (value !== undefined) {\n                this._meta.set(key as keyof _MetaItems, value);\n            }\n        });\n    }\n\n    /**\n     * Creates a shallow copy of the fragment with the same meta data.\n     * \n     * @param newName - Optional new name for the cloned fragment\n     * @returns A new fragment instance with copied meta\n     * \n     * @example\n     * ```typescript\n     * const original = new A_Fragment<{ data: string }>({ name: 'original' });\n     * original.set('data', 'test');\n     * \n     * const clone = original.clone('cloned');\n     * console.log(clone.get('data')); // 'test'\n     * ```\n     */\n    clone(newName?: string): A_Fragment<_MetaItems, _SerializedType> {\n        const cloned = new (this.constructor as any)({\n            name: newName || `${this._name}_copy`\n        });\n\n        // Copy all meta data\n        this._meta.toArray().forEach(([key, value]) => {\n            cloned.set(key, value);\n        });\n\n        return cloned;\n    }\n\n\n    /**\n     * Serializes the fragment to a JSON-compatible object.\n     * \n     * This method combines the fragment's name with all meta data to create\n     * a serializable representation. The return type is determined by the\n     * _SerializedType generic parameter, allowing for custom serialization formats.\n     * \n     * @returns A serialized representation of the fragment\n     * \n     * @example\n     * ```typescript\n     * const fragment = new A_Fragment<{ userId: string, role: string }>({\n     *   name: 'UserFragment'\n     * });\n     * fragment.set('userId', '12345');\n     * fragment.set('role', 'admin');\n     * \n     * const json = fragment.toJSON();\n     * // Result: { name: 'UserFragment', userId: '12345', role: 'admin' }\n     * ```\n     */\n    toJSON(): _SerializedType {\n        const result = {\n            name: this.name,\n\n            ...this.meta.toArray().reduce((acc, [key, value]) => {\n                acc[key] = value;\n                return acc;\n            }, {} as _MetaItems)\n        };\n\n        return result as unknown as _SerializedType;\n    }\n}","import { A_TYPES__DeepPartial } from \"../types/A_Common.types\";\n\nexport class A_CommonHelper {\n\n    /**\n     * A simple promise that resolves immediately.\n     * Can be used in async functions to create a resolved promise.\n     */\n    static resolve() {\n        return new Promise<void>((resolve) => resolve());\n    }\n\n    /**\n     * Check if a class is inherited from another class\n     * \n     * @param childClass \n     * @param parentClass \n     * @returns \n     */\n    static isInheritedFrom(childClass: any, parentClass: any): boolean {\n        let current = childClass;\n\n        // Traverse the prototype chain\n        while (current) {\n            if (current === parentClass) {\n                return true;\n            }\n            current = Object.getPrototypeOf(current);\n        }\n        return false;\n    }\n\n    /**\n     *  Omit properties from an object or array with nested objects\n     * \n     * @param input \n     * @param paths \n     * @returns \n     */\n    static omitProperties<T, S extends string>(\n        input: T,\n        paths: string[]\n\n    ): Omit<T, S> {\n\n        // Deep clone the input object or array\n        const result = JSON.parse(JSON.stringify(input));\n\n        // Helper function to recursively remove properties\n        function removeProperties(target: Record<string, any> | any[], currPath: string[]) {\n            const currKey = currPath[0];\n            if (currPath.length === 1) {\n                // If current path has only one key, delete the property\n                delete target[currKey];\n            } else if (target[currKey] !== undefined && typeof target[currKey] === 'object') {\n                // If current key exists and is an object, recursively call removeProperties\n                removeProperties(target[currKey], currPath.slice(1));\n            }\n        }\n\n        // Iterate through each path and remove corresponding properties from the result\n        paths.forEach(path => {\n            const pathKeys = path.split('.');\n            removeProperties(result, pathKeys);\n        });\n\n        return result as Omit<T, S>;\n    }\n\n\n    static isObject(item: unknown): item is Record<string, any> {\n        return item !== null && typeof item === 'object' && !Array.isArray(item);\n    }\n\n    static deepMerge<T = any>(target: any, source: any, visited = new Map<any, any>()): T {\n        if (this.isObject(target) && this.isObject(source)) {\n            for (const key in source) {\n                if (this.isObject(source[key])) {\n                    if (!target[key]) {\n                        target[key] = {};\n                    }\n                    // Check if the source object has already been visited\n                    if (!visited.has(source[key])) {\n                        visited.set(source[key], {});\n                        this.deepMerge(target[key], source[key], visited);\n                    } else {\n                        target[key] = visited.get(source[key]);\n                    }\n                } else {\n                    target[key] = source[key];\n                }\n            }\n        }\n        return target;\n    }\n\n\n    static deepClone<T>(target: T): T {\n        // Check if the value is null or undefined\n        if (target === null || target === undefined) {\n            return target;\n        }\n\n        // Handle primitive types (string, number, boolean, etc.)\n        if (typeof target !== 'object') {\n            return target;\n        }\n\n        // Handle Date\n        if (target instanceof Date) {\n            return new Date(target.getTime()) as T;\n        }\n\n        // Handle Array\n        if (Array.isArray(target)) {\n            return target.map(item => this.deepClone(item)) as unknown as T;\n        }\n\n        // Handle Function\n        if (typeof target === 'function') {\n            return target;\n        }\n\n        // Handle Object\n        if (target instanceof Object) {\n            const clone = {} as T;\n            for (const key in target) {\n                if (target.hasOwnProperty(key)) {\n                    clone[key] = this.deepClone(target[key]);\n                }\n            }\n            return clone;\n        }\n\n        // For any other cases\n        throw new Error('Unable to clone the object. Unsupported type.');\n    }\n\n\n    static deepCloneAndMerge<T>(target: A_TYPES__DeepPartial<T>, source: T): T {\n        if (\n            (source === null || source === undefined) &&\n            (target === null || target === undefined))\n            return target;\n\n        // Check if the value is null or undefined\n        if ((target === null || target === undefined) &&\n            source\n        ) {\n            return this.deepClone(source);\n        }\n\n        // Handle primitive types (string, number, boolean, etc.)\n        if (typeof target !== 'object') {\n            return target\n        }\n\n\n        // Handle Date\n        if (target instanceof Date) {\n            return new Date(target.getTime()) as T;\n        }\n\n        // Handle Array\n        if (Array.isArray(target)) {\n            return target.map(item => this.deepCloneAndMerge(item, source)) as unknown as T;\n        }\n\n        // Handle Function\n        if (typeof target === 'function') {\n            return target;\n        }\n\n        // Handle Object\n        if (target instanceof Object) {\n            const clone = {} as T;\n            for (const key in target) {\n                if (\n                    source[key] !== null\n                    &&\n                    source[key] !== undefined\n                )\n                    clone[key] = this.deepCloneAndMerge(target[key as any], source[key]);\n                else\n                    clone[key as any] = this.deepClone(target[key]);\n            }\n\n            for (const key in source) {\n                if (\n                    target[key] !== undefined\n                    &&\n                    target[key] !== null\n                )\n                    clone[key] = this.deepCloneAndMerge(target[key], source[key]);\n                else\n                    clone[key] = this.deepClone(source[key]);\n            }\n            return clone;\n        }\n\n        // For any other cases\n        throw new Error('Unable to clone the object. Unsupported type.');\n    }\n\n    /**\n     * Get a readable name for a component (string, class, function, React element, instance, etc.)\n     *\n     * Covers:\n     * - string tags (\"div\")\n     * - symbols (Symbol.for('xxx'))\n     * - functions and classes (with name or displayName)\n     * - React elements (object with `type`)\n     * - component instances (constructor.name)\n     * - objects with custom toString returning meaningful info\n     *\n     * Falls back to sensible defaults (\"Unknown\" / \"Anonymous\").\n     */\n    static getComponentName(component: any): string {\n        const UNKNOWN = 'Unknown';\n        const ANONYMOUS = 'Anonymous';\n\n        if (component === null || component === undefined) {\n            return UNKNOWN;\n        }\n\n        // Strings (HTML tags or explicit names)\n        if (typeof component === 'string') {\n            return component || UNKNOWN;\n        }\n\n        // Symbols\n        if (typeof component === 'symbol') {\n            try {\n                return component.toString();\n            } catch {\n                return UNKNOWN;\n            }\n        }\n\n        // Arrays - try to derive from first element\n        if (Array.isArray(component)) {\n            if (component.length === 0) return UNKNOWN;\n            return this.getComponentName(component[0]);\n        }\n\n        // Functions and classes\n        if (typeof component === 'function') {\n            const fnAny = component as any;\n            // Common React convention\n            if (fnAny.displayName) return String(fnAny.displayName);\n            if (fnAny.name) return String(fnAny.name);\n\n            // Try to extract a name from source if possible\n            try {\n                const src = Function.prototype.toString.call(component);\n                // class Foo { ... } or function foo() { ... } or foo => ...\n                const match = src.match(/^(?:class\\s+([A-Za-z0-9_$]+)|function\\s+([A-Za-z0-9_$]+)|([A-Za-z0-9_$]+)\\s*=>)/);\n                if (match) {\n                    return match[1] || match[2] || match[3] || ANONYMOUS;\n                }\n            } catch {\n                // fallthrough\n            }\n            return ANONYMOUS;\n        }\n\n        // Objects (instances, React elements, plain objects)\n        if (typeof component === 'object') {\n            const objAny = component as any;\n\n            // React element: { type: ComponentOrString, props: ... }\n            if (objAny.type) {\n                return this.getComponentName(objAny.type);\n            }\n\n            // React forwardRef / memo wrappers often expose displayName\n            if (objAny.displayName) return String(objAny.displayName);\n            if (objAny.name) return String(objAny.name);\n\n            // Instance: use constructor name if available and not Object\n            if (objAny.constructor && objAny.constructor.name && objAny.constructor.name !== 'Object') {\n                return String(objAny.constructor.name);\n            }\n\n            // If object implements a meaningful toString, try it\n            try {\n                const s = objAny.toString();\n                if (typeof s === 'string' && s !== '[object Object]') {\n                    return s;\n                }\n            } catch {\n                // ignore\n            }\n\n            return ANONYMOUS;\n        }\n\n        // Fallback for other types\n        try {\n            return String(component);\n        } catch {\n            return UNKNOWN;\n        }\n    }\n}","import { A_Error } from \"../A-Error/A_Error.class\";\n\nexport class A_ScopeError extends A_Error {\n\n\n    static readonly InitializationError = 'A-Scope Initialization Error';\n\n    static readonly ConstructorError = 'Unable to construct A-Scope instance';\n\n    static readonly ResolutionError = 'A-Scope Resolution Error';\n\n    static readonly RegistrationError = 'A-Scope Registration Error';\n\n    static readonly CircularInheritanceError = 'A-Scope Circular Inheritance Error';\n\n    static readonly DeregistrationError = 'A-Scope Deregistration Error';\n}","import {\n    A_TYPES__ScopeConfig,\n    A_TYPES__Scope_Init,\n    A_TYPES__ScopeLinkedComponents,\n    A_TYPES__ScopeResolvableComponents,\n    A_TYPES__Scope_Constructor,\n    A_TYPES__ScopeLinkedConstructors\n} from './A-Scope.types'\nimport {\n    A_TYPES__A_InjectDecorator_EntityInjectionInstructions,\n    A_TYPES__A_InjectDecorator_EntityInjectionQuery,\n    A_TYPES__InjectableConstructors,\n    A_TYPES__InjectableTargets,\n} from \"@adaas/a-concept/global/A-Inject/A-Inject.types\";\nimport { A_Fragment } from \"../A-Fragment/A-Fragment.class\";\nimport { A_Context } from \"../A-Context/A-Context.class\";\nimport { A_Component } from \"../A-Component/A-Component.class\";\nimport { A_Entity } from \"../A-Entity/A-Entity.class\";\nimport { A_TypeGuards } from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_Error } from \"../A-Error/A_Error.class\";\nimport { A_FormatterHelper } from '@adaas/a-concept/helpers/A_Formatter.helper';\nimport { ASEID } from '../ASEID/ASEID.class';\nimport { A_CommonHelper } from '@adaas/a-concept/helpers/A_Common.helper';\nimport { A_TYPES__Entity_Constructor } from '../A-Entity/A-Entity.types';\nimport { A_ScopeError } from './A-Scope.error';\nimport { A_TYPES__Component_Constructor } from '../A-Component/A-Component.types';\nimport { A_TYPES__Fragment_Constructor } from '../A-Fragment/A-Fragment.types';\nimport { A_TYPES__Error_Constructor } from '../A-Error/A_Error.types';\nimport { A_TYPES__ComponentMetaKey } from '../A-Component/A-Component.constants';\n\n\n\n\nexport class A_Scope<\n    _ComponentType extends A_TYPES__Component_Constructor[] = A_TYPES__Component_Constructor[],\n    _ErrorType extends A_TYPES__Error_Constructor[] = A_TYPES__Error_Constructor[],\n    _EntityType extends A_TYPES__Entity_Constructor[] = A_TYPES__Entity_Constructor[],\n    _FragmentType extends A_Fragment[] = A_Fragment[],\n> {\n\n    /**\n     * Scope Name uses for identification and logging purposes\n     */\n    protected _name!: string;\n    /**\n     * Parent scope reference, used for inheritance of components, fragments, entities and commands\n     */\n    protected _parent?: A_Scope;\n\n    // ===========================================================================\n    // --------------------ALLowed Constructors--------------------------------\n    // ===========================================================================\n    /**\n     * A set of allowed components, A set of constructors that are allowed in the scope\n     *      \n     */\n    protected _allowedComponents = new Set<_ComponentType[number]>();\n    /**\n     * A set of allowed errors, A set of constructors that are allowed in the scope\n     */\n    protected _allowedErrors = new Set<_ErrorType[number]>();\n    /**\n     * A set of allowed entities, A set of constructors that are allowed in the scope\n     */\n    protected _allowedEntities = new Set<_EntityType[number]>();\n    /**\n     * A set of allowed fragments, A set of constructors that are allowed in the scope\n     */\n    protected _allowedFragments = new Set<A_TYPES__Fragment_Constructor<_FragmentType[number]>>();\n\n\n\n    // ===========================================================================\n    // --------------------Internal Storage--------------------------------\n    // ===========================================================================\n    /**\n     * Storage for the components, should be strong as components are unique per scope\n     */\n    protected _components: Map<_ComponentType[number], InstanceType<_ComponentType[number]>> = new Map();\n    /**\n     * Storage for the errors, should be strong as errors are unique per code\n     */\n    protected _errors: Map<string, InstanceType<_ErrorType[number]>> = new Map();\n    /**\n     * Storage for the entities, should be strong as entities are unique per aseid\n     */\n    protected _entities: Map<string, InstanceType<_EntityType[number]>> = new Map();\n    /**\n     * Storage for the fragments, should be weak as fragments are singletons per scope\n     */\n    protected _fragments: Map<A_TYPES__Fragment_Constructor<_FragmentType[number]>, _FragmentType[number]> = new Map();\n\n\n\n\n    // ===========================================================================\n    // --------------------Readonly Allowed Properties----------------------------\n    // ===========================================================================\n    /**\n     * Returns the name of the scope\n     */\n    get name() { return this._name }\n\n    /**\n     * Returns a list of Constructors for A-Components that are available in the scope\n     */\n    get allowedComponents() { return this._allowedComponents }\n    /**\n     * Returns a list of Constructors for A-Entities that are available in the scope\n     */\n    get allowedEntities() { return this._allowedEntities }\n    /**\n     * Returns a list of Constructors for A-Fragments that are available in the scope\n     */\n    get allowedFragments() { return this._allowedFragments }\n    /**\n     * Returns a list of Constructors for A-Errors that are available in the scope\n     */\n    get allowedErrors() { return this._allowedErrors }\n    // ===========================================================================\n    // --------------------Readonly Registered Properties--------------------------\n    // ===========================================================================\n    /**\n     * Returns an Array of entities registered in the scope\n     * \n     * [!] One entity per aseid\n     */\n    get entities(): Array<InstanceType<_EntityType[number]>> { return Array.from(this._entities.values()) }\n    /**\n     * Returns an Array of fragments registered in the scope\n     * \n     * [!] One fragment per scope\n     */\n    get fragments(): Array<_FragmentType[number]> { return Array.from(this._fragments.values()) }\n    /**\n     * Returns an Array of components registered in the scope\n     * \n     * [!] One component instance per scope\n     */\n    get components(): Array<InstanceType<_ComponentType[number]>> { return Array.from(this._components.values()) }\n    /**\n     * Returns an Array of errors registered in the scope\n     * \n     * [!] One error per code\n     */\n    get errors(): Array<InstanceType<_ErrorType[number]>> { return Array.from(this._errors.values()) }\n\n    /**\n     * Returns the parent scope of the current scope\n     * \n     * @param setValue \n     * @returns \n     */\n    get parent(): A_Scope | undefined {\n        return this._parent;\n    }\n    /**\n     * A_Scope refers to the visibility and accessibility of :\n     * - variables, \n     * - Components, \n     * - Context Fragments \n     * - Entities\n     * - and objects in different parts of your code. \n     * Scope determines where a particular piece of data (like a variable or function) \n     * can be accessed, modified, or referenced, and it plays a crucial role in avoiding naming collisions and ensuring data integrity. \n     * \n     * [!] The scope behavior is similar to tree structure where each scope can have a parent scope and inherit its components, fragments, entities and errors\n     * \n     * @param params \n     * @param config \n     */\n    constructor()\n    constructor(\n        /**\n         * A set of constructors that are allowed in the scope\n         */\n        params: Partial<A_TYPES__Scope_Init<_ComponentType, _ErrorType, _EntityType, _FragmentType>>,\n        /**\n         * Configuration options for the scope\n         */\n        config?: Partial<A_TYPES__ScopeConfig>\n    )\n    constructor(\n        param1?: Partial<A_TYPES__Scope_Init<_ComponentType, _ErrorType, _EntityType, _FragmentType>>,\n        param2?: Partial<A_TYPES__ScopeConfig>\n    ) {\n        const initializer = this.getInitializer(param1);\n        // the returned initializer is already bound to `this` (we used .bind(this)),\n        // so calling it will run the appropriate logic on this instance:\n        initializer.call(this, param1, param2);\n    }\n\n\n\n    /**\n     * Determines which initializer method to use based on the type of the first parameter.\n     * \n     * @param param1 \n     * @returns\n     */\n    protected getInitializer(\n        param1?: Partial<A_TYPES__Scope_Init<_ComponentType, _ErrorType, _EntityType, _FragmentType>>,\n        param2?: Partial<A_TYPES__ScopeConfig>\n    ): (param1: any, param2: any) => void | (() => void) {\n        switch (true) {\n            case !param1 && !param2: ;\n                return this.defaultInitialized;\n\n            case !!param1:\n                return this.defaultInitialized;\n            default:\n                throw new A_ScopeError(A_ScopeError.ConstructorError, 'Invalid parameters provided to A_Scope constructor');\n        }\n    }\n\n\n\n    protected defaultInitialized(\n        params: Partial<A_TYPES__Scope_Init<_ComponentType, _ErrorType, _EntityType, _FragmentType>> = {},\n        config: Partial<A_TYPES__ScopeConfig> = {}\n    ) {\n        this._name = params.name || this.constructor.name\n\n        this.initComponents(params.components);\n        this.initErrors(params.errors);\n        this.initFragments(params.fragments);\n        this.initEntities(params.entities);\n\n        if (config.parent) {\n            this._parent = config.parent;\n        }\n    }\n\n\n    //==========================================================================\n    // --------------------Scope Initialization Methods---------------------------\n    //==========================================================================\n\n    /**\n     * This method is used to initialize the components in the scope\n     * To save memory components are initialized only when they are requested\n     * \n     * This method only registers the component in the scope in case they are not registered yet\n     * \n     * @param _components \n     */\n    protected initComponents(_components?: _ComponentType) { _components?.forEach(this.register.bind(this)); }\n    /**\n     * This method is used to initialize the errors in the scope\n     * \n     * This method only registers the errors in the scope in case they are not registered yet\n     * \n     * @param _errors \n     */\n    protected initErrors(_errors?: _ErrorType) { _errors?.forEach(this.register.bind(this)); }\n    /**\n     * This method is used to initialize the entities in the scope\n     * \n     * This method only registers the entities in the scope in case they are not registered yet\n     * \n     * @param _entities \n     */\n    protected initEntities(_entities?: [\n        ..._EntityType,\n        ...InstanceType<_EntityType[number]>[]\n    ]) { _entities?.forEach(ent => this.register(ent as any)); }\n    /**\n     * This method is used to initialize the fragments in the scope\n     * \n     * This method only registers the fragments in the scope in case they are not registered yet\n     * \n     * @param _fragments \n     */\n    protected initFragments(_fragments?: _FragmentType) { _fragments?.forEach(this.register.bind(this)); }\n\n\n    // ==========================================================================\n    // --------------------Scope Public Methods-----------------------------------\n    // ==========================================================================\n    /**\n     * This method is used to destroy the scope and all its registered components, fragments and entities\n     * \n     * [!] This method deregisters all components, fragments and entities from the A-Context\n     * [!] This method also clears all internal registries and collections\n     */\n    destroy() {\n        this._components.forEach(component => A_Context.deregister(component));\n        this._fragments.forEach(fragment => A_Context.deregister(fragment));\n        this._entities.forEach(entity => A_Context.deregister(entity));\n\n        this._components.clear();\n        this._errors.clear();\n        this._fragments.clear();\n        this._entities.clear();\n\n        if (this.issuer()) {\n            A_Context.deallocate(this);\n        }\n    }\n\n\n    /**\n     * Returns the issuer of the scope, useful for debugging and tracking purposes\n     * \n     * Issuer can be:\n     * - A Container that allocated the scope\n     * - A Feature that allocated the scope\n     * \n     * [!] Note that the issuer is the direct allocator of the scope, so if a Container allocated a Feature that allocated the scope, the issuer will be the Feature\n     * \n     * @returns \n     */\n    issuer<T extends A_TYPES__ScopeLinkedComponents>(): T | undefined {\n        try {\n            return A_Context.issuer(this) as T;\n        } catch (error) {\n            return undefined;\n        }\n    }\n\n\n\n    /**\n     * This method is used to inherit from a parent scope\n     * \n     * [!] This method checks for circular inheritance and throws an error if detected\n     * \n     * @param parent \n     * @returns \n     */\n    inherit(parent: A_Scope): A_Scope {\n        if (!parent)\n            throw new A_ScopeError(\n                A_ScopeError.InitializationError,\n                `Invalid parent scope provided`\n            );\n\n        if (parent === this)\n            throw new A_ScopeError(\n                A_ScopeError.CircularInheritanceError,\n                `Unable to inherit scope ${this.name} from itself`\n            );\n\n        if (parent === this._parent)\n            return this;\n\n        // Prevent circular inheritance\n        const circularCheck = this.checkCircularInheritance(parent);\n\n        if (circularCheck)\n            throw new A_ScopeError(\n                A_ScopeError.CircularInheritanceError,\n                `Circular inheritance detected: ${[...circularCheck, parent.name].join(' -> ')}`\n            );\n\n\n        this._parent = parent;\n        return this;\n    }\n\n\n    /**\n     * This method is used to check if the component is available in the scope\n     * \n     * [!] Note that this method checks for the component in the current scope and all parent scopes\n     * \n     * @param component \n     * @returns \n     */\n    has<T extends A_Component>(\n        /**\n         * Provide a component constructor to check if it's available in the scope\n         */\n        component: A_TYPES__Component_Constructor<T>\n    ): boolean\n    has<T extends A_Entity>(\n        /**\n         * Provide an entity constructor to check if it's available in the scope\n         * \n         * [!] Note that entities are unique per aseid, so this method checks if there's at least one entity of the provided type in the scope\n         */\n        entity: A_TYPES__Entity_Constructor<T>\n    ): boolean\n    has<T extends A_Fragment>(\n        /**\n         * Provide a fragment constructor to check if it's available in the scope\n         */\n        fragment: A_TYPES__Fragment_Constructor<T>\n    ): boolean\n    has<T extends A_Error>(\n        /**\n         * Provide an error constructor to check if it's available in the scope\n         */\n        error: A_TYPES__Error_Constructor<T>\n    ): boolean\n    has(\n        /**\n         * Provide a string to check if a component, entity or fragment with the provided name is available in the scope\n         */\n        constructor: string\n    ): boolean\n    has(\n        ctor: unknown\n    ): boolean {\n\n        let found = false;\n\n        switch (true) {\n            // 1) Check if it's a Scope. It's always true since it returns itself\n            case A_TypeGuards.isScopeConstructor(ctor):\n                return true;\n\n            // 2) Check by string name.  \n            case typeof ctor === 'string': {\n                // 2.1 Check if it's a component name\n                const possibleComponent = Array.from(this.allowedComponents).find(c => c.name === ctor);\n                if (possibleComponent) found = true;\n\n                // 2.2 Check if it's a fragment name\n                const possibleFragment = Array.from(this.allowedFragments).find(f => f.name === ctor);\n                if (possibleFragment) found = true;\n\n                // 2.3 Check if it's an entity name or entity static entity property\n                const possibleEntity = Array.from(this.allowedEntities).find(e => e.name === ctor);\n                if (possibleEntity) found = true;\n\n                // 2.4 Check if it's an error name\n                const possibleError = Array.from(this.allowedErrors).find(e => e.name === ctor);\n                if (possibleError) found = true;\n\n                // 2.5 If not found in current scope, check parent scope\n                if (!!this._parent)\n                    return this._parent.has(ctor);\n\n                return false;\n            }\n            // 3) Check if it's a Component\n            case A_TypeGuards.isComponentConstructor(ctor): {\n                found = this.isAllowedComponent(ctor)\n                    || !![...this.allowedComponents]\n                        .find(c => A_CommonHelper.isInheritedFrom(c, ctor));\n\n                break;\n            }\n            // 4) Check if it's an Entity\n            case A_TypeGuards.isEntityConstructor(ctor): {\n                found = this.isAllowedEntity(ctor)\n                    || !![...this.allowedEntities]\n                        .find(e => A_CommonHelper.isInheritedFrom(e, ctor));\n\n                break;\n            }\n            // 5) Check if it's a Fragment\n            case A_TypeGuards.isFragmentConstructor(ctor): {\n                found = this.isAllowedFragment(ctor)\n                    || !![...this.allowedFragments]\n                        .find(f => A_CommonHelper.isInheritedFrom(f, ctor));\n\n                break;\n            }\n\n            // 6) Check if it's an Error\n            case A_TypeGuards.isErrorConstructor(ctor): {\n                found = this.isAllowedError(ctor)\n                    || !![...this.allowedErrors]\n                        .find(e => A_CommonHelper.isInheritedFrom(e, ctor));\n\n                break;\n            }\n\n            // 7) Check scope issuer\n            case this.issuer()\n                && (this.issuer()!.constructor === ctor\n                    || A_CommonHelper.isInheritedFrom(this.issuer()!.constructor, ctor\n                    )\n                ): {\n                    found = true;\n                    break;\n                }\n        }\n\n        // 7) Check parent scope in case not found\n        if (!found && !!this._parent)\n            try {\n                return this._parent.has(ctor as any);\n            } catch (error) {\n                return false;\n            }\n\n\n        return found;\n    }\n\n\n    /**\n     * Merges two scopes into a new one\n     * \n     * [!] Notes: \n     *  - this method does NOT modify the existing scopes\n     *  - parent of the new scope will be the parent of the current scope or the parent of anotherScope (if exists)\n     * \n     * @param anotherScope \n     * @returns \n     */\n    merge(anotherScope: A_Scope): A_Scope {\n        const merged = new A_Scope(\n            {\n                name: `${this.name} + ${anotherScope.name}`,\n\n                components: [...this.allowedComponents, ...anotherScope.allowedComponents],\n                fragments: [...this.fragments, ...anotherScope.fragments],\n                entities: [\n                    ...this.entities, ...anotherScope.entities,\n                    ...this.allowedEntities, ...anotherScope.allowedEntities\n                ],\n            },\n            {\n                parent: this._parent || anotherScope._parent\n            }\n        );\n\n        return merged;\n    }\n\n\n    /**\n     * Allows to retrieve the constructor of the component or entity by its name\n     * \n     * [!] Notes:\n     * - In case of search for A-Entity please ensure that provided string corresponds to the static entity property of the class. [!] By default it's the kebab-case of the class name\n     * - In case of search for A_Component please ensure that provided string corresponds to the class name in PascalCase\n     * \n     * @param name \n     * @returns \n     */\n    resolveConstructor<T extends A_Entity>(\n        /**\n         * Provide the entity name or static entity property to retrieve its constructor\n         */\n        name: string\n    ): A_TYPES__Entity_Constructor<T>\n    resolveConstructor<T extends A_Component>(\n        /**\n         * Provide the component name in PascalCase to retrieve its constructor\n         */\n        name: string\n    ): A_TYPES__Component_Constructor<T>\n    resolveConstructor<T extends A_Fragment>(\n        /**\n         * Provide the fragment name in PascalCase to retrieve its constructor\n         */\n        name: string\n    ): A_TYPES__Fragment_Constructor<T>\n    resolveConstructor<T extends A_TYPES__ScopeResolvableComponents>(name: string): A_TYPES__Entity_Constructor<T> | A_TYPES__Component_Constructor<T> | A_TYPES__Fragment_Constructor<T> | undefined {\n        // 1) Check components\n        const component = Array.from(this.allowedComponents).find(\n            c => c.name === name\n                || c.name === A_FormatterHelper.toPascalCase(name)\n        );\n        if (component) return component as A_TYPES__Component_Constructor<T>;\n\n        // 2) Check entities\n        const entity = Array.from(this.allowedEntities).find(\n            e => e.name === name\n                || e.name === A_FormatterHelper.toPascalCase(name)\n                || (e as any).entity === name\n                || (e as any).entity === A_FormatterHelper.toKebabCase(name)\n        );\n        if (entity) return entity as A_TYPES__Entity_Constructor<T>;\n\n        // 3) Check fragments\n        const fragment = Array.from(this.allowedFragments).find(f => f.name === name\n            || f.name === A_FormatterHelper.toPascalCase(name)\n        );\n        if (fragment) return fragment as A_TYPES__Fragment_Constructor<T>;\n\n        // If not found in current scope, check parent scope\n        if (!!this._parent) {\n            return this._parent.resolveConstructor(name) as any;\n        }\n\n        return undefined;\n    }\n\n\n\n    /**\n     * This method allows to resolve/inject a component, fragment or entity from the scope\n     * Depending on the provided parameters it can resolve:\n     * - A single component/fragment/entity by its constructor or name\n     * - An array of components/fragments/entities by providing an array of constructors\n     * - An entity or an array of entities by providing the entity constructor and query instructions\n     * \n     * @param component \n     * @returns \n     */\n    resolve<T extends A_Component>(\n        /**\n         * Provide a component constructor to resolve its instance from the scope\n         */\n        component: A_TYPES__Component_Constructor<T>\n    ): T | undefined\n    resolve<T extends A_TYPES__Component_Constructor[]>(\n        /**\n         * Provide an array of component constructors to resolve their instances from the scope\n         */\n        components: [...T]\n    ): Array<InstanceType<T[number]>> | undefined\n    resolve<T extends A_Fragment>(\n        /**\n         * Provide a fragment constructor to resolve its instance from the scope\n         */\n        fragment: A_TYPES__Fragment_Constructor<T>\n    ): T | undefined\n    resolve<T extends A_TYPES__Fragment_Constructor[]>(\n        /**\n         * Provide an array of fragment constructors to resolve their instances from the scope\n         */\n        fragments: [...T]\n    ): Array<InstanceType<T[number]>> | undefined\n    resolve<T extends A_Entity>(\n        /**\n         * Provide an entity constructor to resolve its instance or an array of instances from the scope\n         */\n        entity: A_TYPES__Entity_Constructor<T>\n    ): T | undefined\n\n    resolve<T extends A_Entity>(\n        /**\n         * Provide an entity constructor to resolve its instance or an array of instances from the scope\n         */\n        entity: A_TYPES__Entity_Constructor<T>,\n        /**\n         * Provide optional instructions to find a specific entity or a set of entities\n         */\n        instructions: Partial<A_TYPES__A_InjectDecorator_EntityInjectionInstructions<T>>\n    ): Array<T>\n    resolve<T extends A_Scope>(\n        /**\n         * Uses only in case of resolving a single entity\n         * \n         * Provide an entity constructor to resolve its instance from the scope\n         */\n        scope: A_TYPES__Scope_Constructor<T>\n    ): T | undefined\n    resolve<T extends A_Error>(\n        /**\n         * Uses only in case of resolving a single entity\n         * \n         * Provide an entity constructor to resolve its instance from the scope\n         */\n        scope: A_TYPES__Error_Constructor<T>\n    ): T | undefined\n    resolve<T extends A_TYPES__ScopeResolvableComponents>(\n        constructorName: string\n    ): T | undefined\n    // base definition\n    resolve<T extends A_TYPES__ScopeResolvableComponents>(\n        /**\n         * Provide a component, fragment or entity constructor or an array of constructors to resolve its instance(s) from the scope\n         */\n        param1: A_TYPES__InjectableConstructors,\n\n    ): T | Array<T> | undefined\n    resolve<T extends A_TYPES__ScopeLinkedConstructors>(\n        /**\n         * Provide a component, fragment or entity constructor or an array of constructors to resolve its instance(s) from the scope\n         */\n        param1: InstanceType<T>,\n\n    ): T | Array<T> | undefined\n    resolve<T extends A_TYPES__ScopeResolvableComponents>(\n        /**\n         * Provide a component, fragment or entity constructor or an array of constructors to resolve its instance(s) from the scope\n         */\n        param1: A_TYPES__InjectableConstructors | Array<A_TYPES__InjectableConstructors>,\n        param2?: Partial<A_TYPES__A_InjectDecorator_EntityInjectionInstructions>\n    ): T | Array<T> | undefined {\n        switch (true) {\n            case A_TypeGuards.isArray(param1): {\n                return param1.map(c => {\n                    if (A_TypeGuards.isString(c))\n                        return this.resolveByName(c);\n                    else\n                        return this.resolveOnce(c, param2);\n                }).filter(Boolean) as Array<T>;\n            }\n\n            case A_TypeGuards.isFunction(param1): {\n                return this.resolveOnce(param1, param2) as T;\n            }\n\n            case A_TypeGuards.isString(param1): {\n                return this.resolveByName(param1) as T;\n            }\n\n            default: {\n                throw new A_ScopeError(\n                    A_ScopeError.ResolutionError,\n                    `Invalid parameter provided to resolve method: ${param1} in scope ${this.name}`);\n            }\n        }\n    }\n\n\n\n\n    // ==================================================================================================\n    // --------------------------------------------------------------------------------------------------\n    // -------------------------------------INTERNAL RESOLVERS-------------------------------------------\n    // --------------------------------------------------------------------------------------------------\n    // ==================================================================================================\n    /**\n     * This method is used internally to resolve a component, fragment or entity by its constructor name\n     * \n     * [!] Note that this method checks for the component, fragment or entity in the current scope and all parent scopes\n     * \n     * @param name  - name of the component, fragment or entity to resolve (constructor name for components and fragments, static entity property for entities, static code property for commands)\n     * @returns \n     */\n    private resolveByName(\n        /**\n         * Provide the name of the component, fragment or entity to resolve\n         */\n        name: string\n    ): _EntityType[number] | InstanceType<_ComponentType[number]> | _FragmentType[number] |\n        InstanceType<_ErrorType[number]> | undefined {\n        // 1) Check components\n        const component = Array.from(this.allowedComponents).find(\n            c => c.name === name\n                || c.name === A_FormatterHelper.toPascalCase(name)\n        );\n        if (component) return this.resolveOnce(component) as InstanceType<_ComponentType[number]>;\n\n        // 2) Check entities\n        const entity = Array.from(this.allowedEntities).find(\n            e => e.name === name\n                || e.name === A_FormatterHelper.toPascalCase(name)\n                || (e as any).entity === name\n                || (e as any).entity === A_FormatterHelper.toKebabCase(name)\n        );\n        if (entity) return this.resolveOnce(entity) as InstanceType<_EntityType[number]>;\n\n        // 3) Check fragments\n        const fragment = Array.from(this.allowedFragments).find(f => f.name === name\n            || f.name === A_FormatterHelper.toPascalCase(name)\n        );\n        if (fragment) return this.resolveOnce(fragment) as _FragmentType[number];\n\n        // 4) Check errors\n        const error = Array.from(this.allowedErrors).find(\n            e => e.name === name\n                || e.name === A_FormatterHelper.toPascalCase(name)\n                || (e as any).code === name\n                || (e as any).code === A_FormatterHelper.toKebabCase(name)\n        );\n        if (error) return this.resolveOnce(error) as InstanceType<_ErrorType[number]>;\n\n        // If not found in current scope, check parent scope\n        if (!!this._parent) {\n            return this._parent.resolveByName(name) as any;\n        }\n\n        return undefined;\n    }\n\n    /**\n     * This method is used internally to resolve a single component, fragment or entity from the scope\n     * \n     * @param component \n     * @param instructions \n     * @returns \n     */\n    private resolveOnce(\n        component: any,\n        instructions?: Partial<A_TYPES__A_InjectDecorator_EntityInjectionInstructions>\n    ): A_TYPES__ScopeResolvableComponents | A_Scope | A_TYPES__ScopeLinkedComponents | Array<A_TYPES__ScopeResolvableComponents> | undefined {\n\n\n        const componentName = A_CommonHelper.getComponentName(component);\n\n        if (!component || !this.has(component))\n            return undefined;\n\n        switch (true) {\n            case A_TypeGuards.isConstructorAllowedForScopeAllocation(component): {\n                return this.resolveIssuer(component);\n            }\n            case A_TypeGuards.isEntityConstructor(component): {\n                return this.resolveEntity(component, instructions);\n            }\n            case A_TypeGuards.isFragmentConstructor(component): {\n                return this.resolveFragment(component);\n            }\n            case A_TypeGuards.isScopeConstructor(component): {\n                return this.resolveScope(component);\n            }\n            case A_TypeGuards.isComponentConstructor(component): {\n                return this.resolveComponent(component);\n            }\n            case A_TypeGuards.isErrorConstructor(component): {\n                return this.resolveError(component);\n            }\n            default:\n                throw new A_ScopeError(\n                    A_ScopeError.ResolutionError,\n                    `Injected Component ${componentName} not found in the scope`\n                );\n        }\n    }\n\n    private resolveIssuer(\n        ctor: A_TYPES__ScopeLinkedConstructors\n    ): A_TYPES__ScopeLinkedComponents | undefined {\n\n        const issuer = this.issuer();\n\n        if (issuer\n            && (\n                issuer.constructor === ctor\n                || A_CommonHelper.isInheritedFrom(issuer?.constructor, ctor)\n            )) {\n            return issuer!;\n        }\n        if (!!this._parent) {\n            return this._parent.resolveIssuer(ctor);\n        }\n\n        return undefined;\n    }\n\n    /**\n     * This method is used internally to resolve a single entity from the scope based on the provided instructions\n     * \n     * [!] Note that this method can return either a single entity or an array of entities depending on the instructions provided\n     * \n     * @param entity \n     * @param instructions \n     * @returns \n     */\n    private resolveEntity<T extends A_Entity>(\n        entity: A_TYPES__Entity_Constructor<T>,\n        instructions?: Partial<A_TYPES__A_InjectDecorator_EntityInjectionInstructions<T>>\n    ): T | Array<T> | undefined {\n\n        const query = instructions?.query || {} as Partial<A_TYPES__A_InjectDecorator_EntityInjectionQuery<T>>;\n        const count = instructions?.pagination?.count || 1;\n\n        switch (true) {\n            /**\n             * 1) In case when no instructions provided, return the first found entity of the provided type\n             * \n             * [!] Note that it returns ONLY ONE entity\n             * [!!] In case when no entity found in the current scope, it tries to resolve it from the parent scope (if exists)\n             */\n            case !instructions: {\n                const found = this.entities.find(e => e instanceof entity);\n\n                switch (true) {\n                    case !!found:\n                        return found as T;\n\n                    case !found && !!this._parent:\n                        return this._parent.resolveEntity(entity, instructions);\n\n                    default:\n                        return undefined;\n                }\n            }\n            /**\n             * 2) In case when aseid is provided in the query, we can directly get the entity from the map\n             * \n             * [!] Note that it returns ONLY ONE entity\n             */\n            case !!query.aseid\n                && typeof query.aseid === 'string'\n                && this._entities.has(query.aseid): {\n                    return this._entities.get(query.aseid) as T;\n                }\n            /**\n             * 3) In case when aseid is provided as ASEID instance, we can directly get the entity from the map\n             * \n             * [!] Note that it returns ONLY ONE entity\n             */\n            case !!query.aseid\n                && typeof query.aseid === 'object'\n                && query.aseid instanceof ASEID\n                && this._entities.has(query.aseid.toString()): {\n                    return this._entities.get(query.aseid.toString()) as T;\n                }\n            /**\n             * 4) In case when id is provided in the query, we have to find the entity by the id\n             * \n             * [!]  Note that it returns ONLY ONE entity\n             */\n            case !!query.id: {\n\n                const found = this.entities\n                    .filter(e => e instanceof entity)\n                    .find(e => String(e.id) === String(query.id));\n\n                return found as T;\n            }\n            /**\n             * 5) In case when there's a query object, we have to filter the entities by the query\n             * \n             * [!] Note that it can return either a single entity or an array of entities depending on the count instruction\n             * [!!] In case when no entity found in the current scope, it tries to resolve it from the parent scope (if exists)\n             */\n            default: {\n\n                const found = this.entities\n                    .filter(e => e instanceof entity)\n                    .filter(e => {\n                        return Object\n                            .entries(query)\n                            .every(([key, value]) => {\n                                if (key in e) {\n                                    return (e as any)[key] === value;\n                                }\n                                return false;\n                            });\n                    });\n\n                if (found.length === 0 && !!this._parent)\n                    return this._parent.resolveEntity(entity, instructions);\n\n                if (count === 1)\n                    return found[0] as T;\n\n                return found as T[];\n            }\n        }\n    }\n    /**\n     * This method is used internally to resolve a single error from the scope\n     * \n     * @param error \n     * @returns \n     */\n    private resolveError<T extends A_Error>(error: A_TYPES__Error_Constructor<T>): T | undefined {\n\n        const found = this.errors.find(e => e instanceof error);\n\n        switch (true) {\n            case !!found:\n                return found as T;\n\n            case !found && !!this._parent:\n                return this._parent.resolveError(error);\n\n            default:\n                return undefined;\n        }\n    }\n    /**\n     * This method is used internally to resolve a single fragment from the scope\n     * \n     * @param fragment \n     * @returns \n     */\n    private resolveFragment<T extends A_Fragment>(fragment: A_TYPES__Fragment_Constructor<T>): _FragmentType[number] | undefined {\n        const fragmentInstancePresented = this._fragments.get(fragment);\n\n        switch (true) {\n            case fragmentInstancePresented && this._fragments.has(fragment):\n                return fragmentInstancePresented;\n\n            case !fragmentInstancePresented && !!this._parent:\n                return this._parent.resolveFragment(fragment);\n\n            default:\n                return undefined;\n        }\n    }\n    /**\n     *  This method is used internally to resolve a single scope from the current scope\n     * \n     * @param scope \n     * @returns \n     */\n    private resolveScope(scope: A_TYPES__Scope_Constructor): A_Scope {\n        return this;\n    }\n    /**\n     * This method is used internally to resolve a single component from the scope\n     * \n     * @param component \n     * @returns \n     */\n    private resolveComponent<T extends A_Component>(component: A_TYPES__Component_Constructor<T>): InstanceType<_ComponentType[number]> | undefined {\n\n        //  The idea here that in case when Scope has no exact component we have to resolve it from the _parent\n        //  BUT: if it's not presented in _parent  we have to check for inheritance\n        //  That means that we should ensure that there's no components that are children of the required component\n        switch (true) {\n            // 1) In case when the component is available and exists in the scope\n            case this.allowedComponents.has(component) && this._components.has(component): {\n                return this._components.get(component)!;\n            }\n\n            // 2) In case the component available but does NOT exist in the scope\n            case this.allowedComponents.has(component) && !this._components.has(component): {\n                const componentMeta = A_Context.meta(component)\n\n                const argsMeta = componentMeta.get(A_TYPES__ComponentMetaKey.INJECTIONS);\n\n                const resolvedArgs = (argsMeta?.get('constructor') || [])\n                    .map(arg => {\n                        // for Error handling purposes\n                        const componentName = A_CommonHelper.getComponentName(arg.target)\n\n                        if ('instructions' in arg && !!arg.instructions) {\n                            const { target, instructions } = arg\n                            const dependency = this.resolve(target as any, instructions);\n                            if (!dependency)\n                                throw new A_ScopeError(\n                                    A_ScopeError.ResolutionError,\n                                    `Unable to resolve dependency ${componentName} for component ${component.name} in scope ${this.name}`\n                                );\n\n                            return dependency;\n                        } else {\n                            const { target, require, create, defaultArgs } = arg;\n\n                            let dependency = this.resolve(target as any);\n\n                            if (create && !dependency && A_TypeGuards.isAllowedForDependencyDefaultCreation(target)) {\n                                const newDependency = new target(...defaultArgs);\n\n                                this.register(newDependency);\n                                return newDependency;\n                            }\n\n                            if (require && !dependency) {\n                                throw new A_ScopeError(\n                                    A_ScopeError.ResolutionError,\n                                    `Unable to resolve required dependency ${componentName} for component ${component.name} in scope ${this.name}`\n                                );\n                            }\n\n                            return dependency;\n                        }\n                    });\n\n                const newComponent = new component(...resolvedArgs)\n\n                this.register(newComponent);\n\n                return this._components.get(component)!;\n            }\n\n            // 3) In case when there's a component that is inherited from the required component\n            case !this.allowedComponents.has(component) && Array.from(this.allowedComponents).some(el => A_CommonHelper.isInheritedFrom(el, component)): {\n                const found = Array.from(this.allowedComponents).find(el => A_CommonHelper.isInheritedFrom(el, component))!;\n\n                return this.resolveComponent(found);\n            }\n\n            // 4) In case when the component is not available in the scope but the _parent is available\n            case !!this._parent: {\n                return this._parent.resolveComponent(component) as InstanceType<_ComponentType[number]>;\n            }\n\n            default:\n                throw new A_ScopeError(\n                    A_ScopeError.ResolutionError,\n                    `Component ${component.name} not found in the scope ${this.name}`\n                );\n        }\n    }\n\n\n    /**\n     * This method is used to register the component in the scope\n     * \n     * @param fragment \n     */\n    register<T extends A_Component>(\n        /**\n         * Provide a component constructor to register it in the scope\n         */\n        component: A_TYPES__Component_Constructor<T>\n    ): void\n    register<T extends A_Component>(\n        /**\n         * Provide a command instance to register it in the scope\n         */\n        component: T\n    ): void\n    register<T extends A_Error>(\n        /**\n         * Provide an error constructor to register it in the scope\n         */\n        error: A_TYPES__Error_Constructor<T>\n    ): void\n    register<T extends A_Error>(\n        /**\n         * Provide an error instance to register it in the scope\n         */\n        error: T\n    ): void\n    register<T extends A_Fragment>(\n        /**\n         * Provide a command instance to register it in the scope\n         */\n        fragment: A_TYPES__Fragment_Constructor<T>\n    ): void\n    register<T extends A_Fragment>(\n        /**\n         * Provide a fragment instance to register it in the scope\n         */\n        fragment: T\n    ): void\n    register<T extends A_Entity>(\n        /**\n         * Provide an entity constructor to register it in the scope\n         */\n        entity: A_TYPES__Entity_Constructor<T>\n    ): void\n    register<T extends A_Entity>(\n        /**\n         * Provide an entity instance to register it in the scope\n         */\n        entity: T\n    ): void\n\n    register(\n        param1: unknown\n    ): void {\n        switch (true) {\n            // ------------------------------------------\n            // ------------ Instances ----------------\n            // ------------------------------------------\n            // 1) In case when it's a A-Component instance\n            case param1 instanceof A_Component: {\n\n                if (!this.allowedComponents.has(param1.constructor as _ComponentType[number]))\n                    this.allowedComponents.add(param1.constructor as _ComponentType[number]);\n\n                this._components.set(\n                    param1.constructor as _ComponentType[number],\n                    param1 as InstanceType<_ComponentType[number]>\n                );\n\n                A_Context.register(this, param1);\n\n                break;\n            }\n            // 3) In case when it's a A-Entity instance\n            case A_TypeGuards.isEntityInstance(param1) && !this._entities.has(param1.aseid.toString()): {\n\n                if (!this.allowedEntities.has(param1.constructor as _EntityType[number]))\n                    this.allowedEntities.add(param1.constructor as _EntityType[number]);\n\n                this._entities.set(param1.aseid.toString(), param1 as InstanceType<_EntityType[number]>);\n                A_Context.register(this, param1);\n                break;\n            }\n            // 4) In case when it's a A-Fragment instance\n            case A_TypeGuards.isFragmentInstance(param1): {\n\n                if (!this.allowedFragments.has(param1.constructor as A_TYPES__Fragment_Constructor<_FragmentType[number]>))\n                    this.allowedFragments.add(param1.constructor as A_TYPES__Fragment_Constructor<_FragmentType[number]>);\n\n                this._fragments.set(\n                    param1.constructor as A_TYPES__Fragment_Constructor<_FragmentType[number]>,\n                    param1 as _FragmentType[number]\n                );\n\n                A_Context.register(this, param1);\n\n                break;\n            }\n            // 5) In case when it's a A-Error instance\n            case A_TypeGuards.isErrorInstance(param1): {\n                if (!this.allowedErrors.has(param1.constructor as _ErrorType[number]))\n                    this.allowedErrors.add(param1.constructor as _ErrorType[number]);\n\n                this._errors.set(\n                    param1.code,\n                    param1 as InstanceType<_ErrorType[number]>\n                );\n\n                A_Context.register(this, param1);\n                break;\n            }\n\n            // ------------------------------------------\n            // ------------ Constructors ----------------\n            // ------------------------------------------\n            // 6) In case when it's a A-Component constructor\n            case A_TypeGuards.isComponentConstructor(param1): {\n                if (!this.allowedComponents.has(param1))\n                    this.allowedComponents.add(param1 as _ComponentType[number]);\n                break;\n            }\n            // 8) In case when it's a A-Fragment constructor\n            case A_TypeGuards.isFragmentConstructor(param1): {\n                if (!this.allowedFragments.has(param1))\n                    this.allowedFragments.add(param1 as A_TYPES__Fragment_Constructor<_FragmentType[number]>);\n                break;\n            }\n            // 9) In case when it's a A-Entity constructor\n            case A_TypeGuards.isEntityConstructor(param1): {\n                if (!this.allowedEntities.has(param1))\n                    this.allowedEntities.add(param1 as _EntityType[number]);\n                break;\n            }\n            // 10) In case when it's a A-Error constructor\n            case A_TypeGuards.isErrorConstructor(param1): {\n                if (!this.allowedErrors.has(param1))\n                    this.allowedErrors.add(param1 as _ErrorType[number]);\n                break;\n            }\n\n            // ------------------------------------------\n            // ------------ Invalid Cases ----------------\n            // ------------------------------------------\n\n            default:\n                if (param1 instanceof A_Entity)\n                    throw new A_ScopeError(\n                        A_ScopeError.RegistrationError,\n                        `Entity with ASEID ${param1.aseid.toString()} is already registered in the scope ${this.name}`\n                    );\n                else if (param1 instanceof A_Fragment)\n                    throw new A_ScopeError(\n                        A_ScopeError.RegistrationError,\n                        `Fragment ${param1.constructor.name} is already registered in the scope ${this.name}`\n                    );\n                else {\n                    const componentName = A_CommonHelper.getComponentName(param1);\n\n                    throw new A_ScopeError(\n                        A_ScopeError.RegistrationError,\n                        `Cannot register ${componentName} in the scope ${this.name}`\n                    );\n                }\n        }\n    }\n\n\n    /**\n     * This method is used to deregister the component from the scope\n     * \n     * @param fragment \n     */\n    deregister<T extends A_Component>(\n        /**\n         * Provide a component constructor to deregister it in the scope\n         */\n        component: A_TYPES__Component_Constructor<T>\n    ): void\n    deregister(\n        /**\n         * Provide a command instance to deregister it in the scope\n         */\n        component: A_Component\n    ): void\n    deregister<T extends A_Error>(\n        /**\n         * Provide an error constructor to deregister it in the scope\n         */\n        error: A_TYPES__Error_Constructor<T>\n    ): void\n    deregister(\n        /**\n         * Provide an error instance to deregister it in the scope\n         */\n        error: A_Error\n    ): void\n    deregister<T extends A_Fragment>(\n        /**\n         * Provide a command instance to deregister it in the scope\n         */\n        fragment: A_TYPES__Fragment_Constructor<T>\n    ): void\n    deregister(\n        /**\n         * Provide a fragment instance to deregister it in the scope\n         */\n        fragment: A_Fragment\n    ): void\n    deregister<T extends A_Entity>(\n        /**\n         * Provide an entity constructor to deregister it in the scope\n         */\n        entity: A_TYPES__Entity_Constructor<T>\n    ): void\n    deregister(\n        /**\n         * Provide an entity instance to deregister it in the scope\n         */\n        entity: A_Entity\n    ): void\n\n    deregister(\n        param1: unknown\n    ): void {\n        switch (true) {\n            // ------------------------------------------\n            // ------------ Instances ----------------\n            // ------------------------------------------\n            // 1) In case when it's a A-Component instance\n            case param1 instanceof A_Component: {\n\n                this._components.delete(param1.constructor as _ComponentType[number]);\n                A_Context.deregister(param1);\n\n                break;\n            }\n            // 3) In case when it's a A-Entity instance\n            case A_TypeGuards.isEntityInstance(param1): {\n\n                this._entities.delete(param1.aseid.toString());\n                A_Context.deregister(param1);\n                break;\n            }\n            // 4) In case when it's a A-Fragment instance\n            case A_TypeGuards.isFragmentInstance(param1): {\n\n                this._fragments.delete(param1.constructor as A_TYPES__Fragment_Constructor<_FragmentType[number]>);\n                A_Context.deregister(param1);\n\n                break;\n            }\n            // 5) In case when it's a A-Error instance\n            case A_TypeGuards.isErrorInstance(param1): {\n\n                this._errors.delete(param1.code);\n                A_Context.deregister(param1);\n                break;\n            }\n\n            // ------------------------------------------\n            // ------------ Constructors ----------------\n            // ------------------------------------------\n            // 6) In case when it's a A-Component constructor\n            case A_TypeGuards.isComponentConstructor(param1): {\n                this.allowedComponents.delete(param1 as _ComponentType[number]);\n                break;\n            }\n            // 8) In case when it's a A-Fragment constructor\n            case A_TypeGuards.isFragmentConstructor(param1): {\n                this.allowedFragments.delete(param1 as A_TYPES__Fragment_Constructor<_FragmentType[number]>);\n                break;\n            }\n            // 9) In case when it's a A-Entity constructor\n            case A_TypeGuards.isEntityConstructor(param1): {\n                this.allowedEntities.delete(param1 as _EntityType[number]);\n                break;\n            }\n            // 10) In case when it's a A-Error constructor\n            case A_TypeGuards.isErrorConstructor(param1): {\n                this.allowedErrors.delete(param1 as _ErrorType[number]);\n                break;\n            }\n\n            // ------------------------------------------\n            // ------------ Invalid Cases ----------------\n            // ------------------------------------------\n\n            default:\n                const componentName = A_CommonHelper.getComponentName(param1);\n\n                throw new A_ScopeError(\n                    A_ScopeError.DeregistrationError,\n                    `Cannot deregister ${componentName} from the scope ${this.name}`\n                );\n        }\n    }\n\n    /**\n     * This method is useful when you want to serialize the scope to JSON\n     * \n     * [!] Note this is not a deep serialization, only the fragments are serialized\n     * [!] Fragments are a storage for information which is relevant to the scope\n     * \n     * @returns \n     */\n    toJSON(): Record<string, any> {\n        return this.fragments\n            .reduce((acc, fragment) => {\n\n                const serialized = fragment.toJSON()\n\n                return {\n                    ...acc,\n                    [serialized.name]: serialized\n                }\n            }, {});\n    }\n\n\n\n    //==========================================================================\n    // --------------------Scope Type Check Helpers---------------------------\n    //==========================================================================\n    /**\n     * Type guard to check if the constructor is of type A_Component and is allowed in the scope\n     * \n     * @param ctor \n     * @returns \n     */\n    protected isAllowedComponent(ctor: unknown): ctor is _ComponentType[number] {\n        return A_TypeGuards.isComponentConstructor(ctor) && this.allowedComponents.has(ctor);\n    }\n    /**\n     * Type guard to check if the constructor is of type A_Entity and is allowed in the scope\n     * \n     * @param ctor \n     * @returns \n     */\n    protected isAllowedEntity(ctor: unknown): ctor is A_TYPES__Entity_Constructor<_EntityType[number]> {\n        return A_TypeGuards.isEntityConstructor(ctor) && this.allowedEntities.has(ctor);\n    }\n    /**\n     * Type guard to check if the constructor is of type A_Fragment and is allowed in the scope\n     * \n     * @param ctor \n     * @returns \n     */\n    protected isAllowedFragment(ctor: unknown): ctor is A_TYPES__Fragment_Constructor<_FragmentType[number]> {\n        return A_TypeGuards.isFragmentConstructor(ctor) && this.allowedFragments.has(ctor);\n    }\n    /**\n     * Type guard to check if the constructor is of type A_Error and is allowed in the scope\n     * \n     * @param ctor \n     * @returns \n     */\n    protected isAllowedError(ctor: unknown): ctor is A_TYPES__Error_Constructor<_ErrorType[number]> {\n        return A_TypeGuards.isErrorConstructor(ctor) && this.allowedErrors.has(ctor);\n    }\n\n\n\n\n    // ==========================================================================\n    // --------------------DEBUG & Helpers Methods--------------------------------\n    // ===========================================================================\n    /**\n     * This method is used to check if the scope is inherited from another scope\n     * \n     * @param scope \n     * @returns \n     */\n    isInheritedFrom(scope: A_Scope): boolean {\n        let current: A_Scope | undefined = this;\n\n        while (current) {\n            if (current === scope) {\n                return true;\n            }\n            current = current._parent;\n        }\n\n        return false;\n    }\n\n    /**\n     * Helper method to check circular inheritance\n     * Should return a full sequence of inheritance for logging purposes\n     * \n     * @param scope \n     * @returns \n     */\n    checkCircularInheritance(scope: A_Scope): Array<string> | false {\n        const inheritanceChain: Array<string> = [];\n        let current: A_Scope | undefined = this._parent;\n\n        while (current) {\n            inheritanceChain.push(current.name);\n            if (current === scope) {\n                return inheritanceChain;\n            }\n            current = current._parent;\n        }\n\n        return false;\n    }\n\n    /**\n     * Helper method to print the inheritance chain of the scope\n     */\n    printInheritanceChain(): void {\n        const chain: Array<string> = [];\n        let current: A_Scope | undefined = this;\n\n        while (current) {\n            chain.push(current.name);\n            current = current._parent;\n        }\n\n        console.log(chain.join(' -> '));\n    }\n}\n\n","import { A_Error } from \"../A-Error/A_Error.class\";\n\n\nexport class A_CallerError extends A_Error {\n\n    /**\n     * This error code indicates that there was an issue initializing the A-Caller\n     */\n    static readonly CallerInitializationError = 'Unable to initialize A-Caller';\n}","import { A_TypeGuards } from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_TYPES__FeatureAvailableComponents } from \"../A-Feature/A-Feature.types\";\nimport { A_CallerError } from \"./A_Caller.error\";\n\n\n\n/**\n * This is a common class that uses to return an entity that initiates a feature call\n * \n * It can be used then in @A_Inject(A_Caller) to get the entity that initiated the feature call\n * \n * [!] the class itself may be retrieved, but may require additional processing inside the feature\n * \n */\nexport class A_Caller<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents> {\n\n    /**\n     * The component that initiated the feature call\n     */\n    protected _component: T;\n\n\n    /**\n     * A_Caller allows to get the component that initiated the feature call\n     * \n     * It can be used then in @A_Inject(A_Caller) to get the entity that initiated the feature call\n     * \n     * [!] If Scope is not provided, a new empty scope will be created and inherited from the global scope\n     * \n     * @param component \n     * @param scope \n     */\n    constructor(\n        component: T\n    ) {\n        this.validateParams(component);\n\n        this._component = component;\n    }\n\n    get component(): T {\n        return this._component;\n    }\n\n\n    /**\n     * Validates the provided parameters and Ensures that the component is of an allowed type\n     * \n     * @param component \n     */\n    protected validateParams(\n        component: T\n    ) {\n        if (!A_TypeGuards.isAllowedForFeatureCall(component)) {\n            throw new A_CallerError(\n                A_CallerError.CallerInitializationError,\n                `Invalid A-Caller component provided of type: ${typeof component} with value: ${JSON.stringify(component).slice(0, 100)}...`\n            );\n        }\n    }\n}","import {\n    A_TYPES__Feature_Constructor,\n    A_TYPES__FeatureAvailableComponents,\n    A_TYPES__FeatureExtendDecoratorTarget\n} from \"../global/A-Feature/A-Feature.types\";\nimport {\n    A_TYPES__Error_Constructor,\n    A_TYPES__Error_Init\n} from \"../global/A-Error/A_Error.types\";\nimport { A_Component } from \"../global/A-Component/A-Component.class\";\nimport { A_ComponentMeta } from \"../global/A-Component/A-Component.meta\";\nimport { A_TYPES__Component_Constructor } from \"../global/A-Component/A-Component.types\";\nimport { A_Container } from \"../global/A-Container/A-Container.class\";\nimport { A_ContainerMeta } from \"../global/A-Container/A-Container.meta\";\nimport { A_TYPES__Container_Constructor } from \"../global/A-Container/A-Container.types\";\nimport { A_Entity } from \"../global/A-Entity/A-Entity.class\";\nimport { A_EntityMeta } from \"../global/A-Entity/A-Entity.meta\";\nimport { A_TYPES__Entity_Constructor } from \"../global/A-Entity/A-Entity.types\";\nimport { A_Feature } from \"../global/A-Feature/A-Feature.class\";\nimport { A_Fragment } from \"../global/A-Fragment/A-Fragment.class\";\nimport { A_TYPES__Fragment_Constructor } from \"../global/A-Fragment/A-Fragment.types\";\nimport { A_Scope } from \"../global/A-Scope/A-Scope.class\";\nimport { A_Caller } from \"../global/A-Caller/A_Caller.class\";\nimport { A_TYPES__Caller_Constructor } from \"../global/A-Caller/A_Caller.types\";\nimport { A_Error } from \"../global/A-Error/A_Error.class\";\nimport { A_CommonHelper } from \"./A_Common.helper\";\nimport { A_TYPES__AbstractionAvailableComponents } from \"../global/A-Abstraction/A-Abstraction.types\";\nimport { A_TYPES__Scope_Constructor, A_TYPES__ScopeLinkedComponents, A_TYPES__ScopeLinkedConstructors } from \"../global/A-Scope/A-Scope.types\";\nimport { A_TYPES__InjectableTargets } from \"../global/A-Inject/A-Inject.types\";\n\n\n\nexport class A_TypeGuards {\n    // ===========================================================================\n    // ============================= BASE Type Guards ============================\n    // ===========================================================================\n    /**\n     * Check if value is a string\n     * \n     * @param value \n     * @returns \n     */\n    static isString(value: any): value is string {\n        return typeof value === 'string' || value instanceof String;\n    }\n    /**\n     * Check if value is a number\n     * \n     * @param value \n     * @returns \n     */\n    static isNumber(value: any): value is number {\n        return typeof value === 'number' && isFinite(value);\n    }\n    /**\n     * Check if value is a boolean\n     * \n     * @param value \n     * @returns \n     */\n    static isBoolean(value: any): value is boolean {\n        return typeof value === 'boolean';\n    }\n    /**\n     * Check if value is an array\n     * \n     * @param value \n     * @returns \n     */\n    static isArray(value: any): value is Array<any> {\n        return Array.isArray(value);\n    }\n    /**\n     * Check if value is an object\n     * \n     * @param value \n     * @returns \n     */\n    static isObject<T extends Object = Object>(value: any): value is T {\n        return value && typeof value === 'object' && !Array.isArray(value);\n    }\n    /**\n     * Check if value is a function\n     * \n     * @param value \n     * @returns \n     */\n    static isFunction(value: any): value is Function {\n        return typeof value === 'function';\n    }\n\n    static isUndefined(value: any): value is undefined {\n        return typeof value === 'undefined';\n    }\n\n    static isRegExp(value: any): value is RegExp {\n        return value instanceof RegExp;\n    }\n\n\n    // ===========================================================================\n    // ==========================A-Concept Type Guards ===========================\n    // ===========================================================================\n    /**\n     * Type guard to check if the constructor is of type A_Container\n     * \n     * @param ctor \n     * @returns \n     */\n    static isContainerConstructor(ctor: any): ctor is A_TYPES__Container_Constructor {\n        return typeof ctor === 'function' && A_CommonHelper.isInheritedFrom(ctor, A_Container);\n    }\n    /**\n     * Type guard to check if the constructor is of type A_Component\n     * \n     * @param ctor \n     * @returns \n     */\n    static isComponentConstructor(ctor: any): ctor is A_TYPES__Component_Constructor {\n        return typeof ctor === 'function' && A_CommonHelper.isInheritedFrom(ctor, A_Component);\n    }\n    /**\n     * Type guard to check if the constructor is of type A_Fragment\n     * \n     * @param ctor \n     * @returns \n     */\n    static isFragmentConstructor(ctor: any): ctor is A_TYPES__Fragment_Constructor {\n        return typeof ctor === 'function' && A_CommonHelper.isInheritedFrom(ctor, A_Fragment);\n    }\n    /**\n     * Type guard to check if the constructor is of type A_Entity\n     * \n     * @param ctor \n     * @returns \n     */\n    static isEntityConstructor(ctor: any): ctor is A_TYPES__Entity_Constructor {\n        return typeof ctor === 'function' && A_CommonHelper.isInheritedFrom(ctor, A_Entity);\n    }\n    /**\n     * Type guard to check if the constructor is of type A_Scope\n     * \n     * @param ctor \n     * @returns \n     */\n    static isScopeConstructor(ctor: any): ctor is A_TYPES__Scope_Constructor {\n        return typeof ctor === 'function' && A_CommonHelper.isInheritedFrom(ctor, A_Scope);\n    }\n    /**\n     * Type guard to check if the constructor is of type A_Scope\n     * \n     * @param ctor \n     * @returns \n     */\n    static isErrorConstructor(ctor: any): ctor is A_TYPES__Error_Constructor {\n        return typeof ctor === 'function' && A_CommonHelper.isInheritedFrom(ctor, A_Error);\n    }\n    /**\n     * Type guard to check if the constructor is of type A_Feature\n     * \n     * @param ctor \n     * @returns \n     */\n    static isFeatureConstructor(ctor: any): ctor is A_TYPES__Feature_Constructor {\n        return typeof ctor === 'function' && A_CommonHelper.isInheritedFrom(ctor, A_Feature);\n    }\n    /**\n     * Type guard to check if the constructor is of type A_Caller\n     * \n     * @param ctor \n     * @returns \n     */\n    static isCallerConstructor(ctor: any): ctor is A_TYPES__Caller_Constructor {\n        return typeof ctor === 'function' && A_CommonHelper.isInheritedFrom(ctor, A_Caller);\n    }\n    // ----------------------------------------------------------------------------\n    // Instance type guards\n    // ----------------------------------------------------------------------------\n    /**\n     * Type guard to check if the instance is of type A_Container\n     * \n     * @param instance \n     * @returns \n     */\n    static isContainerInstance(instance: any): instance is A_Container {\n        return instance instanceof A_Container;\n    }\n    /**\n     * Type guard to check if the instance is of type A_Component\n     * \n     * @param instance \n     * @returns \n     */\n    static isComponentInstance(instance: any): instance is A_Component {\n        return instance instanceof A_Component;\n    }\n\n    /**\n     * Type guard to check if the instance is of type A_Feature\n     * \n     * @param instance \n     * @returns \n     */\n    static isFeatureInstance(instance: any): instance is A_Feature {\n        return instance instanceof A_Feature;\n    }\n    /**\n     * Type guard to check if the instance is of type A_Fragment\n     * \n     * @param instance \n     * @returns \n     */\n    static isFragmentInstance(instance: any): instance is A_Fragment {\n        return instance instanceof A_Fragment;\n    }\n    /**\n     * Type guard to check if the instance is of type A_Entity\n     * \n     * @param instance \n     * @returns \n     */\n    static isEntityInstance(instance: any): instance is A_Entity {\n        return instance instanceof A_Entity;\n    }\n    /**\n     * Type guard to check if the instance is of type A_Scope\n     * \n     * @param instance \n     * @returns \n     */\n    static isScopeInstance(instance: any): instance is A_Scope {\n        return instance instanceof A_Scope;\n    }\n    /**\n     * Type guard to check if the instance is of type A_Error\n     * \n     * @param instance \n     * @returns \n     */\n    static isErrorInstance(instance: any): instance is A_Error {\n        return instance instanceof A_Error;\n    }\n    /**\n     * Type guard to check if the instance is of type A_ComponentMeta\n     * \n     * @param instance \n     * @returns \n     */\n    static isComponentMetaInstance(instance: any): instance is A_ComponentMeta {\n        return instance instanceof A_ComponentMeta;\n    }\n    /**\n     * Type guard to check if the instance is of type A_ContainerMeta\n     * \n     * @param instance \n     * @returns \n     */\n    static isContainerMetaInstance(instance: any): instance is A_ContainerMeta {\n        return instance instanceof A_ContainerMeta;\n    }\n    /**\n     * Type guard to check if the instance is of type A_EntityMeta\n     * \n     * @param instance \n     * @returns \n     */\n    static isEntityMetaInstance(instance: any): instance is A_EntityMeta {\n        return instance instanceof A_EntityMeta;\n    }\n\n\n\n    // ==========================================================================\n    // ========================= SPECIAL Type Guards =============================\n    // ===========================================================================\n    static isConstructorAllowedForScopeAllocation(target: any): target is A_TYPES__ScopeLinkedConstructors {\n        return A_TypeGuards.isContainerConstructor(target)\n            || A_TypeGuards.isFeatureConstructor(target);\n    }\n    static isInstanceAllowedForScopeAllocation(target: any): target is A_TYPES__ScopeLinkedComponents {\n        return A_TypeGuards.isContainerInstance(target)\n            || A_TypeGuards.isFeatureInstance(target);\n    }\n\n    static isConstructorAvailableForAbstraction(target: any): target is A_TYPES__AbstractionAvailableComponents {\n        return A_TypeGuards.isContainerInstance(target)\n            || A_TypeGuards.isComponentInstance(target);\n    }\n\n\n    static isTargetAvailableForInjection(target: any): target is A_TYPES__InjectableTargets {\n        return A_TypeGuards.isComponentConstructor(target)\n            || A_TypeGuards.isComponentInstance(target)\n            || A_TypeGuards.isContainerInstance(target)\n            || A_TypeGuards.isEntityInstance(target)\n    }\n\n    static isAllowedForFeatureCall(param: any): param is A_TYPES__FeatureAvailableComponents {\n        return A_TypeGuards.isContainerInstance(param)\n            || A_TypeGuards.isComponentInstance(param)\n            || A_TypeGuards.isEntityInstance(param);\n    }\n\n    static isAllowedForFeatureDefinition(param: any): param is A_TYPES__FeatureAvailableComponents {\n        return A_TypeGuards.isContainerInstance(param)\n            || A_TypeGuards.isComponentInstance(param)\n            || A_TypeGuards.isEntityInstance(param);\n    }\n\n    static isAllowedForFeatureExtension(param: any): param is A_TYPES__FeatureExtendDecoratorTarget {\n        return A_TypeGuards.isComponentInstance(param)\n            || A_TypeGuards.isContainerInstance(param)\n            || A_TypeGuards.isEntityInstance(param);\n    }\n\n    static isAllowedForAbstractionDefinition(param: any): param is A_TYPES__AbstractionAvailableComponents {\n        return A_TypeGuards.isContainerInstance(param)\n            || A_TypeGuards.isComponentInstance(param);\n    }\n\n    static isAllowedForDependencyDefaultCreation(param: any): param is A_TYPES__Entity_Constructor | A_TYPES__Component_Constructor {\n        return A_TypeGuards.isComponentConstructor(param)\n            || A_CommonHelper.isInheritedFrom(param, A_Component)\n            || A_TypeGuards.isEntityConstructor(param)\n            || A_CommonHelper.isInheritedFrom(param, A_Entity)\n\n    }\n\n    /**\n     * Allows to check if the provided param is of constructor type.\n     * \n     * @param param \n     * @returns \n     */\n    static isConstructorType<T extends A_TYPES__Error_Init>(param: any): param is T {\n        return !!param && A_TypeGuards.isObject(param) && !(param instanceof Error) && \"title\" in param;\n    }\n}","import { A_Error } from \"../A-Error/A_Error.class\";\nimport { A_Stage } from \"../A-Stage/A-Stage.class\";\nimport { A_TYPES__FeatureError_Init } from \"./A-Feature.types\";\n\n\n\nexport class A_FeatureError extends A_Error<A_TYPES__FeatureError_Init> {\n\n    /**\n     * Indicates that the Feature has been interrupted\n     */\n    static readonly Interruption = 'Feature Interrupted';\n    /**\n     * Indicates that there was an error initializing the Feature\n     * \n     * Failed during the A-Feature initialization process\n     */\n    static readonly FeatureInitializationError = 'Unable to initialize A-Feature';\n    /**\n     * Indicates that there was an error processing the Feature\n     * \n     * Failed during the A-Feature processing\n     */\n    static readonly FeatureProcessingError = 'Error occurred during A-Feature processing';\n\n    // =======================================================================\n    // ---------------------- Decorator Errors -----------------------------\n    // =======================================================================\n    /**\n     * Indicates that there was an error defining the Feature\n     * \n     * Failed during the @A_Feature.Define() decorator execution\n     */\n    static readonly FeatureDefinitionError = 'Unable to define A-Feature';\n    /**\n     * Indicates that there was an error extending the Feature\n     * \n     * Failed during the @A_Feature.Extend() decorator execution\n     */\n    static readonly FeatureExtensionError = 'Unable to extend A-Feature';\n\n    \n    /**\n     * Stage where the error occurred\n     */\n    stage?: A_Stage\n\n\n    protected fromConstructor(params: A_TYPES__FeatureError_Init): void {\n        super.fromConstructor(params);\n\n        this.stage = params.stage;\n    }\n}","import {\n    A_TYPES__FeatureDefineDecoratorConfig,\n    A_TYPES__FeatureDefineDecoratorDescriptor,\n    A_TYPES__FeatureDefineDecoratorMeta,\n    A_TYPES__FeatureDefineDecoratorTarget\n} from \"./A-Feature.types\";\nimport { A_Context } from \"@adaas/a-concept/global/A-Context/A-Context.class\";\nimport { A_EntityMeta } from \"@adaas/a-concept/global/A-Entity/A-Entity.meta\";\nimport { A_ContainerMeta } from \"@adaas/a-concept/global/A-Container/A-Container.meta\";\nimport { A_ComponentMeta } from \"@adaas/a-concept/global/A-Component/A-Component.meta\";\nimport { A_Meta } from \"@adaas/a-concept/global/A-Meta/A-Meta.class\";\nimport { A_TYPES__EntityMetaKey } from \"@adaas/a-concept/global/A-Entity/A-Entity.constants\";\nimport { A_TYPES__ContainerMetaKey } from \"@adaas/a-concept/global/A-Container/A-Container.constants\";\nimport { A_TYPES__ComponentMetaKey } from \"@adaas/a-concept/global/A-Component/A-Component.constants\";\nimport { A_TypeGuards } from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_FeatureError } from \"./A-Feature.error\";\nimport { A_CommonHelper } from \"@adaas/a-concept/helpers/A_Common.helper\";\n\n/**\n * A-Feature decorator\n * \n * This decorator allows to define a custom lifecycle stage for the Container.\n * These stages are executed in a container-specific order and can be extended by components that are injected into the container.\n * This approach allows to create a flexible and extendable architecture for the application.\n * \n * The main difference between the A-Feature and A-Feature decorators is that A-Feature methods can be inherited and overridden by child classes.\n * \n * \n * @param params \n * @returns \n */\nexport function A_Feature_Define(\n    config: Partial<A_TYPES__FeatureDefineDecoratorConfig> = {}\n) {\n    return function (\n        target: A_TYPES__FeatureDefineDecoratorTarget,\n        propertyKey: string,\n        descriptor: A_TYPES__FeatureDefineDecoratorDescriptor\n    ) {\n        // for error messages\n        const componentName = A_CommonHelper.getComponentName(target)\n\n\n        if (!A_TypeGuards.isAllowedForFeatureDefinition(target))\n            throw new A_FeatureError(\n                A_FeatureError.FeatureDefinitionError,\n                `A-Feature cannot be defined on the ${componentName} level`\n            );\n\n        const meta: A_EntityMeta | A_ContainerMeta | A_ComponentMeta = A_Context.meta(target.constructor as any);\n\n        let metaKey;\n\n        switch (true) {\n            case A_TypeGuards.isEntityInstance(target):\n                metaKey = A_TYPES__EntityMetaKey.FEATURES;\n                break;\n            case A_TypeGuards.isContainerInstance(target):\n                metaKey = A_TYPES__ContainerMetaKey.FEATURES\n                break;\n            case A_TypeGuards.isComponentInstance(target):\n                metaKey = A_TYPES__ComponentMetaKey.FEATURES\n                break;\n        }\n\n\n        // Get the existed metadata or create a new one\n        const existedMeta: A_Meta<{\n            /**\n             * Where Key is the name of the feature\n             * \n             * Where value is the list of features\n             */\n            [Key: string]: A_TYPES__FeatureDefineDecoratorMeta\n        }> = meta.get(metaKey) || new A_Meta();\n\n\n        const name = config.name || propertyKey;\n        //  default to false\n        const invoke = config.invoke || false;\n\n\n        // Set the metadata of the method to define a custom Feature with name \n        existedMeta.set(propertyKey, {\n            name: `${target.constructor.name}.${name}`,\n            handler: propertyKey,\n            invoke: invoke,\n            template: config.template && config.template.length ? config.template.map(\n                item => ({\n                    ...item,\n                    before: item.before || '',\n                    after: item.after || '',\n                    behavior: item.behavior || 'sync',\n                    throwOnError: true,\n                    override: item.override || ''\n\n                })\n            ) : [],\n        });\n\n        //  Update the metadata of the container with the new Feature definition\n        A_Context\n            .meta(target.constructor as any)\n            .set(\n                metaKey,\n                existedMeta\n            );\n\n        const originalMethod = descriptor.value!;\n\n        // Wrap the original method to add the call to `call`\n        // this helps to automatically call the container/entity/component method when it's called\n        descriptor.value = function (...args: any[]) {\n\n            // Call the original method\n            if (!invoke)\n                return originalMethod.apply(this, args);\n            else\n                originalMethod.apply(this, args);\n\n            // Call your `call` with the function name\n            if (typeof (this as A_TYPES__FeatureDefineDecoratorTarget).call === \"function\" && invoke)\n                return (this as A_TYPES__FeatureDefineDecoratorTarget).call(name);\n\n        };\n\n        return descriptor;\n    };\n}","import { A_Context } from \"@adaas/a-concept/global/A-Context/A-Context.class\";\nimport { A_Meta } from \"@adaas/a-concept/global/A-Meta/A-Meta.class\";\nimport { A_TYPES__FeatureExtendDecoratorConfig, A_TYPES__FeatureExtendDecoratorDescriptor, A_TYPES__FeatureExtendDecoratorScopeItem, A_TYPES__FeatureExtendDecoratorTarget } from \"./A-Feature.types\";\nimport { A_TypeGuards } from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_TYPES__ComponentMetaKey } from \"../A-Component/A-Component.constants\";\nimport { A_FeatureError } from \"./A-Feature.error\";\nimport { A_CommonHelper } from \"@adaas/a-concept/helpers/A_Common.helper\";\n\n\n\n\n/**\n * A-Extend decorator\n * \n * This decorator allows to define a custom Extend stage for the Container.\n * These stages are executed in a container-specific order and can be extended by components that are injected into the container.\n * This approach allows to create a flexible and extendable architecture for the application.\n * \n * The main difference between the A-Extend and A-Extend decorators is that A-Extend methods can be inherited and overridden by child classes.\n * \n * \n * @param params \n * @returns \n */\n/**\n * Use regexp in case if you need more flexibility and control over the name of the method\n * \n * @param regexp \n */\nexport function A_Feature_Extend(\n    /**\n     * The regular expression to match the name of the Feature method to be extended\n     * \n     * Example:\n     * \n     * ```ts\n     *  @A_Feature.Extend(/.*\\.load/)\n     * ```\n     */\n    regexp: RegExp\n)\n/**\n * In this case the name configurations will be used as an input to get scope and name of target function\n * [!] Not that for all SCOPE will be used OR operator\n * \n * @param config \n */\nexport function A_Feature_Extend(\n    /**\n     * Configuration for the A-Feature-Extend decorator\n     */\n    config: Partial<A_TYPES__FeatureExtendDecoratorConfig>\n)\n/**\n * In this case the name of function will be used as a name of the Feature.\n * [!] AND it will be applicable for ANY element where the name is the same as the name of the function\n */\nexport function A_Feature_Extend()\nexport function A_Feature_Extend(\n    param1?: Partial<A_TYPES__FeatureExtendDecoratorConfig> | RegExp\n) {\n    return function (\n        target: A_TYPES__FeatureExtendDecoratorTarget,\n        propertyKey: string,\n        descriptor: A_TYPES__FeatureExtendDecoratorDescriptor\n    ) {\n        // for error messages\n        const componentName = A_CommonHelper.getComponentName(target)\n\n        if (!A_TypeGuards.isAllowedForFeatureExtension(target))\n            throw new A_FeatureError(\n                A_FeatureError.FeatureExtensionError,\n                `A-Feature-Extend cannot be applied on the ${componentName} level`\n            );\n\n        let targetRegexp: RegExp;\n        let behavior: 'sync' | 'async' = 'sync';\n        let before: string = '';\n        let after: string = '';\n        let override: string = '';\n        let include: Array<A_TYPES__FeatureExtendDecoratorScopeItem> = [];\n        let exclude: Array<A_TYPES__FeatureExtendDecoratorScopeItem> = [];\n        let throwOnError: boolean = true;\n\n\n\n        switch (true) {\n            case A_TypeGuards.isRegExp(param1):\n                targetRegexp = param1;\n                break;\n\n            case !!param1 && typeof param1 === 'object':\n\n                if (Array.isArray(param1.scope))\n                    include = param1.scope;\n                else if (!!param1.scope && typeof param1.scope === 'object') {\n                    if (Array.isArray(param1.scope.include))\n                        include = param1.scope.include;\n                    if (Array.isArray(param1.scope.exclude))\n                        exclude = param1.scope.exclude;\n                }\n\n\n                targetRegexp = buildTargetRegexp(param1, include, exclude, propertyKey);\n\n                behavior = param1.behavior || behavior;\n                throwOnError = param1.throwOnError !== undefined ? param1.throwOnError : throwOnError;\n\n                before = A_TypeGuards.isArray(param1.before)\n                    ? new RegExp(`^${param1.before.join('|').replace(/\\./g, '\\\\.')}$`).source\n                    : param1.before instanceof RegExp\n                        ? param1.before.source\n                        : ''\n                after = A_TypeGuards.isArray(param1.after)\n                    ? new RegExp(`^${param1.after.join('|').replace(/\\./g, '\\\\.')}$`).source\n                    : param1.after instanceof RegExp\n                        ? param1.after.source\n                        : ''\n\n                override = A_TypeGuards.isArray(param1.override)\n                    ? new RegExp(`^${param1.override.join('|').replace(/\\./g, '\\\\.')}$`).source\n                    : param1.override instanceof RegExp\n                        ? param1.override.source\n                        : ''\n                break;\n\n            default:\n                targetRegexp = new RegExp(`^.*${propertyKey.replace(/\\./g, '\\\\.')}$`);\n                break;\n        }\n\n\n        const existedDefinitions = A_Context\n            .meta(target)\n            .get(A_TYPES__ComponentMetaKey.FEATURES);\n\n\n        // Get the existed metadata or create a new one\n        const meta = A_Context\n            .meta(target)\n\n        const existedMeta = meta.get(A_TYPES__ComponentMetaKey.EXTENSIONS)\n            ? new A_Meta().from(meta.get(A_TYPES__ComponentMetaKey.EXTENSIONS)!)\n            : new A_Meta();\n\n        if (existedDefinitions\n            && existedDefinitions.size()\n            && existedDefinitions.has(propertyKey)\n            && existedDefinitions.get(propertyKey)!.invoke\n        ) {\n            throw new A_FeatureError(\n                A_FeatureError.FeatureExtensionError,\n                `A-Feature-Extend cannot be used on the method \"${propertyKey}\" because it is already defined as a Feature with \"invoke\" set to true. Please remove the A-Feature-Extend decorator or set \"invoke\" to false in the A-Feature decorator.`\n            );\n        }\n\n        const existedMetaValue = [\n            ...(existedMeta.get(targetRegexp.source) || [])\n        ];\n\n        const existedIndex = existedMetaValue.findIndex(item => item.handler === propertyKey);\n\n        const extension = {\n            name: targetRegexp.source,\n            handler: propertyKey,\n            behavior,\n            before,\n            after,\n            throwOnError,\n            override\n        }\n\n        if (existedIndex !== -1) {\n            // Update the existing method in the metadata\n            existedMetaValue[existedIndex] = extension;\n        } else {\n            // Add the new method to the metadata\n            existedMetaValue.push(extension);\n        }\n\n        // Add the new method to the metadata\n        existedMetaValue.push();\n\n        // Set the metadata of the method to define a custom Feature with name\n        existedMeta.set(targetRegexp.source, existedMetaValue);\n\n        //  Update the metadata of the container with the new Feature definition\n        A_Context\n            .meta(target)\n            .set(A_TYPES__ComponentMetaKey.EXTENSIONS, existedMeta);\n    };\n}\n\n\n/**\n * Builds a target regular expression based on the provided parameters.\n * \n * @param param1 - The first parameter, which can be a string or an object.\n * @param include - An array of items to include in the regular expression.\n * @param exclude - An array of items to exclude from the regular expression.\n * @param propertyKey - The property key to use in the regular expression.\n * @returns A regular expression object.\n */\nexport function buildTargetRegexp(\n    param1: any,\n    include: any[],\n    exclude: any[],\n    propertyKey: string\n) {\n    const includePart = include.length\n        ? `(${include.map(el => el.name).join('|')})`\n        : `.*`;\n\n    const excludePart = exclude.length\n        ? `(?!${exclude.map(el => el.name).join('|')})`\n        : ``;\n\n    const pattern = param1.scope\n        ? `^${excludePart}${includePart}\\\\.${param1.name || propertyKey}$`\n        : `.*\\\\.${param1.name || propertyKey}$`;\n\n    return new RegExp(pattern);\n}","import { A_Container } from \"../A-Container/A-Container.class\"\nimport { A_TYPES__Component_Constructor } from \"../A-Component/A-Component.types\"\n\n\n\nexport enum A_TYPES__A_Stage_Status {\n    /**\n     * The stage is currently being processed\n     */\n    PROCESSING = 'PROCESSING',\n    /**\n     * The stage has been completed\n     */\n    COMPLETED = 'COMPLETED',\n    /**\n     * The stage has failed\n     */\n    FAILED = 'FAILED',\n    /**\n     * The stage has been skipped\n     */\n    SKIPPED = 'SKIPPED',\n    /**\n     * The stage has been paused\n     */\n    // PAUSED = 'PAUSED',\n    /**\n     * The stage has been stopped\n     */\n    // STOPPED = 'STOPPED',\n    /**\n     * The stage has been started\n     */\n    // STARTED = 'STARTED',\n    /**\n     * The stage has been initialized\n     */\n    INITIALIZED = 'INITIALIZED',\n    /**\n     * The stage has been aborted\n     */\n    ABORTED = 'ABORTED'\n}\n\nexport type A_TYPES_StageExecutionBehavior = 'async' | 'sync'\n\n\nexport type A_TYPES__A_StageStep = {\n    /**\n     * The component to be called\n     */\n    component: A_TYPES__Component_Constructor | A_Container | string\n    /**\n     * The method to be called on the component\n     */\n    handler: string,\n    /**\n     * Original Feature Extension name\n     * \n     * [!] could be string or regex\n     * \n     */\n    name: string,\n\n    /**\n     * In case its async it will be executed independently from the main thread.\n     * \n     * [!] However, in case of sync, it will be executed in the main thread.in the order of the declaration.\n     * \n     */\n    behavior: A_TYPES_StageExecutionBehavior\n\n    /**\n     * Allows to define the order of the execution of the method.\n     * \n     * [!] In case the method has circular dependencies it will Throw an error.\n     * \n     */\n    before: string\n\n    /**\n     * Allows to define the order of the execution of the method.\n     * \n     * [!] In case the method has circular dependencies it will Throw an error.\n     * \n     */\n    after: string,\n\n    /**\n     * Indicates whether to throw an error if the step fails.\n     * \n     * [!] By default is true\n     */\n    throwOnError: boolean\n\n    /**\n     * \n     */\n    override: string\n}\n\n\n\nexport type A_TYPES__Stage_Serialized = {\n\n    /**\n     * The name of the stage\n     */\n    name: string,\n\n    /**\n     *  The status of the stage\n     * \n     */\n    status: A_TYPES__A_Stage_Status,\n\n\n}\n\n\n\nexport type A_TYPES__A_StageStepProcessingExtraParams = {\n    steps: A_TYPES__A_StageStep[]\n    filter: (step: A_TYPES__A_StageStep) => boolean\n}\n","import { A_Error } from \"../A-Error/A_Error.class\";\n\n\nexport class A_StageError extends A_Error {\n\n    static readonly ArgumentsResolutionError = 'A-Stage Arguments Resolution Error';\n\n\n    static get CompileError(): string {\n        return 'Unable to compile A-Stage';\n    }\n\n}\n","import {\n    A_TYPES__A_Stage_Status,\n    A_TYPES__A_StageStep,\n    A_TYPES__Stage_Serialized\n} from \"./A-Stage.types\";\nimport { A_Context } from \"../A-Context/A-Context.class\";\nimport { A_Feature } from \"../A-Feature/A-Feature.class\";\nimport { A_Scope } from \"../A-Scope/A-Scope.class\";\nimport { A_StageError } from \"./A-Stage.error\";\nimport { A_Error } from \"../A-Error/A_Error.class\";\nimport { A_TypeGuards } from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_TYPES__ScopeResolvableComponents } from \"../A-Scope/A-Scope.types\";\nimport { A_TYPES__Container_Constructor } from \"../A-Container/A-Container.types\";\nimport { A_TYPES__Component_Constructor } from \"../A-Component/A-Component.types\";\nimport { A_CommonHelper } from \"@adaas/a-concept/helpers/A_Common.helper\";\n\n\n\nexport class A_Stage {\n\n    /**\n     * The feature that owns this stage\n     */\n    private readonly _feature!: A_Feature;\n    /**\n     * Initial Instructions to process the stage\n     */\n    private readonly _definition!: A_TYPES__A_StageStep;\n    /**\n     * Possible errors during stage processing\n     */\n    private _error?: A_Error;\n    /**\n     * Indicates the current status of the stage\n     */\n    private _status: A_TYPES__A_Stage_Status = A_TYPES__A_Stage_Status.INITIALIZED;\n\n    /**\n     * Promise that will be resolved when the stage is Processed\n     */\n    private _processed: Promise<void> | undefined;\n\n\n    /**\n     * A_Stage is a callable A_Function within A_Feature that should be run with specific parameters.\n     * [!] Depending on the Stage Definition type sync/async function can be executed correspondingly.\n     * \n     * A-Stage is a common object that uses to simplify logic and re-use of A-Feature internals for better composition. \n     */\n    constructor(\n        /**\n         * The feature that owns this stage\n         */\n        feature: A_Feature,\n        /**\n         * The step definitions of the stage\n         */\n        step: A_TYPES__A_StageStep\n    ) {\n        this._feature = feature;\n        this._definition = step;\n    }\n\n    /**\n     * Returns the name of the stage\n     */\n    get name(): string {\n        return this.toString();\n    }\n    /**\n     * Returns the definition of the stage\n     */\n    get definition(): A_TYPES__A_StageStep {\n        return this._definition;\n    }\n    /**\n     * Returns the current status of the stage\n     */\n    get status(): A_TYPES__A_Stage_Status {\n        return this._status;\n    }\n    /**\n     * Returns the feature that owns this stage\n     */\n    get feature(): A_Feature {\n        return this._feature;\n    }\n    /**\n     * Returns true if the stage is processed (completed, failed, or skipped)\n     */\n    get isProcessed(): boolean {\n        return this._status === A_TYPES__A_Stage_Status.COMPLETED\n            || this._status === A_TYPES__A_Stage_Status.FAILED\n            || this._status === A_TYPES__A_Stage_Status.SKIPPED;\n    }\n    /**\n     * Returns the error of the stage\n     */\n    get error(): A_Error | undefined {\n        return this._error;\n    }\n\n    /**\n     * Resolves the arguments of the step\n     * \n     * @param step \n     * @returns \n     */\n    protected async getStepArgs(\n        scope: A_Scope,\n        step: A_TYPES__A_StageStep\n    ) {\n        let resolverConstructor: A_TYPES__Container_Constructor | A_TYPES__Component_Constructor;\n\n        switch (true) {\n            case A_TypeGuards.isContainerInstance(step.component):\n                resolverConstructor = step.component.constructor as A_TYPES__Container_Constructor;\n                break;\n\n            case A_TypeGuards.isString(step.component):\n                resolverConstructor = scope.resolveConstructor(step.component);\n                break;\n\n            default:\n                resolverConstructor = step.component;\n                break;\n        }\n\n\n        return Promise\n            .all(A_Context\n                .meta(resolverConstructor)\n                .injections(step.handler)\n                .map(async arg => {\n                    switch (true) {\n                        case A_TypeGuards.isCallerConstructor(arg.target):\n                            return this._feature.caller.component;\n\n                        case A_TypeGuards.isScopeConstructor(arg.target):\n                            return scope;\n\n                        case A_TypeGuards.isFeatureConstructor(arg.target):\n                            return this._feature;\n\n                        case A_TypeGuards.isEntityConstructor(arg.target) && 'instructions' in arg && !!arg.instructions:\n                            return scope.resolve(arg.target, arg.instructions)\n\n                        default: {\n                            const { target, require, create, defaultArgs } = arg;\n\n                            let dependency = scope.resolve(target as any);\n\n                            if (create && !dependency && A_TypeGuards.isAllowedForDependencyDefaultCreation(target)) {\n                                const newDependency = new target(...defaultArgs);\n\n                                scope.register(newDependency);\n                                return newDependency;\n                            }\n\n                            if (require && !dependency) {\n                                throw new A_StageError(\n                                    A_StageError.ArgumentsResolutionError,\n                                    `Unable to resolve required argument ${A_CommonHelper.getComponentName(arg.target)} for stage ${this.name} in scope ${scope.name}`\n                                );\n                            }\n\n                            return scope.resolve(arg.target)\n                        }\n                    }\n                })\n            )\n    }\n\n\n    /**\n     * Resolves the component of the step\n     * \n     * @param step \n     * @returns \n     */\n    protected getStepComponent(\n        scope: A_Scope,\n        step: A_TYPES__A_StageStep\n    ) {\n        const { component, handler } = step;\n\n        let instance: A_TYPES__ScopeResolvableComponents | undefined\n\n        switch (true) {\n            case A_TypeGuards.isContainerInstance(component):\n                instance = component;\n                break;\n\n            case A_TypeGuards.isString(component):\n                instance = scope.resolve(component);\n                break;\n\n            default:\n                instance = scope.resolve(component);\n                break;\n        }\n\n        if (!instance)\n            throw new A_StageError(A_StageError.CompileError, `Unable to resolve component ${typeof component === 'string' ? component : component.name} from scope ${scope.name}`);\n\n        if (!instance[handler])\n            throw new A_StageError(A_StageError.CompileError, `Handler ${handler} not found in ${instance.constructor.name}`);\n\n        return instance;\n    }\n\n\n\n    /**\n     * Calls the handler of the step\n     * \n     * @param step \n     * @returns \n     */\n    protected async callStepHandler(\n        step: A_TYPES__A_StageStep,\n        scope: A_Scope\n    ) {\n        // 1) Resolve component\n        const component = await this.getStepComponent(scope, step);\n        // 2) Resolve arguments\n        const callArgs = await this.getStepArgs(scope, step);\n\n        // 3) Call handler\n        return await component[step.handler](...callArgs);\n    }\n\n\n    skip() {\n        this._status = A_TYPES__A_Stage_Status.SKIPPED;\n    }\n\n\n    /**\n     * This method processes the stage by executing all the steps\n     * \n     * @param scope - Scope to be used to resolve the steps dependencies\n     */\n    async process(\n        /**\n         * Scope to be used to resolve the steps dependencies\n         */\n        scope?: A_Scope,\n    ): Promise<void> {\n\n        const targetScope = A_TypeGuards.isScopeInstance(scope)\n            ? scope\n            : this._feature.scope;\n\n        if (!this._processed)\n            this._processed = new Promise<void>(\n                async (resolve, reject) => {\n                    try {\n                        this._status = A_TYPES__A_Stage_Status.PROCESSING;\n\n                        if (this._definition.behavior === 'sync') {\n                            // in case we have to wait for the result\n                            await this.callStepHandler(this._definition, targetScope);\n                        } else {\n                            // in case we don't have to wait for the result\n                            this.callStepHandler(this._definition, targetScope);\n                        }\n\n                        this.completed();\n\n                        return resolve();\n                    } catch (error) {\n                        const wrappedError = new A_Error(error as any);\n\n                        this.failed(wrappedError);\n\n\n                        if (this._definition.throwOnError) {\n                            return resolve();\n                        } else {\n                            return reject(wrappedError);\n                        }\n                    }\n                });\n\n        return this._processed;\n    }\n\n\n    // ==========================================\n    // ============ Status methods =============\n    // ==========================================\n\n    protected completed() {\n        this._status = A_TYPES__A_Stage_Status.COMPLETED;\n    }\n\n    protected failed(\n        error: Error | A_Error | any\n    ) {\n        this._error = new A_Error(error);\n\n        this._status = A_TYPES__A_Stage_Status.FAILED;\n    }\n\n\n\n    // ==========================================\n    // ============ Serialization ===============\n    // ==========================================\n    /**\n     * Serializes the stage to JSON\n     * \n     */\n    toJSON(): A_TYPES__Stage_Serialized {\n        return {\n            name: this.name,\n            status: this.status,\n        }\n    }\n\n    /**\n     * Returns a string representation of the stage\n     * \n     * @returns \n     */\n    toString() {\n        return `A-Stage(${this._feature.name}::${this._definition.behavior}@${this._definition.handler})`;\n    }\n}   ","import { A_Error } from \"../A-Error/A_Error.class\";\n\n\n\nexport class A_StepManagerError extends A_Error {\n\n\n    static readonly CircularDependencyError = 'A-StepManager Circular Dependency Error';\n\n}","import { A_Feature } from \"../A-Feature/A-Feature.class\";\nimport { A_TYPES__FeatureDefineDecoratorTemplateItem } from \"../A-Feature/A-Feature.types\";\nimport { A_Stage } from \"../A-Stage/A-Stage.class\";\nimport { A_TYPES__A_StageStep } from \"../A-Stage/A-Stage.types\";\nimport { A_StepManagerError } from \"./A-StepManager.error\";\n\nexport class A_StepsManager {\n\n    public entities: A_TYPES__A_StageStep[];\n    public graph: Map<string, Set<string>>;\n    public visited: Set<string>;\n    public tempMark: Set<string>;\n    public sortedEntities: string[];\n\n\n    private _isBuilt: boolean = false;\n\n    constructor(entities: Array<A_TYPES__FeatureDefineDecoratorTemplateItem>) {\n        this.entities = this.prepareSteps(entities);\n\n        this.graph = new Map();\n        this.visited = new Set();\n        this.tempMark = new Set();\n        this.sortedEntities = [];\n\n    }\n\n    private prepareSteps(\n        entities: Array<A_TYPES__FeatureDefineDecoratorTemplateItem>\n    ): Array<A_TYPES__A_StageStep> {\n        return entities\n            .map(step => ({\n                ...step,\n\n                behavior: step.behavior || 'sync',\n                before: step.before || '',\n                after: step.after || '',\n                override: step.override || '',\n                throwOnError: false\n            }));\n    }\n\n    private ID(step: A_TYPES__A_StageStep) {\n        return `${typeof step.component === 'string' ? step.component : step.component.name}.${step.handler}`;\n    }\n\n    private buildGraph() {\n        if (this._isBuilt) return;\n        this._isBuilt = true;\n\n        // Filter override\n        this.entities = this.entities\n            .filter((step, i, self) =>\n                !self.some(s => s.override ? new RegExp(s.override).test(this.ID(step)) : false)\n            );\n\n        // Initialize graph nodes\n        this.entities.forEach(entity => this.graph.set(this.ID(entity), new Set()));\n\n        // Add directed edges based on 'before' and 'after'\n        this.entities.forEach(entity => {\n            const entityId = this.ID(entity);\n\n            // Add edges for 'before' dependencies\n            // If entity should execute before targets, then targets depend on entity\n            // So we add edges: target -> entity (target depends on entity)\n            if (entity.before) {\n                const targets = this.matchEntities(entityId, entity.before);\n                targets.forEach(target => {\n                    if (!this.graph.has(target)) this.graph.set(target, new Set());\n                    this.graph.get(target)!.add(entityId); // target depends on entity\n                });\n            }\n\n            // Add edges for 'after' dependencies  \n            // If entity should execute after sources, then entity depends on sources\n            // So we add edges: entity -> source (entity depends on source)\n            if (entity.after) {\n                const sources = this.matchEntities(entityId, entity.after);\n\n                sources.forEach(source => {\n                    if (!this.graph.has(entityId)) this.graph.set(entityId, new Set());\n                    this.graph.get(entityId)!.add(source); // entity depends on source\n                });\n            }\n        });\n    }\n\n    // Match entities by name or regex\n    private matchEntities(entityId: string, pattern: string): string[] {\n        const regex = new RegExp(pattern);\n\n        return this.entities\n            .filter(entity => regex.test(this.ID(entity)) && this.ID(entity) !== entityId)\n            .map(entity => this.ID(entity));\n    }\n\n    // Topological sort with cycle detection\n    private visit(node: string): void {\n        if (this.tempMark.has(node)) {\n            return;\n            // TODO: maybe we have to keep this error but only for partial cases\n            throw new A_StepManagerError(\n                A_StepManagerError.CircularDependencyError,\n                `Circular dependency detected involving step: ${node}. Make sure that your 'before' and 'after' dependencies do not create cycles.`\n            );\n        }\n\n        if (!this.visited.has(node)) {\n            this.tempMark.add(node);\n\n\n            (this.graph.get(node) || []).forEach(neighbor => this.visit(neighbor));\n            this.tempMark.delete(node);\n            this.visited.add(node);\n            this.sortedEntities.push(node);\n\n            // // Visit neighbors in stable order (preserving original order)\n            // const neighbors = Array.from(this.graph.get(node) || []);\n            // // neighbors.sort((a, b) => {\n            // //     const orderA = this.originalOrder.get(a) || 0;\n            // //     const orderB = this.originalOrder.get(b) || 0;\n            // //     return orderA - orderB;\n            // // });\n\n            // neighbors.forEach(neighbor => this.visit(neighbor));\n            // this.tempMark.delete(node);\n            // this.visited.add(node);\n            // this.sortedEntities.push(node);\n        }\n    }\n\n\n    toSortedArray(): Array<string> {\n        this.buildGraph();\n\n        // Start topological sort\n        this.entities.forEach(entity => {\n            if (!this.visited.has(this.ID(entity))) this.visit(this.ID(entity));\n        });\n\n        return this.sortedEntities;\n    }\n\n    // Sort the entities based on dependencies\n    toStages(feature: A_Feature): Array<A_Stage> {\n\n\n        const sortedNames = this.toSortedArray();\n\n\n        // Map sorted names back to entity objects\n        return sortedNames\n            .map(id => {\n                const step = this.entities.find(entity => this.ID(entity) === id)!;\n\n\n                return new A_Stage(feature, step);\n            });\n    }\n}\n\n\n","import {\n    A_TYPES__Feature_Init,\n    A_TYPES__Feature_InitWithComponent,\n    A_TYPES__Feature_InitWithTemplate,\n    A_TYPES__FeatureAvailableComponents,\n    A_TYPES__FeatureState,\n} from \"./A-Feature.types\";\nimport { A_Feature_Define } from \"@adaas/a-concept/global/A-Feature/A-Feature-Define.decorator\";\nimport { A_Feature_Extend } from \"@adaas/a-concept/global/A-Feature/A-Feature-Extend.decorator\";\nimport { A_Stage } from \"../A-Stage/A-Stage.class\";\nimport { A_StepsManager } from \"@adaas/a-concept/global/A-StepManager/A-StepManager.class\";\nimport { A_StageError } from \"../A-Stage/A-Stage.error\";\nimport { A_TypeGuards } from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_FeatureError } from \"./A-Feature.error\";\nimport { A_Context } from \"../A-Context/A-Context.class\";\nimport { A_Caller } from \"../A-Caller/A_Caller.class\";\nimport { A_Scope } from \"../A-Scope/A-Scope.class\";\nimport { A_Component } from \"../A-Component/A-Component.class\";\n\n\n/**\n * A_Feature is representing a feature that can be executed across multiple components\n * This class stores the steps of the feature and executes them in order of appearance\n * \n * Using A_Feature.Define and A_Feature.Extend decorators to define and extend the feature methods \n * across the different, distributed components\n * \n */\nexport class A_Feature<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents> {\n\n    // =============================================================================\n    // --------------------------- Static Methods ---------------------------------\n    // =============================================================================\n    /**\n     * Define a new A-Feature\n     */\n    static get Define(): typeof A_Feature_Define {\n        return A_Feature_Define;\n    }\n\n    /**\n     * Extend an existing A-Feature\n     */\n    static get Extend(): typeof A_Feature_Extend {\n        return A_Feature_Extend;\n    }\n    // =============================================================================\n    // --------------------------- Internal Properties ----------------------------\n    // =============================================================================\n    /**\n     * The name of the Feature\n     */\n    protected _name!: string;\n    /**\n     * List of stages that are part of this Feature\n     */\n    protected _stages: Array<A_Stage> = [];\n    /**\n     * The Stage currently being processed\n     */\n    protected _current?: A_Stage;\n    /**\n     * Actual Index of the current Stage being processed\n     */\n    protected _index: number = 0;\n    /**\n     * Steps Manager to organize the steps into stages\n     */\n    protected _SM!: A_StepsManager;\n    /**\n     * The Caller that initiated the Feature call\n     */\n    protected _caller!: A_Caller<T>;\n    /**\n     * The current state of the Feature\n     */\n    protected _state: A_TYPES__FeatureState = A_TYPES__FeatureState.INITIALIZED;\n    /**\n     * The error that caused the Feature to be interrupted\n     */\n    protected _error?: A_FeatureError\n\n\n\n    /**\n     * A-Feature is a pipeline distributed by multiple components that can be easily attached or detached from the scope. \n     * Feature itself does not have scope, but attached to the caller who dictates how feature should be processed. \n     * \n     * Comparing to A-Command Feature does not store any state except statuses for better analysis. \n     * \n     * [!] Note: If A-Feature should have result use A-Fragment \n     * \n     * @param params \n     */\n    constructor(\n        /**\n         * Feature Initialization parameters\n         */\n        params: A_TYPES__Feature_Init<T>\n    ) {\n        this.validateParams(params);\n\n        const initializer = this.getInitializer(params);\n        // the returned initializer is already bound to `this` (we used .bind(this)),\n        // so calling it will run the appropriate logic on this instance:\n        initializer.call(this, params);\n    }\n\n\n    /**\n     * The name of the Feature\n     */\n    get name(): string { return this._name; }\n    /**\n     * The error that caused the Feature to be interrupted\n     */\n    get error(): A_FeatureError | undefined { return this._error; }\n    /**\n     * The current state of the Feature\n     */\n    get state(): A_TYPES__FeatureState { return this._state; }\n    /**\n     * Sets the current state of the Feature\n     */\n    get index(): number { return this._index; }\n    /**\n     * Returns the current A-Feature Stage\n     */\n    get stage(): A_Stage | undefined { return this._current; }\n    /**\n     * The Caller that initiated the Feature call\n     */\n    get caller(): A_Caller<T> { return this._caller; }\n    /**\n     * The Scope allocated for the Feature Execution\n     */\n    get scope(): A_Scope { return A_Context.scope(this); }\n    /**\n     * The number of stages in the feature\n     */\n    get size(): number {\n        return this._stages.length;\n    }\n\n    /**\n     * This method checks if the A-Feature is done\n     * \n     * @returns \n     */\n    get isDone(): boolean {\n        return !this.stage\n            || this._index >= this._stages.length\n            || this.state === A_TYPES__FeatureState.COMPLETED\n            || this.state === A_TYPES__FeatureState.INTERRUPTED;\n    }\n    /**\n     * Iterator to iterate over the steps of the feature\n     * \n     * @returns \n     */\n    [Symbol.iterator](): Iterator<A_Stage, any> {\n        return {\n            next: (): IteratorResult<A_Stage, any> => {\n                if (!this.isDone) {\n                    this._current = this._stages[this._index];\n                    this._index++;\n\n                    return {\n                        value: this._current,\n                        done: false\n                    };\n                } else {\n                    this._current = undefined; // Reset current on end\n\n                    return {\n                        value: undefined,\n                        done: true\n                    };\n                }\n            }\n        };\n    }\n\n    // ============================================================================\n    // ------------------------ Initialization Methods ----------------------------\n    // ============================================================================\n    /**\n     * Validates the provided parameters for A-Feature initialization\n     * \n     * @param params \n     */\n    protected validateParams(\n        params: A_TYPES__Feature_Init<T>\n    ) {\n        if (!params || typeof params !== 'object') {\n            throw new A_FeatureError(\n                A_FeatureError.FeatureInitializationError,\n                `Invalid A-Feature initialization parameters of type: ${typeof params} with value: ${JSON.stringify(params).slice(0, 100)}...`\n            );\n        }\n    }\n    /**\n     * Returns the appropriate initializer method based on the provided parameters\n     * \n     * @param params \n     * @returns \n     */\n    protected getInitializer(\n        params: A_TYPES__Feature_Init<T>\n    ): (param1: any) => void | (() => void) {\n\n        switch (true) {\n            case !('template' in params):\n                return this.fromComponent;\n\n            case 'template' in params:\n                return this.fromTemplate;\n            default:\n                throw new A_FeatureError(\n                    A_FeatureError.FeatureInitializationError,\n                    `Invalid A-Feature initialization parameters of type: ${typeof params} with value: ${JSON.stringify(params).slice(0, 100)}...`\n                );\n        }\n    }\n    /**\n     * Initializes the A-Feature from the provided template\n     * \n     * @param params \n     */\n    protected fromTemplate(\n        params: A_TYPES__Feature_InitWithTemplate<T>\n    ) {\n        if (!params.template || !Array.isArray(params.template)) {\n            throw new A_FeatureError(\n                A_FeatureError.FeatureInitializationError,\n                `Invalid A-Feature template provided of type: ${typeof params.template} with value: ${JSON.stringify(params.template).slice(0, 100)}...`\n            );\n        }\n\n        if (!params.component && (!params.scope || !(params.scope instanceof A_Scope))) {\n            throw new A_FeatureError(\n                A_FeatureError.FeatureInitializationError,\n                `Invalid A-Feature scope provided of type: ${typeof params.scope} with value: ${JSON.stringify(params.scope).slice(0, 100)}...`\n            );\n        }\n\n        // 1) save feature name\n        this._name = params.name;\n\n        // 2) get scope from where feature is called\n        // 2) get scope from where feature is called\n        let componentScope: A_Scope | undefined;\n        //  uses to extend a component scope if component is not registered in the context\n        let externalScope: A_Scope | undefined = params.scope;\n\n        try {\n            if (params.component)\n                componentScope = A_Context.scope(params.component);\n        } catch (error) {\n            if (!externalScope)\n                throw error;\n        }\n\n        if (componentScope && externalScope && !externalScope.isInheritedFrom(componentScope)) {\n            externalScope.inherit(componentScope);\n        }\n\n        // 3) create caller wrapper for the simple injection of the caller component\n        //   - Just to prevent issues with undefined caller in features without component\n        //   - TODO: maybe would be better to allow passing caller in params?\n        this._caller = new A_Caller<T>(params.component || new A_Component() as T);\n\n        // 4) allocate new scope for the feature\n        const scope = A_Context.allocate(this);\n\n        // 5) ensure that the scope of the caller component is inherited by the feature scope\n        scope.inherit(componentScope || externalScope!);\n\n        // 6) create steps manager to organize steps into stages\n        this._SM = new A_StepsManager(params.template);\n\n        // 7) create stages from the steps\n        this._stages = this._SM.toStages(this);\n\n        // 8) set the first stage as current\n        this._current = this._stages[0];\n    }\n    /**\n     * Initializes the A-Feature from the provided component\n     * \n     * @param params \n     */\n    protected fromComponent(\n        params: A_TYPES__Feature_InitWithComponent<T>\n    ) {\n        if (!params.component || !A_TypeGuards.isAllowedForFeatureDefinition(params.component)) {\n            throw new A_FeatureError(\n                A_FeatureError.FeatureInitializationError,\n                `Invalid A-Feature component provided of type: ${typeof params.component} with value: ${JSON.stringify(params.component).slice(0, 100)}...`\n            );\n        }\n\n        // 1) save feature name\n        this._name = params.name;\n\n        // 2) get scope from where feature is called\n        let componentScope: A_Scope | undefined;\n        //  uses to extend a component scope if component is not registered in the context\n        let externalScope: A_Scope | undefined = params.scope;\n\n        try {\n            componentScope = A_Context.scope(params.component);\n        } catch (error) {\n            if (!externalScope)\n                throw error;\n        }\n\n        if (componentScope && externalScope && !externalScope.isInheritedFrom(componentScope)) {\n            externalScope.inherit(componentScope);\n        }\n\n        // 3) create caller wrapper for the simple injection of the caller component\n        this._caller = new A_Caller<T>(params.component);\n\n        // 4) allocate new scope for the feature\n        const scope = A_Context.allocate(this);\n\n        // 5) ensure that the scope of the caller component is inherited by the feature scope\n        scope.inherit(componentScope || externalScope!);\n\n        // 6) retrieve the template from the context\n        const template = A_Context.featureTemplate(this._name, this._caller.component, scope);\n\n        // 7) create steps manager to organize steps into stages\n        this._SM = new A_StepsManager(template);\n\n        // 8) create stages from the steps\n        this._stages = this._SM.toStages(this);\n\n        // 9) set the first stage as current\n        this._current = this._stages[0];\n    }\n\n\n    // ============================================================================\n    // ----------------------- Main Processing Methods ----------------------------\n    // ============================================================================\n    /**\n     * This method processes the feature by executing all the stages\n     * \n     */\n    async process(\n        /**\n         * Optional scope to be used to resolve the steps dependencies\n         * If not provided, the scope of the caller component will be used\n         */\n        scope?: A_Scope,\n    ) {\n        try {\n            if (scope && !scope.isInheritedFrom(A_Context.scope(this)))\n                scope.inherit(A_Context.scope(this));\n\n\n            if (this.isDone)\n                return;\n\n            this._state = A_TYPES__FeatureState.PROCESSING;\n\n            for (const stage of this) {\n                await stage.process(scope);\n            }\n\n            return await this.completed();\n        } catch (error) {\n            return await this.failed(new A_FeatureError({\n                title: A_FeatureError.FeatureProcessingError,\n                description: `An error occurred while processing the A-Feature: ${this.name}. Failed at stage: ${this.stage?.name || 'N/A'}.`,\n                stage: this.stage,\n                originalError: error\n            }));\n        }\n\n    }\n    /**\n     * This method moves the feature to the next stage\n     * \n     * @param stage \n     */\n    next(stage) {\n        const stageIndex = this._stages.indexOf(stage);\n\n        this._index = stageIndex + 1;\n\n        if (this._index >= this._stages.length) {\n            this.completed();\n        }\n    }\n    /**\n     * This method marks the feature as completed and returns the result\n     * Uses to interrupt or end the feature processing\n     * \n     * @param result \n     * @returns \n     */\n    async completed(): Promise<void> {\n\n        this._state = A_TYPES__FeatureState.COMPLETED;\n\n        this.scope.destroy();\n    }\n    /**\n     * This method marks the feature as failed and throws an error\n     * Uses to mark the feature as failed\n     * \n     * @param error \n     */\n    async failed(error: A_FeatureError) {\n\n        this._state = A_TYPES__FeatureState.FAILED;\n\n        this._error = error;\n\n        this.scope.destroy();\n\n        throw this._error;\n    }\n    /**\n     * This method marks the feature as failed and throws an error\n     * Uses to interrupt or end the feature processing\n     * \n     * @param error \n     */\n    async interrupt(\n        /**\n         * The reason of feature interruption\n         */\n        reason?: string | A_StageError | Error\n    ) {\n        switch (true) {\n            case A_TypeGuards.isString(reason):\n                this._error = new A_FeatureError(A_FeatureError.Interruption, reason);\n                break;\n\n            case A_TypeGuards.isErrorInstance(reason):\n                this._error = new A_FeatureError({\n                    code: A_FeatureError.Interruption,\n                    title: reason.title,\n                    description: reason.description,\n                    stage: this.stage,\n                    originalError: reason\n                });\n                break;\n\n            default:\n                break;\n        }\n\n        this._state = A_TYPES__FeatureState.INTERRUPTED;\n\n        this.scope.destroy();\n    }\n\n\n\n\n    toString(): string {\n        return `A-Feature(${this.caller.component?.constructor?.name || 'Unknown'}::${this.name})`;\n    }\n}","import { A_Context } from \"../A-Context/A-Context.class\";\nimport { A_Feature } from \"../A-Feature/A-Feature.class\";\nimport { A_Scope } from \"../A-Scope/A-Scope.class\";\n\n\n\n/**\n * A-Component is a primary \"extendable\" object in the system\n * A unique combination of Components creates completely new functionality\n * \n * The most important thing is that A-Component is STATELESS, it means that it doesn't store any state in itself\n * \n * \n * [!] Every A-Component is a singleton, so if you need to create multiple instances of the same logic - use A-Container\n * [!] So one scope can have only one instance of the same A-Component\n * [!] Every A-Component can be extended by features and extensions\n * [!] ONLY A-Component can have A-Feature extensions\n *\n */\nexport class A_Component {\n\n\n    /**\n     * Calls the feature with the given name in the given scope\n     * \n     * [!] Note: This method creates a new instance of the feature every time it is called\n     * \n     * @param feature - the name of the feature to call\n     * @param scope  - the scope in which to call the feature\n     * @returns  - void\n     */\n    async call(\n        /**\n         * Name of the feature to call\n         */\n        feature: string,\n        /**\n         * Scope in which the feature will be executed\n         */\n        scope?: A_Scope\n    ) {\n        const newFeature = new A_Feature({\n            name: feature,\n            component: this\n        });\n\n        return await newFeature.process(scope);\n    }\n}\n\n\n\n","import { A_Error } from \"../A-Error/A_Error.class\";\n\n\n\nexport class A_ContextError extends A_Error {\n\n\n    static NotAllowedForScopeAllocationError = 'Component is not allowed for scope allocation';\n\n    static ComponentAlreadyHasScopeAllocatedError = 'Component already has scope allocated';\n\n    static InvalidMetaParameterError = 'Invalid parameter provided to get meta';\n\n    static InvalidScopeParameterError = 'Invalid parameter provided to get scope';\n\n    static ScopeNotFoundError = 'Scope not found';\n\n    static InvalidFeatureParameterError = 'Invalid parameter provided to get feature';\n\n    static InvalidFeatureDefinitionParameterError = 'Invalid parameter provided to define feature';\n\n    static InvalidFeatureTemplateParameterError = 'Invalid parameter provided to get feature template';\n\n    static InvalidFeatureExtensionParameterError = 'Invalid parameter provided to extend feature';\n\n\n    static InvalidAbstractionParameterError = 'Invalid parameter provided to get abstraction';\n\n    static InvalidAbstractionDefinitionParameterError = 'Invalid parameter provided to define abstraction';\n\n    static InvalidAbstractionTemplateParameterError = 'Invalid parameter provided to get abstraction template';\n\n    static InvalidAbstractionExtensionParameterError = 'Invalid parameter provided to extend abstraction';\n\n    static InvalidInjectionParameterError = 'Invalid parameter provided to get injections';\n\n    static InvalidExtensionParameterError = 'Invalid parameter provided to get extensions';\n\n\n    static InvalidRegisterParameterError = 'Invalid parameter provided to register component';\n\n\n    static InvalidComponentParameterError = 'Invalid component provided';\n\n    static ComponentNotRegisteredError = 'Component not registered in the context';\n\n    static InvalidDeregisterParameterError = 'Invalid parameter provided to deregister component';\n}","import {\n    A_TYPES__Scope_Init,\n    A_TYPES__ScopeConfig,\n    A_TYPES__ScopeLinkedComponents,\n    A_TYPES_ScopeDependentComponents\n} from \"../A-Scope/A-Scope.types\";\nimport {\n    A_TYPES__MetaLinkedComponentConstructors,\n    A_TYPES__MetaLinkedComponents\n} from \"../A-Meta/A-Meta.types\";\nimport {\n    A_TYPES__FeatureAvailableComponents,\n    A_TYPES__FeatureDefineDecoratorMeta\n} from \"../A-Feature/A-Feature.types\";\nimport { A_Component } from \"../A-Component/A-Component.class\";\nimport { A_Feature } from \"../A-Feature/A-Feature.class\";\nimport { A_Container } from \"../A-Container/A-Container.class\";\nimport { A_Scope } from \"../A-Scope/A-Scope.class\";\nimport { A_Meta } from \"../A-Meta/A-Meta.class\";\nimport { A_ComponentMeta } from \"../A-Component/A-Component.meta\";\nimport { A_ContainerMeta } from \"../A-Container/A-Container.meta\";\nimport { A_Entity } from \"../A-Entity/A-Entity.class\";\nimport { A_EntityMeta } from \"../A-Entity/A-Entity.meta\";\nimport { A_TYPES__A_StageStep } from \"../A-Stage/A-Stage.types\";\nimport { A_CONSTANTS__DEFAULT_ENV_VARIABLES } from \"@adaas/a-concept/constants/env.constants\";\nimport { A_TYPES__EntityMetaKey } from \"../A-Entity/A-Entity.constants\";\nimport { A_TYPES__ContainerMetaKey } from \"../A-Container/A-Container.constants\";\nimport { A_TYPES__ComponentMetaKey } from \"../A-Component/A-Component.constants\";\nimport { A_TYPES__ContextEnvironment } from \"./A-Context.types\";\nimport { A_TypeGuards } from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_ContextError } from \"./A-Context.error\";\nimport { A_TYPES__Container_Constructor } from \"../A-Container/A-Container.types\";\nimport { A_TYPES__Entity_Constructor } from \"../A-Entity/A-Entity.types\";\nimport { A_TYPES__Component_Constructor } from \"../A-Component/A-Component.types\";\nimport { A_FormatterHelper } from \"@adaas/a-concept/helpers/A_Formatter.helper\";\nimport { A_Fragment } from \"../A-Fragment/A-Fragment.class\";\nimport { A_TYPES__InjectableTargets } from \"../A-Inject/A-Inject.types\";\nimport { A_TYPES__ConceptAbstraction } from \"../A-Concept/A-Concept.types\";\nimport { A_TYPES__ConceptAbstractions } from \"../A-Concept/A-Concept.constants\";\nimport { A_CommonHelper } from \"@adaas/a-concept/helpers/A_Common.helper\";\n\n\n\nexport class A_Context {\n    // ====================================================================================================\n    // ================================ STATIC PROPERTIES =================================================\n    // ====================================================================================================\n    /**\n     * Default name of the application from environment variable A_CONCEPT_NAME\n     * \n     * [!] If environment variable is not set, it will default to 'a-concept'\n     */\n    static get concept() {\n        return process.env[A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_CONCEPT_NAME] || 'a-concept';\n    }\n    /**\n     * Root scope of the application from environment variable A_CONCEPT_ROOT_SCOPE\n     * \n     * [!] If environment variable is not set, it will default to 'root'\n     */\n    static get root(): A_Scope {\n        return this.getInstance()._root;\n    }\n    /**\n     * Environment the application is running in.\n     * Can be either 'server' or 'browser'.\n     * [!] Determined by checking if 'window' object is available.\n     */\n    static get environment(): A_TYPES__ContextEnvironment {\n        let testEnvironment: A_TYPES__ContextEnvironment = 'browser';\n\n        try {\n            testEnvironment = window.location ? 'browser' : 'server';\n        } catch (error) {\n            testEnvironment = 'server';\n        }\n\n        return testEnvironment;\n    }\n\n    /**\n     * Singleton instance of the Context\n     */\n    private static _instance: A_Context;\n    // ====================================================================================================\n    // ================================ INTERNAL REGISTRY =================================================\n    // ====================================================================================================\n    /**\n     * Root Scope of the Concept and Environment\n     *\n     * Root scope is the top-level scope that all other scopes inherit from.\n     * It stores global configurations and settings and ALL SHAREABLE RESOURCES.\n     * \n     * [!] Root scope is created automatically when the Context is initialized.\n     * [!] Root scope name can be configured using environment variable A_CONCEPT_ROOT_SCOPE\n     */\n    private _root!: A_Scope\n    /**\n     * A registry that keeps track of scopes for all components (Containers, Features, Commands) \n     * Which can issue a scope allocation.\n     */\n    protected _registry: WeakMap<A_TYPES__ScopeLinkedComponents, A_Scope> = new WeakMap();\n    /**\n     * This is a registry that stores an issuer of each scope allocation.\n     * It helps to track which component (Container, Feature, Command) allocated a specific scope.\n     */\n    protected _scopeIssuers: WeakMap<A_Scope, A_TYPES__ScopeLinkedComponents> = new WeakMap();\n    /**\n     * Stores a context associated with a specific component that depends on a scope.\n     * uses for quick retrieval of the scope for the component.\n     */\n    protected _scopeStorage: WeakMap<A_TYPES_ScopeDependentComponents, A_Scope> = new WeakMap();\n    /**\n     * Stores meta information for different component types by their constructors.\n     * Meta provides to store extra information about the class behavior and configuration.\n     */\n    protected _metaStorage: Map<A_TYPES__MetaLinkedComponentConstructors, A_Meta> = new Map();\n\n\n\n    /**\n     * Private constructor to enforce singleton pattern.\n     * \n     * [!] This class should not be instantiated directly. Use A_Context.getInstance() instead.\n     */\n    private constructor() {\n        let name = 'root';\n\n        if (A_Context.environment === 'server')\n            name = process.env[A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_CONCEPT_ROOT_SCOPE] || 'root';\n\n        if (A_Context.environment === 'browser')\n            name = (window as any)[A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_CONCEPT_ROOT_SCOPE] || 'root';\n\n        this._root = new A_Scope({ name });\n    }\n\n\n\n    /**\n     * Get the instance of the Namespace Provider.\n     * \n     * If the instance does not exist, it will be created.\n     * \n     * @returns \n     */\n    static getInstance() {\n        if (!A_Context._instance) {\n            A_Context._instance = new A_Context();\n        }\n\n        return A_Context._instance;\n    }\n\n\n\n    /**\n     * Register method allows to register a component with a specific scope in the context.\n     * \n     * @param component - Component to register with a specific scope. Can be either A_Container, A_Feature.\n     * @param scope - Scope to associate the component with.\n     * @returns \n     */\n    static register(\n        /**\n         * Provide the scope that will be associated with the component.\n         */\n        scope: A_Scope,\n        /**\n         * Provide a component that needs to be registered with a specific scope.\n         */\n        component: A_TYPES_ScopeDependentComponents,\n\n    ): A_Scope {\n        // uses only for error messages\n        const componentName = A_CommonHelper.getComponentName(component);\n\n        const instance = this.getInstance();\n\n        if (!component) throw new A_ContextError(\n            A_ContextError.InvalidRegisterParameterError,\n            `Unable to register component. Component cannot be null or undefined.`);\n\n        if (!scope) throw new A_ContextError(\n            A_ContextError.InvalidRegisterParameterError,\n            `Unable to register component. Scope cannot be null or undefined.`);\n\n        if (!this.isAllowedToBeRegistered(component)) throw new A_ContextError(\n            A_ContextError.NotAllowedForScopeAllocationError,\n            `Component ${componentName} is not allowed for scope allocation.`);\n\n        instance._scopeStorage.set(component, scope);\n\n        return scope;\n    }\n\n    /**\n     * Deregister method allows to deregister a component from the context.\n     * \n     * @param component - Component to deregister from the context.\n     */\n    static deregister(\n        /**\n         * Provide a component that needs to be deregistered from the context.\n         */\n        component: A_TYPES_ScopeDependentComponents,\n    ): void {\n        // uses only for error messages\n        const componentName = A_CommonHelper.getComponentName(component);\n\n        const instance = this.getInstance();\n\n        if (!component) throw new A_ContextError(\n            A_ContextError.InvalidDeregisterParameterError,\n            `Unable to deregister component. Component cannot be null or undefined.`);\n\n        if (!instance._scopeStorage.has(component)) throw new A_ContextError(\n            A_ContextError.ComponentNotRegisteredError,\n            `Unable to deregister component. Component ${componentName} is not registered.`);\n\n        instance._scopeStorage.delete(component);\n    }\n\n    /**\n     * Allocate method instantiates a new scope for the given component and registers it in the context.\n     * It bounds the component (Container, Feature) to a new scope that can be configured and used independently.\n     * \n     * \n     * @param component - Component to allocate the scope for. Can be either A_Container, A_Feature.\n     * @param importing  - Configuration of the scope that will be created for the component.\n     */\n    static allocate(\n        /**\n         * Provide a component that needs a scope allocation.\n         */\n        component: A_TYPES__ScopeLinkedComponents,\n    ): A_Scope\n    static allocate(\n        /**\n         * Provide a component that needs a scope allocation.\n         */\n        component: A_TYPES__ScopeLinkedComponents,\n        /**\n         * Provide the scope that will be used as a base for the new scope.\n         */\n        importing: A_Scope\n    ): A_Scope\n    static allocate(\n        /**\n         * Provide a component that needs a scope allocation.\n         */\n        component: A_TYPES__ScopeLinkedComponents,\n        /**\n         * Provide configuration for the scope that will be created for the component.\n         */\n        config: Partial<A_TYPES__Scope_Init & A_TYPES__ScopeConfig>\n    ): A_Scope\n    static allocate(\n        component: A_TYPES__ScopeLinkedComponents,\n        importing?: Partial<A_TYPES__Scope_Init & A_TYPES__ScopeConfig> | A_Scope\n    ): A_Scope {\n        // uses only for error messages\n        const componentName = A_CommonHelper.getComponentName(component);\n\n        // ---------------------------------------------------------------------\n        // ----------------------Input Validation-------------------------------\n        // ---------------------------------------------------------------------\n        // 1) check if component is valid\n        if (!this.isAllowedForScopeAllocation(component))\n            throw new A_ContextError(A_ContextError.NotAllowedForScopeAllocationError, `Component of type ${componentName} is not allowed for scope allocation. Only A_Container, A_Feature are allowed.`);\n        const instance = this.getInstance();\n\n        // 2) check if component already has a scope allocated\n        if (instance._registry.has(component))\n            throw new A_ContextError(A_ContextError.ComponentAlreadyHasScopeAllocatedError, `Component ${componentName} already has a scope allocated.`);\n\n\n        // 3) Create a new scope for the component\n        const newScope = A_TypeGuards.isScopeInstance(importing)\n            ? importing\n            : new A_Scope(importing || {\n                name: componentName + '-scope'\n            }, importing);\n\n        // 4) Make sure that the new scope inherits from the root scope\n        if (!newScope.isInheritedFrom(A_Context.root))\n            newScope.inherit(A_Context.root);\n\n        // 5) Register the component in the appropriate storage\n        instance._registry.set(component, newScope);\n        // Also register the issuer of the scope for faster tracking\n        instance._scopeIssuers.set(newScope, component);\n\n        // 6) Return the newly created scope\n        return newScope;\n    }\n\n    /**\n     * Deallocate method removes the scope allocation for the given component from the context.\n     * \n     * @param component \n     * @returns \n     */\n    static deallocate(\n        /**\n         * A Scope that needs to be deallocated.\n         */\n        scope: A_Scope,\n    )\n    static deallocate(\n        /**\n         * Provide a component that needs to have its scope deallocated.\n         */\n        component: A_TYPES__ScopeLinkedComponents,\n    )\n    static deallocate(\n        /**\n         * Provide a component that needs to have its scope deallocated.\n         */\n        param1: A_TYPES__ScopeLinkedComponents | A_Scope,\n    ) {\n        const instance = this.getInstance();\n\n\n        const scope = A_TypeGuards.isScopeInstance(param1)\n            ? param1\n            : instance._registry.get(param1);\n\n        if (!scope) return;\n\n        try {\n            const component = A_TypeGuards.isComponentInstance(param1)\n                ? param1\n                : this.issuer(scope);\n\n            instance._registry.delete(component);\n            instance._scopeIssuers.delete(scope);\n        } catch (error) {\n            return\n        }\n    }\n\n\n\n    /**\n      * Get or Create Meta for the specific class or instance.\n      * This method will return the existing meta if it exists, or create a new one if it doesn't.\n      * \n      * Meta object contains custom metadata based on the class type.\n      * \n      * @param container \n      */\n    static meta(\n        /**\n         * Get meta for the specific container class by constructor.\n         */\n        container: A_TYPES__Container_Constructor,\n    ): A_ContainerMeta\n    static meta(\n        /**\n         * Get meta for the specific container instance.\n         */\n        container: A_Container,\n    ): A_ContainerMeta\n    static meta(\n        /**\n         * Get meta for the specific entity class by constructor.\n         */\n        entity: A_TYPES__Entity_Constructor,\n    ): A_EntityMeta\n    static meta(\n        /**\n         * Get meta for the specific entity instance.\n         */\n        entity: A_Entity,\n    ): A_EntityMeta\n    static meta(\n        /**\n         * Get meta for the specific component class by constructor.\n         */\n        component: A_TYPES__Component_Constructor,\n    ): A_ComponentMeta\n    static meta(\n        /**\n         * Get meta for the specific component instance.\n         */\n        component: A_Component,\n    ): A_ComponentMeta\n    static meta(\n        /**\n         * Get meta for the specific component by its name.\n         */\n        component: string,\n    ): A_ComponentMeta\n    static meta(\n        /**\n         * Get meta for the specific injectable target (class or instance).\n         */\n        target: A_TYPES__InjectableTargets,\n    ): A_ComponentMeta\n    static meta<T extends Record<string, any>>(\n        /**\n         * Get meta for the specific class or instance\n         */\n        constructor: new (...args: any[]) => any\n    ): A_Meta<T>\n\n    static meta<T extends Record<string, any>>(\n        param1: A_TYPES__MetaLinkedComponentConstructors\n            | A_TYPES__MetaLinkedComponents\n            | string\n    ): A_Meta<T> {\n\n        // Get the component name for error messages\n        const componentName = A_CommonHelper.getComponentName(param1);\n        // Get the instance of the context\n        const instance = this.getInstance();\n\n        if (!param1) throw new A_ContextError(A_ContextError.InvalidMetaParameterError, `Invalid parameter provided to get meta. Parameter cannot be null or undefined.`);\n\n        // Check if the parameter is allowed for meta storage\n        if (!(\n            this.isAllowedForMeta(param1)\n            || this.isAllowedForMetaConstructor(param1)\n            || A_TypeGuards.isString(param1)\n            || A_TypeGuards.isFunction(param1\n            ))\n        ) throw new A_ContextError(A_ContextError.InvalidMetaParameterError, `Invalid parameter provided to get meta. Component of type ${componentName} is not allowed for meta storage. Only A_Container, A_Component and A_Entity are allowed.`);\n\n        let property: A_TYPES__MetaLinkedComponentConstructors;\n        let metaType: typeof A_Meta<T> | typeof A_ContainerMeta | typeof A_ComponentMeta | typeof A_EntityMeta\n\n        switch (true) {\n            // 1) If param1 is instance of A_Container\n            case A_TypeGuards.isContainerInstance(param1): {\n                property = param1.constructor as A_TYPES__Container_Constructor;\n                metaType = A_ContainerMeta;\n\n                break;\n            }\n            // 2) If param1 is class of A_Container\n            case A_TypeGuards.isContainerConstructor(param1): {\n                property = param1 as typeof A_Container;\n                metaType = A_ContainerMeta;\n\n                break;\n            }\n            // 3) If param1 is instance of A_Component\n            case A_TypeGuards.isComponentInstance(param1): {\n                property = param1.constructor as A_TYPES__Component_Constructor;\n                metaType = A_ComponentMeta;\n\n                break;\n            }\n            // 4) If param1 is class of A_Component\n            case A_TypeGuards.isComponentConstructor(param1): {\n                property = param1 as typeof A_Component;\n                metaType = A_ComponentMeta;\n\n                break;\n            }\n            // 5) If param1 is instance of A_Entity\n            case A_TypeGuards.isEntityInstance(param1): {\n                property = param1.constructor as A_TYPES__Entity_Constructor;\n                metaType = A_ComponentMeta;\n\n                break;\n            }\n            // 6) If param1 is class of A_Entity\n            case A_TypeGuards.isEntityConstructor(param1): {\n                property = param1;\n                metaType = A_EntityMeta;\n\n                break;\n            }\n            // 7) If param1 is string then we need to find the component by its name\n            case typeof param1 === 'string': {\n                const found = Array.from(instance._metaStorage)\n                    .find(([c]) => c.name === param1\n                        || c.name === A_FormatterHelper.toKebabCase(param1)\n                        || c.name === A_FormatterHelper.toPascalCase(param1)\n                    )!;\n                if (!(found && found.length))\n                    throw new A_ContextError(A_ContextError.InvalidMetaParameterError, `Invalid parameter provided to get meta. Component with name ${param1} not found in the meta storage.`);\n\n                property = found[0];\n                metaType = A_ComponentMeta;\n\n                break;\n            }\n            // 8) If param1 is any other class or function\n            default: {\n                property = param1;\n                metaType = A_Meta;\n\n                break;\n            }\n        }\n\n        // Check if the meta already exists for the property, if not create a new one\n        if (!instance._metaStorage.has(property)) {\n            const inheritMeta = instance._metaStorage.get(Object.getPrototypeOf(property)) || new metaType();\n            instance._metaStorage.set(property, new metaType().from(inheritMeta as any));\n        }\n\n        // Return the meta for the property\n        return instance._metaStorage.get(property)!;\n    }\n\n\n    /**\n     * \n     * This method allows to get the issuer of a specific scope.\n     * \n     * @param scope - Scope to get the issuer for.\n     * @returns - Component that issued the scope.\n     */\n    static issuer(\n        /**\n         * Provide the scope to get its issuer.\n         */\n        scope: A_Scope\n    ): A_TYPES__ScopeLinkedComponents {\n\n        const instance = this.getInstance();\n\n        if (!scope) throw new A_ContextError(\n            A_ContextError.InvalidComponentParameterError,\n            `Invalid parameter provided to get scope issuer. Parameter cannot be null or undefined.`\n        );\n\n        if (!instance._scopeIssuers.has(scope)) throw new A_ContextError(\n            A_ContextError.ScopeNotFoundError,\n            `Invalid parameter provided to get scope issuer. Provided scope does not have an issuer registered.`\n        );\n\n        return instance._scopeIssuers.get(scope)!;\n    }\n\n\n\n    /**\n     * Get the scope of the specific class or instance.\n     * \n     * Every execution in Concept has its own scope.\n     * \n     * This method will return the scope of the specific class or instance.\n     * \n     * @param entity \n     */\n    static scope<T extends A_Entity>(\n        /**\n         * Provide an entity to get its scope.\n         */\n        entity: T\n    ): A_Scope\n    static scope<T extends A_Component>(\n        /**\n         * Provide a component to get its scope.\n         */\n        component: T\n    ): A_Scope\n    static scope<T extends A_Container>(\n        /**\n         * Provide a container to get its scope.\n         */\n        container: T\n    ): A_Scope\n    static scope<T extends A_Feature>(\n        /**\n         * Provide a feature to get its scope.\n         */\n        feature: T\n    ): A_Scope\n    static scope<T extends A_Fragment>(\n        /**\n         * Provide a fragment to get its scope.\n         */\n        fragment: T\n    ): A_Scope\n    static scope<T extends A_TYPES__ScopeLinkedComponents | A_TYPES_ScopeDependentComponents>(\n        param1: T\n    ): A_Scope {\n\n        // for error messages\n        const name = (param1 as any)?.constructor?.name || String(param1);\n\n        // Get the instance of the context\n        const instance = this.getInstance();\n\n        // Input validation\n        if (!param1) throw new A_ContextError(A_ContextError.InvalidScopeParameterError, `Invalid parameter provided to get scope. Parameter cannot be null or undefined.`);\n\n        // Check if the parameter is allowed for scope allocation\n        if (!this.isAllowedForScopeAllocation(param1)\n            && !this.isAllowedToBeRegistered(param1)\n        )\n            throw new A_ContextError(A_ContextError.InvalidScopeParameterError, `Invalid parameter provided to get scope. Component of type ${name} is not allowed for scope allocation.`);\n\n        switch (true) {\n            case this.isAllowedForScopeAllocation(param1):\n\n                // Check if the parameter has a scope allocated\n                if (!instance._registry.has(param1))\n                    throw new A_ContextError(\n                        A_ContextError.ScopeNotFoundError,\n                        `Invalid parameter provided to get scope. Component of type ${name} does not have a scope allocated. Make sure to allocate a scope using A_Context.allocate() method before trying to get the scope.`\n                    );\n\n                // If the parameter is allowed for scope allocation, return the scope\n                return instance._registry.get(param1)!;\n\n            case this.isAllowedToBeRegistered(param1):\n\n                // Check if the parameter has a scope registered\n                if (!instance._scopeStorage.has(param1))\n                    throw new A_ContextError(\n                        A_ContextError.ScopeNotFoundError,\n                        `Invalid parameter provided to get scope. Component of type ${name} does not have a scope registered. Make sure to register the component using A_Context.register() method before trying to get the scope.`\n                    );\n\n                // If the parameter is allowed to be registered, return the scope from the storage\n                return instance._scopeStorage.get(param1)!;\n            default:\n                throw new A_ContextError(A_ContextError.InvalidScopeParameterError, `Invalid parameter provided to get scope. Component of type ${name} is not allowed to be registered.`);\n        }\n    }\n\n\n    // ==========================================================================================================\n    // ================================== FEATURE MANAGEMENT ====================================================\n    // ==========================================================================================================\n    // ----------------------------------------------------------------------------------------------------------\n    // -----------------------------------Primary Methods -------------------------------------------------------\n    // ----------------------------------------------------------------------------------------------------------\n    /**\n     * Returns a template of the feature that can be then used to create a new A-Feature Instance\n     * \n     * [!] Note: Steps/Stages included are fully dependent on the scope provided since it dictates which components are active and can provide extensions for the feature.\n     * \n     * @param name \n     */\n    static featureTemplate(\n        /**\n         * Provide the name of the feature to get the template for. Regular expressions are also supported to match multiple features.\n         */\n        name: string | RegExp,\n        /**\n         * Provide the component to get the feature template from.\n         */\n        component: A_TYPES__FeatureAvailableComponents,\n        /**\n         * Provide the scope that dictates which components are active and can provide extensions for the feature.\n         */\n        scope: A_Scope = this.scope(component)\n    ): Array<A_TYPES__A_StageStep> {\n        // name for error messages\n        const componentName = A_CommonHelper.getComponentName(component);\n\n        // Input validation\n        if (!component) throw new A_ContextError(A_ContextError.InvalidFeatureTemplateParameterError, `Unable to get feature template. Component cannot be null or undefined.`);\n        if (!name) throw new A_ContextError(A_ContextError.InvalidFeatureTemplateParameterError, `Unable to get feature template. Feature name cannot be null or undefined.`);\n\n        // Check if the parameter is allowed for feature definition\n        if (!A_TypeGuards.isAllowedForFeatureDefinition(component))\n            throw new A_ContextError(A_ContextError.InvalidFeatureTemplateParameterError, `Unable to get feature template. Component of type ${componentName} is not allowed for feature definition.`);\n\n        const steps: A_TYPES__A_StageStep[] = [\n            // 1) Get the base feature definition from the component\n            ...this.featureDefinition(name, component),\n            // 2) Get all extensions for the feature from other components in the scope\n            ...this.featureExtensions(name, component, scope)\n        ];\n\n        return steps;\n    }\n    // ----------------------------------------------------------------------------------------------------------\n    // -----------------------------------Helper Methods --------------------------------------------------------\n    // ----------------------------------------------------------------------------------------------------------\n    /**\n     * Returns all extensions for the specific feature in the specific component within the provided scope.\n     * Scope dictates which components are active and can provide extensions for the feature.\n     * \n     * [!] This method only returns extensions, not the base feature definition.\n     * \n     * @param scope \n     * @returns \n     */\n    static featureExtensions(\n        /**\n         * Provide the name of the feature to get the template for. Regular expressions are also supported to match multiple features.\n         */\n        name: string | RegExp,\n        /**\n         * Provide the component to get the feature template from.\n         */\n        component: A_TYPES__FeatureAvailableComponents,\n        /**\n         * Provide the scope that dictates which components are active and can provide extensions for the feature.\n         */\n        scope: A_Scope\n    ): Array<A_TYPES__A_StageStep> {\n\n        const instance = this.getInstance();\n        // name for error messages\n        const componentName = A_CommonHelper.getComponentName(component);\n\n        // Input validation\n        if (!component) throw new A_ContextError(A_ContextError.InvalidFeatureExtensionParameterError, `Unable to get feature template. Component cannot be null or undefined.`);\n        if (!name) throw new A_ContextError(A_ContextError.InvalidFeatureExtensionParameterError, `Unable to get feature template. Feature name cannot be null or undefined.`);\n\n        // Check if the parameter is allowed for feature definition\n        if (!A_TypeGuards.isAllowedForFeatureDefinition(component))\n            throw new A_ContextError(A_ContextError.InvalidFeatureExtensionParameterError, `Unable to get feature template. Component of type ${componentName} is not allowed for feature definition.`);\n\n        const callName = `${component.constructor.name}.${name}`;\n\n        const steps: A_TYPES__A_StageStep[] = [];\n\n        // We need to get all components that has extensions for the feature in component\n        for (const [cmp, meta] of instance._metaStorage) {\n            // Just try to make sure that component not only Indexed but also presented in scope\n            if (scope.has(cmp) && (\n                A_TypeGuards.isComponentMetaInstance(meta)\n                || A_TypeGuards.isContainerMetaInstance(meta)\n            )) {\n                // Get all extensions for the feature\n                meta\n                    .extensions(callName)\n                    .forEach((declaration) => {\n                        steps.push({\n                            component: cmp,\n                            ...declaration\n                        });\n                    });\n            }\n        }\n\n        return instance.filterToMostDerived(scope, steps);\n    }\n\n\n    /**\n     * method helps to filter steps in a way that only the most derived classes are kept.\n     * \n     * @param scope \n     * @param items \n     * @returns \n     */\n    private filterToMostDerived(\n        scope: A_Scope,\n        items: A_TYPES__A_StageStep[]): Array<A_TYPES__A_StageStep> {\n        return items.filter(item => {\n            const currentClass = typeof item.component === 'string'\n                ? scope.resolveConstructor(item.component)\n                : A_TypeGuards.isContainerInstance(item.component)\n                    ? item.component.constructor : item.component;\n\n            // Check if this class is parent of any other in the list\n            const isParentOfAnother = items.some(other => {\n                if (other === item) return false;\n\n                const otherClass = typeof other.component === 'string'\n                    ? scope.resolveConstructor(other.component)\n                    : A_TypeGuards.isContainerInstance(other.component)\n                        ? other.component.constructor\n                        : other.component;\n\n\n                return currentClass.prototype.isPrototypeOf(otherClass.prototype);\n            });\n\n            // Keep only classes that are not parent of any other\n            return !isParentOfAnother;\n        });\n    }\n\n\n    /**\n     * This method returns the feature template definition without any extensions.\n     * It can be used to retrieve the base template for a feature before any modifications are applied.\n     * \n     * [!] This method does not consider extensions from other components.\n     * \n     * @param feature \n     * @param component \n     * @returns \n     */\n    static featureDefinition(\n        /**\n         * Name of the feature to get the template for.\n         * Regular expressions are also supported to match multiple features.\n         */\n        feature: string | RegExp,\n        /**\n         * Component to get the feature template from.\n         */\n        component: A_TYPES__FeatureAvailableComponents,\n    ): Array<A_TYPES__A_StageStep> {\n        let metaKey;\n\n        if (!feature)\n            throw new A_ContextError(A_ContextError.InvalidFeatureTemplateParameterError, `Unable to get feature template. Feature name cannot be null or undefined.`);\n        if (!component)\n            throw new A_ContextError(A_ContextError.InvalidFeatureTemplateParameterError, `Unable to get feature template. Component cannot be null or undefined.`);\n\n\n        switch (true) {\n            case component instanceof A_Entity:\n                metaKey = A_TYPES__EntityMetaKey.FEATURES;\n                break;\n            case component instanceof A_Container:\n                metaKey = A_TYPES__ContainerMetaKey.FEATURES\n                break;\n            case component instanceof A_Component:\n                metaKey = A_TYPES__ComponentMetaKey.FEATURES\n                break;\n\n            default:\n                throw new A_ContextError(A_ContextError.InvalidFeatureTemplateParameterError, `A-Feature cannot be defined on the ${component} level`);\n        }\n\n        const featureDefinition: A_TYPES__FeatureDefineDecoratorMeta | undefined = this.meta(component)\n            ?.get(metaKey)\n            ?.get(feature);\n\n        return [\n            ...(featureDefinition?.template || [])\n        ];\n    }\n\n    // ==========================================================================================================\n    // ================================== ABSTRACTION MANAGEMENT =================================================\n    // ==========================================================================================================\n    // ----------------------------------------------------------------------------------------------------------\n    // -----------------------------------Primary Methods -------------------------------------------------------\n    // ----------------------------------------------------------------------------------------------------------\n    /**\n     * Returns a definition of the abstraction that can be then used to create a new A-Feature Instance\n     * \n     * [!] Note: Steps/Stages included are fully dependent on the scope provided since it dictates which components are active and can provide extensions for the abstraction.\n     * \n     * @param abstraction \n     */\n    static abstractionTemplate(\n        /**\n         * Provide the abstraction stage to get the definition for.\n         */\n        abstraction: A_TYPES__ConceptAbstractions,\n        /**\n         * Provide the component to get the abstraction definition from.\n         */\n        component: A_TYPES__FeatureAvailableComponents,\n    ): Array<A_TYPES__A_StageStep> {\n        // name for error messages\n        const componentName = (A_CommonHelper.getComponentName(component));\n\n        // Input validation\n        if (!component) throw new A_ContextError(\n            A_ContextError.InvalidAbstractionTemplateParameterError,\n            `Unable to get feature template. Component cannot be null or undefined.`);\n\n        if (!abstraction) throw new A_ContextError(\n            A_ContextError.InvalidAbstractionTemplateParameterError,\n            `Unable to get feature template. Abstraction stage cannot be null or undefined.`);\n\n        // Check if the parameter is allowed for feature definition\n        if (!A_TypeGuards.isAllowedForAbstractionDefinition(component))\n            throw new A_ContextError(A_ContextError.InvalidAbstractionTemplateParameterError, `Unable to get feature template. Component of type ${componentName} is not allowed for feature definition.`);\n\n        const steps: A_TYPES__A_StageStep[] = [\n            // 1) Get the base abstraction definition from the component\n            // [!] No abstraction Definitions -> They are limited to Concept Abstractions ONLY\n            // ...this.abstractionDefinition(abstraction, component),\n\n            // 2) Get all extensions for the abstraction from other components in the scope\n            ...this.abstractionExtensions(abstraction, component)\n        ];\n\n        return steps;\n    }\n\n    // ----------------------------------------------------------------------------------------------------------\n    // -----------------------------------Helper Methods --------------------------------------------------------\n    // ----------------------------------------------------------------------------------------------------------\n\n    static abstractionExtensions(\n        /**\n         * Provide the abstraction name to get the definition for.\n         */\n        abstraction: A_TYPES__ConceptAbstractions,\n        /**\n         * Provide the component to get the abstraction definition from.\n         */\n        component: A_TYPES__FeatureAvailableComponents,\n    ): Array<A_TYPES__A_StageStep> {\n        const instance = this.getInstance();\n        // name for error messages\n        const componentName = A_CommonHelper.getComponentName(component);\n\n        // Input validation\n        if (!component) throw new A_ContextError(\n            A_ContextError.InvalidAbstractionExtensionParameterError,\n            `Unable to get feature template. Component cannot be null or undefined.`\n        );\n        if (!abstraction) throw new A_ContextError(\n            A_ContextError.InvalidAbstractionExtensionParameterError,\n            `Unable to get feature template. Abstraction stage cannot be null or undefined.`\n        );\n        // Check if the parameter is allowed for feature definition\n        if (!A_TypeGuards.isAllowedForAbstractionDefinition(component))\n            throw new A_ContextError\n                (A_ContextError.InvalidAbstractionExtensionParameterError,\n                    `Unable to get feature template. Component of type ${componentName} is not allowed for feature definition.`\n                );\n\n        const steps: A_TYPES__A_StageStep[] = [];\n\n        const scope = this.scope(component);\n\n        // We need to get all components that has extensions for the feature in component\n        for (const [cmp, meta] of instance._metaStorage) {\n            // Just try to make sure that component not only Indexed but also presented in scope\n            if (scope.has(cmp) && (\n                A_TypeGuards.isComponentMetaInstance(meta)\n                || A_TypeGuards.isContainerMetaInstance(meta)\n            )) {\n                // Get all extensions for the feature\n                meta\n                    .abstractions(abstraction)\n                    .forEach((declaration) => {\n                        steps.push({\n                            component: cmp,\n                            ...declaration\n                        });\n                    });\n            }\n        }\n\n        return instance.filterToMostDerived(scope, steps);\n    }\n\n\n    /**\n     * Resets the Context to its initial state.\n     */\n    static reset() {\n        const instance = A_Context.getInstance();\n\n        instance._registry = new WeakMap();\n\n        let name = 'root';\n\n        if (A_Context.environment === 'server')\n            name = process.env[A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_CONCEPT_ROOT_SCOPE] || 'root';\n\n        if (A_Context.environment === 'browser')\n            name = (window as any)[A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_CONCEPT_ROOT_SCOPE] || 'root';\n\n        instance._root = new A_Scope({ name });\n    }\n\n\n\n\n    // ====================================================================================================================\n    // ====================================== HELPERS & GUARDS ============================================================\n    // ====================================================================================================================\n    /**\n     * Type guard to check if the param is allowed for scope allocation.\n     * \n     * @param param \n     * @returns \n     */\n    static isAllowedForScopeAllocation(param: any): param is A_TYPES__ScopeLinkedComponents {\n        return A_TypeGuards.isContainerInstance(param)\n            || A_TypeGuards.isFeatureInstance(param);\n    }\n    /**\n     * Type guard to check if the param is allowed to be registered in the context.\n     * \n     * @param param \n     * @returns \n     */\n    static isAllowedToBeRegistered(param: any): param is A_TYPES_ScopeDependentComponents {\n        return A_TypeGuards.isEntityInstance(param)\n            || A_TypeGuards.isComponentInstance(param)\n            || A_TypeGuards.isFragmentInstance(param)\n            || A_TypeGuards.isErrorInstance(param);\n    }\n\n    /**\n     * Type guard to check if the param is allowed for meta storage.\n     * \n     * @param param \n     * @returns \n     */\n    static isAllowedForMeta(param: any): param is A_TYPES__MetaLinkedComponents {\n        return A_TypeGuards.isContainerInstance(param)\n            || A_TypeGuards.isComponentInstance(param)\n            || A_TypeGuards.isEntityInstance(param);\n    }\n    /**\n     * Type guard to check if the param is allowed for meta storage by constructor.\n     * \n     * @param param \n     * @returns \n     */\n    static isAllowedForMetaConstructor(param: any): param is A_TYPES__MetaLinkedComponentConstructors {\n        return A_TypeGuards.isContainerConstructor(param)\n            || A_TypeGuards.isComponentConstructor(param)\n            || A_TypeGuards.isEntityConstructor(param);\n    }\n\n\n\n}","import { A_Error } from \"../A-Error/A_Error.class\";\n\nexport class A_AbstractionError extends A_Error {\n    /**\n     * This error code indicates that there was an issue extending the abstraction execution\n     */\n    static readonly AbstractionExtensionError = 'Unable to extend abstraction execution';\n\n}","import {\n    A_TYPES__AbstractionDecoratorConfig,\n    A_TYPES__AbstractionDecoratorDescriptor\n} from \"./A-Abstraction.types\";\nimport { A_Component } from \"@adaas/a-concept/global/A-Component/A-Component.class\";\nimport { A_Context } from \"@adaas/a-concept/global/A-Context/A-Context.class\";\nimport { A_Container } from \"@adaas/a-concept/global/A-Container/A-Container.class\";\nimport { A_ContainerMeta } from \"@adaas/a-concept/global/A-Container/A-Container.meta\";\nimport { A_ComponentMeta } from \"@adaas/a-concept/global/A-Component/A-Component.meta\";\nimport { A_Meta } from \"@adaas/a-concept/global/A-Meta/A-Meta.class\";\nimport { A_TYPES__ConceptAbstractions } from \"@adaas/a-concept/global/A-Concept/A-Concept.constants\";\nimport { A_TYPES__ContainerMetaKey } from \"@adaas/a-concept/global/A-Container/A-Container.constants\";\nimport { A_TYPES__ComponentMetaKey } from \"@adaas/a-concept/global/A-Component/A-Component.constants\";\nimport { A_TYPES__ConceptAbstraction } from \"@adaas/a-concept/global/A-Concept/A-Concept.types\";\nimport { A_AbstractionError } from \"./A-Abstraction.error\";\nimport { A_TypeGuards } from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_CommonHelper } from \"@adaas/a-concept/helpers/A_Common.helper\";\n\n\n/**\n * A-Abstraction Extend decorator allows to extends behavior of each concept abstraction execution. \n * In case some components or containers requires to extend the behavior of the abstraction like 'start', 'build' or 'deploy'\n * for example, this decorator allows to do so.    \n * \n * @param name - abstraction name \n * @param config - configuration of the abstraction extension\n * @returns \n */\nexport function A_Abstraction_Extend(\n    /**\n     * Name of the Concept Abstraction to extend\n     */\n    name: A_TYPES__ConceptAbstractions,\n    /**\n     * Configuration of the Abstraction Extension\n     * \n     */\n    config: Partial<A_TYPES__AbstractionDecoratorConfig> = {}\n) {\n    return function (\n        target: A_Container | A_Component,\n        propertyKey: string,\n        descriptor: A_TYPES__AbstractionDecoratorDescriptor\n    ) {\n        // for error messages\n        const componentName = A_CommonHelper.getComponentName(target)\n\n        if (!name)\n            throw new A_AbstractionError(\n                A_AbstractionError.AbstractionExtensionError,\n                `Abstraction name must be provided to extend abstraction for '${componentName}'.`,\n            );\n\n        //  Only Containers and Components can extend Concept Abstractions\n        if (!A_TypeGuards.isConstructorAvailableForAbstraction(target)) {\n            throw new A_AbstractionError(\n                A_AbstractionError.AbstractionExtensionError,\n                `Unable to extend Abstraction '${name}' for '${componentName}'. Only A-Containers and A-Components can extend Abstractions.`,\n            );\n        }\n\n        let metaKey;\n        const meta: A_ContainerMeta | A_ComponentMeta = A_Context.meta(target);\n\n        switch (true) {\n            case A_TypeGuards.isContainerConstructor(target) || A_TypeGuards.isContainerInstance(target):\n                metaKey = A_TYPES__ContainerMetaKey.ABSTRACTIONS\n                break;\n            case A_TypeGuards.isComponentConstructor(target) || A_TypeGuards.isComponentInstance(target):\n                metaKey = A_TYPES__ComponentMetaKey.ABSTRACTIONS\n                break;\n        }\n        const setName = `CONCEPT_ABSTRACTION::${name}`;\n\n        // Get the existed metadata or create a new one\n        const existedMeta: A_Meta<{\n            [Key: string]: A_TYPES__ConceptAbstraction[];\n        }> = meta.get(metaKey) ?\n                new A_Meta().from(meta.get(metaKey))\n                : new A_Meta();\n\n        // Set the metadata of the method to define a custom Stage with name\n        const existedMetaValue = [\n            ...(existedMeta.get(setName) || [])\n        ];\n\n        const existedIndex = existedMetaValue.findIndex(item => item.handler === propertyKey);\n\n        const abstraction = {\n            name: setName,\n            handler: propertyKey,\n            behavior: config.behavior || 'sync',\n            throwOnError: config.throwOnError !== undefined ? config.throwOnError : true,\n\n            before: A_TypeGuards.isArray(config.before)\n                ? new RegExp(`^${config.before.join('|').replace(/\\./g, '\\\\.')}$`).source\n                : config.before instanceof RegExp\n                    ? config.before.source\n                    : '',\n            after: A_TypeGuards.isArray(config.after)\n                ? new RegExp(`^${config.after.join('|').replace(/\\./g, '\\\\.')}$`).source\n                : config.after instanceof RegExp\n                    ? config.after.source\n                    : '',\n\n            override: A_TypeGuards.isArray(config.override)\n                ? new RegExp(`^${config.override.join('|').replace(/\\./g, '\\\\.')}$`).source\n                : config.after instanceof RegExp\n                    ? config.after.source\n                    : '',\n        }\n\n        if (existedIndex !== -1) {\n            // Update the existing method in the metadata\n            existedMetaValue[existedIndex] = abstraction;\n        } else {\n            // Add the new method to the metadata\n            existedMetaValue.push(abstraction);\n        }\n\n        // Set the metadata of the method to define a custom Feature with name\n        existedMeta.set(setName, existedMetaValue);\n\n        //  Update the metadata of the container with the new Stage definition\n        A_Context\n            .meta(target)\n            .set(\n                metaKey,\n                existedMeta\n            );\n    };\n}\n","import { A_Abstraction_Extend } from \"@adaas/a-concept/global/A-Abstraction/A-Abstraction-Extend.decorator\";\nimport { A_Feature } from \"../A-Feature/A-Feature.class\";\nimport { A_TYPES__Abstraction_Init } from \"./A-Abstraction.types\";\nimport { A_Scope } from \"../A-Scope/A-Scope.class\";\nimport { A_Context } from \"../A-Context/A-Context.class\";\nimport { A_TYPES__ConceptAbstractions } from \"../A-Concept/A-Concept.constants\";\n\n\n\nexport class A_Abstraction {\n\n    /**\n     * The name of the Abstraction e.g. 'deploy', 'start', 'test', etc.\n     */\n    protected _name: A_TYPES__ConceptAbstractions;\n    /**\n     * List of features that are part of this Abstraction\n     */\n    protected _features: A_Feature[] = [];\n    /**\n     * The Feature currently being processed\n     */\n    protected _current?: A_Feature;\n    /**\n     * Actual Index of the current Feature being processed\n     */\n    protected _index: number = 0;\n\n\n    /**\n     * Allows to extends A-Abstraction with additional methods\n     */\n    static get Extend(): typeof A_Abstraction_Extend {\n        return A_Abstraction_Extend;\n    }\n\n    /**\n     * A-Abstraction is an object that is common for any application. \n     * By providing components and creating abstraction extensions it's possible to create a unique behavior of the whole solution.\n     * \n     * Every application has basic abstractions like 'start', 'stop', 'deploy', 'test', etc. \n     * They can be easily extended with additional logic from both containers and components.\n     * \n     * \n     * @param params \n     */\n    constructor(\n        /**\n         * Parameters to define the A-Abstraction\n         */\n        params: A_TYPES__Abstraction_Init\n    ) {\n        this._name = params.name;\n\n        this._features = params.containers.map(container => {\n            const template = A_Context.abstractionTemplate(\n                this._name,\n                container\n            );\n            return new A_Feature({\n                name: this._name,\n                component: container,\n                template\n            })\n        });\n\n        this._current = this._features[0];\n    }\n\n    /**\n     * Returns the name of the Abstraction\n     */\n    get name(): string { return this._name; }\n    /**\n     * Returns the current Feature being processed\n     */\n    get feature(): A_Feature | undefined {\n        return this._current;\n    }\n    /**\n     * This method checks if the A-Feature is done\n     * \n     * @returns \n     */\n    get isDone(): boolean {\n        return !this.feature\n            || this._index >= this._features.length\n\n    }\n\n\n    [Symbol.iterator](): Iterator<A_Feature, any> {\n        return {\n            // Custom next method\n            next: (): IteratorResult<A_Feature, any> => {\n                if (!this.isDone) {\n\n                    this._current = this._features[this._index];\n\n                    return {\n                        value: this._current,\n                        done: false\n                    };\n                } else {\n\n                    this._current = undefined; // Reset current on end\n\n                    return {\n                        value: undefined,\n                        done: true\n                    };\n                }\n            }\n        };\n    }\n\n    /**\n     * This method moves the Abstraction processing to the next Feature in the list\n     * \n     * @param stage \n     */\n    next(stage) {\n        if (this._index >= this._features.length) {\n            return;\n        }\n\n        const stageIndex = this._features.indexOf(stage);\n\n        this._index = stageIndex + 1;\n    }\n\n\n\n    /**\n     * Allows to process all stages of the Abstraction\n     * \n     * @returns \n     */\n    async process(\n        /**\n         * Allows to override the scope in which the Abstraction will be processed\n         * \n         */\n        scope?: A_Scope\n    ) {\n        if (this.isDone)\n            return;\n\n        for (const feature of this._features) {\n\n            await feature.process(scope);\n        }\n    }\n}","import { A_Container } from \"../A-Container/A-Container.class\";\nimport { A_Abstraction } from \"../A-Abstraction/A-Abstraction.class\";\nimport { A_Abstraction_Extend } from \"@adaas/a-concept/global/A-Abstraction/A-Abstraction-Extend.decorator\";\nimport { A_Scope } from \"../A-Scope/A-Scope.class\";\nimport { A_Context } from \"../A-Context/A-Context.class\";\nimport { A_TYPES__ConceptAbstractions } from \"./A-Concept.constants\";\nimport { A_TYPES__Concept_Init } from \"./A-Concept.types\";\nimport { A_TYPES__AbstractionDecoratorConfig } from \"../A-Abstraction/A-Abstraction.types\";\nimport { A_Feature } from \"../A-Feature/A-Feature.class\";\n\n\n\nexport class A_Concept<\n    _Imports extends A_Container[] = A_Container[]\n> {\n\n    // ==============================================================================\n    // ====================  STATIC LIFECYCLE DECORATORS  ===========================\n    // ==============================================================================\n    /**\n     * Load the concept. This step runs before any other steps to ensure that all components are loaded.\n     */\n    static Load(\n        /**\n         * provide additional configuration for the abstraction extension to make it dependent on other factors\n         */\n        config?: Partial<A_TYPES__AbstractionDecoratorConfig>\n    ): ReturnType<typeof A_Abstraction_Extend> {\n        return A_Abstraction.Extend(A_TYPES__ConceptAbstractions.Load, config);\n    }\n\n    /**\n     * Publish the concept to ADAAS platform. (Or any other place defined in the concept)\n     *\n     * [!] To extend the logic just create a custom containers and override the default behavior.\n     */\n    static Publish(\n        /**\n        * provide additional configuration for the abstraction extension to make it dependent on other factors\n        */\n        config?: Partial<A_TYPES__AbstractionDecoratorConfig>\n    ): ReturnType<typeof A_Abstraction_Extend> {\n        return A_Abstraction.Extend(A_TYPES__ConceptAbstractions.Publish);\n    }\n\n    /**\n     * Deploy the concept to the environment.\n     */\n    static Deploy(\n        /**\n        * provide additional configuration for the abstraction extension to make it dependent on other factors\n        */\n        config?: Partial<A_TYPES__AbstractionDecoratorConfig>\n    ) {\n        return A_Abstraction.Extend(A_TYPES__ConceptAbstractions.Deploy, config);\n    }\n\n    /**\n     * Compiles the Concept in case there are some containers that require that. \n     * \n     * Can be used for static websites or any other concept that requires a build step.\n     * \n     */\n    static Build(\n        /**\n        * provide additional configuration for the abstraction extension to make it dependent on other factors\n        */\n        config?: Partial<A_TYPES__AbstractionDecoratorConfig>\n    ) {\n        return A_Abstraction.Extend(A_TYPES__ConceptAbstractions.Build, config);\n    }\n\n    /**\n     *  Main execution of the concept.\n     */\n    static Run(\n        /**\n        * provide additional configuration for the abstraction extension to make it dependent on other factors\n        */\n        config?: Partial<A_TYPES__AbstractionDecoratorConfig>\n    ) {\n        return A_Abstraction.Extend(A_TYPES__ConceptAbstractions.Run, config);\n    }\n\n    /**\n     *  Start the concept. Uses for servers or any other background services.\n     */\n    static Start(\n        /**\n        * provide additional configuration for the abstraction extension to make it dependent on other factors\n        */\n        config?: Partial<A_TYPES__AbstractionDecoratorConfig>\n    ) {\n        return A_Abstraction.Extend(A_TYPES__ConceptAbstractions.Start, config);\n    }\n\n    /**\n     * Stop the concept. Uses for servers or any other background services.\n     */\n    static Stop(\n        /**\n        * provide additional configuration for the abstraction extension to make it dependent on other factors\n        */\n        config?: Partial<A_TYPES__AbstractionDecoratorConfig>\n    ) {\n        return A_Abstraction.Extend(A_TYPES__ConceptAbstractions.Stop, config);\n    }\n\n\n    /**\n     * Name of the concept\n     * \n     * By default, the name of the Concept is 'a-concept'\n     */\n    private _name!: string;\n    /**\n     * A list of internally defined containers that the concept uses.\n     */\n    protected _containers!: A_Container[];\n\n\n\n    // ==============================================================================\n    // ==========================  MAIN Methods  ======================================\n    // ==============================================================================\n\n\n    /**\n     * A-Concept is a placeholder for the concept of the any program.\n     * \n     * Concept - could be any Program regardless environment and it's goal.\n     * It could be mobile, web or simple html page.\n     * All depends on Containers and Components installed and provided in the Concept.\n     * \n     * \n     * [!] Concept operates ONLY with all Components and Containers provided to achieve the goal.\n     * \n     * \n     * @param props - Initialization properties for the Concept\n     */\n    constructor(\n        protected props: A_TYPES__Concept_Init<_Imports>\n    ) {\n        this._name = props.name || A_Context.root.name;\n\n        if (props.components && props.components.length)\n            props.components.forEach(component => this.scope.register(component))\n\n        if (props.fragments && props.fragments.length)\n            props.fragments.forEach(fragment => this.scope.register(fragment))\n\n        if (props.entities && props.entities.length)\n            props.entities.forEach(entity => this.scope.register(entity as any))\n\n\n        this._containers = props.containers || [];\n    }\n\n    /**\n     * Name of the concept\n     */\n    get name() {\n        return A_Context.root.name;\n    }\n    /**\n     * The primary Root scope of the concept.\n     */\n    get scope() {\n        return A_Context.root;\n    }\n\n    /**\n     * Register a class or value in the concept scope.\n     */\n    get register(): A_Scope['register'] {\n        return this.scope.register.bind(this.scope);\n    }\n\n    /**\n     * Resolve a class or value from the concept scope.\n     */\n    get resolve(): A_Scope['resolve'] {\n        return this.scope.resolve.bind(this.scope);\n    }\n\n\n    // =======================================================================\n    // ==========================  LIFECYCLE  ================================\n    // =======================================================================\n    /**\n     * Load the concept.\n     */\n    async load(\n        scope?: A_Scope,\n    ) {\n        const abstraction = new A_Abstraction({\n            name: A_TYPES__ConceptAbstractions.Load,\n            containers: this._containers,\n        });\n\n        await abstraction.process(scope);\n    }\n    /**\n     * Run the concept.\n     */\n    async run(\n        scope?: A_Scope,\n    ) {\n        const abstraction = new A_Abstraction({\n            name: A_TYPES__ConceptAbstractions.Run,\n            containers: this._containers,\n        });\n\n        await abstraction.process(scope);\n    }\n    /**\n     * Start the concept.\n     * \n     * @param params \n     */\n    async start(\n        scope?: A_Scope,\n    ) {\n        const abstraction = new A_Abstraction({\n            name: A_TYPES__ConceptAbstractions.Start,\n            containers: this._containers,\n        });\n\n        await abstraction.process(scope);\n    }\n    /**\n     * Stop the concept.\n     * \n     * @param params \n     */\n    async stop(\n        scope?: A_Scope,\n    ) {\n        const abstraction = new A_Abstraction({\n            name: A_TYPES__ConceptAbstractions.Stop,\n            containers: this._containers,\n        });\n\n        await abstraction.process(scope);\n    }\n    /**\n     * Build the concept.\n     */\n    async build(\n        scope?: A_Scope,\n    ) {\n        const abstraction = new A_Abstraction({\n            name: A_TYPES__ConceptAbstractions.Build,\n            containers: this._containers,\n        });\n\n        await abstraction.process(scope);\n    }\n    /**\n     * Deploy the concept.\n     */\n    async deploy(\n        scope?: A_Scope,\n    ) {\n        const abstraction = new A_Abstraction({\n            name: A_TYPES__ConceptAbstractions.Deploy,\n            containers: this._containers,\n        });\n\n        await abstraction.process(scope);\n\n    }\n    /**\n     * Publish the concept.\n     */\n    async publish(\n        scope?: A_Scope,\n    ) {\n        const abstraction = new A_Abstraction({\n            name: A_TYPES__ConceptAbstractions.Publish,\n            containers: this._containers,\n        });\n\n        await abstraction.process(scope);\n    }\n\n\n    // =======================================================================\n    // ==========================  CALL  =====================================\n    // =======================================================================\n\n\n    /**\n     * Call the specific method of the concept or included modules.\n     */\n    async call<\n        K extends Record<_Imports[number]['name'], string>\n    >(\n        /**\n         * Name of the method to call\n         */\n        method: K[keyof K],\n        /**\n         * Container in which the method is located\n         */\n        container: _Imports[number],\n    ) {\n        const feature = new A_Feature({ name: method, component: container });\n\n        return await feature.process();\n    }\n}\n\n\n\n\n","\nimport { A_Container } from \"@adaas/a-concept/global/A-Container/A-Container.class\";\nimport { A_Meta } from \"../A-Meta/A-Meta.class\";\n\n\n\nexport class A_ConceptMeta extends A_Meta<any> {\n\n\n    constructor(\n        private containers: Array<A_Container>,\n    ) {\n        super();\n    }\n\n\n}","import { A_Error } from \"../A-Error/A_Error.class\";\n\nexport class A_DependencyError extends A_Error {\n\n    static readonly InvalidDependencyTarget = 'Invalid Dependency Target';\n\n    static readonly InvalidLoadTarget = 'Invalid Load Target';\n\n    static readonly InvalidLoadPath = 'Invalid Load Path';\n\n\n    static readonly InvalidDefaultTarget = 'Invalid Default Target';\n}","\nimport { A_Context } from \"@adaas/a-concept/global/A-Context/A-Context.class\";\nimport { A_Meta } from \"@adaas/a-concept/global/A-Meta/A-Meta.class\";\nimport { A_TYPES__ComponentMetaKey } from \"@adaas/a-concept/global/A-Component/A-Component.constants\";\nimport { A_TYPES__ContainerMetaKey } from \"@adaas/a-concept/global/A-Container/A-Container.constants\";\nimport { A_TypeGuards } from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_TYPES__A_InjectDecorator_Meta, A_TYPES__InjectableTargets } from \"../A-Inject/A-Inject.types\";\nimport { A_TYPES__A_Dependency_DefaultDecoratorReturn } from \"./A-Dependency.types\";\nimport { A_DependencyError } from \"./A-Dependency.error\";\nimport { A_CommonHelper } from \"@adaas/a-concept/helpers/A_Common.helper\";\n\n\n/**\n * Should indicate which Default is required\n */\nexport function A_Dependency_Default(\n    /**\n     * Constructor Parameters that will be used to create the default instance\n     */\n    ...args: any[]\n): A_TYPES__A_Dependency_DefaultDecoratorReturn {\n\n\n    return function (\n        target: A_TYPES__InjectableTargets,\n        methodName: string | symbol | undefined,\n        parameterIndex: number\n    ) {\n        // for Error handling purposes\n        const componentName = A_CommonHelper.getComponentName(target)\n\n        if (!A_TypeGuards.isTargetAvailableForInjection(target)) {\n            throw new A_DependencyError(\n                A_DependencyError.InvalidDefaultTarget,\n                `A-Default cannot be used on the target of type ${typeof target} (${componentName})`\n            );\n        }\n\n        // determine the method name or 'constructor' for constructor injections\n        const method = methodName ? String(methodName) : 'constructor';\n        let metaKey;\n\n        switch (true) {\n            case A_TypeGuards.isComponentConstructor(target) || A_TypeGuards.isComponentInstance(target):\n                metaKey = A_TYPES__ComponentMetaKey.INJECTIONS;\n                break;\n\n            case A_TypeGuards.isContainerInstance(target):\n                metaKey = A_TYPES__ContainerMetaKey.INJECTIONS;\n                break;\n        }\n\n        // get existing meta or create a new one\n        const existedMeta = A_Context.meta(target).get(metaKey) || new A_Meta();\n        // get existing injections for the method or create a new array\n        const paramsArray: A_TYPES__A_InjectDecorator_Meta = existedMeta.get(method) || [];\n\n        // set the parameter injection info\n        paramsArray[parameterIndex] = {\n            ...(paramsArray[parameterIndex] || {}),\n            defaultArgs: args,\n            create: true\n        }\n        // save back the updated injections array\n        existedMeta.set(method, paramsArray);\n\n        // save back the updated meta info\n        A_Context\n            .meta(target)\n            .set(\n                metaKey,\n                existedMeta\n            );\n    }\n}","\nimport { A_Context } from \"@adaas/a-concept/global/A-Context/A-Context.class\";\nimport { A_Meta } from \"@adaas/a-concept/global/A-Meta/A-Meta.class\";\nimport { A_TYPES__ComponentMetaKey } from \"@adaas/a-concept/global/A-Component/A-Component.constants\";\nimport { A_TYPES__ContainerMetaKey } from \"@adaas/a-concept/global/A-Container/A-Container.constants\";\nimport { A_TypeGuards } from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_TYPES__A_InjectDecorator_Meta, A_TYPES__InjectableTargets } from \"../A-Inject/A-Inject.types\";\nimport { A_TYPES__A_Dependency_LoadDecoratorReturn } from \"./A-Dependency.types\";\nimport { A_DependencyError } from \"./A-Dependency.error\";\nimport { A_CommonHelper } from \"@adaas/a-concept/helpers/A_Common.helper\";\n\n\n/**\n * Should indicate which Load is required\n */\nexport function A_Dependency_Load(\n    /**\n     * Path to load the dependency from\n     */\n    path: string\n): A_TYPES__A_Dependency_LoadDecoratorReturn {\n\n    if (!path || typeof path !== 'string') {\n        throw new A_DependencyError(\n            A_DependencyError.InvalidLoadPath,\n            `A-Load decorator requires a valid path string to the dependency`\n        );\n    }\n\n    return function (\n        target: A_TYPES__InjectableTargets,\n        methodName: string | symbol | undefined,\n        parameterIndex: number\n    ) {\n        // for Error handling purposes\n        const componentName = A_CommonHelper.getComponentName(target);\n\n        if (!A_TypeGuards.isTargetAvailableForInjection(target)) {\n            throw new A_DependencyError(\n                A_DependencyError.InvalidLoadTarget,\n                `A-Load cannot be used on the target of type ${typeof target} (${componentName})`\n            );\n        }\n\n        // determine the method name or 'constructor' for constructor injections\n        const method = methodName ? String(methodName) : 'constructor';\n        let metaKey;\n\n        switch (true) {\n            case A_TypeGuards.isComponentConstructor(target) || A_TypeGuards.isComponentInstance(target):\n                metaKey = A_TYPES__ComponentMetaKey.INJECTIONS;\n                break;\n\n            case A_TypeGuards.isContainerInstance(target):\n                metaKey = A_TYPES__ContainerMetaKey.INJECTIONS;\n                break;\n        }\n\n        // get existing meta or create a new one\n        const existedMeta = A_Context.meta(target).get(metaKey) || new A_Meta();\n        // get existing injections for the method or create a new array\n        const paramsArray: A_TYPES__A_InjectDecorator_Meta = existedMeta.get(method) || [];\n\n        // set the parameter injection info\n        paramsArray[parameterIndex] = {\n            ...(paramsArray[parameterIndex] || {}),\n            load: path\n        }\n        // save back the updated injections array\n        existedMeta.set(method, paramsArray);\n\n        // save back the updated meta info\n        A_Context\n            .meta(target)\n            .set(\n                metaKey,\n                existedMeta\n            );\n    }\n}","\nimport { A_Context } from \"@adaas/a-concept/global/A-Context/A-Context.class\";\nimport { A_Meta } from \"@adaas/a-concept/global/A-Meta/A-Meta.class\";\nimport { A_TYPES__ComponentMetaKey } from \"@adaas/a-concept/global/A-Component/A-Component.constants\";\nimport { A_TYPES__ContainerMetaKey } from \"@adaas/a-concept/global/A-Container/A-Container.constants\";\nimport { A_TypeGuards } from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_TYPES__A_InjectDecorator_Meta, A_TYPES__InjectableTargets } from \"../A-Inject/A-Inject.types\";\nimport { A_TYPES__A_Dependency_RequireDecoratorReturn } from \"./A-Dependency.types\";\nimport { A_DependencyError } from \"./A-Dependency.error\";\nimport { A_CommonHelper } from \"@adaas/a-concept/helpers/A_Common.helper\";\n\n\n/**\n * Should indicate which dependency is required\n */\nexport function A_Dependency_Require(): A_TYPES__A_Dependency_RequireDecoratorReturn {\n\n    return function (\n        target: A_TYPES__InjectableTargets,\n        methodName: string | symbol | undefined,\n        parameterIndex: number\n    ) {\n        // for Error handling purposes\n        const componentName = A_CommonHelper.getComponentName(target)\n\n        if (!A_TypeGuards.isTargetAvailableForInjection(target)) {\n            throw new A_DependencyError(\n                A_DependencyError.InvalidDependencyTarget,\n                `A-Dependency cannot be used on the target of type ${typeof target} (${componentName})`\n            );\n        }\n\n        // determine the method name or 'constructor' for constructor injections\n        const method = methodName ? String(methodName) : 'constructor';\n        let metaKey;\n\n        switch (true) {\n            case A_TypeGuards.isComponentConstructor(target) || A_TypeGuards.isComponentInstance(target):\n                metaKey = A_TYPES__ComponentMetaKey.INJECTIONS;\n                break;\n\n            case A_TypeGuards.isContainerInstance(target):\n                metaKey = A_TYPES__ContainerMetaKey.INJECTIONS;\n                break;\n        }\n\n        // get existing meta or create a new one\n        const existedMeta = A_Context.meta(target).get(metaKey) || new A_Meta();\n        // get existing injections for the method or create a new array\n        const paramsArray: A_TYPES__A_InjectDecorator_Meta = existedMeta.get(method) || [];\n\n        // set the parameter injection info\n        paramsArray[parameterIndex] = {\n            ...(paramsArray[parameterIndex] || {}),\n            require: true\n        }\n        // save back the updated injections array\n        existedMeta.set(method, paramsArray);\n\n        // save back the updated meta info\n        A_Context\n            .meta(target)\n            .set(\n                metaKey,\n                existedMeta\n            );\n    }\n}","import { A_Dependency_Default } from \"./A-Dependency-Default.decorator\";\nimport { A_Dependency_Load } from \"./A-Dependency-Load.decorator\";\nimport { A_Dependency_Require } from \"./A-Dependency-Require.decorator\";\n\n\nexport class A_Dependency {\n    /**\n     * Allows to indicate which Injected parameter is required\n     * \n     * [!] If parameter marked as required is not provided, an error will be thrown\n     * \n     * @returns \n     */\n    static get Required(): typeof A_Dependency_Require {\n        return A_Dependency_Require;\n    }\n    /**\n     * Allows to indicate which dependency should be loaded from a specific path\n     * \n     * @returns \n     */\n    static get Loaded(): typeof A_Dependency_Load {\n        return A_Dependency_Load;\n    }\n    /**\n     * Allows to indicate which dependency default parameters should be used\n     * \n     * @returns \n     */\n    static get Default(): typeof A_Dependency_Default {\n        return A_Dependency_Default;\n    }\n}","import { A_Error } from \"@adaas/a-concept/global/A-Error/A_Error.class\";\n\n\nexport class A_InjectError extends A_Error {\n    static readonly InvalidInjectionTarget = 'Invalid target for A-Inject decorator';\n\n    static readonly MissingInjectionTarget = 'Missing target for A-Inject decorator';\n}","import {\n    A_TYPES__A_InjectDecorator_EntityInjectionInstructions,\n    A_TYPES__A_InjectDecorator_Meta,\n    A_TYPES__A_InjectDecoratorReturn,\n    A_TYPES__InjectableConstructors,\n    A_TYPES__InjectableTargets\n} from \"./A-Inject.types\";\nimport { A_Component } from \"@adaas/a-concept/global/A-Component/A-Component.class\";\nimport { A_Fragment } from \"@adaas/a-concept/global/A-Fragment/A-Fragment.class\";\nimport { A_Context } from \"@adaas/a-concept/global/A-Context/A-Context.class\";\nimport { A_TYPES__Component_Constructor } from \"@adaas/a-concept/global/A-Component/A-Component.types\";\nimport { A_Meta } from \"@adaas/a-concept/global/A-Meta/A-Meta.class\";\nimport { A_Entity } from \"@adaas/a-concept/global/A-Entity/A-Entity.class\";\nimport { A_TYPES__Feature_Constructor } from \"@adaas/a-concept/global/A-Feature/A-Feature.types\";\nimport { A_Caller } from \"@adaas/a-concept/global/A-Caller/A_Caller.class\";\nimport { A_TYPES__ComponentMetaKey } from \"@adaas/a-concept/global/A-Component/A-Component.constants\";\nimport { A_TYPES__ContainerMetaKey } from \"@adaas/a-concept/global/A-Container/A-Container.constants\";\nimport { A_TypeGuards } from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_InjectError } from \"./A-Inject.error\";\nimport { A_TYPES__Entity_Constructor } from \"@adaas/a-concept/global/A-Entity/A-Entity.types\";\nimport { A_TYPES__Fragment_Constructor } from \"@adaas/a-concept/global/A-Fragment/A-Fragment.types\";\nimport { A_Scope } from \"@adaas/a-concept/global/A-Scope/A-Scope.class\";\nimport { A_TYPES__Scope_Constructor } from \"@adaas/a-concept/global/A-Scope/A-Scope.types\";\nimport { A_Feature } from \"@adaas/a-concept/global/A-Feature/A-Feature.class\";\nimport { A_CommonHelper } from \"@adaas/a-concept/helpers/A_Common.helper\";\nimport { A_TYPES__Error_Constructor } from \"../A-Error/A_Error.types\";\nimport { A_Error } from \"../A-Error/A_Error.class\";\nimport { A_TYPES__EntityMetaKey } from \"../A-Entity/A-Entity.constants\";\n\n\n/**\n * A-Inject decorator\n * \n * This Decorator allows to inject dependencies into the module like \n * - Namespaces \n * - Other Concepts \n * - or maybe Components\n * \n * @param params - see overloads\n * @returns - decorator function\n */\nexport function A_Inject<T extends A_Scope>(\n    /***\n     * Provide the Scope constructor that will be associated with the injection.\n     *\n     * [!] It returns an instance of the Scope where the Entity/Component/Container is defined.\n     */\n    scope: A_TYPES__Scope_Constructor<T>\n): A_TYPES__A_InjectDecoratorReturn\nexport function A_Inject<T extends A_Error>(\n    /***\n     * Provide the Error constructor that will be associated with the injection.\n     *\n     * [!] It returns an Instance of the Error what is executed.\n     */\n    error: A_TYPES__Error_Constructor<T>\n): A_TYPES__A_InjectDecoratorReturn\nexport function A_Inject<T extends A_Feature>(\n    /**\n     * Provide the Feature constructor that will be associated with the injection.\n     * \n     * [!] It returns an Instance of the Feature what is executed. \n     */\n    feature: A_TYPES__Feature_Constructor<T>\n): A_TYPES__A_InjectDecoratorReturn\nexport function A_Inject<T extends A_Component>(\n    /**\n     * Provide the Component constructor that will be associated with the injection.\n     * \n     * [!] It returns an Instance of the Component from current Scope or from Parent Scopes.\n     */\n    component: A_TYPES__Component_Constructor<T>\n): A_TYPES__A_InjectDecoratorReturn\n//  Allows to inject just one A_FeatureCaller\nexport function A_Inject(\n    /**\n     * Provide the A_Caller constructor to inject the Caller instance\n     *\n     * [!] It returns initiator of the call, e.g. Container/Component/Command who called Feature \n     */\n    caller: typeof A_Caller\n): A_TYPES__A_InjectDecoratorReturn\n// Allows to inject just one Context Fragment\nexport function A_Inject<T extends A_Fragment>(\n    /**\n     * Provide the Fragment constructor to inject the Fragment instance\n     *\n     * [!] It returns the Fragment instance from current Scope or from Parent Scopes.\n     */\n    fragment: A_TYPES__Fragment_Constructor<T>\n): A_TYPES__A_InjectDecoratorReturn\nexport function A_Inject<T extends A_Entity>(\n    /**\n     * Provide the Entity constructor to inject the Entity instance\n     * \n     * [!] Note: It returns the Entity instance from current Scope or from Parent Scopes.\n     * [!] Note: If instance has more than one Entity of the same type It returns FIRST found Entity\n     * [!] Note: Use 'config' to specify to inject specific one or even Array of Entities\n     */\n    entity: A_TYPES__Entity_Constructor<T>,\n    /**\n     * Provide additional instructions on how to perform the injection\n     * \n     * [!] Default Pagination is 1 if it's necessary to get multiple Entities please customize it in the instructions\n     */\n    config?: Partial<A_TYPES__A_InjectDecorator_EntityInjectionInstructions<T>>\n): A_TYPES__A_InjectDecoratorReturn<T>\nexport function A_Inject<T extends A_Component>(\n    /**\n     * Provide the name of Component constructor to inject the Component instance\n     * \n     * [!] You can use both customized one or original depending on your overriding strategy\n     */\n    ctor: string\n): A_TYPES__A_InjectDecoratorReturn\nexport function A_Inject(\n    param1: A_TYPES__InjectableConstructors,\n    param2?: Partial<A_TYPES__A_InjectDecorator_EntityInjectionInstructions>\n): A_TYPES__A_InjectDecoratorReturn {\n\n    //  pre call checks\n    if (!param1) {\n        throw new A_InjectError(\n            A_InjectError.MissingInjectionTarget,\n            `A-Inject decorator is missing the target to inject`\n        );\n    }\n\n\n    return function (\n        target: A_TYPES__InjectableTargets,\n        methodName: string | symbol | undefined,\n        parameterIndex: number\n    ) {\n        // for Error handling purposes\n        const componentName = A_CommonHelper.getComponentName(target)\n\n        if (!A_TypeGuards.isTargetAvailableForInjection(target)) {\n            throw new A_InjectError(\n                A_InjectError.InvalidInjectionTarget,\n                `A-Inject cannot be used on the target of type ${typeof target} (${componentName})`\n            );\n        }\n\n        // determine the method name or 'constructor' for constructor injections\n        const method = methodName ? String(methodName) : 'constructor';\n        let metaKey;\n\n        switch (true) {\n            case A_TypeGuards.isComponentConstructor(target) || A_TypeGuards.isComponentInstance(target):\n                metaKey = A_TYPES__ComponentMetaKey.INJECTIONS;\n                break;\n\n            case A_TypeGuards.isContainerInstance(target):\n                metaKey = A_TYPES__ContainerMetaKey.INJECTIONS;\n                break;\n\n            case A_TypeGuards.isEntityInstance(target):\n                metaKey = A_TYPES__EntityMetaKey.INJECTIONS;\n                break;\n        }\n\n        // get existing meta or create a new one\n        const existedMeta = A_Context.meta(target).get(metaKey) || new A_Meta();\n        // get existing injections for the method or create a new array\n        const paramsArray: A_TYPES__A_InjectDecorator_Meta = existedMeta.get(method) || [];\n\n        // set the parameter injection info\n        paramsArray[parameterIndex] = {\n            target: param1,\n            instructions: param2\n        }\n        // save back the updated injections array\n        existedMeta.set(method, paramsArray);\n\n        // save back the updated meta info\n        A_Context\n            .meta(target)\n            .set(\n                metaKey,\n                existedMeta\n            );\n    }\n}"]}