{"version":3,"file":"decaf-ts-for-angular.mjs","sources":["../../../src/lib/engine/constants.ts","../../../src/lib/utils/helpers.ts","../../../src/lib/engine/helpers.ts","../../../src/lib/engine/ValidatorFactory.ts","../../../src/lib/services/NgxFormService.ts","../../../src/lib/utils/DecafFakerRepository.ts","../../../src/lib/utils/NgxSpinner.ts","../../../src/lib/utils/NgxToast.ts","../../../src/lib/utils/index.ts","../../../src/lib/engine/NgxRenderingEngine.ts","../../../src/lib/engine/decorators.ts","../../../src/lib/i18n/Loader.ts","../../../src/lib/services/NgxMediaService.ts","../../../src/lib/services/NgxRouterService.ts","../../../src/lib/i18n/FakeLoader.ts","../../../src/lib/services/NgxTranslateService.ts","../../../src/lib/engine/NgxRepositoryDirective.ts","../../../src/lib/engine/NgxComponentDirective.ts","../../../src/lib/components/card/card.component.ts","../../../src/lib/components/card/card.component.html","../../../src/lib/engine/NgxPageDirective.ts","../../../src/lib/engine/NgxModelPageDirective.ts","../../../src/lib/engine/NgxRenderableComponentDirective.ts","../../../src/lib/components/component-renderer/component-renderer.component.ts","../../../src/lib/components/component-renderer/component-renderer.component.html","../../../src/lib/directives/svg.directive.ts","../../../src/lib/pipes/truncate.pipe.ts","../../../src/lib/directives/tooltip.directive.ts","../../../src/lib/engine/NgxFormFieldDirective.ts","../../../src/lib/components/icon/icon.component.ts","../../../src/lib/components/icon/icon.component.html","../../../src/lib/engine/NgxParentComponentDirective.ts","../../../src/lib/components/model-renderer/model-renderer.component.ts","../../../src/lib/components/model-renderer/model-renderer.component.html","../../../src/lib/components/modal/modal.component.ts","../../../src/lib/components/modal/modal.component.html","../../../src/lib/components/crud-field/crud-field.component.ts","../../../src/lib/components/crud-field/crud-field.component.html","../../../src/lib/engine/NgxFormDirective.ts","../../../src/lib/components/layout/layout.component.ts","../../../src/lib/components/layout/layout.component.html","../../../src/lib/components/crud-form/crud-form.component.ts","../../../src/lib/components/crud-form/crud-form.component.html","../../../src/lib/components/empty-state/empty-state.component.ts","../../../src/lib/components/empty-state/empty-state.component.html","../../../src/lib/components/modal/modal-confirm.component.ts","../../../src/lib/components/modal/modal-confirm.component.html","../../../src/lib/components/fieldset/fieldset.component.ts","../../../src/lib/components/fieldset/fieldset.component.html","../../../src/lib/components/file-upload/file-upload.component.ts","../../../src/lib/components/file-upload/file-upload.component.html","../../../src/lib/engine/DynamicModule.ts","../../../src/lib/engine/NgxEventHandler.ts","../../../src/lib/engine/overrides.ts","../../../src/lib/engine/index.ts","../../../src/lib/components/searchbar/searchbar.component.ts","../../../src/lib/components/searchbar/searchbar.component.html","../../../src/lib/components/filter/filter.component.ts","../../../src/lib/components/filter/filter.component.html","../../../src/lib/components/list-item/list-item.component.ts","../../../src/lib/components/list-item/list-item.component.html","../../../src/lib/components/pagination/pagination.component.ts","../../../src/lib/components/pagination/pagination.component.html","../../../src/lib/components/list/list.component.ts","../../../src/lib/components/list/list.component.html","../../../src/lib/components/stepped-form/stepped-form.component.ts","../../../src/lib/components/stepped-form/stepped-form.component.html","../../../src/lib/components/table/table.component.ts","../../../src/lib/components/table/table.component.html","../../../src/lib/components/for-angular-components.module.ts","../../../src/lib/components/index.ts","../../../src/lib/for-angular-common.module.ts","../../../src/lib/pipes/translate.pipe.ts","../../../src/lib/public-apis.ts","../../../src/lib/decaf-ts-for-angular.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { OperationKeys } from '@decaf-ts/db-decorators';\nimport { DEFAULT_PATTERNS, VALIDATION_PARENT_KEY, ValidationKeys } from '@decaf-ts/decorator-validation';\nimport { ModalOptions } from '@ionic/angular/standalone';\nimport { I18nToken, ICrudFormButtons, IListEmptyOptions } from './interfaces';\nimport { DecafRepositoryAdapter } from './types';\n\nexport const DB_ADAPTER_FLAVOUR_TOKEN = 'DbAdapterFlavour';\n\n/**\n * Maps validation keys for password, email, and URL to their corresponding regex patterns.\n * These patterns are used to validate field values against standard format requirements.\n */\n/**\n * Maps validation keys for password, email, and URL to their corresponding regex patterns.\n * These patterns are used to validate field values against standard format requirements.\n */\nexport const patternValidators: Record<string, RegExp> = {\n  [ValidationKeys.PASSWORD]: DEFAULT_PATTERNS.PASSWORD.CHAR8_ONE_OF_EACH,\n  [ValidationKeys.EMAIL]: DEFAULT_PATTERNS.EMAIL,\n  [ValidationKeys.URL]: DEFAULT_PATTERNS.URL,\n};\n\n/**\n * @description Injection token for registering the database adapter provider.\n * @summary Used to inject the database adapter instance that implements DecafRepositoryAdapter.\n * This token allows the framework to locate and use the application's specific database implementation.\n * @const {InjectionToken<DecafRepositoryAdapter>}\n * @memberOf module:lib/for-angular-common.module\n */\nexport const DB_ADAPTER_PROVIDER_TOKEN = new InjectionToken<DecafRepositoryAdapter>('DB_ADAPTER_PROVIDER_TOKEN');\n/**\n * @description Injection token for the root path of locale translation files.\n * @summary Used to configure the base path where i18n translation files are located.\n * This allows the translation loader to locate JSON files for different languages.\n * @const {InjectionToken<string>}\n * @memberOf module:lib/for-angular-common.module\n * @example\n * // Typical usage when providing the token\n * { provide: LOCALE_ROOT_TOKEN, useValue: './assets/i18n/' }\n */\nexport const LOCALE_ROOT_TOKEN = new InjectionToken<string>('LOCALE_ROOT_TOKEN');\n\n/* Generic token for injecting on class constructors */\n/**\n * @description Generic injection token for providing arbitrary values to constructors.\n * @summary Used to inject classes, strings, or any other value into component or service constructors.\n * This is a flexible token that can be used to provide any type of dependency when more specific\n * tokens are not appropriate. The actual type and purpose of the injected value is determined by\n * the provider configuration.\n * @const {InjectionToken<unknown>}\n * @memberOf module:lib/for-angular-common.module\n * @example\n * // Inject a string value\n * { provide: CPTKN, useValue: 'some-config-value' }\n *\n * // Inject a class\n * { provide: CPTKN, useClass: MyService }\n *\n * // Inject any arbitrary value\n * { provide: CPTKN, useValue: { key: 'value', data: [1, 2, 3] } }\n */\nexport const CPTKN = new InjectionToken<unknown>('CPTKN', {\n  providedIn: 'root',\n  factory: () => '',\n});\n\n/**\n * @description Injection token for i18n resource configuration.\n * @summary Used to provide configuration for internationalization resources, including\n * translation file locations and supported languages. This token configures how the\n * application loads and manages translation resources.\n * @const {InjectionToken<I18nToken>}\n * @memberOf module:lib/for-angular-common.module\n */\nexport const I18N_CONFIG_TOKEN = new InjectionToken<I18nToken>('I18N_CONFIG_TOKEN');\n\n/**\n * @description Default options for empty list state display.\n * @summary Provides default configuration for displaying empty state in list components\n * when no data is available. Includes default text for title and subtitle, icon name,\n * button text and visibility settings. These defaults can be overridden by individual\n * list component implementations to customize the empty state presentation.\n * @type {IListEmptyOptions}\n * @property {string} title - Default translation key for empty list title\n * @property {string} subtitle - Default translation key for empty list subtitle\n * @property {boolean} showButton - Whether to show action button in empty state\n * @property {string} icon - Default Ionic icon name for empty state\n * @property {string} buttonText - Default translation key for button text\n * @property {string} link - Default navigation link (empty string)\n * @const DefaultListEmptyOptions\n * @memberOf module:lib/engine/constants\n */\nexport const DefaultListEmptyOptions: IListEmptyOptions = {\n  title: 'empty.title',\n  subtitle: 'empty.subtitle',\n  showButton: true,\n  icon: 'folder-open-outline',\n  buttonText: 'create',\n  link: '',\n} as const;\n\nexport const DefaultModalOptions = {\n  component: '',\n  showBackdrop: true,\n  backdropDismiss: false,\n  animated: true,\n  canDismiss: true,\n  showBackdropTapClose: true,\n  focusTrap: true,\n} as ModalOptions;\n\nexport const ActionRoles = {\n  cancel: 'cancel',\n  confirm: 'confirm',\n  submit: 'submit',\n  clear: 'clear',\n  close: 'close',\n  back: 'back',\n  [OperationKeys.CREATE]: OperationKeys.CREATE,\n  [OperationKeys.READ]: OperationKeys.READ,\n  [OperationKeys.UPDATE]: OperationKeys.UPDATE,\n  [OperationKeys.DELETE]: OperationKeys.DELETE,\n} as const;\n\nexport const WindowColorSchemes = {\n  light: 'light',\n  dark: 'dark',\n  undefined: 'undefined',\n} as const;\n\nexport const ListItemPositions = {\n  uid: 'uid',\n  title: 'title',\n  description: 'description',\n  info: 'info',\n  subinfo: 'subinfo',\n} as const;\n\n/**\n * @description Angular engine key constants.\n * @summary Contains key strings used by the Angular rendering engine for reflection,\n * dynamic component creation, and other engine operations. These constants provide\n * consistent naming for metadata keys, DOM attributes, and component identification\n * throughout the rendering system.\n * @typedef {Object} AngularEngineKeys\n * @property {string} REFLECT - Prefix for reflection metadata keys\n * @property {string} DYNAMIC - Key for dynamic component identification\n * @property {string} ANNOTATIONS - Key for component annotations\n * @property {string} ECMP - Key for embedded components\n * @property {string} NG_REFLECT - Prefix for Angular reflection attributes\n * @property {string} RENDERED - Prefix for rendered component markers\n * @property {string} MAPPER - Key for property mappers\n * @property {string} CHILDREN - Key for child components\n * @property {string} LISTABLE - Key for listable components\n * @property {string} RENDER - Key for renderable components\n * @property {string} RENDERED_ID - Template for rendered component IDs\n * @property {string} PARENT - Key for comparison decorators and validators\n * @property {string} VALIDATION_PARENT_KEY - Key for validation parent reference\n * @property {string} FLAVOUR - Identifier for the Angular engine flavor\n * @const AngularEngineKeys\n * @memberOf module:lib/engine/constants\n */\nexport const AngularEngineKeys = {\n  REFLECT: `angular`,\n  DYNAMIC: 'dynamic-component',\n  ANNOTATIONS: '__annotations__',\n  ECMP: 'ecmp',\n  NG_REFLECT: 'ng-reflect-',\n  RENDERED: 'rendered-as-',\n  MAPPER: 'mapper',\n  CHILDREN: 'children',\n  ERRORS: 'errors',\n  LISTABLE: 'listable',\n  RENDER: 'render',\n  RENDERED_ID: 'rendered-as-{0}',\n  PARENT: '_parent',\n  VALIDATION_PARENT_KEY: VALIDATION_PARENT_KEY,\n  FLAVOUR: 'angular',\n  LOADED: 'engineLoaded',\n  DARK_PALETTE_CLASS: 'dcf-palette-dark',\n} as const;\n\n/**\n * @description Route direction constants.\n * @summary Defines the possible navigation directions in the application.\n * Used for controlling navigation flow and animation directions during route transitions.\n * These constants help maintain consistent navigation behavior throughout the app.\n * @enum {string}\n * @readonly\n * @property {string} BACK - Navigate back to the previous page\n * @property {string} FORWARD - Navigate forward to the next page\n * @property {string} ROOT - Navigate to the root/home page\n * @memberOf module:lib/engine/constants\n */\nexport enum RouteDirections {\n  BACK = 'back',\n  FORWARD = 'forward',\n  ROOT = 'root',\n}\n\n/**\n * @description Component tag name constants.\n * @summary Defines the custom HTML tag names for specialized components used in the application.\n * These tag names are registered with Angular and used for component rendering and identification.\n * Each constant represents the selector for a specific custom component type.\n * @enum {string}\n * @readonly\n * @property {string} LIST_ITEM - Tag name for list item component\n * @property {string} LIST_INFINITE - Tag name for infinite scrolling list component\n * @property {string} LIST_PAGINATED - Tag name for paginated list component\n * @property {string} CRUD_FIELD - Tag name for CRUD form field component\n * @property {string} LAYOUT_COMPONENT - Tag name for layout container component\n * @memberOf module:lib/engine/constants\n */\nexport enum ComponentsTagNames {\n  LIST_ITEM = 'ngx-decaf-list-item',\n  LIST_INFINITE = 'ngx-decaf-list-infinite',\n  LIST_PAGINATED = 'ngx-decaf-list-paginated',\n  CRUD_FIELD = 'ngx-decaf-crud-field',\n  LAYOUT_COMPONENT = 'ngx-decaf-layout',\n}\n\n/**\n * @description Base component property name constants.\n * @summary Defines the standard property names used by base components throughout the application.\n * These constants ensure consistent property naming across components and facilitate\n * property access, validation, and data binding. Used primarily for component input\n * properties and change detection.\n * @enum {string}\n * @readonly\n * @property {string} MODEL - Property name for the component's data model\n * @property {string} LOCALE - Property name for localization settings\n * @property {string} LOCALE_ROOT - Property name for the locale root identifier\n * @property {string} PK - Property name for primary key\n * @property {string} ITEMS - Property name for collection items\n * @property {string} ROUTE - Property name for routing information\n * @property {string} OPERATIONS - Property name for available operations\n * @property {string} UID - Property name for unique identifier\n * @property {string} TRANSLATABLE - Property name for translation flag\n * @property {string} MAPPER - Property name for property mapper\n * @property {string} INITIALIZED - Property name for initialization state\n * @property {string} COMPONENT_NAME - Property name for component identifier\n * @property {string} PARENT_FORM - Property name for parent component reference\n * @property {string} FORM_GROUP_COMPONENT_PROPS - Property name for form group component properties\n * @memberOf module:lib/engine/constants\n */\nexport enum BaseComponentProps {\n  MODEL_ID = 'modelId',\n  MODEL = 'model',\n  HANDLERS = 'handlers',\n  LOCALE = 'locale',\n  LOCALE_ROOT = 'locale_root',\n  PK = 'pk',\n  ITEMS = 'items',\n  ROUTE = 'route',\n  OPERATION = 'operation',\n  OPERATIONS = 'operations',\n  UID = 'uid',\n  TRANSLATABLE = 'translatable',\n  MAPPER = 'mapper',\n  INITIALIZED = 'initialized',\n  COMPONENT_NAME = 'componentName',\n  PARENT_FORM = 'parentForm',\n  FORM_GROUP_COMPONENT_PROPS = 'componentProps',\n}\n\n/**\n * @description List component type constants.\n * @summary Defines the available types for list components, determining their\n * pagination and scrolling behavior. Used to configure list rendering strategies.\n * @enum {string}\n * @readonly\n * @property {string} INFINITE - Infinite scroll list type\n * @property {string} PAGINATED - Paginated list type with page navigation\n * @memberOf module:lib/engine/constants\n */\nexport enum ListComponentsTypes {\n  INFINITE = 'infinite',\n  PAGINATED = 'paginated',\n}\n\n/**\n * @description CSS class name constants.\n * @summary Contains predefined CSS class names used for consistent styling\n * across components. These constants help maintain a unified visual language\n * and make it easier to apply standard styles.\n * @typedef {Object} CssClasses\n * @property {string} BUTTONS_CONTAINER - CSS class for button container elements\n * @const CssClasses\n * @memberOf module:lib/engine/constants\n */\nexport const CssClasses = {\n  BUTTONS_CONTAINER: 'buttons-container',\n};\n\n/**\n * @description Default options for reactive CRUD forms.\n * @summary Provides default configuration for form buttons in CRUD operations.\n * Includes default text labels for submit and clear buttons, which can be\n * overridden by individual form implementations.\n * @type {ICrudFormButtons}\n * @property {Object} buttons - Configuration for form action buttons\n * @property {Object} buttons.submit - Submit button configuration\n * @property {string} buttons.submit.text - Default text for submit button\n * @property {Object} buttons.clear - Clear button configuration\n * @property {string} buttons.clear.text - Default text for clear button\n * @const DefaultFormButtonsOptions\n * @memberOf module:lib/engine/constants\n */\nexport const DefaultFormButtonsOptions: ICrudFormButtons = {\n  submit: {\n    text: 'Submit',\n  },\n  clear: {\n    text: 'Clear',\n  },\n};\n\n/**\n * @description Mapping of select field interface types used in Ionic components.\n * @summary Provides a set of supported select interface types for Ionic select fields,\n * mapping human-readable keys to their corresponding `SelectInterface` string values.\n * This allows for consistent usage and reference of select interface types throughout the application.\n * @property {string} PopOver - Represents the 'popover' select interface.\n * @property {string} Alert - Represents the 'alert' select interface.\n * @property {string} ActionSheet - Represents the 'action-sheet' select interface.\n * @property {string} modal - Represents the 'modal' select interface.\n * @const SelectFieldInterfaces\n * @memberOf module:lib/engine/constants\n */\nexport const SelectFieldInterfaces = {\n  POPOVER: 'popover',\n  ALERT: 'alert',\n  ACTION_SHEET: 'action-sheet',\n  MODAL: 'modal',\n} as const;\n\n/**\n * @description Maps HTTP status codes to translation keys.\n * @summary Provides the i18n lookup key for each supported error code so the UI can render localized\n * error messages consistently across the application.\n * @const ErrorCodesTranslationKeys\n * @memberOf module:lib/engine/constants\n */\nexport const ErrorCodesTranslationKeys: Record<string, string> = {\n  '400': 'errors.bad_request',\n  '401': 'errors.unauthorized',\n  '403': 'errors.forbidden',\n  '404': 'errors.not_found',\n  '405': 'errors.method_not_allowed',\n  '408': 'errors.request_timeout',\n  '409': 'errors.conflict',\n  '410': 'errors.gone',\n  '413': 'errors.payload_too_large',\n  '429': 'errors.too_many_requests',\n  '500': 'errors.internal_server_error',\n  '501': 'errors.not_implemented',\n  '502': 'errors.bad_gateway',\n  '503': 'errors.service_unavailable',\n  '504': 'errors.gateway_timeout',\n  '505': 'errors.http_version_not_supported',\n} as const;\n\n/**\n * @description Standardized validation error identifiers for input components.\n * @summary Defines the internal error keys used by input controls when reporting validation failures.\n * @const InputComponentErrors\n * @memberOf module:lib/engine/constants\n */\nexport const InputComponentErrors = {\n  notAllowed: 'not_allowed',\n  maxSize: 'max_size',\n} as const;\n\nexport const HTTPMethods = {\n  GET: 'GET',\n  POST: 'POST',\n  PUT: 'PUT',\n  PATCH: 'PATCH',\n  DELETE: 'DELETE',\n} as const;\n","/**\n * @module module:lib/helpers/utils\n * @description General helper utilities used across the library.\n * @summary Exposes small, reusable utility functions for window/document access, date handling,\n * string manipulation, simple mapping helpers and environment helpers used by UI components\n * and services. This module's functions include `getWindow`, `getWindowDocument`, `formatDate`,\n * `isValidDate`, `itemMapper`, `dataMapper`, and event helpers like `windowEventEmitter`.\n *\n * Do not document individual exports here — functions are documented inline.\n * @link {@link getWindow}\n */\n\nimport { isDevMode } from '@angular/core';\nimport { Primitives } from '@decaf-ts/decorator-validation';\nimport { InjectableRegistryImp, InjectablesRegistry } from '@decaf-ts/injectable-decorators';\nimport { getLogger } from '../engine/helpers';\nimport { IMenuItem } from '../engine/interfaces';\nimport { FunctionLike, KeyValue, StringOrBoolean } from '../engine/types';\n\nlet injectableRegistry: InjectablesRegistry;\n\n/**\n * @description Retrieves the singleton instance of the injectables registry\n * @summary This function implements the singleton pattern for the InjectablesRegistry.\n * It returns the existing registry instance if one exists, or creates a new instance\n * if none exists. The registry is used to store and retrieve injectable dependencies\n * throughout the application.\n *\n * @return {InjectablesRegistry} The singleton injectables registry instance\n *\n * @function getInjectablesRegistry\n * @memberOf module:for-angular\n */\nexport function getInjectablesRegistry(): InjectablesRegistry {\n  if (!injectableRegistry) injectableRegistry = new InjectableRegistryImp();\n  return injectableRegistry;\n}\n\n/**\n * @description Determines if the application is running in development mode\n * @summary This function checks whether the application is currently running in a development\n * environment. It uses Angular's isDevMode() function and also checks the window context\n * and hostname against the provided context parameter. This is useful for enabling\n * development-specific features or logging.\n *\n * @param {string} [context='localhost'] - The context string to check against the current environment\n * @return {boolean} True if the application is running in development mode, false otherwise\n *\n * @function isDevelopmentMode\n * @memberOf module:for-angular\n */\nexport function isDevelopmentMode(context: string = 'localhost'): boolean {\n  const devMode = isDevMode();\n  const win = getWindow();\n  const env = win?.['env'] || win?.['ENV'];\n  const { protocol } = win.location || ({} as Location);\n  if (!env || !context) {\n    if (protocol.includes('https')) return false;\n    return devMode;\n  }\n  return env?.['CONTEXT'].toLowerCase() !== context.toLowerCase() || win?.['location']?.hostname?.includes(context);\n}\n\n/**\n * @description Dispatches a custom event to the document window\n * @summary This function creates and dispatches a custom event to the browser window.\n * It's useful for cross-component communication or for triggering application-wide events.\n * The function allows specifying the event name, detail data, and additional event properties.\n *\n * @param {string} name - The name of the custom event to dispatch\n * @param {unknown} detail - The data to include in the event's detail property\n * @param {object} [props] - Optional additional properties for the custom event\n * @return {void}\n *\n * @function windowEventEmitter\n * @memberOf module:for-angular\n */\nexport function windowEventEmitter(name: string, detail: unknown, props?: object): void {\n  const data = Object.assign(\n    {\n      bubbles: true,\n      composed: true,\n      cancelable: false,\n      detail: detail,\n    },\n    props || {}\n  );\n  (getWindow() as Window).dispatchEvent(new CustomEvent(name, data));\n}\n/**\n * @description Retrieves a property from the window's document object\n * @summary This function provides a safe way to access properties on the window's document object.\n * It uses the getWindowDocument function to get a reference to the document, then accesses\n * the specified property. This is useful for browser environment interactions that need\n * to access document properties.\n *\n * @param {string} key - The name of the property to retrieve from the document object\n * @return {any} The value of the specified property, or undefined if the document or property doesn't exist\n *\n * @function getOnWindowDocument\n * @memberOf module:for-angular\n */\nexport function getOnWindowDocument(key: string): Document | undefined {\n  const doc = getWindowDocument() as Document;\n  return doc instanceof Document ? (doc as KeyValue)?.[key] || undefined : undefined;\n}\n\n/**\n * @description Retrieves the document object from the window\n * @summary This function provides a safe way to access the document object from the window.\n * It uses the getOnWindow function to retrieve the 'document' property from the window object.\n * This is useful for browser environment interactions that need access to the document.\n *\n * @return {Document | undefined} The window's document object, or undefined if it doesn't exist\n *\n * @function getWindowDocument\n * @memberOf module:for-angular\n */\nexport function getWindowDocument(): Document | undefined {\n  return getOnWindow('document') as Document;\n}\n\n/**\n * @description Retrieves a property from the window object\n * @summary This function provides a safe way to access properties on the window object.\n * It uses the getWindow function to get a reference to the window, then accesses\n * the specified property. This is useful for browser environment interactions that need\n * to access window properties or APIs.\n *\n * @param {string} key - The name of the property to retrieve from the window object\n * @return {unknown | undefined} The value of the specified property, or undefined if the window or property doesn't exist\n *\n * @function getOnWindow\n * @memberOf module:for-angular\n */\nexport function getOnWindow(key: string): unknown | undefined {\n  return getWindow()?.[key];\n}\n\n/**\n * @description Sets a property on the window object\n * @summary This function provides a way to set properties on the window object.\n * It uses the getWindow function to get a reference to the window, then sets\n * the specified property to the provided value. This is useful for storing\n * global data or functions that need to be accessible across the application.\n *\n * @param {string} key - The name of the property to set on the window object\n * @param {any} value - The value to assign to the property\n * @return {void}\n *\n * @function setOnWindow\n * @memberOf module:for-angular\n */\nexport function setOnWindow(key: string, value: unknown): void {\n  getWindow()[key] = value;\n}\n\n/**\n * @description Retrieves the global window object\n * @summary This function provides a safe way to access the global window object.\n * It uses globalThis to ensure compatibility across different JavaScript environments.\n * This is the core function used by other window-related utility functions to\n * access the window object.\n *\n * @return {Window} The global window object\n *\n * @function getWindow\n * @memberOf module:for-angular\n */\nexport function getWindow(): Window & KeyValue {\n  return (globalThis as KeyValue)?.['window'] as Window & KeyValue;\n}\n\n/**\n * @description Retrieves the width of the browser window\n * @summary This function provides a convenient way to get the current width of the browser window.\n * It uses the getOnWindow function to access the 'innerWidth' property of the window object.\n * This is useful for responsive design implementations and viewport-based calculations.\n *\n * @return {number | undefined} The current width of the browser window in pixels\n *\n * @function getWindowWidth\n * @memberOf module:for-angular\n */\nexport function getWindowWidth(): number {\n  return (getOnWindow('innerWidth') as number) || 0;\n}\n\n/**\n * @description Checks if a value is  not undefined\n * @summary This utility function determines whether a given value is not undefined.\n * It's a simple wrapper that makes code more readable when checking for defined values.\n * The function is particularly useful for checking StringOrBoolean properties that might be undefined.\n *\n * @param {StringOrBoolean | undefined} prop - The property to check\n * @return {boolean} True if the property is not undefined, false otherwise\n *\n * @function isNotUndefined\n * @memberOf module:for-angular\n */\nexport function isNotUndefined(prop: StringOrBoolean | undefined): boolean {\n  return (prop !== undefined) as boolean;\n}\n\n/**\n * @description Generates a locale string from a class name or instance\n * @summary This utility function converts a class name or instance into a locale string\n * that can be used for internationalization purposes. It handles different input types\n * (string, function, or object) and applies formatting rules to generate a consistent\n * locale identifier. For short names (less than 3 parts), it reverses the dot-separated\n * string. For longer names, it uses the last part as a prefix and joins the rest with\n * underscores.\n *\n * @param {string|FunctionLike|object} instance - The input to generate the locale from (class name, constructor, or instance)\n * @param {string} [suffix] - Optional string to append to the instance name before processing\n * @return {string} A formatted locale string derived from the input\n *\n * @function getLocaleFromClassName\n * @memberOf module:for-angular\n */\nexport function getLocaleFromClassName(instance: string | FunctionLike | KeyValue, suffix?: string): string {\n  if (typeof instance !== Primitives.STRING)\n    instance = (instance as FunctionLike).name || (instance as object)?.constructor?.name;\n\n  if (typeof instance === 'string' && instance.includes('.')) {\n    return instance;\n  }\n\n  let name: string | string[] = instance as string;\n\n  if (suffix) name = `${instance}${suffix.charAt(0).toUpperCase() + suffix.slice(1)}`;\n\n  name = name\n    .replace(/_|-/g, '')\n    .replace(/(?:^\\w|[A-Z]|\\b\\w)/g, (word: string, index: number) => {\n      if (index > 1) word = '.' + word;\n      return word.toLowerCase();\n    })\n    .split('.');\n\n  if (name.length < 3) return name.reverse().join('.');\n\n  const preffix = name[name.length - 1];\n  name.pop();\n  name = name.join('_');\n  return `${preffix}.${name}`;\n}\n\n/**\n * @description Retrieves the current locale language\n * @summary This utility function gets the current locale language based on the user's browser settings.\n * It provides a consistent way to access the user's language preference throughout the application.\n * The function returns the browser's navigator.language value, defaulting to 'en' if not available.\n *\n * @return {string} The current locale language (e.g., 'en', 'fr')\n *\n * @function getLocaleLanguage\n * @memberOf module:for-angular\n */\nexport function getLocaleLanguage(): string {\n  const win = getWindow();\n  return (win as Window).navigator.language || 'en';\n  // return win?.[WINDOW_KEYS.LANGUAGE_SELECTED] || (win.navigator.language || '').split('-')[0] || \"en\";\n}\n\n/**\n * @description Generates a random string or number of specified length\n * @summary This utility function creates a random string of a specified length.\n * It can generate either alphanumeric strings (including uppercase and lowercase letters)\n * or numeric-only strings. This is useful for creating random IDs, temporary passwords,\n * or other random identifiers throughout the application.\n *\n * @param {number} [length=8] - The length of the random value to generate\n * @param {boolean} [onlyNumbers=false] - Whether to generate only numeric characters\n * @return {string} A randomly generated string of the specified length and character set\n *\n * @function generateRandomValue\n * @memberOf module:for-angular\n */\nexport function generateRandomValue(length: number = 8, onlyNumbers: boolean = false): string {\n  const chars = onlyNumbers ? '0123456789' : 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n  let result = '';\n  for (let i = 0; i < length; i++) result += chars.charAt(Math.floor(Math.random() * chars.length));\n\n  return result;\n}\n\n/**\n * @description Converts a string representation of a boolean or a boolean value to a boolean type.\n * @summary This utility function handles conversion of string-based boolean values ('true', 'false')\n * to actual boolean types. It performs case-insensitive string comparison and returns the\n * corresponding boolean value. This is particularly useful when parsing configuration values,\n * URL parameters, or form inputs that may come as strings but need to be used as booleans.\n *\n * @param {'true' | 'false' | boolean} prop - The value to convert. Can be the string 'true', 'false', or a boolean\n * @returns {boolean} The boolean representation of the input value. Returns true if the input is the string 'true' or boolean true, false otherwise\n *\n * @function stringToBoolean\n * @memberOf module:lib/helpers/utils\n */\nexport function stringToBoolean(prop: 'true' | 'false' | boolean): boolean {\n  if (typeof prop === Primitives.STRING) {\n    prop = String(prop).toLowerCase() === 'true' ? true : false;\n  }\n  return prop as boolean;\n}\n\n/**\n * @description Checks if a value is a valid Date object.\n * @summary This validation function determines whether a given value represents a valid date.\n * It handles multiple input types including Date objects, timestamp numbers, and date strings.\n * For string inputs, it supports ISO 8601 format (YYYY-MM-DD) with or without time components.\n * The function performs comprehensive validation including regex pattern matching and Date\n * object creation to ensure the date is not only parseable but also represents a real date.\n *\n * @param {string | Date | number} date - The value to check. Can be a Date object, a timestamp number, or a date string\n * @returns {boolean} Returns true if the value is a valid Date object (not NaN), otherwise false\n *\n * @function isValidDate\n * @memberOf module:lib/helpers/utils\n */\nexport function isValidDate(date: string | Date | number): boolean {\n  try {\n    return (\n      (date instanceof Date && !isNaN(date as unknown as number)) ||\n      (() => {\n        const testRegex = new RegExp(/^\\d{4}-\\d{2}-\\d{2}$/).test(date as string);\n        if (typeof date !== Primitives.STRING || (!(date as string)?.includes('T') && !testRegex)) return false;\n\n        date = (date as string).split('T')[0];\n        if (!new RegExp(/^\\d{4}-\\d{2}-\\d{2}$/).test(date)) return false;\n\n        return !!new Date(date);\n      })()\n    );\n  } catch (error: unknown) {\n    getLogger(isValidDate).error(error as Error | string);\n    return false;\n  }\n}\n\n/**\n * @description Formats a date into a localized string representation.\n * @summary This function converts a date value into a formatted string according to a specified\n * or system locale. It accepts multiple input formats (Date objects, timestamps, or date strings)\n * and returns a consistently formatted date string in DD/MM/YYYY format. If the input date is\n * invalid, the function returns the original input as a string. The function automatically\n * uses the system locale if none is provided and handles string format conversions by replacing\n * forward slashes with hyphens for proper Date parsing.\n *\n * @param {string | Date | number} date - The date to format. Can be a Date object, a timestamp number, or a date string\n * @param {string} [locale] - The locale to use for formatting. If not provided, the system's locale will be used\n * @returns {Date | string} A formatted date string in the format DD/MM/YYYY according to the specified locale,\n *                          or the original input as a string if the date is invalid\n *\n * @function formatDate\n * @memberOf module:lib/helpers/utils\n */\nexport function formatDate(date: string | Date | number, locale?: string | undefined): Date | string {\n  if (!locale) locale = getLocaleLanguage();\n\n  if (typeof date === Primitives.STRING || typeof date === 'number') {\n    date = new Date(typeof date === Primitives.STRING ? `${date}`.replace(/\\//g, '-') : date);\n  }\n\n  return !isValidDate(date)\n    ? `${date}`\n    : date.toLocaleString(locale, {\n        year: 'numeric',\n        day: '2-digit',\n        month: '2-digit',\n      });\n}\n\n/**\n/**\n * @description Maps an item object using a provided mapper object and optional additional properties.\n * @summary This function transforms a source object into a new object based on mapping rules defined\n * in the mapper parameter. It supports dot notation for nested property access (e.g., 'user.name.first')\n * and handles various data types including strings and complex objects. For date values, it automatically\n * formats them using the formatDate function. The function also allows merging additional properties\n * into the result. When a mapped value is null or undefined, it uses the original mapper value as\n * a fallback.\n *\n * @param {KeyValue} item - The source object to be mapped\n * @param {KeyValue} mapper - An object that defines the mapping rules. Keys represent the new property names,\n *                            and values represent the path to the corresponding values in the source object\n * @param {KeyValue} [props] - Optional additional properties to be included in the mapped object\n * @returns {KeyValue} A new object with properties mapped according to the mapper object and including any additional properties\n *\n * @function itemMapper\n * @memberOf module:lib/helpers/utils\n */\nexport function itemMapper(item: KeyValue, mapper: KeyValue, props?: KeyValue): KeyValue {\n  return Object.entries(mapper).reduce((accum: KeyValue, [key, prop]) => {\n    const arrayValue = (prop || '').split('.');\n    let value = item?.[prop] || '';\n    if (!prop) {\n      accum[key] = prop;\n    } else {\n      if (arrayValue.length === 1) {\n        accum[key] = value;\n        // accum[key] = item?.[value as string] || (value !== key ? value : \"\");\n      } else {\n        for (const propValue of arrayValue)\n          value = !value ? item[propValue] : (typeof value === 'string' ? JSON.parse(value) : value)[propValue];\n\n        if (isValidDate(new Date(value))) value = `${formatDate(value)}`;\n\n        accum[key] = value === null || value === undefined ? prop : value;\n      }\n    }\n    return Object.assign({}, props || {}, accum);\n  }, {});\n}\n\n/**\n * @description Maps an array of data objects using a provided mapper object.\n * @summary This function transforms an array of objects by applying mapping rules to each item\n * using the itemMapper function. It processes each element in the data array and creates\n * new mapped objects based on the mapper configuration. The function includes validation\n * to ensure meaningful data: if a mapped item contains only null/undefined values, it\n * preserves the original item instead. This prevents data loss during transformation.\n * Returns an empty array if the input data is null, undefined, or empty.\n *\n * @template T - The type of the resulting mapped items\n * @param {T[]} data - The array of data objects to be mapped\n * @param {KeyValue} mapper - An object that defines the mapping rules\n * @param {KeyValue} [props] - Additional properties to be included in the mapped items\n * @returns {T[]} The array of mapped items. If an item in the original array does not have any non-null values after mapping,\n *                the original item is returned instead\n *\n * @function dataMapper\n * @memberOf module:lib/helpers/utils\n */\nexport function dataMapper<T>(data: T[], mapper: KeyValue, props?: KeyValue): T[] {\n  if (!data || !data.length) return [];\n  return data.reduce((accum: T[], curr) => {\n    const item = itemMapper(curr as KeyValue, mapper, props) as T;\n    const hasValues = [...new Set(Object.values(item as T[]))].filter((value) => value).length > 0;\n    accum.push(hasValues ? item : curr);\n    return accum;\n  }, []);\n}\n\n/**\n * @description Removes focus from the currently active DOM element\n * @summary This utility function blurs the currently focused element in the document,\n * effectively removing focus traps that might prevent proper navigation or keyboard\n * interaction. It safely accesses the document's activeElement and calls blur() if\n * an element is currently focused. This is useful for accessibility and user experience\n * improvements, particularly when closing modals or dialogs.\n *\n * @return {void}\n *\n * @function removeFocusTrap\n * @memberOf module:for-angular\n */\nexport function removeFocusTrap(): void {\n  const doc = getWindowDocument();\n  if (doc?.activeElement) (doc.activeElement as HTMLElement)?.blur();\n}\n\n/**\n * @description Cleans and normalizes whitespace in a string value\n * @summary This utility function trims leading and trailing whitespace from a string\n * and replaces multiple consecutive whitespace characters with a single space.\n * Optionally converts the result to lowercase for consistent text processing.\n * This is useful for normalizing user input, search terms, or data sanitization.\n *\n * @param {string} value - The string value to clean and normalize\n * @param {boolean} [lowercase=false] - Whether to convert the result to lowercase\n * @return {string} The cleaned and normalized string\n *\n * @function cleanSpaces\n * @memberOf module:for-angular\n */\nexport function cleanSpaces(value: string = '', lowercase: boolean = false): string {\n  value = `${value}`.trim().replace(/\\s+/g, ' ');\n  return lowercase ? value.toLowerCase() : value;\n}\n\n/**\n * @description Determines if the user's system is currently in dark mode\n * @summary This function checks the user's color scheme preference using the CSS media query\n * '(prefers-color-scheme: dark)'. It returns a boolean indicating whether the system is\n * currently set to dark mode. This is useful for implementing theme-aware functionality\n * and adjusting UI elements based on the user's preferred color scheme.\n *\n * @return {Promise<boolean>} True if the system is in dark mode, false otherwise\n *\n * @function isDarkMode\n * @memberOf module:for-angular\n */\nexport async function isDarkMode(): Promise<boolean> {\n  const { matches } = getWindow().matchMedia('(prefers-color-scheme: dark)');\n  return matches;\n}\n\n/**\n * @description Filters out strings containing or not containing a specific substring from an array or space-separated string.\n * @summary This function removes or retains strings based on whether they include the specified substring.\n * If the input is a single string, it is split into an array using spaces as delimiters before filtering.\n *\n * @param {string | string[]} original - The input string or array of strings to filter.\n * @param {string} value - The substring to filter by.\n * @param {boolean} [contain=true] - Determines the filtering behavior. If true, retains strings containing the substring; otherwise, removes them.\n * @returns {string} A string that contains or excludes the specified substring based on the `contain` parameter.\n *\n * @function filterString\n * @memberOf module:lib/helpers/utils\n */\nexport function filterString(original: string | string[], value: string, contain: boolean = true): string {\n  if (typeof original === Primitives.STRING) original = (original as string).split(' ');\n  return ((original as string[]).filter((str) => (contain ? str.includes(value) : !str.includes(value))) || []).join(\n    ' '\n  );\n}\n\n/**\n * @summary Retrieves the icon associated with a menu item based on its label.\n *\n * @param {string} label - The label of the menu item to search for. The search is case-insensitive.\n * @param {IMenuItem[]} menu - An array of menu items to search within.\n * @returns {string} The icon associated with the menu item if found, otherwise an empty string.\n */\nexport function getMenuIcon(label: string, menu: IMenuItem[]): string {\n  const item = menu.find((m) => m.label?.toLowerCase() === label.toLowerCase());\n  return item?.icon || '';\n}\n\nexport function dateFromString(value: string | Date): Date {\n  if (value instanceof Date) {\n    return value;\n  }\n  const dateArray = value.includes('T') ? value.split('T') : value.split(' ');\n  return new Date(dateArray.length === 1 ? `${value}T00:00:00` : value);\n}\n\nexport function isValidBase64(value: string): boolean {\n  if (!value?.trim()?.length) {\n    return false;\n  }\n  const pure = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;\n  const dataUrl = /^data:([a-zA-Z0-9.+-]+\\/[a-zA-Z0-9.+-]+);base64,[A-Za-z0-9+/]+={0,2}$/;\n  return pure.test(value) || dataUrl.test(value);\n}\n\nexport function stripHTML(content: string): unknown {\n  if (typeof content === Primitives.STRING) {\n    return content.replace(/<[^>]*>/g, '');\n  }\n  return content;\n}\n","import { EnvironmentProviders, provideEnvironmentInitializer, Provider } from '@angular/core';\nimport { Repository } from '@decaf-ts/core';\nimport { Constructor, Metadata, uses } from '@decaf-ts/decoration';\nimport { Model, Primitives } from '@decaf-ts/decorator-validation';\nimport { Logger, Logging } from '@decaf-ts/logging';\nimport { AnimationController, provideIonicAngular } from '@ionic/angular/standalone';\nimport { NgxRenderingEngine } from '../engine/NgxRenderingEngine';\nimport { getOnWindow, getWindow, getWindowDocument, setOnWindow } from '../utils/helpers';\nimport { NgxComponentDirective } from './NgxComponentDirective';\nimport { AngularEngineKeys, DB_ADAPTER_FLAVOUR_TOKEN, DB_ADAPTER_PROVIDER_TOKEN } from './constants';\nimport { IRepositoryModelProps } from './interfaces';\nimport { DecafRepository, FunctionLike, KeyValue } from './types';\n\nexport function getDbAdapterFlavour(): string {\n  return (getOnWindow(DB_ADAPTER_FLAVOUR_TOKEN) || '') as string;\n}\n\n/**\n * @description Provides an array of component types for dynamic rendering.\n * @summary Helper function to package component constructors for registration with the\n * rendering engine. This function accepts component classes and returns them as an array\n * suitable for use with the CPTKN injection token.\n * @param {...Constructor[]} components - Component constructor classes to register\n * @return {Constructor} Array of component constructors\n * @memberOf module:lib/for-angular-common.module\n * @example\n * // Register multiple custom components\n * providers: [\n *   { provide: CPTKN, useValue: provideDynamicComponents(MyComponent, AnotherComponent) }\n * ]\n */\nexport function provideDecafDynamicComponents(...components: unknown[]): Constructor<unknown>[] {\n  try {\n    const win = getWindow();\n    if (!win?.[AngularEngineKeys.LOADED]) new NgxRenderingEngine();\n    setOnWindow(AngularEngineKeys.LOADED, true);\n  } catch (e: unknown) {\n    throw new Error(`Failed to load rendering engine: ${e}`);\n  }\n  return components as Constructor<unknown>[];\n}\n\n/**\n * @description Retrieves the repository instance for a given model.\n * @summary Creates or retrieves a DecafRepository instance for the specified model. This function\n * resolves the model by name or class, locates the registered database adapter, and returns\n * a fully initialized repository instance for performing CRUD operations.\n * @param {Model | string} model - The model class or model name string\n * @return {DecafRepository<Model>} Repository instance for the model\n * @throws {InternalError} If model is not found or not registered with @model decorator\n * @memberOf module:lib/for-angular-common.module\n * @example\n * // Get repository by model class\n * const userRepo = getModelAndRepository(User);\n *\n * // Get repository by model name\n * const productRepo = getModelAndRepository('Product');\n *\n * // Use repository for queries\n * const users = await userRepo.findAll();\n */\nexport function getModelAndRepository<M extends Model>(\n  model: M | string,\n  clazz?: NgxComponentDirective\n): IRepositoryModelProps<Model> | undefined {\n  if (!model) return undefined;\n  try {\n    const modelName = (typeof model === Primitives.STRING ? model : (model as Model).constructor.name) as string;\n    const constructor = Model.get((modelName.charAt(0).toUpperCase() + modelName.slice(1)) as string);\n    if (!constructor) return undefined;\n    const dbAdapterFlavour = getOnWindow(DB_ADAPTER_FLAVOUR_TOKEN) || undefined;\n    if (dbAdapterFlavour) {\n      uses(dbAdapterFlavour as string)(constructor);\n    }\n    const repository = Repository.forModel(\n      constructor,\n      typeof dbAdapterFlavour === Primitives.STRING ? String(dbAdapterFlavour) : undefined\n    );\n    model = new constructor() as M;\n    const pk = Model.pk(repository.class as Constructor<Model>);\n    if (!pk) return undefined;\n    const pkType = Metadata.type(repository.class, pk).name;\n    if (clazz) {\n      clazz.repository = repository as DecafRepository<Model>;\n      clazz.model = model;\n      clazz.pk = pk;\n      clazz.pkType = Metadata.type(repository.class, pk).name;\n    }\n    return { repository, model, pk, pkType };\n  } catch (error: unknown) {\n    getLogger(getModelAndRepository).warn((error as Error)?.message || (error as string));\n    return undefined;\n  }\n}\n\n/**\n * @description Provides a database adapter for dependency injection.\n * @summary Creates an Angular provider that registers a database adapter instance. This function\n * instantiates the adapter class, registers its flavour globally, and returns a provider object\n * for use in Angular's dependency injection system.\n * @template DbAdapter - The database adapter class type extending {flavour: string}\n * @param {Constructor<DbAdapter>} adapterClass - Database adapter constructor class\n * @param {KeyValue} [options={}] - Configuration options passed to adapter constructor\n * @param {string} [flavour] - Optional flavour override; uses adapter.flavour if not provided\n * @return {Provider} Angular provider object for DB_ADAPTER_PROVIDER_TOKEN\n * @memberOf module:lib/for-angular-common.module\n * @example\n * // Register a SQLite adapter\n * providers: [\n *   provideDbAdapter(SqliteAdapter, { database: 'myapp.db' }, 'sqlite')\n * ]\n *\n * // Register with default flavour from adapter\n * providers: [\n *   provideDbAdapter(PostgresAdapter, { host: 'localhost', port: 5432 })\n * ]\n */\nexport function provideDecafDbAdapter<DbAdapter extends { flavour: string }>(\n  clazz: Constructor<DbAdapter>,\n  options: KeyValue = {},\n  flavour?: string\n): Provider {\n  const adapter = new clazz(options);\n  if (!flavour) flavour = adapter.flavour;\n  getLogger(provideDecafDbAdapter).info(`Using ${adapter.constructor.name} ${flavour} as Db Provider`);\n  setOnWindow(DB_ADAPTER_FLAVOUR_TOKEN, flavour);\n  return {\n    provide: DB_ADAPTER_PROVIDER_TOKEN,\n    useValue: adapter,\n  };\n}\n\n/**\n * Creates a custom page transition animation using the Ionic `AnimationController`.\n *\n * @param baseEl - The base HTML element for the animation.\n * @param opts - Optional parameters for the animation, including:\n *   - `enteringEl`: The HTML element that is entering the view.\n *   - `leavingEl`: The HTML element that is leaving the view.\n *\n * @returns An object containing the `navAnimation`, which is a composed animation\n *          of the entering and leaving animations.\n *\n * The entering animation fades in and slides the element upwards, while the leaving\n * animation fades out and slides the element downwards. Both animations use a cubic-bezier\n * easing function for smooth transitions.\n */\nexport const decafPageTransition = (baseEl: HTMLElement, opts?: KeyValue) => {\n  const animationCtrl = new AnimationController();\n\n  const enteringAnimation = animationCtrl\n    .create()\n    .addElement(opts?.['enteringEl'])\n    .duration(280)\n    .easing('cubic-bezier(0.36,0.66,0.04,1)')\n    .fromTo('opacity', '0.01', '1')\n    .fromTo('transform', 'translateY(40px)', 'translateY(0)');\n\n  const leavingAnimation = animationCtrl\n    .create()\n    .addElement(opts?.['leavingEl'])\n    .duration(200)\n    .easing('cubic-bezier(0.36,0.66,0.04,1)')\n    .fromTo('opacity', '1', '0')\n    .fromTo('transform', 'translateY(0)', 'translateY(20px)');\n\n  return animationCtrl.create().addAnimation([enteringAnimation, leavingAnimation]);\n};\n\nexport function provideDecafPageTransition(): EnvironmentProviders {\n  return provideIonicAngular({\n    navAnimation: decafPageTransition,\n  });\n}\n\nexport function provideDecafDarkMode(): EnvironmentProviders {\n  return provideEnvironmentInitializer(() => {\n    const doc = getWindowDocument();\n    doc?.documentElement.classList.add('has-dark-mode');\n  });\n}\n\n/**\n * @const {Logger}\n * @private\n * @description Base logger instance for the for-angular module.ẑ\n * @memberOf module:lib/for-angular-common.module\n */\nconst log = Logging.for('for-angular');\n\n/**\n * @description Retrieves a logger instance for the given context.\n * @summary Creates or retrieves a namespaced logger instance using the Decaf logging system.\n * The logger is automatically namespaced under \"for-angular\" and can be further scoped\n * to a specific instance, function, or string identifier.\n * @param {string | FunctionLike | unknown} instance - The instance, function, or string to scope the logger to\n * @return {Logger} Logger instance for the specified context\n * @memberOf module:lib/for-angular-common.module\n * @example\n * // Get logger for a class\n * const logger = getLogger(MyComponent);\n * logger.info('Component initialized');\n *\n * // Get logger with string identifier\n * const serviceLogger = getLogger('UserService');\n * serviceLogger.error('Operation failed', error);\n */\nexport function getLogger(instance: string | FunctionLike | unknown): Logger {\n  return log.for(instance as string | FunctionLike);\n}\n","/**\n * @module module:lib/engine/ValidatorFactory\n * @description Factory for generating Angular ValidatorFn from Decaf validation metadata.\n * @summary ValidatorFactory maps validation keys defined by the Decaf validation system\n * into Angular ValidatorFn instances. It supports type-based resolution and comparison\n * validators and provides helpers to create proxies for nested control validation.\n *\n * @link {@link ValidatorFactory}\n */\nimport { AbstractControl, FormControl, FormGroup, ValidationErrors, ValidatorFn } from '@angular/forms';\nimport {\n  ComparisonValidationKeys,\n  PathProxy,\n  PathProxyEngine,\n  Primitives,\n  Validation,\n  ValidationKeys,\n  Validator,\n} from '@decaf-ts/decorator-validation';\nimport { FieldProperties, HTML5InputTypes, parseValueByType, UIKeys } from '@decaf-ts/ui-decorators';\nimport { patternValidators } from './constants';\nimport { getLogger } from './helpers';\nimport { NgxRenderingEngine } from './NgxRenderingEngine';\nimport { ComparisonValidationKey, FunctionLike, KeyValue } from './types';\n\nexport class ValidatorFactory {\n  /**\n   * @summary Extracts and parses the value from an Angular control.\n   * @description Retrieves the control's value and converts it to the appropriate type based on field properties.\n   * Handles undefined values gracefully by returning undefined without parsing.\n   *\n   * @param {AbstractControl} control - The Angular form control to extract the value from.\n   * @param {string} fieldType - The declared type of the field.\n   * @param {FieldProperties} fieldProps - The field properties containing type conversion metadata.\n   * @returns {unknown} The parsed value or undefined if the control value is undefined.\n   */\n  static getFieldValue(control: AbstractControl, fieldType: string, fieldProps: FieldProperties): unknown {\n    return typeof control.value !== 'undefined' ? parseValueByType(fieldType, control.value, fieldProps) : undefined;\n  }\n  /**\n   * @summary Resolves the effective field type from multiple possible type sources.\n   * @description Determines the field's type by checking customTypes, subType, or type in order of priority.\n   * For checkbox and array fields with options, converts the type to STRING for proper validation.\n   *\n   * @param {string} [type] - The primary field type.\n   * @param {string | string[]} [customTypes] - Custom type definition with highest priority.\n   * @param {unknown[]} [options] - Available options for the field (affects checkbox/array handling).\n   * @param {string} [subType] - Secondary type definition.\n   * @returns {string} The resolved field type.\n   */\n  static getFieldType(\n    type?: string,\n    customTypes?: string | string[],\n    options?: unknown[] | FunctionLike,\n    subType?: string\n  ): string {\n    const fieldType = (customTypes || subType || type) as string;\n\n    if (fieldType === HTML5InputTypes.CHECKBOX || fieldType === Array.name) {\n      if (Array.isArray(options) || typeof options === 'function') {\n        return Primitives.STRING;\n      }\n    }\n    return fieldType;\n  }\n\n  /**\n   * @summary Creates a ValidatorFn for a specific validation key.\n   * @description Generates an Angular ValidatorFn that applies Decaf validation logic to a form control.\n   * Resolves the appropriate validator based on field type, parses the control value, constructs validation properties,\n   * and handles comparison validators through proxy access to parent/child form values.\n   *\n   * @param {FieldProperties} fieldProps - The field properties containing type and validation metadata.\n   * @param {string} key - The validation key to create a validator for.\n   * @returns {ValidatorFn} A validator function that returns ValidationErrors or null.\n   * @throws {Error} If the validation key is not supported.\n   */\n  static spawn(fieldProps: FieldProperties, key: string): ValidatorFn {\n    if (!Validation.keys().includes(key)) {\n      throw new Error('Unsupported custom validation');\n    }\n    const validatorFn: ValidatorFn = (control: AbstractControl): ValidationErrors | null => {\n      const { type, customTypes, options, subType } = fieldProps || {};\n      const fieldType = ValidatorFactory.getFieldType(type, customTypes, options, subType);\n      const customValidator = key === UIKeys.TYPE && subType;\n      const { validatorKey, props } = this.resolveValidatorKeyProps(\n        key,\n        fieldType,\n        fieldProps,\n        customValidator ? (subType as string) : undefined\n      );\n      const validator = Validation.get(validatorKey) as Validator;\n      // parseValueByType does not support undefined values\n      const value = ValidatorFactory.getFieldValue(control, fieldType, fieldProps);\n      // Create a proxy to enable access to parent and child values\n      const proxy = ValidatorFactory.getValidatorProxy(control, key as ComparisonValidationKey);\n      let errs: string | undefined;\n      try {\n        const validationMessage = fieldProps?.validationMessage;\n        if (validationMessage && customValidator) {\n          Object.assign(props, { message: validationMessage });\n        }\n        errs = validator.hasErrors(value, props, proxy);\n      } catch (e: unknown) {\n        errs = `${key} validator failed to validate: ${e}`;\n        getLogger(ValidatorFactory).error(errs);\n      }\n      return errs ? { [validatorKey]: props?.['message'] ? errs : true } : null;\n    };\n\n    Object.defineProperty(validatorFn, 'name', {\n      value: `${key}Validator`,\n    });\n\n    return validatorFn;\n  }\n\n  /**\n   * Retrieves the validator value from field properties, with special handling for checkbox types.\n   * Returns the field property value, or the type if the field is a checkbox and the types differ.\n   *\n   * @param key - The validation key.\n   * @param type - The field's type.\n   * @param fieldProps - The field properties object.\n   * @returns The validator value to use.\n   */\n  static getValidatorValue(key: string, type: string, fieldProps: FieldProperties): unknown {\n    return key === ValidationKeys.TYPE && HTML5InputTypes.CHECKBOX && fieldProps[key as keyof FieldProperties] !== type\n      ? type\n      : fieldProps[key as keyof FieldProperties];\n  }\n\n  /**\n   * Determines whether a validation should be resolved based on the field's type.\n   * Returns true for TYPE validations with custom types or pattern-based validators.\n   *\n   * @param key - The validation key to evaluate.\n   * @param type - The field's declared type.\n   * @param customTypes - Optional custom type definition.\n   * @returns True if validation should use type-based resolution.\n   */\n  static isTypeBasedValidation(key: string, type: string, customTypes: string | undefined): boolean {\n    return (\n      key === ValidationKeys.TYPE &&\n      ((typeof customTypes === Primitives.STRING && HTML5InputTypes.TEXT !== customTypes) ||\n        Object.keys(patternValidators).includes(type))\n    );\n  }\n\n  /**\n   * @summary Creates or retrieves a proxy for validator access to parent/child form values.\n   * @description Returns a PathProxy configured for the given validation key.\n   * For comparison validators, creates a proxy rooted at the parent FormGroup to enable cross-field validation.\n   * For other validators, returns an empty proxy for type safety.\n   *\n   * @param {AbstractControl | FormGroup} control - The form control to create a proxy for.\n   * @param {ComparisonValidationKey} key - The validation key determining proxy scope.\n   * @returns {PathProxy<unknown>} A proxy object for form value access.\n   */\n  static getValidatorProxy(control: AbstractControl | FormGroup, key: ComparisonValidationKey): PathProxy<unknown> {\n    const proxy = ValidatorFactory.createProxy({} as AbstractControl);\n    if (Object.values(ComparisonValidationKeys).includes(key)) {\n      return ValidatorFactory.createProxy((control instanceof FormGroup ? control : control.parent) as FormGroup);\n    }\n    return proxy;\n  }\n\n  /**\n   * @summary Creates a proxy wrapper for an Angular AbstractControl to assist with custom validation logic.\n   * @description Returns a structured proxy object that simulates a hierarchical tree of form values.\n   * Enables Validators handling method to access parent and child properties using consistent dot-notation in Angular forms.\n   *\n   * @param {AbstractControl} control - The control to wrap in a proxy.\n   * @returns {PathProxy<unknown>} A proxy object exposing form values and enabling recursive parent access.\n   */\n  static createProxy(control: AbstractControl | FormGroup): PathProxy<unknown> {\n    return PathProxyEngine.create(control, {\n      getValue(target: AbstractControl, prop: string): unknown {\n        if (target instanceof FormControl) return target.value;\n\n        if (target instanceof FormGroup) {\n          const control = target.controls[prop];\n          return control instanceof FormControl ? control.value : control;\n        }\n\n        // const value = target[prop];\n        // if (value instanceof FormControl)\n        //   return value.value;\n        //\n        // if (value instanceof FormGroup) {\n        //   const control = value.controls[prop];\n        //   return control instanceof FormControl ? control.value : control;\n        // }\n\n        return (target as KeyValue)?.[prop];\n      },\n      getParent: function (target: AbstractControl) {\n        return target?.['_parent'];\n      },\n      ignoreUndefined: true,\n      ignoreNull: true,\n    });\n  }\n\n  /**\n   *\n   * Resolves the correct validator key and its associated properties based on the input key and type.\n   *\n   * When the validation key is TYPE, it's necessary to resolve the actual validator based on the\n   * field's type (e.g., 'password', 'email', 'url') instead of using the generic getValidator(\"type\") logic.\n   * This allows directly invoking specific validators like getValidator('password'), ensuring the correct\n   * behavior for type-based validation.\n   *\n   * @param key - The validation key (e.g., 'type', 'required', etc.).\n   * @param value - The value that needs be provided to the validator.\n   * @param type - The field's declared type.\n   * @returns An object containing the resolved validator key and its corresponding props.\n   */\n  static resolveValidatorKeyProps = (\n    key: string,\n    type: string,\n    fieldProps: FieldProperties,\n    customTypes: string | undefined = undefined\n  ): { validatorKey: string; props: KeyValue } => {\n    const isTypeBased = this.isTypeBasedValidation(key, type, customTypes);\n    const validatorKey = isTypeBased ? type : key;\n    const value = this.getValidatorValue(key, type, fieldProps);\n    const props = this.getValidatorProps(validatorKey, type, isTypeBased, value);\n    return { validatorKey, props };\n  };\n\n  /**\n   * Constructs the properties object to be passed to a validator.\n   * Handles translation of string values and applies pattern validators for type-based validations.\n   *\n   * @param validatorKey - The resolved validator key.\n   * @param type - The field's type.\n   * @param isTypeBased - Whether this is a type-based validation.\n   * @param value - The value to validate.\n   * @returns An object containing validator properties.\n   */\n  static getValidatorProps(validatorKey: string, type: string, isTypeBased: boolean, value: unknown): KeyValue {\n    return {\n      [validatorKey]:\n        !isTypeBased && validatorKey === ValidationKeys.TYPE\n          ? NgxRenderingEngine.get().translate(value as string, false)\n          : value,\n      // Email, Password, and URL are validated using the \"pattern\" key\n      ...(isTypeBased && { [ValidationKeys.PATTERN]: patternValidators[type] }),\n    };\n  }\n}\n","/**\n * @module lib/engine/NgxFormService\n * @description Utilities to create and manage Angular forms in Decaf components.\n * @summary The NgxFormService exposes helpers to build FormGroup/FormArray instances\n * from component metadata or UI model definitions, register forms in a registry,\n * validate and extract form data, and create controls with appropriate validators.\n */\nimport { AbstractControl, FormArray, FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms';\nimport { OperationKeys } from '@decaf-ts/db-decorators';\nimport { isValidDate, ModelKeys, parseDate, Primitives, Validation } from '@decaf-ts/decorator-validation';\nimport {\n  escapeHtml,\n  FieldProperties,\n  HTML5CheckTypes,\n  HTML5InputTypes,\n  IPagedComponentProperties,\n  parseToNumber,\n  UIModelMetadata,\n} from '@decaf-ts/ui-decorators';\nimport { BaseComponentProps } from '../engine/constants';\nimport { IComponentConfig, IFormComponentProperties } from '../engine/interfaces';\nimport { FieldUpdateMode, FormParent, FormParentGroup, KeyValue } from '../engine/types';\nimport { ValidatorFactory } from '../engine/ValidatorFactory';\nimport { cleanSpaces, dateFromString } from '../utils/helpers';\n\n/**\n * @description Service for managing Angular forms and form controls.\n * @summary The NgxFormService provides utility methods for creating, managing, and validating Angular forms and form controls. It includes functionality for registering forms, adding controls, validating fields, and handling form data.\n *\n * @class\n * @param {WeakMap<AbstractControl, FieldProperties>} controls - A WeakMap to store control properties.\n * @param {Map<string, FormGroup>} formRegistry - A Map to store registered forms.\n *\n * @example\n * // Creating a form from components\n * const components = [\n *   { inputs: { name: 'username', type: 'text', required: true } },\n *   { inputs: { name: 'password', type: 'password', minLength: 8 } }\n * ];\n * const form = NgxFormService.createFormFromComponents('loginForm', components, true);\n *\n * // Validating fields\n * NgxFormService.validateFields(form);\n *\n * // Getting form data\n * const formData = NgxFormService.getFormData(form);\n * @mermaid\n * sequenceDiagram\n *   participant C as Component\n *   participant NFS as NgxFormService\n *   participant AF as Angular Forms\n *   C->>NFS: createFormFromComponents()\n *   NFS->>AF: new FormGroup()\n *   NFS->>NFS: addFormControl()\n *   NFS->>AF: addControl()\n *   NFS-->>C: Return FormGroup\n *   C->>NFS: validateFields()\n *   NFS->>AF: markAsTouched(), markAsDirty(), updateValueAndValidity()\n *   C->>NFS: getFormData()\n *   NFS->>AF: Get control values\n *   NFS-->>C: Return form data\n */\nexport class NgxFormService {\n  /**\n   * @description WeakMap that stores control properties for form controls.\n   * @summary A WeakMap that associates AbstractControl instances with their corresponding FieldProperties.\n   * This allows the service to track metadata for form controls without creating memory leaks.\n   * @type {WeakMap<AbstractControl, FieldProperties>}\n   * @private\n   * @static\n   */\n  private static controls: WeakMap<AbstractControl, FieldProperties> = new WeakMap<AbstractControl, FieldProperties>();\n\n  /**\n   * @description Registry of form groups indexed by their unique identifiers.\n   * @summary A Map that stores FormGroup instances with their unique string identifiers.\n   * This allows global access to registered forms throughout the application.\n   * @type {Map<string, FormGroup>}\n   * @private\n   * @static\n   */\n  private static formRegistry: Map<string, FormParent> = new Map<string, FormParent>();\n\n  /**\n   * @description Creates a new form group or form array with the specified identifier.\n   * @summary Generates a FormGroup or FormArray based on the provided parameters. If formArray is true,\n   * creates a FormArray; otherwise creates a FormGroup. The form can optionally be registered in the\n   * global form registry for later access throughout the application. If a form with the given id\n   * already exists in the registry, it returns the existing form.\n   * @param {string} id - Unique identifier for the form\n   * @param {boolean} [formArray=false] - Whether to create a FormArray instead of a FormGroup\n   * @param {boolean} [registry=true] - Whether to register the form in the global registry\n   * @return {FormGroup | FormArray} The created or existing form instance\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as Component\n   *   participant NFS as NgxFormService\n   *   participant FR as Form Registry\n   *   participant AF as Angular Forms\n   *   C->>NFS: createForm(id, formArray, registry)\n   *   NFS->>FR: Check if form exists\n   *   alt Form exists\n   *     FR-->>NFS: Return existing form\n   *   else Form doesn't exist\n   *     alt formArray is true\n   *       NFS->>AF: new FormArray([])\n   *     else\n   *       NFS->>AF: new FormGroup({})\n   *     end\n   *     alt registry is true\n   *       NFS->>FR: addRegistry(id, form)\n   *     end\n   *   end\n   *   NFS-->>C: Return FormGroup | FormArray\n   * @static\n   */\n  static createForm(id: string, formArray = false, registry: boolean = true): FormGroup | FormArray {\n    const form = this.formRegistry.get(id) ?? (formArray ? new FormArray([]) : new FormGroup({}));\n    if (!this.formRegistry.has(id) && registry) this.addRegistry(id, form as FormArray | FormGroup);\n    return form as FormArray | FormGroup;\n  }\n\n  /**\n   * @description Adds a form to the registry.\n   * @summary Registers a FormGroup or FormArray with a unique identifier for global access throughout\n   * the application. This allows forms to be retrieved and managed centrally. Throws an error if\n   * the identifier is already in use to prevent conflicts.\n   * @param {string} formId - The unique identifier for the form\n   * @param {FormParent} formGroup - The FormGroup or FormArray to be registered\n   * @return {void}\n   * @throws {Error} If a FormGroup with the given id is already registered\n   * @static\n   */\n  static addRegistry(formId: string, formGroup: FormParent): void {\n    if (this.formRegistry.has(formId)) throw new Error(`A FormGroup with id '${formId}' is already registered.`);\n    this.formRegistry.set(formId, formGroup);\n  }\n\n  /**\n   * @description Retrieves a form from the registry by its identifier.\n   * @summary Gets a FormGroup or FormArray from the registry using its unique identifier.\n   * Returns undefined if the form is not found in the registry. This method provides\n   * safe access to registered forms without throwing errors.\n   * @param {string} [id] - The unique identifier of the form to retrieve\n   * @return {FormParent | undefined} The FormGroup or FormArray if found, undefined otherwise\n   * @static\n   */\n  static getOnRegistry(id?: string): FormParent | undefined {\n    return this.formRegistry.get(id as string);\n  }\n\n  /**\n   * @description Removes a form from the registry.\n   * @summary Deletes a FormGroup or FormArray from the registry using its unique identifier.\n   * This cleans up the registry and allows the identifier to be reused. The form itself\n   * is not destroyed, only removed from the central registry.\n   * @param {string} formId - The unique identifier of the form to be removed\n   * @return {void}\n   * @static\n   */\n  static removeRegistry(formId: string): void {\n    this.formRegistry.delete(formId);\n  }\n\n  /**\n   * @description Resolves the parent group and control name from a path.\n   * @summary Traverses the form group structure to find the parent group and control name for a given path.\n   * Handles complex nested structures including arrays and sub-groups. Creates missing intermediate\n   * groups as needed and properly configures FormArray controls for multiple value scenarios.\n   * @param {FormGroup} formGroup - The root FormGroup to traverse\n   * @param {string} path - The dot-separated path to the control (e.g., 'user.address.street')\n   * @param {IFormComponentProperties} componentProps - Properties defining the component configuration\n   * @param {KeyValue} parentProps - Properties from the parent component for context\n   * @return {FormParentGroup} A tuple containing the parent FormGroup and the control name\n   * @private\n   * @mermaid\n   * sequenceDiagram\n   *   participant NFS as NgxFormService\n   *   participant FG as FormGroup\n   *   participant FA as FormArray\n   *   NFS->>NFS: Split path into parts\n   *   loop For each path part\n   *     alt Control doesn't exist\n   *       alt isMultiple and part is childOf\n   *         NFS->>FA: new FormArray([new FormGroup({})])\n   *       else\n   *         NFS->>FG: new FormGroup({})\n   *       end\n   *       NFS->>FG: addControl(part, newControl)\n   *     end\n   *     NFS->>NFS: Navigate to next level\n   *   end\n   *   NFS-->>NFS: Return [parentGroup, controlName]\n   * @static\n   */\n  private static resolveParentGroup(\n    formGroup: FormGroup,\n    path: string,\n    componentProps: IFormComponentProperties,\n    parentProps: Partial<IFormComponentProperties>\n  ): FormParentGroup {\n    const isMultiple = parentProps?.multiple || parentProps?.type === Array.name || false;\n    const parts = path.split('.');\n    const controlName = parts.pop() as string;\n\n    const { childOf } = componentProps;\n    let currentGroup = formGroup;\n    function setArrayComponentProps(formGroupArray: KeyValue) {\n      const props = formGroupArray?.[BaseComponentProps.FORM_GROUP_COMPONENT_PROPS] || {};\n      if (!props[ModelKeys.MODEL][controlName])\n        props[ModelKeys.MODEL] = Object.assign({}, props[ModelKeys.MODEL], {\n          [controlName]: { ...componentProps },\n        });\n    }\n\n    for (const part of parts) {\n      if (!currentGroup.get(part)) {\n        const partFormGroup =\n          isMultiple && (part === childOf || childOf?.endsWith(`${part}`))\n            ? new FormArray([new FormGroup({})])\n            : new FormGroup({});\n        const pk = componentProps?.pk || parentProps?.pk || '';\n        (partFormGroup as KeyValue)[BaseComponentProps.FORM_GROUP_COMPONENT_PROPS] = {\n          childOf: childOf || '',\n          isMultiple: isMultiple,\n          required: parentProps?.required ?? false,\n          name: part,\n          pk,\n          [ModelKeys.MODEL]: {},\n        } as Partial<FieldProperties> & { model: KeyValue };\n\n        if (currentGroup instanceof FormArray) {\n          (currentGroup as FormArray).push(partFormGroup);\n        } else {\n          for (const control of Object.values(partFormGroup.controls)) {\n            if (control instanceof FormControl) this.register(control as AbstractControl, componentProps);\n          }\n\n          if (partFormGroup instanceof AbstractControl) this.register(partFormGroup as AbstractControl, componentProps);\n          currentGroup.addControl(part, partFormGroup);\n        }\n      }\n      if (childOf && currentGroup instanceof FormArray) setArrayComponentProps(currentGroup);\n      currentGroup = currentGroup.get(part) as FormGroup;\n    }\n    return [currentGroup, controlName];\n  }\n\n  /**\n   * @description Retrieves component properties from a FormGroup or FormArray.\n   * @summary Extracts component properties stored in the form group metadata. If a FormGroup is provided\n   * and groupArrayName is specified, it will look for the FormArray within the form structure.\n   * @param {FormGroup | FormArray} formGroup - The form group or form array to extract properties from\n   * @param {string} [key] - Optional key to retrieve a specific property\n   * @param {string} [groupArrayName] - Optional name of the group array if formGroup is not a FormArray\n   * @return {Partial<FieldProperties>} The component properties or a specific property if key is provided\n   * @static\n   */\n  static getComponentPropsFromGroupArray(\n    formGroup: FormGroup | FormArray,\n    key?: string,\n    groupArrayName?: string | undefined\n  ): Partial<FieldProperties> {\n    if (!(formGroup instanceof FormArray) && typeof groupArrayName === Primitives.STRING)\n      formGroup = (formGroup.root.get(groupArrayName as string) as FormArray) || {};\n    const props = (formGroup as KeyValue)?.[BaseComponentProps.FORM_GROUP_COMPONENT_PROPS] || {};\n    return (!key ? props : props?.[key]) || {};\n  }\n\n  /**\n   * @description Adds a new group to a parent FormArray.\n   * @summary Creates and adds a new FormGroup to the specified parent FormArray based on the\n   * component properties stored in the parent's metadata. This is used for dynamic form arrays\n   * where new groups need to be added at runtime. Clones the control at the specified index\n   * to maintain the same structure and validators.\n   * @param {FormParent} parentForm - The FormArray or FormGroup containing the parent FormArray\n   * @param {number} [index] - The index position to clone from; defaults to last index if length > 0, otherwise 0\n   * @return {FormArray} The parent FormArray after adding the new group\n   * @static\n   */\n  static addGroupToParent(parentForm: FormParent, index?: number): FormArray {\n    if (parentForm instanceof FormGroup) parentForm = parentForm.parent as FormArray;\n    index = index || (parentForm.length === 0 ? 0 : parentForm.length - 1);\n    parentForm.push(this.cloneFormControl(parentForm.at(index)));\n    return parentForm;\n  }\n\n  /**\n   * @description Retrieves a FormGroup from a parent FormArray at the specified index.\n   * @summary Gets a FormGroup from the specified parent FormArray. If the group doesn't exist\n   * at the given index, it will create a new one using addGroupToParent.\n   * @param {FormParent} formGroup - The root form group containing the parent FormArray\n   * @param {string} parentName - The name of the parent FormArray to retrieve the group from\n   * @param {number} [index=1] - The index of the group to retrieve\n   * @return {FormGroup} The FormGroup at the specified index\n   * @static\n   */\n  static getGroupFromParent(formGroup: FormParent, parentName: string, index: number = 1): FormGroup {\n    const childGroup = ((formGroup.get(parentName) || formGroup) as FormArray).at(index);\n    if (childGroup instanceof FormGroup) return childGroup;\n    return this.addGroupToParent(formGroup, index).at(index) as FormGroup;\n  }\n\n  /**\n   * @description Clones a form control with its validators.\n   * @summary Creates a deep copy of a FormControl, FormGroup, or FormArray, preserving\n   * validators but resetting values and state. This is useful for creating new instances\n   * of form controls with the same validation rules, particularly in dynamic FormArrays\n   * where new groups need to be added with identical structure.\n   * @param {AbstractControl} control - The control to clone (FormControl, FormGroup, or FormArray)\n   * @return {AbstractControl} A new instance of the control with the same validators\n   * @throws {Error} If the control type is not supported\n   * @static\n   */\n  static cloneFormControl(control: AbstractControl): AbstractControl {\n    const syncValidators = (control.validator ? [control.validator] : []).filter((fn) => {\n      // if(lastIndex > 0)\n      //   if(fn !== Validators.required)\n      //     return fn;\n      return fn;\n    });\n    const asyncValidators = control.asyncValidator ?? null;\n    const validators = {\n      validators: syncValidators,\n      asyncValidators,\n    };\n    if (control instanceof FormControl) {\n      control = new FormControl('', validators);\n      // control.markAsPristine();\n      // control.markAsUntouched();\n      // control.setErrors(null);\n      // control.updateValueAndValidity();\n      return control;\n    }\n\n    if (control instanceof FormGroup) {\n      const groupControls: Record<string, AbstractControl> = {};\n      for (const key in control.controls) {\n        groupControls[key] = this.cloneFormControl(control.controls[key]);\n      }\n      return new FormGroup(groupControls, validators);\n    }\n\n    if (control instanceof FormArray) {\n      const arrayControls = control.controls.map((child) => this.cloneFormControl(child));\n      return new FormArray(arrayControls, validators);\n    }\n\n    throw new Error('Unsupported control type');\n  }\n\n  /**\n   * @description Checks if a value is unique within a FormArray group.\n   * @summary Validates that the primary key value in a FormGroup is unique among all groups\n   * in the parent FormArray. The uniqueness check behavior differs based on the operation type.\n   * For both CREATE and UPDATE operations, it checks that no other group in the array has the same\n   * primary key value.\n   * @param {FormGroup} formGroup - The FormGroup to check for uniqueness\n   * @param {OperationKeys} [operation=OperationKeys.CREATE] - The type of operation being performed\n   * @param {number} [index] - The index of the current group within the FormArray\n   * @return {boolean} True if the value is unique, false otherwise\n   * @static\n   */\n  static isUniqueOnGroup(\n    formGroup: FormGroup,\n    operation: OperationKeys = OperationKeys.CREATE,\n    index?: number\n  ): boolean {\n    const formArray = formGroup.parent as FormArray;\n    if (index === undefined || index === null) index = formArray.length - 1;\n    const pk = this.getComponentPropsFromGroupArray(formArray, BaseComponentProps.PK as string) as string;\n    const controlName = Object.keys(formGroup.controls)[0];\n\n    if (controlName !== pk || !pk) return true;\n    const controlValue = cleanSpaces(`${formGroup.get(pk)?.value}`, true);\n    if (operation === OperationKeys.CREATE) {\n      return !formArray.controls.some((group, i) => {\n        const value = cleanSpaces(`${group.get(pk)?.value}`, true);\n        return i !== index && value === controlValue;\n      });\n    }\n\n    return !formArray.controls.some((group, i) => {\n      const value = cleanSpaces(`${group.get(pk)?.value}`, true);\n      return i !== index && value === controlValue;\n    });\n  }\n\n  /**\n   * @description Enables all controls within a FormGroup or FormArray.\n   * @summary Recursively enables all form controls within the provided FormGroup or FormArray.\n   * This is useful for making all controls interactive after they have been disabled.\n   * @param {FormArray | FormGroup} formGroup - The FormGroup or FormArray to enable all controls for\n   * @return {void}\n   * @static\n   */\n  static enableAllGroupControls(formGroup: FormArray | FormGroup): void {\n    Object.keys(formGroup.controls).forEach((key) => {\n      const control = formGroup.get(key);\n      if (control instanceof FormArray) {\n        control.controls.forEach((child) => {\n          if (child instanceof FormGroup) {\n            child.enable({ emitEvent: false });\n            child.updateValueAndValidity({ emitEvent: true });\n          }\n        });\n      }\n\n      if (control instanceof FormGroup) {\n        control.enable({ emitEvent: false });\n        control.updateValueAndValidity({ emitEvent: true });\n      }\n    });\n  }\n\n  /**\n   * @description Adds a form control to a form group based on component properties.\n   * @summary Creates and configures a FormControl within the specified FormGroup using the provided\n   * component properties. Handles nested paths, multiple controls (FormArrays), and control registration.\n   * This method supports complex form structures with nested groups and arrays. It also manages\n   * page-based forms and FormArray indexing.\n   * @param {FormParent} formGroup - The form group or form array to add the control to\n   * @param {IFormComponentProperties} componentProps - The component properties defining the control configuration\n   * @param {Partial<IFormComponentProperties>} [parentProps={}] - Properties from the parent component for context\n   * @param {number} [index=0] - The index for multiple controls in FormArrays\n   * @return {FormParent} The updated form parent (FormGroup or FormArray)\n   * @private\n   * @static\n   */\n  private static addFormControl(\n    formGroup: FormParent,\n    componentProps: IFormComponentProperties,\n    parentProps: Partial<IFormComponentProperties> = {},\n    index: number = 0\n  ): FormParent {\n    const isMultiple = parentProps?.['multiple'] || parentProps?.['type'] === 'Array' || false;\n    const { name, childOf } = componentProps;\n    if (isMultiple) componentProps['pk'] = componentProps['pk'] || parentProps?.['pk'] || '';\n    const fullPath = childOf ? (isMultiple ? `${childOf}.${index}.${name}` : `${childOf}.${name}`) : name;\n    const [parentGroup, controlName] = this.resolveParentGroup(\n      formGroup as FormGroup,\n      fullPath,\n      componentProps,\n      parentProps\n    );\n\n    if (!parentGroup.get(controlName)) {\n      const control = NgxFormService.fromProps(componentProps, componentProps.updateMode || 'change');\n      NgxFormService.register(control, componentProps);\n      if (parentGroup instanceof FormGroup) {\n        parentGroup.addControl(controlName, control);\n      }\n      if (parentGroup instanceof FormArray) {\n        const root = parentGroup.controls[(componentProps as KeyValue)?.['page'] - 1] as FormGroup;\n        if (root) {\n          root.addControl(controlName, control);\n        } else {\n          parentGroup.push({ [controlName]: control });\n        }\n      }\n    }\n    let rootGroup = parentGroup;\n    if (rootGroup instanceof FormArray)\n      rootGroup = (parentGroup as FormArray).controls[(componentProps as KeyValue)?.['page'] - 1] as FormParent;\n    // if(childOf?.includes(\".\"))\n    //   rootGroup = (rootGroup as FormGroup)?.parent as FormArray\n\n    // componentProps['formGroup'] = root as FormGroup;\n    componentProps['formGroup'] = rootGroup as FormGroup;\n    componentProps['formControl'] = parentGroup.get(controlName) as FormControl;\n    // componentProps['multiple'] = isMultiple;\n    return parentGroup as FormParent;\n  }\n\n  /**\n   * @description Retrieves a control from a registered form.\n   * @summary Finds and returns an AbstractControl from a registered form using the form id and optional path.\n   * This method provides centralized access to form controls across the application by leveraging\n   * the form registry system.\n   * @param {string} formId - The unique identifier of the form in the registry\n   * @param {string} [path] - The optional dot-separated path to a specific control within the form\n   * @return {AbstractControl} The requested AbstractControl (FormGroup, FormArray, or FormControl)\n   * @throws {Error} If the form is not found in the registry or the control is not found in the form\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as Component\n   *   participant NFS as NgxFormService\n   *   participant FR as Form Registry\n   *   C->>NFS: getControlFromForm(formId, path?)\n   *   NFS->>FR: Get form by formId\n   *   alt Form not found\n   *     FR-->>NFS: null\n   *     NFS-->>C: Throw Error\n   *   else Form found\n   *     FR-->>NFS: Return form\n   *     alt path provided\n   *       NFS->>NFS: form.get(path)\n   *       alt Control not found\n   *         NFS-->>C: Throw Error\n   *       else\n   *         NFS-->>C: Return control\n   *       end\n   *     else\n   *       NFS-->>C: Return form\n   *     end\n   *   end\n   * @static\n   */\n  static getControlFromForm(formId: string, path?: string): AbstractControl {\n    const form = this.formRegistry.get(formId);\n    if (!form) throw new Error(`Form with id '${formId}' not found in the registry.`);\n\n    if (!path) return form;\n\n    const control = form.get(path);\n    if (!control) throw new Error(`Control with path '${path}' not found in form '${formId}'.`);\n    return control;\n  }\n\n  /**\n   * @description Creates a form from UI model metadata children.\n   * @summary Generates a FormGroup from an array of UIModelMetadata objects, extracting component\n   * properties and creating appropriate form controls. This method is specifically designed to work\n   * with the UI decorator system and provides automatic form generation from metadata.\n   * @param {string} id - Unique identifier for the form\n   * @param {boolean} [registry=false] - Whether to register the created form in the global registry\n   * @param {UIModelMetadata[]} [children] - Array of UI model metadata objects to create controls from\n   * @return {FormGroup} The created FormGroup with controls for each child metadata\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as Component\n   *   participant NFS as NgxFormService\n   *   participant AF as Angular Forms\n   *   C->>NFS: createFormFromChildren(id, registry, children)\n   *   NFS->>AF: new FormGroup({})\n   *   loop For each child metadata\n   *     NFS->>NFS: addFormControl(form, child.props)\n   *     NFS->>AF: Create and add FormControl\n   *   end\n   *   alt registry is true\n   *     NFS->>NFS: addRegistry(id, form)\n   *   end\n   *   NFS-->>C: Return FormGroup\n   * @static\n   */\n  static createFormFromChildren(id: string, registry: boolean = false, children?: UIModelMetadata[]): FormGroup {\n    const form = new FormGroup({});\n    if (children?.length)\n      children.forEach((child) => {\n        this.addFormControl(form, child.props as IFormComponentProperties);\n      });\n    if (registry) this.addRegistry(id, form);\n    return form;\n  }\n\n  /**\n   * @description Creates a form from component configurations.\n   * @summary Generates a FormGroup based on an array of component configurations and optionally registers it.\n   * This method processes component input configurations to create appropriate form controls with\n   * validation and initial values.\n   * @param {string} id - The unique identifier for the form\n   * @param {IComponentConfig[]} components - An array of component configurations defining the form structure\n   * @param {boolean} [registry=false] - Whether to register the created form in the global registry\n   * @return {FormGroup} The created FormGroup with controls for each component configuration\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as Component\n   *   participant NFS as NgxFormService\n   *   participant AF as Angular Forms\n   *   C->>NFS: createFormFromComponents(id, components, registry)\n   *   NFS->>AF: new FormGroup({})\n   *   loop For each component config\n   *     NFS->>NFS: addFormControl(form, component.inputs)\n   *     NFS->>AF: Create and add FormControl\n   *   end\n   *   alt registry is true\n   *     NFS->>NFS: addRegistry(id, form)\n   *   end\n   *   NFS-->>C: Return FormGroup\n   * @static\n   */\n  static createFormFromComponents(id: string, components: IComponentConfig[], registry: boolean = false): FormGroup {\n    const form = new FormGroup({});\n    components.forEach((component) => {\n      this.addFormControl(form, component.inputs);\n    });\n    if (registry) this.addRegistry(id, form);\n    return form;\n  }\n\n  /**\n   * @description Adds a control to a form based on component properties.\n   * @summary Creates and adds a form control to a form (existing or new) based on the provided component properties.\n   * Handles multi-page forms by managing FormArray structures and proper indexing. This method supports\n   * complex form scenarios including nested controls and page-based form organization. It automatically\n   * creates FormArrays for forms with multiple pages and manages page indexing.\n   * @param {string} id - The unique identifier of the form\n   * @param {ComponentProperties} props - The properties of the component to create the control from\n   * @param {props} [parentProps] - Optional parent properties for context and configuration\n   * @return {FormParent} The form or created control (FormGroup or FormArray)\n   * @throws {Error} If page property is required but not provided or is invalid\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as Component\n   *   participant NFS as NgxFormService\n   *   participant F as Form\n   *   C->>NFS: addControlFromProps(id, props, parentProps?)\n   *   NFS->>NFS: createForm(id, formArray, true)\n   *   alt Multi-page form (parentProps.pages > 0)\n   *     NFS->>NFS: Calculate page index\n   *     alt Group doesn't exist at index\n   *       NFS->>F: Create new FormGroup at index\n   *     end\n   *     NFS->>NFS: Set form to page FormGroup\n   *   end\n   *   alt props has path\n   *     NFS->>NFS: addFormControl(form, props, parentProps)\n   *   end\n   *   NFS-->>C: Return form/control\n   * @static\n   */\n  static addControlFromProps(\n    id: string,\n    props: IFormComponentProperties,\n    parentProps?: IFormComponentProperties\n  ): FormParent {\n    const componentPages = (\n      typeof props?.pages === Primitives.NUMBER ? props?.pages : (props?.pages as IPagedComponentProperties[])?.length\n    ) as number;\n    const parentPages = (\n      typeof parentProps?.pages === Primitives.NUMBER\n        ? parentProps?.pages\n        : (parentProps?.pages as IPagedComponentProperties[])?.length\n    ) as number;\n\n    const isFormArray = (componentPages && componentPages >= 1) || props.multiple === true;\n    let form = this.createForm(id, isFormArray, true);\n\n    if (parentPages && parentPages > 0) {\n      const childOf = props.childOf || '';\n      const parentChildOf = parentProps?.childOf || '';\n      const index = props.page || parentProps?.page;\n      // dont check page in nested childs with same childOf\n      if ((!(typeof index === 'number') || index === 0) && childOf.length && childOf !== parentChildOf)\n        throw Error(`Property 'page' is required and greather than 0 on ${props.name}`);\n      // if(index > formLength) {\n      //   if((form as KeyValue)?.['lastIndex'] && index === (form as KeyValue)['lastIndex']['page']) {\n      //     index = (form as KeyValue)['lastIndex']['index'];\n      //   } else {\n      //     (form as KeyValue)['lastIndex'] = {\n      //       page: index,\n      //       index: formLength + 1\n      //     };\n      //     index = formLength + 1;\n\n      //   }\n      // }\n      let group = (form as FormArray).controls[(index as number) - 1];\n      if (!group) {\n        group = new FormGroup({});\n        (form as FormArray).insert(index as number, group);\n      }\n      form = group as FormGroup;\n    }\n    if (props.path) form = this.addFormControl(form, props, parentProps);\n    return form;\n  }\n\n  /**\n   * @description Retrieves form data from a FormGroup.\n   * @summary Extracts and processes the data from a FormGroup, handling different input types and nested form groups.\n   * Performs type conversion for various HTML5 input types, validates nested controls, and manages\n   * multiple control scenarios. Automatically enables all group controls after data extraction.\n   * @param {FormGroup} formGroup - The FormGroup to extract data from\n   * @return {Record<string, unknown>} An object containing the processed form data with proper type conversions\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as Component\n   *   participant NFS as NgxFormService\n   *   participant FG as FormGroup\n   *   participant FC as FormControl\n   *   C->>NFS: getFormData(formGroup)\n   *   loop For each control in formGroup\n   *     alt Control is not FormControl\n   *       NFS->>NFS: Recursive getFormData(control)\n   *       alt parentProps.multiple and !isValid\n   *         NFS->>NFS: reset(control)\n   *       end\n   *     else Control is FormControl\n   *       NFS->>FC: Get control value\n   *       NFS->>NFS: Apply type conversion based on props.type\n   *       alt HTML5CheckTypes\n   *         NFS->>NFS: Keep boolean value\n   *       else NUMBER type\n   *         NFS->>NFS: parseToNumber(value)\n   *       else DATE/DATETIME types\n   *         NFS->>NFS: new Date(value)\n   *       else Other types\n   *         NFS->>NFS: escapeHtml(value)\n   *       end\n   *     end\n   *   end\n   *   NFS->>NFS: enableAllGroupControls(formGroup)\n   *   NFS-->>C: Return processed data object\n   * @static\n   */\n  static getFormData(formGroup: FormGroup): Record<string, unknown> {\n    const data: Record<string, unknown> = {};\n    const parentProps = NgxFormService.getPropsFromControl(formGroup as FormGroup | FormArray);\n    for (const key in formGroup.controls) {\n      const control = formGroup.controls[key];\n      const props = NgxFormService.getPropsFromControl(control as FormControl | FormArray);\n      if (!(control instanceof FormControl)) {\n        if (control.disabled) {\n          if (control instanceof FormGroup) {\n            const hasValue = this.controlHasValue(control);\n            if (!hasValue) {\n              continue;\n            }\n            data[key] = NgxFormService.getFormData(control as FormGroup);\n            continue;\n          }\n          if (control instanceof FormArray) {\n            const value = this.getFormArrayControlsValue(control as FormArray);\n            if (Array.isArray(value)) {\n              if (value.length > 0) {\n                data[key] = value.reduce((acc, curr, i) => {\n                  acc[i] = curr;\n                  return acc;\n                }, {});\n              }\n              continue;\n            }\n            data[key] = value;\n          }\n          continue;\n        }\n        const value = control.value;\n        const isValid = control.valid;\n        if (parentProps?.multiple) {\n          if (isValid) {\n            data[key] = value;\n          } else {\n            this.reset(control as FormControl);\n          }\n          continue;\n        }\n        data[key] = NgxFormService.getFormData(control as FormGroup);\n        continue;\n      }\n\n      // const { readonly } = (props as IFormComponentProperties) || false; TODO: dont send readonly fields?\n      let value = control.value;\n      if (!HTML5CheckTypes.includes(props['type'])) {\n        switch (props['type']) {\n          case HTML5InputTypes.NUMBER:\n            value = parseToNumber(value);\n            break;\n          case HTML5InputTypes.DATE:\n          case HTML5InputTypes.DATETIME_LOCAL:\n            value = typeof value === Primitives.STRING ? dateFromString(value) : value;\n            break;\n          default:\n            value = !isNaN(value) ? value : escapeHtml(value)?.trim();\n        }\n      } else {\n        if (props['type'] === HTML5InputTypes.CHECKBOX)\n          value = Array.isArray(value) || typeof value === Primitives.STRING ? value : (value ?? false);\n      }\n      data[key] = value;\n    }\n    NgxFormService.enableAllGroupControls(formGroup as FormGroup);\n    return data;\n  }\n\n  static getFormArrayControlsValue(formArray: FormArray): unknown {\n    return formArray.controls\n      .map((c) => {\n        return this.controlHasValue(c) ? c.value : undefined;\n      })\n      .filter((v) => v !== undefined);\n  }\n\n  static controlHasValue(control: AbstractControl): boolean {\n    return Object.values(control.value).some((p) => p !== undefined && String(p).trim() !== '');\n  }\n\n  /**\n   * @description Validates fields in a form control or form group.\n   * @summary Recursively validates all fields in a form control or form group, marking them as touched and dirty.\n   * Performs comprehensive validation including uniqueness checks for primary keys in FormArray scenarios.\n   * This method ensures all validation rules are applied and form state is properly updated.\n   * @param {AbstractControl} control - The control or form group to validate\n   * @param {string} [pk] - Optional primary key field name for uniqueness validation\n   * @param {string} [path] - The path to the control within the form for error reporting\n   * @return {boolean} True if all fields are valid, false otherwise\n   * @throws {Error} If no control is found at the specified path or if the control type is unknown\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as Component\n   *   participant NFS as NgxFormService\n   *   participant FC as FormControl\n   *   participant FG as FormGroup\n   *   participant FA as FormArray\n   *   C->>NFS: validateFields(control, pk?, path?)\n   *   alt Control is FormControl\n   *     NFS->>FC: markAsTouched()\n   *     NFS->>FC: markAsDirty()\n   *     NFS->>FC: updateValueAndValidity()\n   *     alt Is in FormArray group\n   *       NFS->>NFS: Check uniqueness in group\n   *       alt Not unique\n   *         NFS->>FC: setErrors({notUnique: true})\n   *       end\n   *     end\n   *     NFS-->>C: Return control.valid\n   *   else Control is FormGroup\n   *     loop For each child control\n   *       NFS->>NFS: Recursive validateFields(child)\n   *     end\n   *     NFS-->>C: Return allValid\n   *   else Control is FormArray\n   *     loop For each array control\n   *       NFS->>NFS: Recursive validateFields(child)\n   *     end\n   *     NFS-->>C: Return allValid\n   *   else Unknown control type\n   *     NFS-->>C: Throw Error\n   *   end\n   * @static\n   */\n  static validateFields(control: AbstractControl, pk?: string, path?: string): boolean {\n    control = path ? (control.get(path) as AbstractControl) : control;\n    if (!control) throw new Error(`No control found at path: ${path || 'root'}.`);\n\n    const isAllowed = [FormArray, FormGroup, FormControl].some((type) => control instanceof type);\n    if (!isAllowed) throw new Error(`Unknown control type at: ${path || 'root'}`);\n\n    control.markAsTouched();\n    control.markAsDirty();\n    control.updateValueAndValidity({ emitEvent: true });\n\n    if (control instanceof FormGroup) {\n      Object.values(control.controls).forEach((childControl) => {\n        this.validateFields(childControl);\n      });\n    }\n\n    if (control instanceof FormArray) {\n      const totalGroups = control.length;\n      const hasValid = control.controls.some((control) => control.valid);\n      const parentProps = (control as KeyValue)[BaseComponentProps.FORM_GROUP_COMPONENT_PROPS] || {};\n      const childControl = control.at(0);\n      if (totalGroups === 1) {\n        const parent = childControl.parent as FormGroup;\n        if (!parentProps.required) {\n          parent.setErrors(null);\n          parent.updateValueAndValidity({ emitEvent: true });\n          const hasValue =\n            parentProps.isMultiple &&\n            Object.keys(childControl.value).some(\n              (key) =>\n                childControl.value[key] !== null &&\n                childControl.value[key] !== undefined &&\n                childControl.value[key] !== ''\n            );\n          if (!hasValue) {\n            childControl.disable();\n          }\n        } else {\n          this.validateFields(childControl);\n        }\n      } else if (totalGroups > 1 && hasValid) {\n        for (let i = control.length - 1; i >= 0; i--) {\n          const childControl = control.at(i);\n          // disable no valid groups on array\n          if (!childControl.valid) {\n            const parent = childControl.parent as FormGroup;\n            parent.setErrors(null);\n            parent.updateValueAndValidity({ emitEvent: true });\n            childControl.disable();\n          } else {\n            this.validateFields(childControl);\n          }\n        }\n      } else {\n        Object.values(control.controls).forEach((childControl) => {\n          this.validateFields(childControl);\n        });\n      }\n    }\n\n    // function getControlName(control: AbstractControl): string | null {\n    //   const group = control.parent as FormGroup;\n    //   if (!group)\n    //       return null;\n    //   return Object.keys(group.controls).find(name => control === group.get(name)) || null;\n    // }\n\n    return control?.disabled ? true : control.valid;\n  }\n\n  /**\n   * @description Generates validators from component properties.\n   * @summary Creates an array of ValidatorFn based on the supported validation keys in the component properties.\n   * Maps each validation property to its corresponding Angular validator function using the ValidatorFactory.\n   * Only processes properties that are recognized as validation keys by the Validation utility.\n   * @param {KeyValue} props - The component properties containing validation rules\n   * @return {ValidatorFn[]} An array of validator functions\n   * @private\n   * @static\n   */\n  private static validatorsFromProps(props: KeyValue): ValidatorFn[] {\n    const supportedValidationKeys = Validation.keys();\n    return Object.keys(props)\n      .filter((k: string) => supportedValidationKeys.includes(k))\n      .map((k: string) => {\n        return ValidatorFactory.spawn(props as FieldProperties, k);\n      });\n  }\n\n  /**\n   * @description Creates a FormControl from component properties.\n   * @summary Generates a FormControl with validators and initial configuration based on the provided\n   * component properties. Handles different input types, sets initial values, and configures\n   * validation rules and update modes.\n   * @param {FieldProperties} props - The component properties defining the control configuration\n   * @param {FieldUpdateMode} [updateMode='change'] - The update mode for the control ('change', 'blur', 'submit')\n   * @return {FormControl} The created FormControl with proper configuration and validators\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as Component\n   *   participant NFS as NgxFormService\n   *   participant VF as ValidatorFactory\n   *   participant AF as Angular Forms\n   *   C->>NFS: fromProps(props, updateMode?)\n   *   NFS->>NFS: validatorsFromProps(props)\n   *   NFS->>VF: Create validators from props\n   *   VF-->>NFS: Return validator array\n   *   NFS->>NFS: Compose validators\n   *   alt props.value exists and not checkbox\n   *     alt props.type is DATE\n   *       NFS->>NFS: Validate date format\n   *     end\n   *     NFS->>NFS: Set initial value\n   *   end\n   *   NFS->>AF: new FormControl(config)\n   *   AF-->>NFS: Return FormControl\n   *   NFS-->>C: Return configured FormControl\n   * @static\n   */\n  static fromProps(props: FieldProperties, updateMode: FieldUpdateMode = 'change'): FormControl {\n    const validators = this.validatorsFromProps(props);\n    const composed = validators.length ? Validators.compose(validators) : null;\n    const value = props.value\n      ? props.type === HTML5InputTypes.CHECKBOX\n        ? Array.isArray(props.value)\n          ? props.value\n          : undefined\n        : props.type === HTML5InputTypes.DATE\n          ? !isValidDate(parseDate(props.format as string, props.value as string))\n            ? undefined\n            : props.value\n          : (props.value as KeyValue)\n      : undefined;\n    return new FormControl(\n      {\n        value,\n        disabled: props.disabled,\n      },\n      {\n        validators: composed,\n        updateOn: updateMode,\n      }\n    );\n  }\n\n  /**\n   * @description Retrieves properties from a FormControl, FormArray, or FormGroup.\n   * @summary Gets the FieldProperties associated with a form control from the internal WeakMap.\n   * This method provides access to the original component properties that were used to create\n   * the control, enabling validation, rendering, and behavior configuration.\n   * @param {FormControl | FormArray | FormGroup} control - The form control to get properties for\n   * @return {FieldProperties} The properties associated with the control, or empty object if not found\n   * @static\n   */\n  static getPropsFromControl(control: FormControl | FormArray | FormGroup): FieldProperties {\n    return this.controls.get(control) || ({} as FieldProperties);\n  }\n\n  /**\n   * @description Finds a parent element with a specific tag in the DOM tree.\n   * @summary Traverses up the DOM tree to find the nearest parent element with the specified tag name.\n   * This is useful for finding container elements or specific parent components in the DOM hierarchy.\n   * The search is case-insensitive for tag name matching.\n   * @param {HTMLElement} el - The starting element to traverse from\n   * @param {string} tag - The tag name to search for (case-insensitive)\n   * @return {HTMLElement} The found parent element with the specified tag\n   * @throws {Error} If no parent with the specified tag is found in the DOM tree\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as Component\n   *   participant NFS as NgxFormService\n   *   participant DOM as DOM Tree\n   *   C->>NFS: getParentEl(element, tagName)\n   *   loop Traverse up DOM tree\n   *     NFS->>DOM: Get parentElement\n   *     DOM-->>NFS: Return parent or null\n   *     alt Parent exists and tag matches\n   *       NFS-->>C: Return parent element\n   *     else Parent is null\n   *       NFS-->>C: Throw Error\n   *     end\n   *   end\n   * @static\n   */\n  static getParentEl(el: HTMLElement, tag: string): HTMLElement {\n    let parent: HTMLElement | null;\n    while ((parent = el.parentElement) !== null) {\n      if (parent.tagName.toLowerCase() === tag.toLowerCase()) {\n        return parent;\n      }\n      el = parent;\n    }\n    throw new Error(`No parent with the tag ${tag} was found for provided element`);\n  }\n\n  /**\n   * @description Registers a control with its properties in the internal WeakMap.\n   * @summary Associates a form control with its component properties for later retrieval.\n   * This enables the service to maintain metadata about controls without creating memory leaks,\n   * as WeakMap automatically cleans up references when controls are garbage collected.\n   * @param {AbstractControl} control - The control to register (FormControl, FormGroup, or FormArray)\n   * @param {FieldProperties} props - The properties to associate with the control\n   * @return {void}\n   * @static\n   */\n  static register(control: AbstractControl, props: FieldProperties): void {\n    this.controls.set(control, props);\n  }\n\n  /**\n   * @description Unregisters a control from the internal WeakMap.\n   * @summary Removes a control and its associated properties from the internal WeakMap.\n   * This cleans up the metadata tracking for the control and frees up memory. Returns\n   * true if the control was found and removed, false if it was not in the registry.\n   * @param {AbstractControl} control - The control to unregister (FormControl, FormGroup, or FormArray)\n   * @return {boolean} True if the control was successfully unregistered, false otherwise\n   * @static\n   */\n  static unregister(control: AbstractControl): boolean {\n    return this.controls.delete(control);\n  }\n\n  /**\n   * @description Resets a form group or form control.\n   * @summary Recursively resets all controls in a form group or a single form control, clearing values,\n   * errors, and marking them as pristine and untouched. For FormControls, it sets the value to empty\n   * string (except for checkbox types) and clears validation errors. For FormGroups, it recursively\n   * resets all child controls.\n   * @param {FormGroup | FormControl} formGroup - The form group or form control to reset\n   * @return {void}\n   * @static\n   */\n  static reset(formGroup: FormGroup | FormControl): void {\n    if (formGroup instanceof FormControl) {\n      const control = formGroup as FormControl;\n      const { type } = NgxFormService.getPropsFromControl(control);\n      if (!HTML5CheckTypes.includes(type)) control.setValue('');\n      control.markAsPristine();\n      control.markAsUntouched();\n      control.setErrors(null);\n      control.updateValueAndValidity();\n    } else {\n      for (const key in formGroup.controls) {\n        const control = formGroup.controls[key];\n        NgxFormService.reset(control as FormControl);\n        continue;\n      }\n    }\n  }\n}\n","import { Repository } from '@decaf-ts/core';\nimport { InternalError } from '@decaf-ts/db-decorators';\nimport { Metadata, uses } from '@decaf-ts/decoration';\nimport { Model, Primitives } from '@decaf-ts/decorator-validation';\nimport { LoggedClass } from '@decaf-ts/logging';\nimport { parseToNumber } from '@decaf-ts/ui-decorators';\nimport { faker } from '@faker-js/faker';\nimport { DB_ADAPTER_FLAVOUR_TOKEN } from '../engine/constants';\nimport { DecafRepository, FunctionLike, KeyValue } from '../engine/types';\nimport { formatDate, getOnWindow } from './helpers';\n\nexport class DecafFakerRepository<T extends Model> extends LoggedClass {\n  protected propFnMapper?: KeyValue;\n\n  protected data: T[] = [];\n\n  protected _repository: DecafRepository<Model> | undefined = undefined;\n\n  protected pk: string | undefined = undefined;\n\n  protected pkType?: string;\n\n  constructor(\n    protected model: string | Model,\n    protected limit: number = 36\n  ) {\n    super();\n  }\n\n  protected get repository(): DecafRepository<Model> {\n    if (!this._repository) {\n      const modelName = typeof this.model === Primitives.STRING ? this.model : (this.model as Model).constructor.name;\n      const constructor = Model.get(String(modelName));\n      if (!constructor) throw new InternalError(`Cannot find model ${modelName}. was it registered with @model?`);\n      try {\n        this.model = new constructor();\n        const dbAdapterFlavour = getOnWindow(DB_ADAPTER_FLAVOUR_TOKEN) || undefined;\n        if (dbAdapterFlavour) {\n          uses(String(dbAdapterFlavour))(constructor);\n        }\n        this._repository = Repository.forModel(\n          constructor,\n          typeof dbAdapterFlavour === Primitives.STRING ? String(dbAdapterFlavour) : undefined\n        ) as DecafRepository<Model>;\n        this.pk = Model.pk(constructor) as string;\n        this.pkType = Metadata.type(this._repository.class, this.pk).name.toLowerCase();\n      } catch (error: unknown) {\n        throw new InternalError((error as Error)?.message || (error as string));\n      }\n    }\n    return this._repository;\n  }\n\n  public async initialize(): Promise<void> {\n    if (!this._repository) this._repository = this.repository;\n  }\n\n  async generateData<T extends Model>(values?: KeyValue, key?: string, keyType?: string): Promise<T[]> {\n    const limit = values ? Object.values(values || {}).length : this.limit;\n    if (!key) key = Model.pk(this.repository.class) as string;\n\n    if (!keyType) keyType = Metadata.type(this.repository.class, key).name.toLowerCase() as string;\n\n    const modelProperties = this.getModelProperties(key, keyType);\n    const dataFunctions: Record<string, FunctionLike> = {};\n    for (const prop of modelProperties) {\n      const fn = (this.propFnMapper?.[prop] as FunctionLike) || undefined;\n      if (fn && typeof fn === Function.name.toLowerCase()) {\n        dataFunctions[prop] = () => fn() as FunctionLike;\n        continue;\n      }\n      dataFunctions[prop] = this.getPropValueFn(prop, key);\n    }\n\n    const data = getFakerData<T>(\n      limit,\n      dataFunctions,\n      typeof this.model === Primitives.STRING ? String(this.model) : this.model?.constructor.name\n    );\n\n    if (!values) return data;\n\n    const _values = Object.values(values as KeyValue);\n    const iterated: (string | number)[] = [];\n\n    function getPkValue(item: KeyValue): T {\n      if (_values.length > 0) {\n        const randomIndex = Math.floor(Math.random() * _values.length);\n        const selected = _values.splice(randomIndex, 1)[0];\n        const value =\n          keyType === Primitives.STRING\n            ? selected\n            : keyType === Primitives.NUMBER\n              ? parseToNumber(selected)\n              : keyType === Array.name\n                ? [selected]\n                : selected;\n        item[key as string] = value;\n      }\n      if (!iterated.includes(item[key as string])) {\n        iterated.push(item[key as string]);\n        return item as T;\n      }\n      return undefined as unknown as T;\n    }\n    const uids = new Set();\n    return data\n      .map((d) => getPkValue(d))\n      .filter((item: KeyValue) => {\n        if (!item || uids.has(item[key]) || !item[key] || item[key] === undefined) return false;\n        uids.add(item[key]);\n        return true;\n      })\n      .filter(Boolean) as T[];\n  }\n\n  protected pickRandomValue(source: string[] | KeyValue): string {\n    const values: string[] = Array.isArray(source) ? source : Object.values(source);\n    return !values?.length ? '' : `${values[Math.floor(Math.random() * values.length)]}`;\n  }\n\n  protected getModelProperties(pk: string, pkType: string): string[] {\n    return Object.keys(this.model as KeyValue).filter((k) => {\n      if (pkType === Primitives.STRING) return !['updatedBy', 'createdAt', 'createdBy', 'updatedAt'].includes(k);\n      return ![pk, 'updatedBy', 'createdAt', 'createdBy', 'updatedAt'].includes(k);\n    });\n  }\n\n  protected getPropValueFn(propName: string, pkName: string): FunctionLike {\n    const type = Metadata.type(this.repository.class, propName);\n    switch (type && type.name.toLowerCase()) {\n      case 'string':\n        return () =>\n          `${faker.lorem.word()} ${pkName === propName ? ' - ' + faker.number.int({ min: 1, max: 200 }) : ''}`;\n      case 'step':\n        return () => faker.lorem.word();\n      case 'email':\n        return () => faker.internet.email();\n      case 'number':\n        return () => faker.number.int({ min: 1, max: 5 });\n      case 'boolean':\n        return () => faker.datatype.boolean();\n      case 'date':\n        return () => faker.date.past();\n      case 'url':\n        return () => faker.internet.url();\n      case 'array':\n        return () => faker.lorem.words({ min: 2, max: 5 }).split(' ');\n      default:\n        return () => undefined;\n    }\n  }\n}\n\nexport function getFakerData<T extends Model>(limit = 100, data: Record<string, FunctionLike>, model?: string): T[] {\n  let index = 1;\n  return Array.from({ length: limit }, () => {\n    const item: Record<string, unknown> = {};\n    for (const [key, value] of Object.entries(data)) {\n      const val = value();\n      item[key] =\n        val?.constructor === Date ? formatDate(val) : typeof val === Primitives.STRING ? String(val)?.trim() : val;\n    }\n    index = index + 1;\n    return (!model ? item : Model.build(item, model)) as T;\n  });\n}\n","import { LoadingOptions } from '@ionic/angular';\nimport { loadingController } from '@ionic/core';\nimport { IDecafSpinner } from 'node_modules/@decaf-ts/ui-decorators/lib/types/ui/interfaces/index.mjs';\nimport { getLogger } from '../engine/helpers';\n\n/**\n * @module lib/utils/NgxSpinner\n * @description Loading overlay utility for Ionic Angular applications.\n * @summary Exposes the `NgxSpinner` singleton helper and the `getNgxSpinner()` factory used\n * to manage Ionic loading overlays with progress updates, message changes, and safe dismissal.\n * The module centralizes loading state so components can request a shared spinner instance\n * instead of handling overlay lifecycles directly.\n */\n\n/**\n * @description Cached singleton factory instance for the loading utility.\n * @summary Holds the shared `NgxSpinner` reference returned by `getNgxSpinner()`. This\n * ensures the application reuses the same loading controller wrapper across calls and\n * avoids competing overlays or inconsistent progress state.\n *\n * @private\n * @type {NgxSpinner}\n */\nlet instance: NgxSpinner;\n\n/**\n * @description Loading overlay manager for Ionic UI flows.\n * @summary Wraps `loadingController` with a singleton-friendly API for showing, updating,\n * and dismissing loading overlays. It keeps track of the active message and progress value\n * so callers can update the same overlay instead of creating new ones.\n *\n * @class NgxSpinner\n * @implements {IDecafSpinner}\n */\nexport class NgxSpinner implements IDecafSpinner {\n  /**\n   * @description Active Ionic loading element reference.\n   * @summary Stores the overlay currently presented to the user so it can be updated or\n   * dismissed later. The value is `undefined` when no spinner is visible.\n   *\n   * @private\n   * @type {HTMLIonLoadingElement | undefined}\n   * @memberOf NgxSpinner\n   */\n  private instance!: HTMLIonLoadingElement | undefined;\n\n  /**\n   * @description Current loading message.\n   * @summary Mirrors the latest message shown by the overlay so follow-up updates can reuse\n   * it when progress mode is enabled.\n   *\n   * @private\n   * @type {string}\n   * @memberOf NgxSpinner\n   */\n  private message!: string;\n\n  /**\n   * @description Current progress percentage for the visible overlay.\n   * @summary Tracks the last emitted progress value so callers can advance the spinner in\n   * controlled increments without regressing or exceeding the expected range.\n   *\n   * @private\n   * @type {number}\n   * @default 0\n   * @memberOf NgxSpinner\n   */\n  private progress: number = 0;\n\n  /**\n   * @description Default Ionic loading configuration.\n   * @summary Provides the baseline overlay styling and behavior used whenever no explicit\n   * options are supplied. Callers can override individual fields per invocation.\n   *\n   * @private\n   * @type {LoadingOptions}\n   * @memberOf NgxSpinner\n   */\n  private options: LoadingOptions = {\n    cssClass: 'aeon-loading',\n    duration: undefined,\n    message: 'Carregando...',\n    spinner: 'crescent',\n    backdropDismiss: false,\n    showBackdrop: true,\n    animated: true,\n  };\n\n  /**\n   * @description Checks whether a loading overlay is visible.\n   * @summary Returns `true` when the singleton has an active Ionic loading element and\n   * `false` otherwise. Useful for preventing duplicate overlays before starting a new task.\n   *\n   * @returns {boolean} True if loading overlay is visible, false otherwise\n   * @memberOf NgxSpinner\n   *\n   * @example\n   * ```typescript\n   * const loading = getCmxLoading();\n   *\n   * if (!loading.isVisible()) {\n   *   await loading.show('Loading data...');\n   * }\n   *\n   * // Conditional operations based on loading state\n   * if (loading.isVisible()) {\n   *   await loading.update('Processing...', 50);\n   * }\n   * ```\n   */\n  isVisible(): boolean {\n    return !!this.instance;\n  }\n\n  /**\n   * @description Presents the loading overlay with a message and optional options.\n   * @summary Creates the overlay on first call and reuses the existing one on subsequent\n   * calls. When a loading object is passed as the first argument, its message becomes the\n   * displayed text and the remaining fields are treated as options.\n   *\n   * @param {string | LoadingOptions} message - Message text or a full loading options object\n   * @param {LoadingOptions} [options] - Optional configuration for the loading overlay\n   * @returns {Promise<void>} Promise that resolves when the loading overlay is displayed\n   * @memberOf NgxSpinner\n   *\n   * @example\n   * ```typescript\n   * const loading = getCmxLoading();\n   *\n   * // Simple loading with message\n   * await loading.show('Loading...');\n   *\n   * // Loading with custom options\n   * await loading.show('Processing data...', {\n   *   duration: 5000,\n   *   spinner: 'bubbles',\n   *   cssClass: 'custom-loading'\n   * });\n   *\n   * // Loading with backdrop dismiss\n   * await loading.show('Please wait...', {\n   *   backdropDismiss: true\n   * });\n   * ```\n   */\n  async show(message: string | LoadingOptions, options?: LoadingOptions): Promise<void> {\n    if (typeof message === 'object') {\n      options = message;\n      message = options.message as string;\n    }\n    try {\n      this.message = message;\n      if (this.isVisible()) return this.update(message);\n      this.instance = (await loadingController.create(\n        await this.getOptions(options, message)\n      )) as HTMLIonLoadingElement;\n      await this.instance.present();\n    } catch (error: unknown) {\n      getLogger(this.show).error((error as Error)?.message || String(error));\n    }\n  }\n\n  /**\n   * @description Updates the overlay message and optionally advances progress.\n   * @summary Reuses the current loading element when one is visible, otherwise opens a new\n   * one with a fallback duration. A numeric second argument advances the stored progress,\n   * while `true` treats the first argument as the progress label suffix.\n   *\n   * @param {string} message - The new message to display\n   * @param {boolean | number} [isProgressUpdate=false] - Progress update mode or percentage value\n   * @returns {Promise<void>} Promise that resolves when the update is complete\n   * @memberOf NgxSpinner\n   *\n   * @example\n   * ```typescript\n   * const loading = getCmxLoading();\n   * await loading.show('Starting process...');\n   *\n   * // Simple message update\n   * await loading.update('Processing data...');\n   *\n   * // Progress update with percentage\n   * await loading.update('Loading files...', 25);\n   * await loading.update('Processing files...', 50);\n   * await loading.update('Finalizing...', 90);\n   *\n   * // Progress update with boolean flag\n   * await loading.update('75', true); // Shows \"Original Message (75%)\"\n   * ```\n   */\n  async update(message: string, isProgressUpdate: boolean | number = false): Promise<void> {\n    if (!this.instance) return await this.show(message, { duration: 5000 });\n\n    if (isProgressUpdate) {\n      if (typeof isProgressUpdate === 'number' && Number(isProgressUpdate)) {\n        if (isProgressUpdate <= this.progress) isProgressUpdate = this.progress + 10;\n        this.progress = isProgressUpdate;\n        if (this.progress > 100) this.progress = 99;\n        this.instance.message = `${message} (${this.progress}%)`;\n      } else {\n        this.instance.message = `${this.message} (${message}%)`;\n      }\n    } else {\n      this.message = this.instance.message = message;\n    }\n  }\n\n  /**\n   * @description Dismisses the current loading overlay.\n   * @summary Clears the cached overlay reference, resets progress, and dismisses the visible\n   * Ionic loading element if one exists.\n   *\n   * @returns {Promise<void>} Promise that resolves when the loading overlay is removed\n   * @memberOf NgxSpinner\n   *\n   * @example\n   * ```typescript\n   * const loading = getCmxLoading();\n   * await loading.show('Loading...');\n   *\n   * // Perform some async operation\n   * await performDataOperation();\n   *\n   * // Remove loading overlay\n   * await loading.remove();\n   *\n   * // Safe to call even if no loading is present\n   * await loading.remove(); // Logs warning but doesn't throw error\n   * ```\n   */\n  async remove(): Promise<void> {\n    const loading = this.instance;\n    this.instance = undefined;\n    this.progress = 0;\n    if (loading) {\n      await loading.dismiss();\n    }\n  }\n\n  /**\n   * @description Merges custom loading options with the defaults.\n   * @summary Produces the final overlay configuration by combining the class defaults,\n   * caller-provided overrides, and the effective message value.\n   *\n   * @param {LoadingOptions} [options={}] - Custom loading options to merge\n   * @param {string} [message] - Optional message to override options.message\n   * @returns {LoadingOptions} The merged configuration object\n   * @memberOf NgxSpinner\n   *\n   * @example\n   * ```typescript\n   * // Internal usage - automatically called by show() method\n   * const config = await loading.getOptions({\n   *   duration: 3000,\n   *   spinner: 'bubbles'\n   * }, 'Custom message');\n   *\n   * // Result: default options + custom options + message override\n   * ```\n   */\n  async getOptions(options: LoadingOptions = {}, message?: string): Promise<LoadingOptions> {\n    return Object.assign({}, this.options, options, {\n      message: message || this.options['message'],\n    });\n  }\n\n  /**\n   * @description Retrieves the current loading message.\n   * @summary Returns the latest message tracked by the spinner instance so callers can\n   * inspect the overlay state without accessing the Ionic element directly.\n   *\n   * @returns {Promise<string>} Promise resolving to the current loading message\n   * @memberOf NgxSpinner\n   *\n   * @example\n   * ```typescript\n   * const loading = getCmxLoading();\n   * await loading.show('Processing...');\n   *\n   * const currentMessage = await loading.getMessage();\n   * console.log('Current loading message:', currentMessage); // \"Processing...\"\n   *\n   * // Useful for debugging or state management\n   * if (await loading.getMessage() === 'Processing...') {\n   *   await loading.update('Almost done...', 90);\n   * }\n   * ```\n   */\n  async getMessage(): Promise<string> {\n    return this.message;\n  }\n}\n\n/**\n * @description Returns the shared `NgxSpinner` instance.\n * @summary Lazily creates the singleton on first call and reuses it afterwards. The\n * optional options argument is accepted for API compatibility but does not alter the\n * cached instance once it exists.\n *\n * @param {Partial<LoadingOptions>} [options={}] - Optional spinner configuration placeholder\n * @returns {NgxSpinner} The singleton NgxSpinner instance\n * @memberOf NgxSpinner\n *\n * @example\n * ```typescript\n * // Get the singleton instance\n * const loading = getCmxLoading();\n *\n * // All calls return the same instance\n * const loading1 = getCmxLoading();\n * const loading2 = getCmxLoading();\n * console.log(loading1 === loading2); // true\n *\n * // Use throughout the application\n * await loading.show('Loading...');\n * // ... later in another component ...\n * await getCmxLoading().update('Still loading...', 50);\n * ```\n */\nexport function getNgxSpinner(options: Partial<LoadingOptions> = {}): NgxSpinner {\n  if (!instance) {\n    instance = new NgxSpinner();\n  }\n  return instance;\n}\n","import { DecafToastOptions, DecafToastRole, IDecafToast } from '@decaf-ts/ui-decorators';\nimport { ToastOptions } from '@ionic/angular/standalone';\nimport { OverlayEventDetail, toastController } from '@ionic/core';\n\n/**\n * @description Default toast configuration used by the toast utility.\n * @summary Provides the baseline Ionic toast settings applied before caller overrides are\n * merged. These defaults keep toast behavior consistent across the application.\n * @const {DecafToastOptions} DefaulOptions\n */\nconst DefaulOptions = {\n  duration: 3000,\n  position: 'top',\n  animated: true,\n};\n\n/**\n * @description Cached singleton toast helper instance.\n * @summary Stores the shared `NgxToast` object returned by the factory so every caller uses\n * the same overlay state and toast lifecycle.\n *\n * @private\n * @type {NgxToast}\n */\nlet instance!: NgxToast;\n\n/**\n * @description Active Ionic toast element reference.\n * @summary Tracks the toast element currently visible on screen so it can be dismissed,\n * replaced, or observed for dismissal events.\n *\n * @private\n * @type {HTMLIonToastElement | null}\n */\nlet component: HTMLIonToastElement | null;\n\n/**\n * @description Toast notification helper for Ionic applications.\n * @summary Wraps Ionic's toast controller with a singleton-friendly API for showing\n * informational, success, warning, and error messages. The class centralizes overlay\n * creation, dismissal handling, and role extraction so application code stays small.\n * @class NgxToast\n * @implements {IDecafToast}\n *\n * @example\n * ```typescript\n * // Basic usage\n * const toast = getNgxToastComponent();\n * await toast.success('Operation completed successfully!');\n * await toast.error('Something went wrong!');\n *\n * // With custom options\n * const toast = getNgxToastComponent({\n *   duration: 5000,\n *   position: 'bottom'\n * });\n * await toast.inform('Custom toast message');\n *\n * // Handling dismissal role\n * const role = await toast.warn('Are you sure?');\n * if (role === 'cancel') {\n *   console.log('User cancelled');\n * }\n * ```\n *\n * @features\n * - Multiple toast types with semantic colors (error, success, warning, info)\n * - Automatic dismissal handling\n * - Singleton pattern for consistent behavior\n * - Promise-based API for better async handling\n * - Customizable options with sensible defaults\n * - Role-based dismissal tracking\n *\n * @since 1.0.0\n * @version 1.0.0\n */\nexport class NgxToast implements IDecafToast {\n  /**\n   * @description Merged toast options used when creating overlays.\n   * @summary Holds the current configuration base that each toast operation reuses before\n   * applying action-specific overrides such as color or duration.\n   * @type {DecafToastOptions}\n   */\n  options: DecafToastOptions;\n\n  /**\n   * @description Creates a toast helper instance.\n   * @summary Merges the provided options with the default toast configuration so all\n   * subsequent notifications share the same baseline settings.\n   * @param {Partial<ToastOptions>} [options={}] - Custom toast options to merge with defaults\n   */\n  constructor(options: Partial<ToastOptions> = {}) {\n    this.options = Object.assign(DefaulOptions, options as DecafToastOptions);\n  }\n\n  /**\n   * @description Displays an error toast.\n   * @summary Presents a toast using the danger color and returns the dismissal role so\n   * callers can react to user interaction after the toast closes.\n   * @param {string} message - The error message to display\n   * @returns {Promise<DecafToastRole>} Promise that resolves with the dismissal role\n   * @example\n   * ```typescript\n   * const role = await toast.error('Failed to save data');\n   * if (role === 'cancel') {\n   *   // Handle cancellation\n   * }\n   * ```\n   */\n  async error(message: string): Promise<DecafToastRole> {\n    (component as HTMLIonToastElement) = await this.create(\n      Object.assign(this.options, { message: message, color: 'danger' })\n    );\n    const { role } = await this.handleDidDismiss(component as HTMLIonToastElement);\n    return role;\n  }\n\n  /**\n   * @description Presents a toast using the supplied options.\n   * @summary Creates the Ionic toast element, dismisses any active toast, and presents the\n   * new overlay. The `message` argument is merged into the final toast configuration so the\n   * displayed text always reflects the caller input.\n   * @param {string} message - Toast message to display\n   * @param {Partial<ToastOptions>} [options] - Toast configuration options\n   * @returns {Promise<void>} Promise that resolves when the toast is presented\n   */\n  async show(message: string, options?: Partial<ToastOptions>): Promise<void> {\n    const config = Object.assign({}, this.options, { duration: 5000 }, options, { message });\n    if (component) {\n      await component.dismiss();\n      component = null;\n    }\n    component = await this.create(config);\n    await component.present();\n  }\n\n  /**\n   * @description Creates a toast element.\n   * @summary Builds and stores the Ionic toast element for later presentation or dismissal.\n   * This helper is used internally by the public toast methods.\n   * @param {Partial<ToastOptions>} options - Toast configuration options\n   * @returns {Promise<HTMLIonToastElement>} Promise that resolves with the toast element\n   */\n  async create(options: Partial<ToastOptions>): Promise<HTMLIonToastElement> {\n    return (component = await toastController.create(options));\n  }\n\n  /**\n   * @description Displays an informational toast.\n   * @summary Presents a neutral message with dark styling and any caller-provided options.\n   * @param {string} message - The informational message to display\n   * @param {Partial<ToastOptions>} [options={}] - Additional toast configuration\n   * @returns {Promise<void>} Promise that resolves when toast is presented\n   * @example\n   * ```typescript\n   * await toast.inform('Data loaded successfully');\n   * ```\n   */\n  async inform(message: string, options: Partial<ToastOptions> = {}): Promise<void> {\n    await this.show(message, { ...options, color: 'dark' });\n  }\n\n  /**\n   * @description Displays a success toast.\n   * @summary Presents a toast with success styling to confirm positive outcomes or completed\n   * operations.\n   * @param {string} message - The success message to display\n   * @returns {Promise<void>} Promise that resolves when toast is presented\n   * @example\n   * ```typescript\n   * await toast.success('Operation completed successfully!');\n   * ```\n   */\n  async success(message: string): Promise<void> {\n    await this.show(message, { color: 'success' });\n  }\n\n  /**\n   * @description Displays a warning toast.\n   * @summary Presents a toast with warning styling and returns the dismissal role after\n   * the user closes it.\n   * @param {string} message - The warning message to display\n   * @returns {Promise<DecafToastRole>} Promise that resolves with the dismissal role\n   * @example\n   * ```typescript\n   * const role = await toast.warn('This action cannot be undone');\n   * if (role !== 'cancel') {\n   *   // Proceed with action\n   * }\n   * ```\n   */\n  async warn(message: string): Promise<DecafToastRole> {\n    (component as HTMLIonToastElement) = await this.create(Object.assign(this.options, { color: 'warning', message }));\n    const { role } = await this.handleDidDismiss(component as HTMLIonToastElement);\n    return role;\n  }\n\n  /**\n   * @description Resolves the toast dismissal event.\n   * @summary Waits for the Ionic dismissal promise, clears the cached toast element, and\n   * returns the overlay event detail used by the public methods.\n   * @param {HTMLIonToastElement} toast - The toast element to handle dismissal for\n   * @returns {Promise<OverlayEventDetail>} Promise that resolves with dismissal event data\n   * @private\n   */\n  private async handleDidDismiss(toast: HTMLIonToastElement): Promise<OverlayEventDetail> {\n    const didDismiss = await toast.onDidDismiss();\n    component = null;\n    return didDismiss as OverlayEventDetail;\n  }\n}\n\n/**\n * @description Returns the shared toast helper instance.\n * @summary Lazily creates the singleton on first call and reuses it for subsequent toast\n * operations. Any options passed after the first call are ignored because the instance\n * has already been initialized.\n * @function getNgxToastComponent\n * @param {Partial<ToastOptions>} [options={}] - Optional toast configuration options\n * @returns {NgxToast} Singleton NgxToast instance\n * @example\n * ```typescript\n * // Get default instance\n * const toast = getNgxToastComponent();\n *\n * // Get instance with custom options\n * const toast = getNgxToastComponent({\n *   duration: 5000,\n *   position: 'bottom',\n *   animated: false\n * });\n *\n * // All subsequent calls return the same instance\n * const sameToast = getNgxToastComponent(); // Returns existing instance\n * ```\n * @memberOf utils.toast\n */\nexport function getNgxToast(options: Partial<ToastOptions> = {}): NgxToast {\n  if (!instance) {\n    instance = new NgxToast(options);\n  }\n  return instance;\n}\n","/**\n * @module utils\n * @description Utility functions for Angular Decaf applications\n * @summary The utils module provides a collection of utility functions and types\n * that assist with common tasks in Decaf Angular applications. It includes functions\n * for array manipulation, date formatting, logging, string operations, and various\n * utility functions for working with Angular components and services. These helpers\n * simplify common operations and promote code reuse across the application.\n * Key exports include logging utilities, string manipulation functions, and component\n * utility functions.\n */\nexport * from './DecafFakerRepository';\nexport * from './helpers';\nexport * from './NgxSpinner';\nexport * from './NgxToast';\n\n","/**\n * @module lib/engine/NgxRenderingEngine\n * @description Angular rendering engine for Decaf model-driven UIs.\n * @summary Implements NgxRenderingEngine which converts model decorator metadata\n * into Angular components, manages component registration, and orchestrates\n * dynamic component creation and input mapping.\n * @link {@link NgxRenderingEngine}\n */\nimport '@decaf-ts/overrides/ui-decorators';\n\nimport {\n  ComponentMirror,\n  ComponentRef,\n  createComponent,\n  createEnvironmentInjector,\n  EnvironmentInjector,\n  Injector,\n  reflectComponentType,\n  runInInjectionContext,\n  TemplateRef,\n  Type,\n  ViewContainerRef,\n} from '@angular/core';\nimport { InternalError, OperationKeys } from '@decaf-ts/db-decorators';\nimport { Constructor } from '@decaf-ts/decoration';\nimport { Model, ModelKeys, Primitives } from '@decaf-ts/decorator-validation';\nimport {\n  DecafComponent,\n  FieldDefinition,\n  HTML5InputTypes,\n  IDecafModal,\n  IDecafRouter,\n  IDecafSpinner,\n  IDecafToast,\n  RenderingEngine,\n} from '@decaf-ts/ui-decorators';\nimport { LoadingOptions, ModalOptions, ToastOptions } from '@ionic/angular/standalone';\nimport type { ModalComponent } from '../components/modal/modal.component';\nimport { NgxFormService } from '../services/NgxFormService';\nimport { isDevelopmentMode } from '../utils';\nimport { getNgxSpinner } from '../utils/NgxSpinner';\nimport { getNgxToast } from '../utils/NgxToast';\nimport { AngularEngineKeys, BaseComponentProps } from './constants';\nimport { getLogger } from './helpers';\nimport { AngularDynamicOutput, IFormComponentProperties } from './interfaces';\nimport type { NgxComponentDirective } from './NgxComponentDirective';\nimport { AngularFieldDefinition, FormParent, KeyValue } from './types';\n\n/**\n * @description Angular implementation of the RenderingEngine for Decaf components.\n * @summary This class extends the base RenderingEngine to provide Angular-specific rendering capabilities.\n * It handles the conversion of field definitions to Angular components, manages component registration,\n * and provides utilities for component creation and input handling. The engine converts model decorator\n * metadata into dynamically created Angular components with proper input binding and lifecycle management.\n * @template AngularFieldDefinition - Type for Angular-specific field definitions\n * @template AngularDynamicOutput - Type for Angular-specific component output\n * @class NgxRenderingEngine\n * @extends {RenderingEngine<AngularFieldDefinition, AngularDynamicOutput>}\n * @example\n * ```typescript\n * const engine = NgxRenderingEngine.get();\n * engine.initialize();\n * const output = engine.render(myModel, {}, viewContainerRef, injector, templateRef);\n * ```\n * @mermaid\n * sequenceDiagram\n *   participant Client\n *   participant Engine as NgxRenderingEngine\n *   participant Components as RegisteredComponents\n *\n *   Client->>Engine: get()\n *   Client->>Engine: initialize()\n *   Client->>Engine: render(model, props, vcr, injector, tpl)\n *   Engine->>Engine: toFieldDefinition(model, props)\n *   Engine->>Engine: fromFieldDefinition(fieldDef, vcr, injector, tpl)\n *   Engine->>Components: components(fieldDef.tag)\n *   Components-->>Engine: component constructor\n *   Engine->>Engine: createComponent(component, inputs, metadata, vcr, injector, template)\n *   Engine-->>Client: return AngularDynamicOutput\n * @memberOf module:lib/engine/NgxRenderingEngine\n */\nexport class NgxRenderingEngine extends RenderingEngine<AngularFieldDefinition, AngularDynamicOutput> {\n  private static _injector?: Injector;\n\n  /**\n   * @description Registry of components available for dynamic rendering.\n   * @summary Static registry that stores all registered components indexed by their selector name.\n   * Each component entry contains a constructor reference that can be used to instantiate\n   * the component during the rendering process. This registry is shared across all instances\n   * of the rendering engine and is populated through the registerComponent method.\n   * @private\n   * @static\n   * @type {Record<string, { constructor: Constructor<unknown> }>}\n   * @memberOf module:lib/engine/NgxRenderingEngine\n   */\n  private static _components: Record<string, { constructor: Constructor<unknown> }>;\n\n  /**\n   * @description Currently active model being rendered by the engine.\n   * @summary Stores a reference to the model instance that is currently being processed\n   * by the rendering engine. This property is set during the render method execution\n   * and is used throughout the rendering lifecycle to access model data and metadata.\n   * The definite assignment assertion (!) is used because this property is always\n   * initialized before use within the render method.\n   * @private\n   * @type {Model}\n   * @memberOf module:lib/engine/NgxRenderingEngine\n   */\n  private _model!: Model;\n\n  /**\n   * @description Current operation context for component visibility control.\n   * @summary Static property that stores the current operation being performed,\n   * which is used to determine component visibility through the 'hidden' property.\n   * Components can specify operations where they should be hidden, and this property\n   * provides the context for those visibility checks. The value is typically extracted\n   * from the global properties during the rendering process.\n   * @private\n   * @static\n   * @type {string | undefined}\n   * @memberOf module:lib/engine/NgxRenderingEngine\n   */\n  private static _operation: string | undefined = undefined;\n\n  /**\n   * @description Reference to the currently active component instance.\n   * @summary Static property that maintains a reference to the most recently created\n   * component instance. This is used internally for component lifecycle management\n   * and can be cleared through the destroy method. The reference allows access to\n   * the active component instance for operations that need to interact with the\n   * currently rendered component.\n   * @private\n   * @static\n   * @type {Type<unknown> | undefined}\n   * @memberOf module:lib/engine/NgxRenderingEngine\n   */\n  private static _instance: Type<unknown> | undefined;\n\n  // private static _projectable: boolean = true\n\n  /**\n   * @description Parent component properties for child component inheritance.\n   * @summary Static property that stores parent component properties that should be\n   * inherited by child components. This is particularly used for passing page configuration\n   * down to child components in multi-page forms. The property is cleared after rendering\n   * to prevent property leakage between unrelated component trees.\n   * @private\n   * @static\n   * @type {KeyValue | undefined}\n   * @memberOf module:lib/engine/NgxRenderingEngine\n   */\n  private static _parentProps: KeyValue | undefined = undefined;\n\n  /**\n   * @description Constructs a new NgxRenderingEngine instance.\n   * @summary Initializes a new instance of the Angular rendering engine by calling the parent\n   * constructor with the 'angular' engine type identifier. This constructor sets up the base\n   * rendering engine functionality with Angular-specific configurations and prepares the\n   * instance for component registration and rendering operations.\n   * @constructor\n   * @memberOf module:lib/engine/NgxRenderingEngine\n   */\n  constructor() {\n    super(AngularEngineKeys.FLAVOUR);\n  }\n\n  override router(): IDecafRouter {\n    return (NgxRenderingEngine._instance as unknown as NgxComponentDirective)?.routerService as IDecafRouter;\n  }\n\n  override async getToast(options: Partial<ToastOptions>): Promise<IDecafToast> {\n    return getNgxToast(options);\n  }\n\n  override async getSpinner(options: Partial<LoadingOptions>): Promise<IDecafSpinner> {\n    return getNgxSpinner(options);\n  }\n\n  /**\n   * @description Converts a field definition to an Angular component output.\n   * @summary This private method takes a field definition and creates the corresponding Angular component.\n   * It handles component instantiation, input property mapping, child component rendering, and visibility\n   * control. The method validates input properties against the component's metadata and processes\n   * child components recursively.\n   * @param {FieldDefinition<AngularFieldDefinition>} fieldDef - The field definition to convert\n   * @param {ViewContainerRef} vcr - The view container reference for component creation\n   * @param {Injector} injector - The Angular injector for dependency injection\n   * @param {TemplateRef<any>} tpl - The template reference for content projection\n   * @param {string} registryFormId - Form identifier for the component renderer\n   * @param {boolean} createComponent - Whether to create the component instance\n   * @param {FormParent} [formGroup] - Optional form group for form components\n   * @return {AngularDynamicOutput} The Angular component output with component reference and inputs\n   * @mermaid\n   * sequenceDiagram\n   *   participant Method as fromFieldDefinition\n   *   participant Components as NgxRenderingEngine.components\n   *   participant Angular as Angular Core\n   *   participant Process as processChild\n   *\n   *   Method->>Components: components(fieldDef.tag)\n   *   Components-->>Method: component constructor\n   *   Method->>Angular: reflectComponentType(component)\n   *   Angular-->>Method: componentMetadata\n   *   Method->>Method: Validate input properties\n   *   Method->>Method: Create result object\n   *   alt Has children\n   *     Method->>Process: Process children recursively\n   *     Process->>Method: Return processed children\n   *     Method->>Angular: Create embedded view\n   *     Method->>Method: Create component instance\n   *   end\n   *   Method-->>Caller: return AngularDynamicOutput\n   * @private\n   * @memberOf module:lib/engine/NgxRenderingEngine\n   */\n  private fromFieldDefinition(\n    fieldDef: FieldDefinition<AngularFieldDefinition>,\n    vcr: ViewContainerRef,\n    injector: Injector,\n    tpl: TemplateRef<unknown>,\n    registryFormId: string = Date.now().toString(36).toUpperCase(),\n    createComponent: boolean = true,\n    formGroup?: FormParent\n  ): AngularDynamicOutput {\n    const cmp = (fieldDef as KeyValue)?.['component'] || NgxRenderingEngine.components(fieldDef.tag);\n    const component = cmp.constructor as Type<unknown>;\n\n    const componentMetadata = reflectComponentType(component);\n    if (!componentMetadata) {\n      throw new InternalError(`Metadata for component ${fieldDef.tag} not found.`);\n    }\n\n    const { inputs: possibleInputs } = componentMetadata;\n    const inputs = { ...fieldDef.props };\n\n    // const unmappedKeys = Object.keys(inputs).filter((input) => {\n    //   const isMapped = possibleInputs.find(({ propName }) => propName === input);\n    //   if (!isMapped) delete inputs[input];\n    //   return !isMapped;\n    // });\n    // if (unmappedKeys.length > 0 && isDevelopmentMode())\n    //   getLogger(this).warn(\n    //     `Unmapped input properties for component ${fieldDef.tag}: ${unmappedKeys.join(', ')}`,\n    //   );\n    const operation = NgxRenderingEngine._operation;\n\n    const hiddenOn = inputs?.hidden || [];\n    if ((hiddenOn as string[]).includes(operation as string)) return { inputs, injector };\n\n    // const customTypes = (inputs as KeyValue)?.['customTypes'] || [];\n    // const hasFormRoot = Object.values(possibleInputs).some(({propName}) => propName ===  AngularEngineKeys.PARENT_FORM);\n    // if (hasFormRoot && !inputs?.[AngularEngineKeys.PARENT_FORM] && formGroup)\n    //   inputs[AngularEngineKeys.PARENT_FORM] = formGroup;\n    if (operation !== OperationKeys.CREATE && (hiddenOn as string[]).includes(OperationKeys.CREATE)) {\n      fieldDef.props = { ...fieldDef.props, ...{ readonly: true, type: HTML5InputTypes.TEXT } };\n    }\n\n    const result: AngularDynamicOutput = {\n      component,\n      inputs,\n      injector,\n    };\n\n    if (fieldDef.rendererId) (result.inputs as Record<string, unknown>)['rendererId'] = fieldDef.rendererId;\n    // process children\n    // generating DOM\n    // const projectable = NgxRenderingEngine._projectable;\n    // const template = !projectable ? [] : vcr.createEmbeddedView(tpl, injector).rootNodes;\n    // const template = [];\n    const hasChildren = Object.values(possibleInputs).some(({ propName }) => propName === AngularEngineKeys.CHILDREN);\n    const hasModel = Object.values(possibleInputs).some(({ propName }) => propName === ModelKeys.MODEL);\n    const componentInputs = Object.assign(\n      inputs,\n      hasModel ? { model: this._model } : {},\n      hasChildren ? { children: fieldDef?.['children'] || [] } : {}\n    );\n    if (createComponent) {\n      vcr.clear();\n      const componentInstance = NgxRenderingEngine.createComponent(\n        component,\n        componentInputs,\n        injector,\n        componentMetadata,\n        vcr,\n        []\n      );\n      result.component = NgxRenderingEngine._instance = componentInstance as Type<unknown>;\n    }\n    if (fieldDef.children?.length) {\n      if (!NgxRenderingEngine._parentProps && inputs?.['pages']) {\n        NgxRenderingEngine._parentProps = { pages: inputs?.['pages'] };\n        //  NgxRenderingEngine._projectable = false;\n      }\n      const { handlers } = fieldDef.props;\n      result.children = fieldDef.children.map((child) => {\n        const readonly =\n          [OperationKeys.READ, OperationKeys.DELETE].includes(fieldDef.props?.['operation'] as OperationKeys) ||\n          fieldDef.props?.['readonly'] ||\n          (operation === OperationKeys.UPDATE &&\n            ((child?.props?.hidden || []) as string[]).includes(OperationKeys.CREATE));\n        // const hiddenOn = (child?.props?.hidden || []) as string[];\n        // // moved to ui decorators\n        // if (child?.children?.length) {\n        //   child.children = child.children.filter(c => {\n        //     const hiddenOn = c?.props?.hidden || [];\n        //     if (!(hiddenOn as string[]).includes(operation as string))\n        //       return c\n        //   })\n        // }\n        // if (!hiddenOn?.length || !(hiddenOn as CrudOperations[]).includes(operation as CrudOperations))\n        child.props['handlers'] = Object.keys(child.props?.['handlers'] || {}).length\n          ? child.props?.['handlers']\n          : handlers;\n        if (!readonly) {\n          NgxFormService.addControlFromProps(registryFormId, child.props, {\n            ...inputs,\n            ...(NgxRenderingEngine._parentProps || {}),\n          });\n        } else {\n          child.props = {\n            ...child.props,\n            ...{\n              readonly: true,\n              operation: fieldDef.props[BaseComponentProps.OPERATION] || child.props?.[BaseComponentProps.OPERATION],\n            },\n          };\n        }\n        return this.fromFieldDefinition(child, vcr, injector, tpl, registryFormId, false, formGroup);\n      });\n    }\n    return result;\n  }\n\n  /**\n   * @description Creates an Angular component instance with inputs and template projection.\n   * @summary This static utility method creates an Angular component instance with the specified\n   * inputs and template. It uses Angular's component creation API to instantiate the component\n   * and then sets the input properties using the provided metadata.\n   * @param {Type<unknown>} component - The component type to create\n   * @param {KeyValue} [inputs={}] - The input properties to set on the component\n   * @param {ComponentMirror<unknown>} metadata - The component metadata for input validation\n   * @param {ViewContainerRef} vcr - The view container reference for component creation\n   * @param {Injector} injector - The Angular injector for dependency injection\n   * @param {Node[]} [template=[]] - The template nodes to project into the component\n   * @return {ComponentRef<unknown>} The created component reference\n   * @static\n   * @memberOf module:lib/engine/NgxRenderingEngine\n   */\n  static createComponent<C>(\n    component: Type<unknown> | string,\n    inputs: KeyValue = {},\n    injector?: Injector,\n    metadata?: ComponentMirror<unknown>,\n    vcr?: ViewContainerRef,\n    template?: Node[]\n  ): C {\n    if (vcr && metadata && injector)\n      return NgxRenderingEngine.createViewComponent(component, inputs, metadata, vcr, injector, template || []);\n    return NgxRenderingEngine.createHostComponent(component, inputs, injector);\n  }\n\n  static createViewComponent<C>(\n    component: Type<unknown> | string,\n    inputs: KeyValue = {},\n    metadata: ComponentMirror<unknown>,\n    vcr: ViewContainerRef,\n    injector: Injector,\n    template: Node[] = []\n  ): C {\n    const cmp = vcr.createComponent(component as Type<unknown>, {\n      environmentInjector: injector as EnvironmentInjector,\n      projectableNodes: [template],\n    });\n    this.setInputs(cmp, inputs, metadata);\n    return cmp.instance as C;\n  }\n\n  static createHostComponent<C>(component: Type<C | unknown> | string, props: KeyValue = {}, injector?: Injector): C {\n    if (!injector) injector = NgxRenderingEngine._injector || Injector.create({ providers: [], parent: Injector.NULL });\n    const envInjector: EnvironmentInjector = createEnvironmentInjector([], injector as EnvironmentInjector);\n\n    let cmp: ComponentRef<unknown> = {} as ComponentRef<C>;\n\n    runInInjectionContext(envInjector, () => {\n      const host = document.createElement('div');\n      component =\n        typeof component === Primitives.STRING\n          ? (NgxRenderingEngine.components(component as string) as Type<unknown>)\n          : component;\n      if (!host) throw new Error('Cant create host element for component');\n\n      cmp = createComponent(component as Type<unknown>, {\n        environmentInjector: envInjector,\n        hostElement: host,\n      });\n\n      const metadata = reflectComponentType(component as Type<unknown>);\n      if (!metadata) throw new InternalError(`Metadata for component ${component} not found.`);\n\n      const { inputs: possibleInputs } = metadata;\n      const inputs = { ...props };\n\n      const unmappedKeys = Object.keys(inputs).filter((input) => {\n        const isMapped = possibleInputs.find(({ propName }) => propName === input);\n        if (!isMapped) delete inputs[input];\n        return !isMapped;\n      });\n\n      if (unmappedKeys.length > 0 && isDevelopmentMode())\n        getLogger(this.createHostComponent).warn(\n          `Unmapped input properties for component ${component}: ${unmappedKeys.join(', ')}`\n        );\n\n      if (metadata) this.setInputs(cmp as ComponentRef<unknown>, inputs, metadata as ComponentMirror<unknown>);\n      document.body.querySelector('ion-app')?.appendChild(host);\n    });\n    return cmp.instance as C;\n  }\n\n  /**\n   * @description Extracts decorator metadata from a model.\n   * @summary This method provides access to the field definition generated from a model's\n   * decorators. It's a convenience wrapper around the toFieldDefinition method that\n   * converts a model to a field definition based on its decorators and the provided\n   * global properties.\n   * @param {Model} model - The model to extract decorators from\n   * @param {Record<string, unknown>} globalProps - Global properties to include in the field definition\n   * @return {FieldDefinition<AngularFieldDefinition>} The field definition generated from the model\n   * @memberOf module:lib/engine/NgxRenderingEngine\n   */\n  getDecorators(model: Model, globalProps: Record<string, unknown>): FieldDefinition<AngularFieldDefinition> {\n    return this.toFieldDefinition(model, globalProps);\n  }\n\n  /**\n   * @description Destroys the current engine instance and cleans up resources.\n   * @summary This static method clears the current instance reference and parent props,\n   * effectively destroying the singleton instance of the rendering engine. Optionally\n   * removes the form registry for the specified form ID. This can be used to reset the\n   * engine state or to prepare for a new instance creation.\n   * @param {string} [formId] - Optional form ID to remove from registry\n   * @return {Promise<void>} A promise that resolves when the instance is destroyed\n   * @static\n   * @memberOf module:lib/engine/NgxRenderingEngine\n   */\n  static async destroy(formId?: string): Promise<void> {\n    if (formId) NgxFormService.removeRegistry(formId);\n    NgxRenderingEngine._instance = undefined;\n    NgxRenderingEngine._parentProps = undefined;\n  }\n\n  /**\n   * @description Renders a model into an Angular component output.\n   * @summary This method takes a model and converts it to an Angular component output.\n   * It first stores a reference to the model, then converts it to a field definition\n   * using the base RenderingEngine's toFieldDefinition method, and finally converts\n   * that field definition to an Angular component output using fromFieldDefinition.\n   * @template M - Type extending Model\n   * @param {M} model - The model to render\n   * @param {Record<string, unknown>} globalProps - Global properties to pass to the component\n   * @param {ViewContainerRef} vcr - The view container reference for component creation\n   * @param {Injector} injector - The Angular injector for dependency injection\n   * @param {TemplateRef<any>} tpl - The template reference for content projection\n   * @return {AngularDynamicOutput} The Angular component output with component reference and inputs\n   * @mermaid\n   * sequenceDiagram\n   *   participant Client as Client Code\n   *   participant Render as render method\n   *   participant ToField as toFieldDefinition\n   *   participant FromField as fromFieldDefinition\n   *\n   *   Client->>Render: render(model, globalProps, vcr, injector, tpl)\n   *   Render->>Render: Store model reference\n   *   Render->>ToField: toFieldDefinition(model, globalProps)\n   *   ToField-->>Render: fieldDef\n   *   Render->>FromField: fromFieldDefinition(fieldDef, vcr, injector, tpl)\n   *   FromField-->>Render: AngularDynamicOutput\n   *   Render-->>Client: return AngularDynamicOutput\n   * @override\n   * @memberOf module:lib/engine/NgxRenderingEngine\n   */\n  override render<M extends Model>(\n    model: M,\n    globalProps: Record<string, unknown>,\n    vcr: ViewContainerRef,\n    injector: Injector,\n    tpl: TemplateRef<unknown>\n  ): AngularDynamicOutput {\n    let result: AngularDynamicOutput;\n    if (!NgxRenderingEngine._injector) NgxRenderingEngine._injector = injector;\n    try {\n      this._model = model;\n      const formId = `${Date.now()}`.toUpperCase();\n      const fieldDef = this.toFieldDefinition(model, globalProps);\n      const props = fieldDef.props as Partial<IFormComponentProperties>;\n      if (!NgxRenderingEngine._operation) NgxRenderingEngine._operation = props?.operation || undefined;\n      const isArray = (props?.pages && (props?.pages as number) >= 1) || props?.multiple === true;\n      const formGroup = NgxFormService.createForm(formId, isArray);\n      result = this.fromFieldDefinition(fieldDef, vcr, injector, tpl, formId, true, formGroup);\n      if (result.component) (result.component as KeyValue)['formGroup'] = formGroup;\n      NgxRenderingEngine.destroy(formId);\n    } catch (e: unknown) {\n      throw new InternalError(`Failed to render Model ${model.constructor.name}: ${e}`);\n    }\n\n    return result;\n  }\n\n  /**\n   * @description Initializes the rendering engine.\n   * @summary This method initializes the rendering engine. It checks if the engine is already initialized\n   * and sets the initialized flag to true. This method is called before the engine is used\n   * to ensure it's properly set up for rendering operations.\n   * @return {Promise<void>} A promise that resolves when initialization is complete\n   * @override\n   * @memberOf module:lib/engine/NgxRenderingEngine\n   */\n  override async initialize(): Promise<void> {\n    if (!this.initialized) this.initialized = true;\n  }\n\n  async getModal<C extends DecafComponent<Model>>(\n    props: Partial<C>,\n    options?: Partial<ModalOptions>,\n    injector?: EnvironmentInjector\n  ): Promise<IDecafModal> {\n    const modalProps = props as Partial<ModalComponent>;\n    const { globals } = { ...modalProps };\n    if (!globals || !globals?.['operation']) {\n      modalProps.globals = { ...(globals || {}), operation: OperationKeys.CREATE };\n    }\n    const component = await (\n      NgxRenderingEngine.createComponent('ModalComponent', modalProps, injector || undefined) as ModalComponent\n    ).create(options);\n    return component;\n  }\n\n  /**\n   * @description Registers a component with the rendering engine.\n   * @summary This static method registers a component constructor with the rendering engine\n   * under a specific name. It initializes the components registry if needed and throws\n   * an error if a component is already registered under the same name to prevent\n   * accidental overrides.\n   * @param {string} name - The name to register the component under\n   * @param {Constructor<unknown>} constructor - The component constructor\n   * @return {void}\n   * @static\n   * @memberOf module:lib/engine/NgxRenderingEngine\n   */\n  static registerComponent(name: string, constructor: Constructor<unknown>): void {\n    if (!this._components) this._components = {};\n    if (name in this._components) throw new InternalError(`Component already registered under ${name}`);\n    this._components[name] = {\n      constructor: constructor,\n    };\n  }\n\n  /**\n   * @description Retrieves registered components from the rendering engine.\n   * @summary This static method retrieves either all registered components or a specific component\n   * by its selector. When called without a selector, it returns an array of all registered\n   * components. When called with a selector, it returns the specific component if found,\n   * or throws an error if the component is not registered.\n   * @param {string} [selector] - Optional selector to retrieve a specific component\n   * @return {Object|Array} Either a specific component or an array of all components\n   * @static\n   * @memberOf module:lib/engine/NgxRenderingEngine\n   */\n  static components(selector?: string): object | string[] {\n    if (!selector) return Object.values(this._components);\n    if (!(selector in this._components)) throw new InternalError(`No Component registered under ${selector}`);\n    return this._components[selector];\n  }\n\n  /**\n   * @description Sets input properties on a component instance.\n   * @summary This static utility method sets input properties on a component instance\n   * based on the provided inputs object and component metadata. It handles both simple\n   * values and nested objects, recursively processing object properties. The method\n   * validates each input against the component's metadata to ensure only valid inputs\n   * are set.\n   * @param {ComponentRef<unknown>} component - The component reference to set inputs on\n   * @param {KeyValue} inputs - The input properties to set\n   * @param {ComponentMirror<unknown>} metadata - The component metadata for input validation\n   * @return {void}\n   * @mermaid\n   * sequenceDiagram\n   *   participant Caller\n   *   participant SetInputs as setInputs\n   *   participant Parse as parseInputValue\n   *   participant Component as ComponentRef\n   *\n   *   Caller->>SetInputs: setInputs(component, inputs, metadata)\n   *   SetInputs->>SetInputs: Iterate through inputs\n   *   loop For each input\n   *     SetInputs->>SetInputs: Check if input exists in metadata\n   *     alt Input is 'props'\n   *       SetInputs->>Parse: parseInputValue(component, value)\n   *       Parse->>Parse: Recursively process nested objects\n   *       Parse->>Component: setInput(key, value)\n   *     else Input is valid\n   *       SetInputs->>Component: setInput(key, value)\n   *     end\n   *   end\n   * @static\n   * @memberOf module:lib/engine/NgxRenderingEngine\n   */\n  static setInputs(component: ComponentRef<unknown>, inputs: KeyValue, metadata: ComponentMirror<unknown>): void {\n    function parseInputValue(component: ComponentRef<unknown>, input: KeyValue) {\n      Object.keys(input).forEach((key) => {\n        const value = input[key];\n        if (typeof value === 'object' && !!value) return parseInputValue(component, value);\n        component.setInput(key, value);\n      });\n    }\n\n    Object.entries(inputs).forEach(([key, value]) => {\n      const prop = metadata.inputs.find((item: { propName: string }) => item.propName === key);\n      if (prop) {\n        if (key === 'props') {\n          component.setInput(key, value);\n          parseInputValue(component, value);\n        }\n\n        // if (key === 'locale' && !value)\n        //   value = getLocaleFromClassName(this._componentName);\n        component.setInput(key, value);\n      }\n    });\n  }\n}\n","import { apply, metadata } from '@decaf-ts/decoration';\nimport { NgxRenderingEngine } from './NgxRenderingEngine';\nimport { AngularEngineKeys } from './constants';\nimport { Constructor, Metadata } from '@decaf-ts/decoration';\nimport { InternalError } from '@decaf-ts/db-decorators';\nimport { reflectComponentType, Type } from '@angular/core';\nimport { Model } from '@decaf-ts/decorator-validation';\nimport {\n  ModelService,\n  Repository as CoreRepository,\n  Service as CoreService,\n} from '@decaf-ts/core';\n\n/**\n * @description Marks an Angular component as dynamically loadable\n * @summary Decorator that registers an Angular component with the NgxRenderingEngine for dynamic loading.\n * This decorator must be applied before the @Component decorator to properly extract component metadata.\n * It adds metadata to the component class and registers it with the rendering engine using its selector.\n * @function Dynamic\n * @return {Function} A decorator function that can be applied to Angular component classes\n * @mermaid\n * sequenceDiagram\n *   participant C as Component Class\n *   participant D as Dynamic Decorator\n *   participant R as NgxRenderingEngine\n *   participant M as Angular Metadata\n *   C->>D: Apply decorator\n *   D->>M: reflectComponentType()\n *   M-->>D: Return component metadata\n *   alt No metadata found\n *     D->>D: Throw InternalError\n *   else Metadata found\n *     D->>R: registerComponent(selector, constructor)\n *     D->>C: Apply metadata\n *   end\n * @category Decorators\n */\nexport function Dynamic() {\n  return apply(\n    (original: object) => {\n      const metadata = reflectComponentType(original as Type<unknown>);\n\n      if (!metadata)\n        throw new InternalError(`Could not find Component metadata. @Dynamic decorator must come above @Component`);\n\n      NgxRenderingEngine.registerComponent(metadata.selector, original as unknown as Constructor<unknown>);\n    },\n    metadata(Metadata.key(AngularEngineKeys.REFLECT, AngularEngineKeys.DYNAMIC), true)\n  );\n}\n\nfunction isModelConstructor(value: unknown): value is Constructor<any> {\n  return typeof value === 'function' && value.prototype instanceof Model;\n}\n\n/**\n * @description Resolves a decaf {@link CoreService} or {@link ModelService} for use as an Angular property initializer.\n * @summary Angular analogue of for-nest's `@Service()` parameter decorator, adapted to Angular's `inject()` property\n * initializer pattern (e.g. `private svc = injectService(MyService)`). Resolves from decaf's `Injectables` registry\n * rather than Angular's DI tree, so no Angular provider registration is required.\n *\n * - `injectService(SomeModel)` returns the `ModelService<SomeModel>` singleton via {@link ModelService.forModel}.\n * - `injectService(SomeServiceClass)` or `injectService('alias')` returns the matching decaf {@link CoreService}\n *   via {@link CoreService.get}.\n *\n * @example\n * ```typescript\n * @Component({ template: '' })\n * class ProductComponent {\n *   private modelService = injectService(Product);\n *   private authService = injectService(AuthService);\n *   private aliasService = injectService('auth');\n * }\n * ```\n * @function injectService\n * @param key the model class (resolves a `ModelService`), service class, or alias string to resolve.\n * @return the resolved `ModelService<M>` when `key` is a Model class, otherwise the registered `Service` instance.\n * @category Decorators\n */\nexport function injectService<M extends Model<boolean>>(\n  model: Constructor<M>\n): ModelService<M>;\nexport function injectService<S extends CoreService>(\n  service: Constructor<S>\n): S;\nexport function injectService<S extends CoreService>(alias: string): S;\nexport function injectService(key: string | Constructor<any>): any {\n  if (key == null)\n    throw new InternalError(\n      `injectService() requires a model class, service class, or alias string`\n    );\n  if (typeof key === 'string') return CoreService.get(key);\n  if (isModelConstructor(key)) return ModelService.forModel(key);\n  return CoreService.get(key);\n}\n\n/**\n * @description Resolves a decaf {@link CoreRepository} for a Model for use as an Angular property initializer.\n * @summary Angular analogue of for-nest's `@Repository()` parameter decorator, adapted to Angular's `inject()`\n * property initializer pattern (e.g. `private repo = injectRepository(Product)`). Resolves via\n * {@link CoreRepository.forModel} from decaf's registry rather than Angular's DI tree.\n *\n * @example\n * ```typescript\n * @Component({ template: '' })\n * class ProductComponent {\n *   private repo = injectRepository(Product);\n *   private pgRepo = injectRepository(Product, 'postgres');\n * }\n * ```\n * @function injectRepository\n * @param model the Model class to resolve a repository for.\n * @param flavour optional adapter flavour/alias, forwarded to {@link CoreRepository.forModel}.\n * @return the resolved {@link CoreRepository} instance for `model`.\n * @category Decorators\n */\nexport function injectRepository<M extends Model<boolean>>(\n  model: Constructor<M>,\n  flavour?: string\n): CoreRepository<M, any> {\n  if (model == null)\n    throw new InternalError(`injectRepository() requires a model class`);\n  return CoreRepository.forModel(model, flavour);\n}\n","/**\n * @module module:lib/i18n/Loader\n * @description Internationalization loader and helpers for the for-angular package.\n * @summary Provides an implementation of TranslateLoader (I18nLoader) and helper factories\n * to load translation resources. Also exposes locale utilities used by components to resolve\n * localized keys.\n *\n * @link {@link I18nLoader}\n */\nimport { HttpClient, provideHttpClient } from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport { Primitives } from '@decaf-ts/decorator-validation';\nimport { sf } from '@decaf-ts/logging';\nimport {\n  provideTranslateParser,\n  provideTranslateService,\n  RootTranslateServiceConfig,\n  TranslateLoader,\n  TranslateParser,\n  TranslationObject,\n} from '@ngx-translate/core';\nimport { forkJoin, Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { I18N_CONFIG_TOKEN } from '../engine/constants';\nimport { I18nResourceConfig } from '../engine/interfaces';\nimport { AngularProvider, FunctionLike, I18nResourceConfigType, KeyValue } from '../engine/types';\nimport { cleanSpaces, getLocaleFromClassName } from '../utils';\nimport en from './data/en.json';\n\nconst libLanguage: Record<string, TranslationObject> = { en };\n\n/**\n * @description Retrieves the locale context for a given class, object, or string.\n * @summary Resolves the locale context by extracting the class name or using the provided suffix.\n *\n * @param {FunctionLike | object | string} clazz - The class, object, or string to derive the locale context from.\n * @param {string} [suffix] - An optional suffix to append to the locale context.\n * @returns {string} - The resolved locale context string.\n */\nexport function getLocaleContext(clazz: FunctionLike | object | string, suffix?: string): string {\n  return getLocaleFromClassName(clazz, suffix);\n}\n\n/**\n * @description Generates a localized string by combining locale and phrase\n * @summary This utility function creates a properly formatted locale string by combining\n * a locale identifier with a phrase. It handles edge cases such as empty phrases,\n * missing locales, and phrases that already include the locale prefix. This function\n * is useful for ensuring consistent formatting of localized strings throughout the application.\n *\n * @param {string} locale - The locale identifier (e.g., 'en', 'fr')\n * @param {string | undefined} phrase - The phrase to localize\n * @return {string} The formatted locale string, or empty string if phrase is undefined\n *\n * @function generateLocaleFromString\n * @memberOf module:for-angular\n */\nexport function getLocaleContextByKey(locale: string, phrase: string | undefined): string {\n  if (!phrase) return locale;\n  if (!locale || phrase.includes(`${locale}.`)) return phrase;\n  const parts = phrase.split(' ');\n  return `${locale}.${cleanSpaces(parts.join('.'), true)}`;\n}\n\n/**\n * @description Factory function for creating an instance of I18nLoader.\n * @summary Configures and returns an I18nLoader instance with the specified HTTP client and translation resources.\n *\n * @param {HttpClient} http - The HTTP client used to fetch translation resources.\n * @returns {TranslateLoader} - An instance of I18nLoader configured with the provided HTTP client and resources.\n */\nexport function I18nLoaderFactory(http: HttpClient): TranslateLoader {\n  const { resources, versionedSuffix } =\n    inject(I18N_CONFIG_TOKEN, { optional: true }) ?? provideDecafI18nLoader().useValue;\n  return new I18nLoader(\n    http,\n    resources?.length ? resources : [{ prefix: './app/assets/i18n/', suffix: '.json' }],\n    versionedSuffix\n  );\n}\n\n/**\n * @description Provides the I18nLoader configuration.\n * @summary Configures the translation resources and versioned suffix for the I18nLoader.\n *\n * @param {I18nResourceConfigType} [resources=[]] - The translation resources to be used by the loader.\n * @param {boolean} [versionedSuffix=false] - Whether to append a versioned suffix to resource URLs.\n * @returns {object} - The configuration object for the I18nLoader.\n */\nexport function provideDecafI18nLoader(\n  resources: I18nResourceConfigType = [],\n  versionedSuffix: boolean = false\n): {\n  provide: typeof I18N_CONFIG_TOKEN;\n  useValue: { resources: I18nResourceConfig[]; versionedSuffix: boolean };\n} {\n  if (!Array.isArray(resources)) {\n    resources = [resources];\n  }\n  return {\n    provide: I18N_CONFIG_TOKEN,\n    useValue: { resources: [...resources], versionedSuffix },\n  };\n}\n\n/**\n * @description Custom implementation of TranslateLoader for loading translations.\n * @summary Fetches and merges translation resources, supporting versioned suffixes and recursive merging.\n */\nexport class I18nLoader implements TranslateLoader {\n  static enabled: boolean = true;\n\n  static cache: Record<string, TranslationObject> = {};\n\n  /**\n   * @param {HttpClient} http - The HTTP client used to fetch translation resources.\n   * @param {I18nResourceConfig[]} [resources=[]] - The translation resources to be loaded.\n   * @param {boolean} [versionedSuffix=false] - Whether to append a versioned suffix to resource URLs.\n   */\n  constructor(\n    private http: HttpClient,\n    private resources: I18nResourceConfig[] = [],\n    private versionedSuffix: boolean = false\n  ) {}\n\n  /**\n   * @description Appends a versioned suffix to the resource URL if enabled.\n   * @summary Generates a versioned suffix based on the current date.\n   *\n   * @param {string} suffix - The original suffix of the resource URL.\n   * @returns {string} - The modified suffix with a version string appended.\n   */\n  private getSuffix(suffix: string): string {\n    if (!this.versionedSuffix) {\n      return suffix;\n    }\n    const today = new Date();\n    return `${suffix}?version=${today.getFullYear()}${today.getMonth()}${today.getDay()}`;\n  }\n\n  /**\n   * @description Fetches and merges translations for the specified language.\n   * @summary Loads translation resources, merges them recursively, and includes library keys.\n   *\n   * @param {string} lang - The language code for the translations to load.\n   * @returns {Observable<TranslationObject>} - An observable that emits the merged translation object.\n   */\n  getTranslation(lang: string): Observable<TranslationObject> {\n    const libKeys: KeyValue = !I18nLoader.enabled ? {} : libLanguage[lang] || libLanguage['en'] || {};\n    const httpRequests$ = forkJoin(\n      this.resources.map((config) =>\n        this.http.get<TranslationObject>(`${config.prefix}${lang}${this.getSuffix(config.suffix || '.json')}`)\n      )\n    );\n\n    /**\n     * @description Recursively merges two translation objects.\n     * @summary Combines the properties of the source object into the target object.\n     *\n     * @param {KeyValue} target - The target object to merge into.\n     * @param {KeyValue} source - The source object to merge from.\n     * @returns {KeyValue} - The merged object.\n     */\n    function recursiveMerge(target: KeyValue, source: KeyValue): KeyValue {\n      for (const key of Object.keys(source)) {\n        if (source[key] instanceof Object) {\n          if (!target[key]) Object.assign(target, { [key]: {} });\n          recursiveMerge(target[key], source[key]);\n        } else {\n          Object.assign(target, { [key]: source[key] });\n        }\n      }\n      return target;\n    }\n\n    return httpRequests$.pipe(\n      map((res) => {\n        const merged = {\n          ...libKeys,\n          ...res.reduce((acc: KeyValue, current: KeyValue) => {\n            for (const key in current) {\n              let value = current[key] || {};\n              if (libKeys[key]) {\n                value = {\n                  ...libKeys[key],\n                  ...recursiveMerge(libKeys[key] as KeyValue, current[key] as KeyValue),\n                };\n              }\n              acc[key] = value;\n            }\n            return acc;\n          }, {}),\n        };\n        I18nLoader.cache[lang] = merged;\n        return merged;\n      })\n    );\n  }\n}\n\n/**\n * @description Custom implementation of TranslateParser for interpolation.\n * @summary Extends TranslateParser to support string formatting with parameters.\n */\nexport class I18nParser extends TranslateParser {\n  /**\n   * @description Interpolates a translation string with parameters.\n   * @summary Replaces placeholders in the translation string with parameter values.\n   *\n   * @param {string} value - The translation string to interpolate.\n   * @param {object | string} [params={}] - The parameters to replace placeholders with.\n   * @returns {string} - The interpolated translation string.\n   */\n  interpolate(value: string, params: object | string = {}): string {\n    return sf(value, params === Primitives.STRING ? { '0': params } : params).replace(/undefined/g, '');\n  }\n}\n\n/**\n * @description Provides the internationalization (i18n) configuration for the application.\n * @summary Configures the translation service with a fallback language, default language, custom parser, and loader.\n *\n * @param {RootTranslateServiceConfig} [config={fallbackLang: 'en', lang: 'en'}] - The configuration for the translation service, including fallback and default languages.\n * @param {I18nResourceConfigType} [resources=[]] - The translation resources to be used by the loader.\n * @param {boolean} [versionedSuffix=false] - Whether to append a versioned suffix to resource URLs.\n * @returns {AngularProvider[]} - An array of providers for the translation service and loader.\n */\nexport function provideDecafI18nConfig(\n  config: RootTranslateServiceConfig = { fallbackLang: 'en', lang: 'en' },\n  resources: I18nResourceConfigType = [],\n  versionedSuffix: boolean = false,\n  enabled: boolean = true\n): AngularProvider[] {\n  I18nLoader.enabled = enabled;\n  return [\n    provideHttpClient(),\n    provideTranslateService({\n      fallbackLang: config.fallbackLang,\n      lang: config.lang,\n      parser: provideTranslateParser(I18nParser),\n      loader: {\n        provide: TranslateLoader,\n        useFactory: I18nLoaderFactory,\n        deps: [HttpClient],\n      },\n    }),\n    provideDecafI18nLoader(resources, versionedSuffix),\n  ];\n}\n","/**\n * @module NgxMediaService\n * @description Provides utilities for managing media-related features such as color scheme detection,\n * window resize observation, and SVG injection.\n * @summary\n * This module exposes the `NgxMediaService` class, which includes methods for observing the\n * application's color scheme, handling window resize events, and dynamically injecting SVG content\n * into the DOM. It leverages Angular's dependency injection system and RxJS for reactive programming.\n *\n * Key exports:\n * - {@link NgxMediaService}: The main service class providing media-related utilities.\n */\n\nimport { HttpClient } from '@angular/common/http';\nimport { ElementRef, inject, Injectable, NgZone } from '@angular/core';\nimport { BehaviorSubject, fromEvent, merge, Observable, of, Subject, timer } from 'rxjs';\nimport { distinctUntilChanged, map, shareReplay, switchMap, takeUntil, tap } from 'rxjs/operators';\nimport { AngularEngineKeys, WindowColorSchemes } from '../engine/constants';\nimport { IWindowResizeEvent } from '../engine/interfaces';\nimport { WindowColorScheme } from '../engine/types';\nimport { getWindow, getWindowDocument } from '../utils/helpers';\n\n/**\n * @description Service for managing media-related features in an Angular application.\n * @summary\n * The `NgxMediaService` provides utilities for observing and managing media-related features\n * such as color scheme detection, window resize events, and dynamic SVG injection. It leverages\n * Angular's dependency injection system and RxJS for reactive programming.\n *\n * @class NgxMediaService\n * @example\n * // Inject the service into a component\n * constructor(private mediaService: NgxMediaService) {}\n *\n * // Observe the current color scheme\n * this.mediaService.colorScheme$.subscribe(scheme => {\n *   console.log('Current color scheme:', scheme);\n * });\n *\n * // Observe window resize events\n * this.mediaService.resize$.subscribe(dimensions => {\n *   console.log('Window dimensions:', dimensions);\n * });\n */\n@Injectable({\n  providedIn: 'root',\n})\nexport class NgxMediaService {\n  /**\n   * @description Subject used to signal the destruction of the service.\n   * @summary\n   * This subject is used to complete observables and clean up resources when the service is destroyed.\n   * It is utilized with the `takeUntil` operator to manage subscriptions.\n   */\n  private readonly destroy$ = new Subject<void>();\n\n  /**\n   * @description BehaviorSubject to track the window's dimensions.\n   * @summary\n   * This subject holds the current dimensions of the window (width and height) and emits updates\n   * whenever the window is resized. It is used to provide the `resize$` observable.\n   */\n  private resizeSubject = new BehaviorSubject<IWindowResizeEvent>({\n    width: this._window.innerWidth,\n    height: this._window.innerHeight,\n  });\n\n  /**\n   * @description Angular's NgZone service for running code outside Angular's zone.\n   * @summary\n   * This service is used to optimize performance by running certain operations outside\n   * Angular's zone and bringing updates back into the zone when necessary.\n   */\n  private readonly angularZone: NgZone = inject(NgZone);\n\n  /**\n   * @description Angular's HttpClient service for making HTTP requests.\n   * @summary\n   * This service is used to fetch resources such as SVG files for injection into the DOM.\n   */\n  // private http = inject(HttpClient);\n\n  /**\n   * @description Tracks the current color scheme of the application.\n   * @summary\n   * This property holds the current color scheme (light, dark, or undefined) and is updated\n   * whenever the color scheme changes.\n   */\n  private currentSchema: WindowColorScheme = WindowColorSchemes.undefined;\n\n  /**\n   * @description Observable that emits the current color scheme of the application.\n   * @summary\n   * This observable emits the current color scheme (light or dark) and updates whenever\n   * the system's color scheme preference changes or the `DARK_PALETTE_CLASS` is toggled.\n   */\n  readonly colorScheme$: Observable<WindowColorScheme> = this.colorSchemeObserver();\n\n  /**\n   * @description Observable that emits the current dimensions of the window.\n   * @summary\n   * This observable emits the current dimensions of the window (width and height) and updates\n   * whenever the window is resized.\n   */\n  readonly resize$: Observable<IWindowResizeEvent> = this.resizeSubject.asObservable();\n\n  /**\n   * @description Retrieves the global `window` object.\n   * @summary\n   * This getter provides access to the global `window` object, ensuring it is properly typed.\n   *\n   * @return {Window} The global `window` object.\n   */\n  private get _window(): Window {\n    return getWindow() as Window;\n  }\n\n  /**\n   * @description Retrieves the global `document` object.\n   * @summary\n   * This getter provides access to the global `document` object, ensuring it is properly typed.\n   *\n   * @return {Document} The global `document` object.\n   */\n  private get _document(): Document {\n    return getWindowDocument() as Document;\n  }\n\n  darkModeEnabled(): boolean {\n    return this._document.documentElement.classList.contains('has-dark-mode');\n  }\n\n  /**\n   * @description Observes window resize events and emits the updated dimensions.\n   * @summary\n   * This method listens for window resize events and emits the new dimensions\n   * (width and height) through the `resize$` observable. The resize events are\n   * processed outside Angular's zone to improve performance, and updates are\n   * brought back into the Angular zone to ensure change detection.\n   *\n   * @return {Observable<IWindowResizeEvent>} An observable that emits the window dimensions on resize.\n   * @function windowResizeObserver\n   * @example\n   * mediaService.windowResizeObserver().subscribe(dimensions => {\n   *   console.log('Window dimensions:', dimensions);\n   * });\n   */\n  windowResizeObserver(): Observable<IWindowResizeEvent> {\n    const win = this._window;\n    this.angularZone.runOutsideAngular(() => {\n      fromEvent(win, 'resize')\n        .pipe(distinctUntilChanged(), takeUntil(this.destroy$), shareReplay({ bufferSize: 1, refCount: true }))\n        .subscribe(() => {\n          const dimensions: IWindowResizeEvent = {\n            width: win.innerWidth,\n            height: win.innerHeight,\n          };\n          // update within the zone to reflect in Angular\n          this.angularZone.run(() => this.resizeSubject.next(dimensions));\n        });\n    });\n\n    return this.resize$;\n  }\n\n  /**\n   * @description Observes the color scheme of the application.\n   * @summary\n   * This method observes changes in the system's color scheme preference (light or dark)\n   * and the presence of the `DARK_PALETTE_CLASS` on the document's root element.\n   * Optionally, it can toggle the dark mode class on a specific component.\n   *\n   * @param {ElementRef | HTMLElement} [component] - Optional component to toggle the dark mode class on.\n   * @return {Observable<WindowColorScheme>} An observable that emits the current color scheme (`dark` or `light`).\n   * @function colorSchemeObserver\n   * @example\n   * // Observe the color scheme globally\n   * mediaService.colorSchemeObserver().subscribe(scheme => {\n   *   console.log('Current color scheme:', scheme);\n   * });\n   *\n   * // Observe and toggle dark mode on a specific component\n   * const component = document.querySelector('.my-component');\n   * mediaService.colorSchemeObserver(component).subscribe();\n   */\n  colorSchemeObserver(component?: ElementRef | HTMLElement): Observable<WindowColorScheme> {\n    if (!this.darkModeEnabled()) return of(WindowColorSchemes.light);\n    const win = this._window;\n    const doc = this._document;\n    const documentElement = doc.documentElement;\n    const mediaFn = win.matchMedia(`(prefers-color-scheme: ${WindowColorSchemes.dark})`);\n\n    if (component) {\n      this.colorScheme$.subscribe((schema: WindowColorScheme) => {\n        this.toggleClass(\n          component,\n          AngularEngineKeys.DARK_PALETTE_CLASS,\n          schema === WindowColorSchemes.dark ? true : false\n        );\n      });\n    }\n\n    return merge(\n      of(mediaFn.matches ? WindowColorSchemes.dark : WindowColorSchemes.light),\n      // observe media query changes\n      new Observable<WindowColorScheme>((observer) => {\n        this.angularZone.runOutsideAngular(() => {\n          const mediaQuery = mediaFn;\n          const subscription = fromEvent<MediaQueryListEvent>(mediaQuery, 'change')\n            .pipe(map((event) => (event.matches ? WindowColorSchemes.dark : WindowColorSchemes.light)))\n            .subscribe((value) => {\n              this.angularZone.run(() => observer.next(value));\n            });\n          return () => subscription.unsubscribe();\n        });\n      }),\n      // observe ngx-dcf-palettedark class changes\n      new Observable<WindowColorScheme>((observer) => {\n        this.angularZone.runOutsideAngular(() => {\n          const observerConfig = { attributes: true, attributeFilter: ['class'] };\n          const mutationObserver = new MutationObserver(() => {\n            const theme = documentElement.classList.contains(AngularEngineKeys.DARK_PALETTE_CLASS)\n              ? WindowColorSchemes.dark\n              : WindowColorSchemes.light;\n            this.angularZone.run(() => observer.next(theme));\n          });\n          mutationObserver.observe(documentElement, observerConfig);\n          // this.angularZone.run(() => observer.next(theme));\n\n          // this.angularZone.run(() => observer.next(theme));\n          return () => mutationObserver.disconnect();\n        });\n      })\n    ).pipe(\n      distinctUntilChanged(),\n      tap((scheme) => {\n        const shouldAdd = scheme === WindowColorSchemes.dark;\n        if (shouldAdd) {\n          // always add when the emitted scheme is dark\n          this.toggleClass(documentElement, AngularEngineKeys.DARK_PALETTE_CLASS, true);\n        } else {\n          // remove the class only if the previously stored schema was dark\n          if (this.currentSchema === WindowColorSchemes.dark) {\n            this.toggleClass(documentElement, AngularEngineKeys.DARK_PALETTE_CLASS, false);\n          }\n        }\n        // store the latest schema value\n        this.currentSchema = scheme;\n      }),\n      takeUntil(this.destroy$),\n      shareReplay({ bufferSize: 1, refCount: true })\n    );\n  }\n\n  /**\n   * @description Observes the scroll state of the active page.\n   * @summary\n   * This method observes the scroll position of the active page's content and emits a boolean\n   * indicating whether the scroll position exceeds the specified offset. It waits for a delay\n   * before starting the observation to allow page transitions to complete.\n   *\n   * @param {number} offset - The scroll offset to compare against.\n   * @param {number} [awaitDelay=500] - The delay in milliseconds before starting the observation.\n   * @return {Observable<boolean>} An observable that emits `true` if the scroll position exceeds the offset, otherwise `false`.\n   * @function observePageScroll\n   * @example\n   * mediaService.observePageScroll(100).subscribe(isScrolled => {\n   *   console.log('Page scrolled past 100px:', isScrolled);\n   * });\n   */\n  observePageScroll(offset: number, awaitDelay: number = 500): Observable<boolean> {\n    // await delay for page change to complete\n    return timer(awaitDelay).pipe(\n      switchMap(\n        () =>\n          new Observable<boolean>((observer) => {\n            const activeContent = this._document.querySelector(\n              'ion-router-outlet .ion-page:not(.ion-page-hidden) ion-content'\n            ) as HTMLIonContentElement;\n            if (!(activeContent && typeof (activeContent as HTMLIonContentElement).getScrollElement === 'function'))\n              return this.angularZone.run(() => observer.next(false));\n\n            (activeContent as HTMLIonContentElement).getScrollElement().then((element: HTMLElement) => {\n              const emitScrollState = () => {\n                const scrollTop = element.scrollTop || 0;\n                this.angularZone.run(() => observer.next(scrollTop > offset));\n              };\n              element.addEventListener('scroll', emitScrollState);\n              emitScrollState();\n              return () => element.removeEventListener('scroll', emitScrollState);\n            });\n          })\n      ),\n      distinctUntilChanged(),\n      takeUntil(this.destroy$),\n      shareReplay({ bufferSize: 1, refCount: true })\n    );\n  }\n\n  /**\n   * @description Loads an SVG file and injects it into a target element.\n   * @summary\n   * This method fetches an SVG file from the specified path and injects its content\n   * into the provided target element. The operation is performed outside Angular's\n   * zone to improve performance, and the DOM update is brought back into the Angular\n   * zone to ensure change detection.\n   *\n   * @param {string} path - The path to the SVG file.\n   * @param {HTMLElement} target - The target element to inject the SVG content into.\n   * @return {void}\n   * @function loadSvgObserver\n   * @example\n   * const targetElement = document.getElementById('svg-container');\n   * mediaService.loadSvgObserver('/assets/icons/icon.svg', targetElement);\n   */\n  loadSvgObserver(http: HttpClient, path: string, target: HTMLElement): void {\n    this.angularZone.runOutsideAngular(() => {\n      const svg$ = http\n        .get(path, { responseType: 'text' })\n        .pipe(takeUntil(this.destroy$), shareReplay({ bufferSize: 1, refCount: true }));\n      svg$.subscribe((svg: string) => {\n        this.angularZone.run(() => {\n          target.innerHTML = svg;\n        });\n      });\n    });\n  }\n\n  /**\n   * @description Determines if the current theme is dark mode.\n   * @summary\n   * Observes the `colorScheme$` observable and checks if the `DARK_PALETTE_CLASS` is present\n   * on the document's root element or if the emitted color scheme is `dark`.\n   *\n   * @return {Observable<boolean>} An observable that emits `true` if dark mode is active, otherwise `false`.\n   * @function isDarkMode\n   * @example\n   * mediaService.isDarkMode().subscribe(isDark => {\n   *   console.log('Dark mode active:', isDark);\n   * });\n   */\n  isDarkMode(): Observable<boolean> {\n    if (!this.darkModeEnabled()) return of(false);\n    const documentElement = this._document.documentElement;\n    return this.colorScheme$.pipe(\n      map(\n        (scheme) =>\n          documentElement.classList.contains(AngularEngineKeys.DARK_PALETTE_CLASS) || scheme === WindowColorSchemes.dark\n      ),\n      distinctUntilChanged(),\n      shareReplay({ bufferSize: 1, refCount: true }),\n      takeUntil(this.destroy$)\n    );\n  }\n\n  /**\n   * @description Toggles dark mode for a specific component.\n   * @summary\n   * Subscribes to the `colorScheme$` observable and adds or removes the `DARK_PALETTE_CLASS`\n   * on the provided component based on the emitted color scheme.\n   *\n   * @param {ElementRef | HTMLElement} component - The target component to toggle dark mode on.\n   * @return {void}\n   * @function setDarkMode\n   * @example\n   * const component = document.querySelector('.my-component');\n   * mediaService.setDarkMode(component);\n   */\n  setDarkMode(component: ElementRef | HTMLElement): void {\n    this.colorScheme$.subscribe((scheme) => {\n      this.toggleClass(\n        component,\n        AngularEngineKeys.DARK_PALETTE_CLASS,\n        scheme === WindowColorSchemes.dark ? true : false\n      );\n    });\n  }\n\n  /**\n   * @description Add or remove a CSS class on one or multiple elements.\n   * @summary\n   * Accepts an ElementRef, HTMLElement, or array of mixed elements and will add\n   * or remove the provided `className` depending on the `add` flag. Operates\n   * defensively: resolves ElementRef.nativeElement when needed and ignores\n   * falsy entries.\n   *\n   * @param {(ElementRef | HTMLElement | unknown[])} component - Single element,\n   * ElementRef, or array of elements to update.\n   * @param {string} className - CSS class name to add or remove.\n   * @param {boolean} [add=true] - Whether to add (true) or remove (false) the class.\n   * @return {void}\n   * @function toggleClass\n   * @example\n   * // Add a class to a single element\n   * mediaService.toggleClass(element, 'active', true);\n   *\n   * // Remove a class from multiple elements\n   * mediaService.toggleClass([element1, element2], 'hidden', false);\n   */\n  toggleClass(component: ElementRef | HTMLElement | unknown[], className: string, add: boolean = true): void {\n    const components = Array.isArray(component) ? component : [component];\n    components.forEach((element) => {\n      if ((element as ElementRef)?.nativeElement) element = (element as ElementRef).nativeElement;\n      if (element instanceof HTMLElement) {\n        switch (add) {\n          case true:\n            (element as HTMLElement).classList.add(className);\n            break;\n          case false:\n            (element as HTMLElement).classList.remove(className);\n            break;\n        }\n      }\n    });\n  }\n\n  /**\n   * @description Clean up internal subscriptions and observers used by the service.\n   * @summary\n   * Triggers completion of the internal `destroy$` subject so that any\n   * Observables created with `takeUntil(this.destroy$)` will complete and\n   * resources are released.\n   *\n   * @return {void}\n   * @function destroy\n   */\n  destroy(): void {\n    this.destroy$.next();\n    this.destroy$.complete();\n  }\n}\n","import { Location } from '@angular/common';\nimport { inject, Injectable } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { Primitives } from '@decaf-ts/decorator-validation';\nimport { ComponentEventNames, IDecafRouter } from '@decaf-ts/ui-decorators';\nimport { NavController } from '@ionic/angular/standalone';\nimport { RouteDirections } from '../engine/constants';\nimport { KeyValue } from '../engine/types';\n\n/**\n * @description Service for handling routing operations in the application.\n * @summary The RouterService provides a unified interface for navigation and route management,\n * abstracting the underlying Angular Router and Ionic NavController functionality. It offers\n * methods for navigating between routes, retrieving URL information, and managing query parameters.\n * This service is designed to simplify navigation patterns and provide consistent behavior\n * across the application.\n *\n * @class RouterService\n * @injectable\n */\n@Injectable({\n  providedIn: 'root',\n})\nexport class NgxRouterService implements IDecafRouter {\n  /**\n   * @description Stores the previous URL for back navigation.\n   * @summary Caches the previous URL from the router navigation events.\n   * This is used as a reference point for back navigation and for determining\n   * the navigation history of the application.\n   *\n   * @private\n   * @type {string}\n   * @memberOf RouterService\n   */\n  private previousUrl!: string;\n\n  /**\n   * @description Angular Router service.\n   * @summary Injected Angular Router service that provides core navigation capabilities,\n   * URL manipulation, and navigation event handling. This service is used for most\n   * routing operations and for accessing information about the current route.\n   *\n   * @private\n   * @type {Router}\n   * @memberOf RouterService\n   */\n  private router: Router = inject(Router);\n\n  /**\n   * @description Angular ActivatedRoute service.\n   * @summary Injected service that provides access to information about a route\n   * associated with a component loaded in an outlet. This service is used to\n   * access route parameters, query parameters, and other route-specific data.\n   *\n   * @private\n   * @type {ActivatedRoute}\n   * @memberOf RouterService\n   */\n  private route: ActivatedRoute = inject(ActivatedRoute);\n\n  /**\n   * @description Ionic NavController service.\n   * @summary Injected Ionic service that provides methods for navigating between pages\n   * with animated transitions. This service extends Angular's routing capabilities\n   * with mobile-friendly navigation patterns and animations.\n   *\n   * @private\n   * @type {NavController}\n   * @memberOf RouterService\n   */\n  private navController: NavController = inject(NavController);\n\n  /**\n   * @description Angular Location service.\n   * @summary Injected service that provides access to the browser's URL and history.\n   * This service is used for interacting with the browser's history API, allowing\n   * for back navigation and URL manipulation outside of Angular's router.\n   *\n   * @private\n   * @type {Location}\n   * @memberOf RouterService\n   */\n  private location: Location = inject(Location);\n\n  /**\n   * @description Creates an instance of RouterService.\n   * @summary Initializes a new RouterService. The commented line suggests that in a previous\n   * version, this service was registered with an injectable registry system, which may have\n   * been used for dependency tracking or service discovery.\n   *\n   * @memberOf RouterService\n   */\n  // constructor() {}\n\n  /**\n   * @description Parses query parameters from the current route.\n   * @summary Extracts specified query parameters from the current route and returns them\n   * as an array of key-value pairs. This method supports both single parameter and\n   * multiple parameter extraction, making it flexible for various use cases.\n   *\n   * @param {string | string[]} params - The parameter name(s) to extract from the route\n   * @return {KeyValue[]} An array of key-value objects representing the extracted parameters\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as Component\n   *   participant R as RouterService\n   *   participant A as ActivatedRoute\n   *\n   *   C->>R: parseAllQueryParams(params)\n   *   alt params is string\n   *     R->>R: Convert params to array\n   *   end\n   *   R->>R: Initialize empty result array\n   *   loop For each param in params\n   *     R->>A: Get param value from queryParamMap\n   *     A-->>R: Return param value or null\n   *     R->>R: Create key-value object\n   *     R->>R: Add to result array\n   *   end\n   *   R-->>C: Return array of key-value pairs\n   *\n   * @memberOf RouterService\n   */\n  parseAllQueryParams(params?: string | string[]): KeyValue[] {\n    if (!params) {\n      params = Object.keys(this.route.snapshot.queryParams);\n    }\n    if (typeof params === Primitives.STRING) {\n      params = [params as string];\n    }\n    return (params as string[]).reduce((acc: KeyValue[], param: string) => {\n      const item = {\n        [param]: (this.route.snapshot.queryParamMap.get(param) as string) || null,\n      };\n      return [...acc, item];\n    }, []);\n  }\n\n  /**\n   * @description Checks if a query parameter exists in the current route.\n   * @summary Determines whether a specific query parameter is present in the current route's\n   * query parameters. This is useful for conditional logic based on the presence of\n   * certain parameters in the URL.\n   *\n   * @param {string} param - The name of the query parameter to check\n   * @return {boolean} True if the parameter exists, false otherwise\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as Component\n   *   participant R as RouterService\n   *   participant A as ActivatedRoute\n   *\n   *   C->>R: hasQueryParam(param)\n   *   R->>A: Access snapshot.queryParams\n   *   R->>R: Check if param exists in queryParams\n   *   R-->>C: Return boolean result\n   *\n   * @memberOf RouterService\n   */\n  hasQueryParam(param: string): boolean {\n    return !!this.route.snapshot.queryParams?.[param];\n  }\n\n  /**\n   * @description Retrieves a specific query parameter from the current route.\n   * @summary Extracts a single query parameter from the current route and returns it\n   * as a key-value pair. This method leverages parseAllQueryParams internally and\n   * returns the first result or undefined if the parameter doesn't exist.\n   *\n   * @param {string} param - The name of the query parameter to retrieve\n   * @return {KeyValue | undefined} A key-value object representing the parameter, or undefined if not found\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as Component\n   *   participant R as RouterService\n   *\n   *   C->>R: getQueryParam(param)\n   *   R->>R: parseAllQueryParams(param)\n   *   R->>R: Extract first result or undefined\n   *   R-->>C: Return key-value object or undefined\n   *\n   * @memberOf RouterService\n   */\n  getQueryParam(param: string): KeyValue | undefined {\n    return this.parseAllQueryParams(param)?.[0] || undefined;\n  }\n\n  /**\n   * @description Retrieves the value of a specific query parameter.\n   * @summary Extracts the value of a single query parameter from the current route.\n   * This is a convenience method that handles the extraction and returns just the\n   * value rather than a key-value pair.\n   *\n   * @param {string} param - The name of the query parameter to retrieve\n   * @return {string | undefined} The value of the parameter, or undefined if not found\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as Component\n   *   participant R as RouterService\n   *\n   *   C->>R: getQueryParamValue(param)\n   *   R->>R: parseAllQueryParams(param)\n   *   R->>R: Extract value from first result or undefined\n   *   R-->>C: Return string value or undefined\n   *\n   * @memberOf RouterService\n   */\n  getQueryParamValue(param: string): string | undefined {\n    return (this.parseAllQueryParams(param)?.[0]?.[param] as string) || undefined;\n  }\n\n  /**\n   * @description Retrieves the last segment of the current URL.\n   * @summary Extracts the final path segment from the current URL, which often\n   * represents the current page or resource identifier. This method first attempts\n   * to use the Angular Router's URL, and falls back to the window location if needed.\n   *\n   * @return {string} The last segment of the current URL path\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as Component\n   *   participant R as RouterService\n   *   participant W as Window\n   *\n   *   C->>R: getLastUrlSegment()\n   *   alt Router URL available\n   *     R->>R: Split router.url by &#39;/&#39;\n   *   else Router URL not available\n   *     R->>W: Get window.location.href\n   *     R->>R: Split href by &#39;/&#39;\n   *   end\n   *   R->>R: Extract last segment\n   *   R-->>C: Return last segment\n   *\n   * @memberOf RouterService\n   */\n  getLastUrlSegment(): string {\n    return (this.router.url || globalThis.window.location.href).split('/').pop() as string;\n  }\n\n  /**\n   * @description Retrieves the current URL of the application.\n   * @summary Extracts the current URL path from either the Angular Router or the browser's\n   * window location, depending on availability. It also cleans the URL by removing the\n   * leading forward slash for consistency.\n   *\n   * @return {string} The current URL of the application without the leading slash\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as Component\n   *   participant R as RouterService\n   *   participant W as Window\n   *\n   *   C->>R: getCurrentUrl()\n   *   R->>R: Get router.url\n   *   R->>W: Get window.location.pathname\n   *   alt router.url is &#39;/&#39; and different from pathname\n   *     R->>R: Use pathname\n   *   else\n   *     R->>R: Use router.url\n   *   end\n   *   R->>R: Remove leading &#39;/&#39;\n   *   R-->>C: Return clean URL\n   *\n   * @memberOf RouterService\n   */\n  getCurrentUrl(): string {\n    const routerUrl = this.router.url;\n    const pathName = globalThis.window?.location?.pathname;\n    const result = routerUrl === '/' && routerUrl !== pathName ? pathName : routerUrl;\n    return result.replace('/', '');\n  }\n\n  /**\n   * @description Retrieves the URL of the previous page.\n   * @summary Extracts the URL of the previous page from the router's navigation history.\n   * This information is useful for back navigation and for understanding the user's\n   * navigation path through the application.\n   *\n   * @return {string} The URL of the previous page\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as Component\n   *   participant R as RouterService\n   *   participant N as Router Navigation\n   *\n   *   C->>R: getPreviousUrl()\n   *   R->>N: Get currentNavigation\n   *   alt previousNavigation exists\n   *     R->>N: Extract previousNavigation.finalUrl\n   *     R->>R: Store in previousUrl\n   *   end\n   *   R-->>C: Return previousUrl\n   *\n   * @memberOf RouterService\n   */\n  getPreviousUrl(): string {\n    const currentNavigation = this.router.currentNavigation() || this.router.getCurrentNavigation();\n    if (!!currentNavigation && currentNavigation.previousNavigation?.finalUrl?.toString() !== undefined)\n      this.previousUrl = currentNavigation.previousNavigation?.finalUrl?.toString();\n    return this.previousUrl as string;\n  }\n\n  /**\n   * @description Navigates back to the previous page.\n   * @summary Triggers navigation back to the previous page in the browser's history.\n   * This method also dispatches a custom event to notify other components about\n   * the back navigation.\n   *\n   * @return {void}\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as Component\n   *   participant R as RouterService\n   *   participant L as Location\n   *\n   *   C->>R: backToLastPage()\n   *   R->>L: Dispatch BackButtonClickEvent event\n   *   R->>L: Navigate back\n   *\n   * @memberOf RouterService\n   */\n  backToLastPage(): void {\n    globalThis.window.dispatchEvent(\n      new CustomEvent(ComponentEventNames.BackButtonClickEvent, {\n        bubbles: true,\n        composed: true,\n        cancelable: false,\n        detail: { refres: true },\n      })\n    );\n    this.location.back();\n  }\n\n  /**\n   * @description Navigates to a specified page.\n   * @summary Triggers navigation to a specified page using the Ionic NavController.\n   * Supports different navigation directions and additional options.\n   *\n   * @param {string} page - The page to navigate to\n   * @param {RouteDirections} direction - The direction of navigation\n   * @param {KeyValue} [options] - Additional navigation options\n   * @return {Promise<boolean>} A promise that resolves to true if navigation is successful, otherwise false\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as Component\n   *   participant R as RouterService\n   *   participant N as NavController\n   *\n   *   C->>R: navigateTo(page, direction, options)\n   *   alt direction is ROOT\n   *     R->>N: navigateRoot(page, options)\n   *   else direction is FORWARD\n   *     R->>N: navigateForward(page, options)\n   *   else direction is BACK\n   *     R->>N: navigateBack(page, options)\n   *   end\n   *   N-->>R: Return navigation result\n   *   R-->>C: Return boolean result\n   *\n   * @memberOf RouterService\n   */\n  async navigate(page: string, direction?: RouteDirections, options?: KeyValue): Promise<boolean> {\n    if (!direction) {\n      direction = RouteDirections.FORWARD;\n    }\n    if (direction === RouteDirections.ROOT) return this.navController.navigateRoot(page, options);\n    if (direction === RouteDirections.FORWARD) return await this.navController.navigateForward(page, options);\n    return await this.navController.navigateBack(page, options);\n  }\n}\n","/**\n * @module module:lib/i18n/FakeLoader\n * @description Simple fake translate loader used for tests or fallback scenarios.\n * @summary Implements a minimal TranslateLoader that returns a small set of default\n * translation keys. Useful for development, demos or when a full HTTP-backed loader is not available.\n *\n * @link {@link I18nFakeLoader}\n */\nimport { TranslateLoader } from \"@ngx-translate/core\";\nimport { Observable, of } from \"rxjs\";\nimport { KeyValue } from \"../engine\";\n\nexport const MockedEnTranslations = {\n  FIELD_LABEL: 'Translated Label',\n  FIELD_PLACEHOLDER: 'Translated Placeholder',\n  HELLO: 'Hello',\n  GOODBYE: 'Goodbye'\n} as const;\n\nexport class I18nFakeLoader implements TranslateLoader {\n  getTranslation(): Observable<KeyValue> {\n    return of(MockedEnTranslations);\n  }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { Primitives } from '@decaf-ts/decorator-validation';\nimport { DecafTranslateService } from '@decaf-ts/ui-decorators';\nimport {\n  InterpolatableTranslationObject,\n  InterpolationParameters,\n  Language,\n  TranslateService,\n  Translation,\n} from '@ngx-translate/core';\nimport { firstValueFrom, Observable } from 'rxjs';\nimport { KeyValue } from '../engine/types';\nimport { I18nLoader } from '../i18n';\n\n@Injectable({\n  providedIn: 'root',\n})\nexport class NgxTranslateService extends DecafTranslateService implements DecafTranslateService {\n  private translateService = inject(TranslateService);\n\n  override instant(key: string, interpolateParams?: InterpolationParameters): Translation {\n    return this.translateService.instant(key, interpolateParams);\n  }\n\n  override async translate(key: string, params?: InterpolationParameters | string): Promise<string | KeyValue> {\n    if (typeof params === Primitives.STRING) {\n      params = { '0': params };\n    }\n    return firstValueFrom(this.translateService.instant(key, params as InterpolationParameters));\n  }\n\n  async get(key: string | string[], params?: InterpolationParameters | string): Promise<string | KeyValue> {\n    if (key) {\n      if (typeof params === Primitives.STRING) {\n        params = { '0': params };\n      }\n      return await firstValueFrom(this.translateService.get(key, (params || {}) as object));\n    }\n    return key;\n  }\n\n  use(lang: string): void {\n    this.translateService.use(lang);\n  }\n\n  setFallbackLang(lang: string): Observable<InterpolatableTranslationObject> {\n    return this.translateService.setFallbackLang(lang);\n  }\n\n  getCurrentLang(): Language {\n    return this.translateService.getCurrentLang();\n  }\n\n  getOnCache(lang?: string): Translation {\n    if (!lang) {\n      lang = this.getCurrentLang();\n    }\n    return I18nLoader.cache[lang] || {};\n  }\n}\n","import { Directive, inject, Input } from '@angular/core';\nimport { AttributeOption, Condition, Observer, OrderDirection, Paginator } from '@decaf-ts/core';\nimport { CrudOperations, IRepository, OperationKeys, PrimaryKeyType } from '@decaf-ts/db-decorators';\nimport { Constructor, Metadata } from '@decaf-ts/decoration';\nimport { Model, Primitives } from '@decaf-ts/decorator-validation';\nimport { DecafComponent } from '@decaf-ts/ui-decorators';\nimport { debounceTime, shareReplay, Subject, takeUntil } from 'rxjs';\nimport { DB_ADAPTER_PROVIDER_TOKEN } from './constants';\nimport { getModelAndRepository } from './helpers';\nimport { IFilterQuery } from './interfaces';\nimport { DecafRepository, DecafRepositoryAdapter, KeyValue } from './types';\n\ntype TransactionResponse<M extends Model> = M | M[] | PrimaryKeyType | PrimaryKeyType[] | undefined;\n\n@Directive()\nexport class NgxRepositoryDirective<M extends Model> extends DecafComponent<M> {\n  private _context?: DecafRepository<M>;\n\n  /**\n   * @description Store query results for the component.\n   * @summary Holds an array of `Model` instances returned from repository queries.\n   * This is used internally to cache query results that child components may bind to.\n   * @type {M[]}\n   */\n  @Input()\n  _query: M[] = [];\n\n  /**\n   * @description Backing main model data supplied to the component.\n   * @summary Holds the raw `Model` instance or a generic key-value payload that child\n   * components may bind to. When provided, it represents the contextual data the\n   * component should render or mutate.\n   * @type {M | M[] | KeyValue | KeyValue[] | undefined}\n   */\n  @Input()\n  _data?: M | M[] | KeyValue | KeyValue[] = {};\n\n  /**\n   * @description Data model or model name for component operations.\n   * @summary The data model that this component will use for CRUD operations. This can be provided\n   * as a Model instance, a model constructor, or a string representing the model's registered name.\n   * When set, this property provides the component with access to the model's schema, validation rules,\n   * and metadata needed for rendering and data operations.\n   * @type {Model | string | undefined}\n   * @memberOf module:lib/engine/NgxRepositoryDirective\n   */\n  @Input()\n  override model!: Model | string | undefined;\n\n  /**\n   * @description Primary key value of the current model instance.\n   * @summary Specifies the primary key value for the current model record being displayed or\n   * manipulated by the component. This identifier is used for CRUD operations that target\n   * specific records, such as read, update, and delete operations. The value corresponds to\n   * the field designated as the primary key in the model definition.\n   * @type {PrimaryKeyType}\n   * @memberOf module:lib/engine/NgxRepositoryDirective\n   */\n  @Input()\n  override modelId: PrimaryKeyType = '';\n\n  /**\n   * @description The name of the model class to operate on.\n   * @summary Identifies which registered model class this component should work with.\n   * This name is used to resolve the model constructor from the global model registry\n   * and instantiate the appropriate repository for data operations. The model must\n   * be properly registered using the @Model decorator for resolution to work.\n   *\n   * @type {string}\n   */\n  @Input()\n  modelName!: string;\n\n  /**\n   * @description Primary key field name for the data model.\n   * @summary Specifies which field in the model should be used as the primary key.\n   * This is typically used for identifying unique records in operations like update and delete.\n   * If not explicitly set, it defaults to the repository's configured primary key or 'id'.\n   * @type {string}\n   */\n  @Input()\n  override pk!: string;\n\n  /**\n   * @description Pre-built filtering expression applied to repository queries.\n   * @summary Supply a custom `AttributeOption` to control how records are constrained. When omitted,\n   * the directive derives a condition from `filterBy` or `pk`, comparing it against `modelId`.\n   * @type {AttributeOption<M>}\n   */\n  @Input()\n  override filter!: AttributeOption<M>;\n\n  /**\n   * @description Model field used when generating the default condition.\n   * @summary Indicates which key should be compared to `modelId` when `filter` is not provided.\n   * Defaults to the configured primary key so overrides are only needed for custom lookups.\n   * @type {string}\n   */\n  @Input()\n  override filterBy!: string;\n\n  /**\n   * @description Primitive type descriptor for the primary key.\n   * @summary Helps coerce `modelId` to the proper primitive before executing queries, ensuring numeric\n   * identifiers are handled correctly when the repository expects number-based keys.\n   * @type {string}\n   */\n  pkType!: string;\n\n  /**\n   * @description The current search query value.\n   * @summary Stores the text entered in the search bar. This is used to filter\n   * the list data or to send as a search parameter when fetching new data.\n   *\n   * @type {string | undefined}\n   * @memberOf ListComponent\n   */\n  searchValue?: string | IFilterQuery | undefined;\n\n  /**\n   * @description The starting index for data fetching.\n   * @summary Specifies the index from which to start fetching data. This is used\n   * for pagination and infinite scrolling to determine which subset of data to load.\n   *\n   * @type {number}\n   * @default 0\n   */\n  @Input()\n  start: number = 0;\n\n  /**\n   * @description The number of items to fetch per page or load operation.\n   * @summary Determines how many items are loaded at once during pagination or\n   * infinite scrolling. This affects the size of data chunks requested from the source.\n   *\n   * @type {number}\n   * @default 10\n   */\n  @Input()\n  limit: number = 10;\n\n  /**\n   * @description Sorting parameters for data fetching.\n   * @summary Specifies how the fetched data should be sorted. This can be provided\n   * as a string (field name with optional direction) or a direct object.\n   *\n   * @type {OrderDirection}\n   * @default OrderDirection.DSC\n   */\n  @Input()\n  sortDirection: OrderDirection = OrderDirection.DSC;\n\n  /**\n   * @description Sorting parameters for data fetching.\n   * @summary Specifies how the fetched data should be sorted. This can be provided\n   * as a string (field name with optional direction) or a direct object.\n   *\n   * @type {string | KeyValue | undefined}\n   */\n  @Input()\n  sortBy!: string;\n\n  /**\n   * @description Available field indexes for filtering operations.\n   * @summary Defines the list of field names that users can filter by. These represent\n   * the data properties available for filtering operations. Each index corresponds to\n   * a field in the data model that supports comparison operations.\n   *\n   * @type {string[]}\n   * @default []\n   */\n  @Input()\n  indexes: string[] = [];\n\n  /**\n   * @description Subject for debouncing repository observation events.\n   * @summary RxJS Subject that collects repository change events and emits them after\n   * a debounce period. This prevents multiple rapid repository changes from triggering\n   * multiple list refresh operations, improving performance and user experience.\n   *\n   * @private\n   * @type {Subject<any>}\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  protected repositoryObserverSubject: Subject<any> = new Subject<any>();\n\n  /**\n   * @description Observer object for repository change notifications.\n   * @summary Implements the Observer interface to receive notifications when the\n   * underlying data repository changes. This enables automatic list updates when\n   * data is created, updated, or deleted through the repository.\n   *\n   * @private\n   * @type {Observer}\n   */\n  protected repositoryObserver!: Observer;\n\n  protected destroySubscriptions$ = new Subject<void>();\n\n  protected adapter: DecafRepositoryAdapter | null = inject(DB_ADAPTER_PROVIDER_TOKEN, { optional: true });\n\n  override async initialize(): Promise<void> {\n    if (this.repository) {\n      if (this.filter) {\n        const value = !this.modelId || !`${this.modelId}`.trim().length ? null : this.modelId;\n        if (value === null) {\n          this._data = [];\n          return;\n        }\n        this._data = await this.query(this.filter.eq(value as PrimaryKeyType));\n        if (this._data) {\n          await this.refresh();\n          this.changeDetectorRef.markForCheck();\n        }\n      } else {\n        // this._data = await this.read(this.modelId as PrimaryKeyType);\n        // if (String(this.modelName) === this.model?.constructor.name) {\n        //   const model = await this.repository.read(this.modelId as PrimaryKeyType);\n        //   if (model) {\n        //     await this.refresh(model);\n        //   }\n        // }\n      }\n    }\n  }\n\n  set context(context: DecafRepository<M>) {\n    this._context = context;\n  }\n\n  from(repository: IRepository<M>): NgxRepositoryDirective<M> {\n    this.context = repository as DecafRepository<M>;\n    return this;\n  }\n\n  override get repository(): DecafRepository<M> {\n    if (!this._context) {\n      return super.repository as DecafRepository<M>;\n    }\n    return this._context;\n  }\n\n  override async refresh(model?: unknown): Promise<void> {\n    if (this.repository) {\n      this.observe();\n    }\n    if (model && Model.isModel(model)) {\n      this.model = Model.build(model as M, this.modelName);\n      this._data = model;\n    }\n  }\n\n  observe() {\n    if (!this.repositoryObserver) {\n      this.repositoryObserver = {\n        refresh: async (...args) => this.handleRepositoryRefresh(...args),\n      };\n      try {\n        // const observerHandler = (this._repository as DecafRepository<Model>)['observerHandler'];\n        // if (!observerHandler)\n        //   (this._repository as DecafRepository<Model>).observe(this.repositoryObserver);\n        const observerHandler = this.repository?.['observerHandler'] as { observers: Observer[] } | undefined;\n        if (!observerHandler?.observers?.length) {\n          this.repository?.observe(this.repositoryObserver);\n          this.log.for(this.observe).info(`Registered repository observer for model ${this.modelName}`);\n\n          this.repositoryObserverSubject\n            .pipe(\n              debounceTime(100),\n              shareReplay({ bufferSize: 1, refCount: true }),\n              takeUntil(this.destroySubscriptions$)\n            )\n            .subscribe(([model, action, uid, data]) => this.handleObserveEvent(data, model, action, uid));\n        }\n      } catch (error: unknown) {\n        this.log.info((error as Error)?.message);\n      }\n    }\n  }\n\n  protected buildCondition(attr?: keyof M): Condition<M> {\n    if (!attr) {\n      attr = (this.filterBy || this.pk) as keyof M;\n    }\n    const condition = this.filter || Condition.attribute<M>(attr);\n    if (!this.repository) {\n      const repo = getModelAndRepository(Model.tableName(this.model as Model));\n      if (repo) {\n        this._repository = repo.repository as DecafRepository<M>;\n      }\n    }\n    const type = this.getModelPropertyType(this.repository.class, attr as keyof M);\n    if (this.modelId) {\n      return condition.eq(\n        [Primitives.NUMBER, Primitives.BIGINT].includes(type as Primitives)\n          ? Number(this.modelId)\n          : (this.modelId as PrimaryKeyType)\n      );\n    }\n    return condition.dif(null);\n  }\n\n  async read(uid: PrimaryKeyType): Promise<M> {\n    return (await this.repository.read(uid)) as M;\n  }\n\n  async delete(data: PrimaryKeyType | PrimaryKeyType[] | M[], pk: PrimaryKeyType): Promise<void> {\n    if (Array.isArray(data)) {\n      if (pk && this._context) {\n        pk = Model.pk(this._context.class) as PrimaryKeyType;\n      }\n      data = data.map((item) => (item as KeyValue)[pk as string | number]).filter(Boolean) as PrimaryKeyType[];\n    } else {\n      data = [data] as PrimaryKeyType[];\n    }\n    await this.repository.deleteAll(data as PrimaryKeyType[]);\n  }\n\n  async query(\n    condition?: Condition<M>,\n    sortBy: keyof M = (this.sortBy || this.pk) as keyof M,\n    sortDirection: OrderDirection = this.sortDirection\n  ): Promise<M[]> {\n    if (!condition) {\n      condition = this.buildCondition();\n    }\n    try {\n      return (await this.repository.query(condition as Condition<M>, sortBy, sortDirection)) as M[];\n    } catch (error: unknown) {\n      this.log.for(this).error((error as Error)?.message || String(error));\n      return [];\n    }\n    // const paginator = await this.repository\n    //   .select()\n    //   .where(condition)\n    //   .orderBy([(this.sortBy || this.pk) as keyof M, sortDirection])\n    //   .paginate(250);\n    // if (paginator.total === 0) {\n    //   return [];\n    // }\n    // return await paginator.page(1);\n  }\n\n  async paginate(\n    limit: number = this.limit,\n    sortDirection: OrderDirection = this.sortDirection,\n    condition?: Condition<M>\n  ): Promise<Paginator<M>> {\n    if (!condition) {\n      condition = this.buildCondition();\n    }\n    // !! use where condition will make paginator ignores sortBy and col name\n    return await this.repository\n      .select()\n      .orderBy((this.sortBy || this.pk) as keyof M, sortDirection)\n      .paginate(limit);\n    // .select()\n    // .where(condition)\n    // .orderBy([(this.sortBy || this.pk) as keyof M, sortDirection])\n    // .paginate(limit);\n  }\n\n  protected async transactionBegin<M extends Model>(\n    data: M,\n    repository: DecafRepository<M>,\n    operation: CrudOperations\n  ): Promise<M | M[] | PrimaryKeyType | undefined> {\n    try {\n      const hook = `before${operation.charAt(0).toUpperCase() + operation.slice(1)}`;\n      const handler = this.handlers?.[hook] || undefined;\n      const model = this.buildTransactionModel(data || {}, repository, operation);\n      if (handler && typeof handler === 'function') {\n        const result = await handler.bind(this)(\n          // this,\n          // NgxRenderingEngine.get('angular'), TODO: Pass component and engine instance to the handler (change UIEventProperty on ui-decorators repository)\n          model,\n          repository,\n          this.modelId\n        );\n        if (result === false) {\n          return undefined;\n        }\n        return result as M;\n      }\n      return model as M;\n    } catch (error: unknown) {\n      this.log.for(this).error((error as Error)?.message || String(error));\n      return undefined;\n    }\n  }\n\n  protected async transactionEnd<M extends Model>(\n    model: M,\n    repository: DecafRepository<M>,\n    operation: CrudOperations\n  ): Promise<TransactionResponse<M>> {\n    try {\n      const hook = `after${operation.charAt(0).toUpperCase() + operation.slice(1)}`;\n      const handler = this.handlers?.[hook] || undefined;\n      if (handler && typeof handler === 'function') {\n        const result = await handler.bind(this)(model, repository, this.modelId);\n        if (result === false) {\n          return undefined;\n        }\n        return result as M;\n      }\n      return model;\n    } catch (error: unknown) {\n      this.log.for(this).error((error as Error)?.message || String(error));\n      return undefined;\n    }\n  }\n\n  /**\n   * @description Parses and transforms form data for repository operations.\n   * @summary Converts raw form data into the appropriate format for repository operations.\n   * For DELETE operations, returns the primary key value (string or number). For CREATE\n   * and UPDATE operations, builds a complete model instance using the Model.build method\n   * with proper primary key assignment for updates.\n   *\n   * @param {Partial<Model>} data - The raw form data to be processed\n   * @return {Model | string | number} Processed data ready for repository operations\n   * @private\n   */\n  protected buildTransactionModel<M extends Model>(\n    data: KeyValue | KeyValue[],\n    repository: DecafRepository<M>,\n    operation?: OperationKeys\n  ): TransactionResponse<M> {\n    if (!operation) {\n      operation = this.operation as OperationKeys;\n    }\n    operation = (\n      [OperationKeys.READ, OperationKeys.DELETE].includes(operation) ? OperationKeys.DELETE : operation.toLowerCase()\n    ) as OperationKeys;\n\n    if (Array.isArray(data)) return data.map((item) => this.buildTransactionModel(item, repository, operation)) as M[];\n\n    const pk = Model.pk(repository.class as Constructor<M>) as string;\n    const pkType = Metadata.type(repository.class as Constructor<M>, pk as string).name;\n    const modelId = (this.modelId || data[pk]) as Primitives;\n    if (!this.modelId) {\n      this.modelId = modelId;\n    }\n    const uid = this.parsePkValue(operation === OperationKeys.DELETE ? data[pk] : modelId, pkType);\n    if (operation !== OperationKeys.DELETE) {\n      const properties = Metadata.properties(repository.class as Constructor<M>) as string[];\n      const relation =\n        pk === this.pk ? {} : properties.includes(this.pk) && !data[this.pk] ? { [this.pk]: modelId } : {};\n      if (!String(data?.[pk] || '').trim().length) {\n        data[pk] = undefined;\n      }\n      return Model.build(\n        Object.assign(data || {}, relation, modelId && !data[this.pk] ? { [this.pk]: modelId } : {}),\n        repository.class.name\n      ) as M;\n    }\n    return uid as PrimaryKeyType;\n  }\n\n  protected getIndexes(model: M): string[] {\n    this.indexes = Object.keys(Model.indexes((model || this.model) as Model) || {});\n    return this.indexes;\n  }\n\n  protected parsePkValue(value: PrimaryKeyType, type: string): PrimaryKeyType {\n    return [Primitives.NUMBER, Primitives.BIGINT].includes(type.toLowerCase() as Primitives) ? Number(value) : value;\n  }\n\n  protected getModelConstrutor(model: string | Model): Constructor<Model> | undefined {\n    return Model.get(typeof model === Primitives.STRING ? String(model) : model?.constructor.name);\n  }\n\n  protected getModelProperties(clazz: Constructor<M>): (keyof M)[] {\n    return Metadata.properties(clazz) as (keyof M)[];\n  }\n\n  protected getModelPropertyType(constructor: Constructor<M> | string, prop: keyof M): string {\n    try {\n      return Metadata.type(constructor as Constructor<M>, prop as string)?.name;\n    } catch (error: unknown) {\n      this.log.for(this).info(`${(error as Error)?.message || String(error)}. Tryng get with table Name`);\n      constructor = Model.get(Model.tableName(this.repository.class as Constructor<M>) as string) as Constructor<M>;\n      return Metadata.type(constructor, prop as string)?.name;\n    }\n  }\n\n  protected getModelPkType(clazz: Constructor<M>): string {\n    return this.getModelPropertyType(clazz, Model.pk(clazz) as keyof M);\n  }\n\n  /**\n   * @description Handles repository observation events with debouncing.\n   * @summary Processes repository change notifications and routes them appropriately.\n   * For CREATE events with a UID, handles them immediately. For other events,\n   * passes them to the debounced observer subject to prevent excessive updates.\n   *\n   * @param {...unknown[]} args - The repository event arguments including table, event type, and UID\n   * @returns {Promise<void>}\n   */\n  async handleRepositoryRefresh(...args: unknown[]): Promise<void> {\n    const [model, action, uid, data] = args;\n    if ([OperationKeys.CREATE, OperationKeys.DELETE].includes(action as OperationKeys))\n      return this.handleObserveEvent(data, model, action, uid as string | number, data);\n    return this.repositoryObserverSubject.next(args);\n  }\n\n  async handleObserveEvent(...args: unknown[]): Promise<void> {\n    this.log.for(this.handleObserveEvent).info(`Repository change observed with args: ${args}`);\n  }\n}\n","/**\n * @module lib/engine/NgxComponentDirective\n * @description Base decaf component abstraction providing shared inputs and utilities.\n * @summary NgxComponentDirective is the abstract foundation for Decaf components and provides common\n * inputs (model, mapper, pk, props), logging, repository resolution, and event dispatch helpers.\n * It centralizes shared behavior for child components and simplifies integration with the rendering engine.\n * @link {@link NgxComponentDirective}\n */\n\nimport '@decaf-ts/overrides/ui-decorators';\n\nimport { Location } from '@angular/common';\nimport {\n  ChangeDetectorRef,\n  Directive,\n  effect,\n  ElementRef,\n  EnvironmentInjector,\n  EventEmitter,\n  Inject,\n  inject,\n  Input,\n  OnChanges,\n  OnDestroy,\n  Output,\n  Renderer2,\n  signal,\n  SimpleChanges,\n  ViewChild,\n  WritableSignal,\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\nimport { NavigationStart, Router } from '@angular/router';\nimport { CrudOperations, InternalError, OperationKeys } from '@decaf-ts/db-decorators';\nimport { Model, ModelConstructor, ModelKeys, Primitives } from '@decaf-ts/decorator-validation';\nimport { ComponentEventNames, DecafEventHandler, UIFunctionLike, UIKeys } from '@decaf-ts/ui-decorators';\nimport { OverlayBaseController } from '@ionic/angular/common';\nimport { LoadingController, LoadingOptions } from '@ionic/angular/standalone';\nimport { fromEvent, shareReplay, takeUntil } from 'rxjs';\nimport { getLocaleContext } from '../i18n/Loader';\nimport { NgxMediaService } from '../services/NgxMediaService';\nimport { NgxRouterService } from '../services/NgxRouterService';\nimport { NgxTranslateService } from '../services/NgxTranslateService';\nimport { generateRandomValue, getWindow, setOnWindow } from '../utils';\nimport { AngularEngineKeys, BaseComponentProps, CPTKN, WindowColorSchemes } from './constants';\nimport { getModelAndRepository } from './helpers';\nimport { IBaseCustomEvent, ICrudFormEvent } from './interfaces';\nimport { NgxRenderingEngine } from './NgxRenderingEngine';\nimport { NgxRepositoryDirective } from './NgxRepositoryDirective';\nimport { DecafRepository, FormParent, FunctionLike, KeyValue, PropsMapperFn, WindowColorScheme } from './types';\ntry {\n  const win = getWindow();\n  if (!win?.[AngularEngineKeys.LOADED]) new NgxRenderingEngine();\n  setOnWindow(AngularEngineKeys.LOADED, true);\n} catch (e: unknown) {\n  throw new Error(`Failed to load rendering engine: ${e}`);\n}\n\n/**\n * @description Base directive for Decaf components in Angular applications.\n * @summary Abstract base class that provides common functionality for all Decaf components.\n * This directive establishes a foundation for component development by offering shared inputs\n * (model, mapper, pk, props), logging infrastructure, repository access, event handling, and\n * internationalization support. It implements OnChanges to respond to input property changes\n * and includes utilities for navigation, localization, and dynamic property binding. All Decaf\n * components should extend this directive to inherit its foundational capabilities.\n * @class NgxComponentDirective\n * @extends {LoggedClass}\n * @implements {OnChanges}\n * @memberOf module:lib/engine/NgxComponentDirective\n */\n@Directive({ host: { '[attr.id]': 'uid' } })\nexport abstract class NgxComponentDirective extends NgxRepositoryDirective<Model> implements OnChanges, OnDestroy {\n  /**\n   * @description Reference to the component's native DOM element.\n   * @summary Provides direct access to the native DOM element of the component through Angular's\n   * ViewChild decorator. This reference can be used to manipulate the DOM element directly,\n   * apply custom styles, or access native element properties and methods. The element is\n   * identified by the 'component' template reference variable.\n   * @type {ElementRef}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @ViewChild('component', { read: ElementRef, static: true })\n  component!: ElementRef;\n\n  /**\n   * @description Writable signal used for prop synchronization.\n   * @summary Stores a reactive snapshot of component props so derived classes\n   * can observe assignments performed by `initProps` without directly mutating\n   * the instance. Signals ensure Angular change detection reacts to prop updates.\n   * @type {WritableSignal<NgxComponentDirective>}\n   */\n  _props: WritableSignal<NgxComponentDirective> = signal<NgxComponentDirective>({} as NgxComponentDirective);\n\n  /**\n   * @description Flag to enable or disable dark mode support for the component.\n   * @summary When enabled, the component will automatically detect the system's dark mode\n   * preference using the media service and apply appropriate styling classes. This flag\n   * controls whether the component should respond to dark mode changes and apply the\n   * dark palette class to its DOM element. By default, dark mode support is disabled.\n   * @protected\n   * @type {boolean}\n   * @default false\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @Input()\n  protected override enableDarkMode: boolean = true;\n\n  /**\n   * @description Flag to enable or disable dark mode support for the component.\n   * @summary When enabled, the component will automatically detect the system's dark mode\n   * preference using the media service and apply appropriate styling classes. This flag\n   * controls whether the component should respond to dark mode changes and apply the\n   * dark palette class to its DOM element. By default, dark mode support is disabled.\n   * @protected\n   * @type {boolean}\n   * @default false\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @Input()\n  protected override isDarkMode: boolean = false;\n\n  /**\n   * @description Name identifier for the component instance.\n   * @summary Provides a string identifier that can be used to name or label the component\n   * instance. This name can be used for debugging purposes, logging, or to identify specific\n   * component instances within a larger application structure. It serves as a human-readable\n   * identifier that helps distinguish between multiple instances of the same component type.\n   * @type {string}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @Input()\n  override name!: string;\n\n  /**\n   * @description Parent component identifier for hierarchical component relationships.\n   * @summary Specifies the identifier of the parent component in a hierarchical component structure.\n   * This property establishes a parent-child relationship between components, allowing for\n   * proper nesting and organization of components within a layout. It can be used to track\n   * component dependencies and establish component hierarchies for rendering and event propagation.\n   * @type {string}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @Input()\n  override childOf: string = '';\n\n  /**\n   * @description Unique identifier for the component instance.\n   * @summary A unique identifier automatically generated for each component instance.\n   * This UID is used for DOM element identification, component tracking, and debugging purposes.\n   * By default, it generates a random 16-character value, but it can be explicitly set via input.\n   * @type {string | number}\n   * @default generateRandomValue(16)\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @Input()\n  override uid?: string | number;\n\n  /**\n   * @description Label for the file upload field.\n   * @summary Provides a user-friendly label for the file upload input.\n   *\n   * @type {string | undefined}\n   */\n  @Input()\n  override label?: string;\n\n  /**\n   * @description Query predicate applied when resolving model data.\n   * @summary Provides an optional set of conditions used to filter the repository query that\n   * supplies data to this component. When present, the condition constrains the model lookup\n   * (e.g., WHERE clauses) so only records matching the specified criteria are fetched, enabling\n   * contextualized reads such as filtering by status, tenant, or foreign keys. This is especially\n   * useful when the component should render or operate on a subset of records rather than a single\n   * primary-key match.\n   * @type {AttributeOption<Model> | undefined}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  // @Input()\n  // condition: AttributeOption<Model> | undefined;\n\n  /**\n   * @description Angular reactive FormGroup for form state management.\n   * @summary The FormGroup instance that manages all form controls, validation,\n   * and form state. This is the main interface for accessing form values and\n   * controlling form behavior. May be undefined for read-only operations.\n   *\n   * @type {FormGroup | undefined}\n   */\n  @Input()\n  formGroup: FormParent | undefined = undefined;\n\n  /**\n   * @description Backing value supplied to the component instance.\n   * @summary Holds the data payload bound to the component (for example, the field value in a\n   * form control or the record currently being edited). The directive treats this input as an\n   * opaque value and passes it through to child components or handlers, allowing each component\n   * implementation to interpret the value according to its own semantics (e.g., scalar, object,\n   * or collection). This is not tied to any primary key; it simply mirrors whatever data the\n   * host template provides.\n   * @type {unknown}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @Input()\n  override value: unknown;\n\n  /**\n   * @description Field mapping configuration object or function.\n   * @summary Defines how fields from the data model should be mapped to properties used by the component.\n   * This allows for flexible data binding between the model and the component's display logic. Can be\n   * provided as a static object mapping or as a function for dynamic mapping transformations.\n   * @type {Record<string, string> | FunctionLike | Record<string, FunctionLike>}\n   * @default {}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @Input()\n  mapper: Record<string, string> | FunctionLike | Record<string, FunctionLike> = {};\n\n  /**\n   * @description Available CRUD operations for this component instance.\n   * @summary Defines which CRUD operations (Create, Read, Update, Delete) are available\n   * for this component. This affects which operations can be performed on the data and\n   * which operation buttons are displayed in the UI. By default, only READ operations are enabled.\n   * @type {CrudOperations[]}\n   * @default [OperationKeys.READ]\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @Input()\n  operations: CrudOperations[] = [OperationKeys.READ];\n\n  /**\n   * @description The CRUD operation type to be performed on the model.\n   * @summary Specifies which operation (Create, Read, Update, Delete) this component instance\n   * should perform. This determines the UI behavior, form configuration, and available actions.\n   * The operation affects form validation, field availability, and the specific repository\n   * method called during data submission.\n   *\n   * @type {OperationKeys}\n   * @default OperationKeys.READ\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @Input()\n  override operation: OperationKeys | undefined = OperationKeys.READ;\n\n  /**\n   * @description Row position in a grid-based layout system.\n   * @summary Specifies the row position of this component when rendered within a grid-based layout.\n   * This property is used for positioning components in multi-row, multi-column layouts and helps\n   * establish the component's vertical placement within the grid structure.\n   * @type {number}\n   * @default 1\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @Input()\n  row: number = 1;\n\n  /**\n   * @description Column position in a grid-based layout system.\n   * @summary Specifies the column position of this component when rendered within a grid-based layout.\n   * This property is used for positioning components in multi-row, multi-column layouts and helps\n   * establish the component's horizontal placement within the grid structure.\n   * @type {number}\n   * @default 1\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @Input()\n  col: number = 1;\n\n  /**\n   * @description Additional CSS class names for component styling.\n   * @summary Allows custom CSS classes to be added to the component's root element.\n   * These classes are appended to any automatically generated classes based on other\n   * component properties. Multiple classes can be provided as a space-separated string.\n   * This provides a way to customize the component's appearance beyond the built-in styling options.\n   * @type {string}\n   * @default \"\"\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @Input()\n  className: string = '';\n\n  /**\n   * @description Translatability of field labels.\n   * @summary Indicates whether the field labels should be translated based on the current language settings.\n   * This is useful for applications supporting multiple languages.\n   *\n   * @type {boolean}\n   * @default true\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @Input()\n  translatable: boolean = true;\n\n  /**\n   * @description Angular change detection service for manual change detection control.\n   * @summary Injected service that provides manual control over change detection cycles.\n   * This is essential for ensuring that programmatic DOM changes (like setting accordion\n   * attributes) are properly reflected in the component's state and trigger appropriate\n   * view updates when modifications occur outside the normal Angular change detection flow.\n   * @protected\n   * @type {ChangeDetectorRef}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  protected override changeDetectorRef: ChangeDetectorRef = inject(ChangeDetectorRef);\n\n  /**\n   * @description Injector used for dependency injection in the dynamic component.\n   * @summary This injector is used when creating the dynamic component to provide it with\n   * access to the application's dependency injection system. It ensures that the dynamically\n   * created component can access the same services and dependencies as statically created\n   * components.\n   *\n   * @type {EnvironmentInjector}\n   */\n  protected injector: EnvironmentInjector = inject(EnvironmentInjector);\n\n  /**\n   * @description Media service instance for responsive design and media query management.\n   * @summary Provides access to media query functionality for detecting and responding to\n   * different screen sizes and device capabilities. This service enables components to adapt\n   * their behavior and presentation based on viewport dimensions, orientation, and other\n   * media features. It manages media query listeners and provides utilities for responsive\n   * component rendering. The service is instantiated per component and should be destroyed\n   * via ngOnDestroy to prevent memory leaks.\n   * @protected\n   * @type {NgxMediaService}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  protected mediaService: NgxMediaService = inject(NgxMediaService);\n\n  /**\n   * @description Angular Renderer2 service for platform-agnostic DOM manipulation.\n   * @summary Injected service that provides a safe, platform-agnostic way to manipulate DOM elements.\n   * This service ensures proper handling of DOM operations across different platforms and environments,\n   * including server-side rendering and web workers, without direct DOM access.\n   * @protected\n   * @type {Renderer2}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  protected renderer: Renderer2 = inject(Renderer2);\n\n  /**\n   * @description Translation service for application internationalization.\n   * @summary Injected service that provides translation capabilities for UI text.\n   * Used to translate button labels, validation messages, and other text content based\n   * on the current locale setting, enabling multilingual support throughout the application.\n   * @protected\n   * @type {NgxTranslateService}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  override translateService: NgxTranslateService = inject(NgxTranslateService);\n\n  /**\n   * @description Event emitter for custom component events.\n   * @summary Emits custom events that occur within child components or the component itself.\n   * This allows parent components to listen for and respond to user interactions or\n   * state changes. Events are passed up the component hierarchy to enable coordinated\n   * behavior across the application.\n   * @type {EventEmitter<IBaseCustomEvent>}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @Output()\n  listenEvent: EventEmitter<IBaseCustomEvent | ICrudFormEvent> = new EventEmitter<IBaseCustomEvent | ICrudFormEvent>();\n\n  /**\n   * @description Event emitter for custom component events.\n   * @summary Emits custom events that occur within child components or the component itself.\n   * This allows parent components to listen for and respond to user interactions or\n   * state changes. Events are passed up the component hierarchy to enable coordinated\n   * behavior across the application.\n   * @type {EventEmitter<IBaseCustomEvent>}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @Output()\n  refreshEvent: EventEmitter<IBaseCustomEvent | boolean> = new EventEmitter<IBaseCustomEvent | boolean>();\n\n  /**\n   * @description Angular Router instance for programmatic navigation.\n   * @summary Injected Router service used for programmatic navigation between routes\n   * in the application. This service enables navigation to different views and operations,\n   * handles route parameters, and manages the browser's navigation history.\n   * @protected\n   * @type {Router}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  override router: Router = inject(Router);\n\n  /**\n   * @description Decaf router service for route utilities and navigation helpers.\n   * @summary Injected application router abstraction used by the directive to access\n   * higher-level navigation helpers, query parameter utilities, and route-related\n   * behaviors without depending directly on lower-level router logic in consumers.\n   * @type {NgxRouterService}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  routerService: NgxRouterService = inject(NgxRouterService);\n\n  /**\n   * @description Current locale identifier for component internationalization.\n   * @summary Specifies the locale code (e.g., 'en-US', 'pt-BR') used for translating UI text\n   * and formatting data according to regional conventions. This property can be set to override\n   * the default application locale for this specific component instance, enabling per-component\n   * localization when needed.\n   * @type {string | undefined}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @Input()\n  override locale?: string;\n\n  /**\n   * @description Configuration for list item rendering behavior.\n   * @summary Defines how list items should be rendered in the component.\n   * This property holds a configuration object that specifies the tag name\n   * and other properties needed to render list items correctly. The tag property\n   * identifies which component should be used to render each item in a list.\n   * Additional properties can be included to customize the rendering behavior.\n   * @type {Record<string, FieldDefinition>}\n   * @default {tag: \"\"}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @Input()\n  override item: Record<string, unknown> = { tag: '' };\n\n  /**\n   * @description Dynamic properties configuration for runtime customization.\n   * @summary Contains key-value pairs of dynamic properties that can be applied to the component\n   * at runtime. This flexible configuration object allows for dynamic property assignment without\n   * requiring explicit input bindings for every possible configuration option. Properties from\n   * this object are parsed and applied to the component instance through the parseProps method,\n   * enabling customizable component behavior based on external configuration.\n   * @type {Record<string, unknown>}\n   * @default {}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @Input()\n  override props: Record<string, unknown> | Partial<NgxComponentDirective> = {};\n\n  /**\n   * @description Base route path for component navigation.\n   * @summary Defines the base route path used for navigation actions related to this component.\n   * This is often used as a prefix for constructing navigation URLs when transitioning between\n   * different operations or views. The route helps establish the component's position in the\n   * application's routing hierarchy.\n   * @type {string}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @Input()\n  override route?: string = '';\n\n  /**\n   * @description Controls whether borders are displayed around the component.\n   * @summary Boolean flag that determines if the component should be visually outlined with borders.\n   * When true, borders are shown to visually separate the component from surrounding content.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  @Input()\n  override borders: boolean = false;\n\n  /**\n   * @description Angular Location service.\n   * @summary Injected service that provides direct access to the browser's URL and history.\n   * Unlike the Router, Location allows for low-level manipulation of the browser's history stack\n   * and URL path, such as programmatically navigating back or forward, or updating the URL without\n   * triggering a route change. This is useful for scenarios where you need to interact with the\n   * browser history or URL outside of Angular's routing system, such as closing modals, handling\n   * popstate events, or supporting custom navigation logic.\n   *\n   * @private\n   * @type {Location}\n   */\n  override location: Location = inject(Location);\n\n  /**\n   * @description Ionic loading overlay manager available to derived components.\n   * @summary Provides convenient access to Ionic's LoadingController, enabling directive\n   * subclasses to create, present, and dismiss loading overlays without wiring the\n   * service themselves. Use this helper to surface async progress indicators tied to\n   * CRUD operations, navigation, or any long-running UI task.\n   * @type {LoadingController}\n   * @returns {OverlayBaseController<LoadingOptions, HTMLIonLoadingElement>}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  protected loadingController: OverlayBaseController<LoadingOptions, HTMLIonLoadingElement> = inject(LoadingController);\n\n  /**\n   * @description Flag indicating if the component is rendered as a child of a modal dialog.\n   * @summary Determines whether this component instance is being displayed within a modal\n   * context. This flag affects component behavior such as navigation patterns, event handling,\n   * and lifecycle management. When true, the component may use different navigation strategies\n   * (e.g., closing the modal instead of browser navigation) and adjust its layout to fit modal\n   * constraints. This is typically set by parent modal containers when instantiating child components.\n   * @protected\n   * @type {boolean}\n   * @default false\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  @Input()\n  isModalChild: boolean = false;\n\n  @Input()\n  protected override handlers: Record<string, UIFunctionLike> = {};\n\n  @Input()\n  protected override events: Record<string, UIFunctionLike> = {};\n\n  @Input()\n  propsMapperFn!: PropsMapperFn<NgxComponentDirective>;\n\n  /**\n   * @description Indicates whether a refresh operation is in progress.\n   * @summary When true, the component is currently fetching new data. This is used\n   * to control loading indicators and prevent duplicate refresh operations from\n   * being triggered simultaneously.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  @Input()\n  refreshing: boolean = false;\n\n  /**\n   * @description Represents the color scheme used for application.\n   * @summary  This property determines the visual appearance of the application\n   * based on predefined color schemes (e.g., light or dark mode).\n   * @type {WindowColorScheme}\n   * @default WindowColorSchemes.light\n   */\n  protected colorSchema: WindowColorScheme = WindowColorSchemes.light;\n\n  private popState$ = fromEvent<PopStateEvent>(window, 'popstate').pipe(shareReplay({ bufferSize: 1, refCount: true }));\n\n  // Convertendo o Observable em Signal\n  readonly popStateSignal = toSignal(this.popState$, {\n    initialValue: null,\n  });\n\n  /**\n   * @description Constructor for NgxComponentDirective.\n   * @summary Initializes the directive by setting up the component name, locale root,\n   * and logger. Calls the parent LoggedClass constructor and configures localization\n   * context. The component name and locale root can be optionally injected via the\n   * CPTKN token, otherwise defaults are used.\n   * @param {string} [componentName] - Optional component name for identification and logging\n   * @param {string} [localeRoot] - Optional locale root key for internationalization\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n\n  // eslint-disable-next-line @angular-eslint/prefer-inject\n  constructor(@Inject(CPTKN) componentName?: string, @Inject(CPTKN) localeRoot?: string) {\n    super();\n    this.value = undefined;\n    this.componentName = componentName || this.constructor.name || 'NgxComponentDirective';\n    this.localeRoot = localeRoot;\n    if (!this.localeRoot && this.componentName) this.localeRoot = this.componentName;\n    if (this.localeRoot) this.getLocale(this.localeRoot);\n    this.uid = `${this.componentName}-${generateRandomValue(8)}`;\n    this.mediaService\n      .isDarkMode()\n      .pipe(shareReplay({ bufferSize: 1, refCount: true }), takeUntil(this.destroySubscriptions$))\n      .subscribe((isDark) => {\n        if (isDark) {\n          this.isDarkMode = isDark;\n          this.colorSchema = WindowColorSchemes.dark;\n        }\n      });\n    effect(async () => {\n      const event = this.popStateSignal();\n      if (event) {\n        await this.beforeInitialize(this);\n      }\n    });\n  }\n\n  async beforeInitialize<T extends NgxComponentDirective>(component?: unknown): Promise<void> {\n    if (!component) {\n      component = this as unknown;\n    }\n    const instance = component as KeyValue;\n    if (this.propsMapperFn) {\n      for (const [key, fn] of Object.entries(this.propsMapperFn)) {\n        if (key in instance) instance[key] = await fn(instance as T);\n      }\n    }\n    // search for handler render\n    const handler = this.handlers?.[ComponentEventNames.Render] || undefined;\n    if (handler && typeof handler === 'function') {\n      await handler.bind(instance)(instance as T, this.name, this.value);\n    }\n    // search for event render\n    const event = this.events?.[ComponentEventNames.Render] || undefined;\n    if (event && typeof event === 'function') {\n      await event.bind(instance)(instance as T, this.name, this.value);\n    }\n  }\n\n  override async initialize(): Promise<void> {\n    this.mediaService.darkModeEnabled();\n    // connect component to media service for color scheme toggling\n    this.mediaService.colorSchemeObserver(this.component);\n    if (!this.initialized && Object.keys(this.props || {}).length) {\n      this.parseProps(this);\n    }\n    if (this.operation === OperationKeys.CREATE) {\n      this.refreshing = false;\n    }\n\n    this.router.events\n      .pipe(shareReplay({ bufferSize: 1, refCount: true }), takeUntil(this.destroySubscriptions$))\n      .subscribe(async (event) => {\n        if (event instanceof NavigationStart) {\n          if (this.value) {\n            await this.ngOnDestroy();\n          }\n        }\n      });\n\n    this.route = this.router.url.replace('/', '');\n    this.changeDetectorRef.markForCheck();\n\n    // search for handler to render event\n    if (!this.initialized) {\n      await this.beforeInitialize(this);\n    }\n    await super.initialize();\n    this.initialized = true;\n    this.changeDetectorRef.detectChanges();\n  }\n\n  /**\n   * @description Cleanup lifecycle hook invoked when the directive is destroyed.\n   * @summary Ensures any resources allocated by the directive's media service are\n   * released (DOM listeners, timers, subscriptions, etc.). Implementations should\n   * keep `mediaService.destroy()` idempotent; calling it here prevents leaks when\n   * components are torn down.\n   * @returns {Promise<void>}\n   */\n  async ngOnDestroy(): Promise<void> {\n    this.value = undefined;\n    this.mediaService.destroy();\n    if (this.destroySubscriptions$) {\n      this.destroySubscriptions$.next();\n      this.destroySubscriptions$.complete();\n    }\n  }\n\n  /**\n   * @description Getter for the current locale context identifier.\n   * @summary Returns the current locale identifier by calling the getLocale method.\n   * This property provides convenient access to the component's active locale setting.\n   * @returns {string} The current locale identifier\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  get localeContext(): string {\n    return this.getLocale();\n  }\n\n  /**\n   * @description Getter for the data repository instance.\n   * @summary Lazily initializes and returns the DecafRepository instance for the current model.\n   * This getter ensures the repository is created only when needed and reused for subsequent\n   * access. It also automatically sets the primary key field if not explicitly configured.\n   * @protected\n   * @returns {DecafRepository<Model>} The repository instance for the current model\n   * @throws {InternalError} If repository initialization fails\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  override get repository(): DecafRepository<Model> {\n    try {\n      if (!this._repository) {\n        const context = getModelAndRepository(this.model as Model);\n        if (context) {\n          const { repository, pk, pkType } = context;\n          this._repository = repository;\n          if (this.model && !this.pk) this.pk = pk;\n          this.pkType = pkType;\n          if (!this.modelName) {\n            this.modelName = repository.class.name;\n          }\n        }\n      }\n    } catch (error: unknown) {\n      throw new InternalError((error as Error)?.message || (error as string));\n    }\n    return this._repository as DecafRepository<Model>;\n  }\n\n  override set repository(repository: DecafRepository<Model> | undefined) {\n    this._repository = repository;\n  }\n\n  /**\n   * @description Angular lifecycle hook for handling input property changes.\n   * @summary Responds to changes in component input properties, specifically monitoring changes\n   * to the model, locale root, and component name properties. When the model changes, it triggers\n   * model initialization and locale context updates. When locale-related properties change,\n   * it updates the component's locale setting accordingly.\n   * @param {SimpleChanges} changes - Object containing the changed properties with their previous and current values\n   * @return {void}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  async ngOnChanges(changes: SimpleChanges): Promise<void> {\n    if (changes[ModelKeys.MODEL]) {\n      const { currentValue } = changes[ModelKeys.MODEL];\n      if (currentValue) {\n        this.getModel(currentValue);\n      }\n      this.locale = this.localeContext;\n    }\n\n    // if (changes[UIKeys.HANDLERS]) {\n    //   const { currentValue, previousValue } = changes[UIKeys.HANDLERS];\n    //   if (currentValue && typeof currentValue !== previousValue) {\n    //     for(const key in currentValue) {\n    //       const event = currentValue[key]();\n    //       if (event && typeof event === 'function') {\n    //         const clazz = new event();\n    //         this.handlers[key] = clazz[key].bind(this);\n    //         console.log(this.handlers);\n    //       }\n    //     }\n    //   }\n    // }\n\n    if (changes[BaseComponentProps.HANDLERS]) {\n      const { currentValue, previousValue } = changes[BaseComponentProps.HANDLERS];\n      if (currentValue && currentValue !== previousValue)\n        this.parseHandlers(currentValue, this as unknown as DecafEventHandler);\n    }\n\n    if (changes[UIKeys.EVENTS]) {\n      const { currentValue, previousValue } = changes[UIKeys.EVENTS];\n      if (currentValue && currentValue !== previousValue) {\n        if (!this._repository) {\n          this._repository = this.repository;\n        }\n        this.parseEvents(currentValue, this);\n\n        // for (const key in currentValue) {\n        //   const event = currentValue[key]();\n        //   if (event && typeof event === 'function') {\n        //     try {\n        //       const clazz = new event();\n        //       this.events[key] = clazz[key].bind(this);\n        //       if (event[key] instanceof Promise) {\n        //         await clazz[key].bind(this)();\n        //       } else {\n        //         clazz[key].bind(this)();\n        //       }\n        //     } catch (error: unknown) {\n        //       this.log\n        //         .for(this.ngOnChanges)\n        //         .error(\n        //           `Error occurred while processing event \"${key}\": ${(error as Error)?.message || (error as string)}`\n        //         );\n        //     }\n        //   }\n        // }\n      }\n    }\n    if (changes[BaseComponentProps.LOCALE_ROOT] || changes[BaseComponentProps.COMPONENT_NAME])\n      this.locale = this.localeContext;\n\n    if (this.enableDarkMode) this.checkDarkMode();\n  }\n\n  /**\n   * @description Translates text phrases using the translation service.\n   * @summary Provides a promise-based wrapper around the translation service to translate\n   * UI text based on the current locale. Supports both single phrases and arrays of phrases,\n   * and accepts optional parameters for template interpolation. When a string parameter is\n   * provided, it's automatically converted to an object format for the translation service.\n   * @param {string | string[]} phrase - The translation key or array of keys to translate\n   * @param {object | string} [params] - Optional parameters for interpolation in translated text\n   * @return {Promise<string|KeyValue>} A promise that resolves to the translated text\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  override async translate(phrase: string | string[], params?: object | string): Promise<string | KeyValue> {\n    return await this.translateService.get(phrase, params || {});\n  }\n\n  protected checkDarkMode(): void {\n    this.mediaService\n      .isDarkMode()\n      .pipe(shareReplay({ bufferSize: 1, refCount: true }), takeUntil(this.destroySubscriptions$))\n      .subscribe((isDark) => {\n        this.isDarkMode = isDark;\n        this.mediaService.toggleClass([this.component], AngularEngineKeys.DARK_PALETTE_CLASS, this.isDarkMode);\n      });\n  }\n\n  // parseHandlers(handlers: Record<string, UIFunctionLike>): void {\n  //   // function isClass(value: UIFunctionLike | Constructor<NgxEventHandler>): boolean {\n  //   //   return typeof value === 'function' && /^class\\s/.test(String(value));\n  //   // }\n  //   Object.entries(handlers).forEach(([key, fn]) => {\n  //     if (isClassConstructor<NgxEventHandler>(fn)) {\n  //       const clazz = new fn() as NgxEventHandler;\n  //       this.handlers[key] = key in clazz ? clazz[key as keyof NgxEventHandler] : clazz.handle;\n  //     } else {\n  //       this.handlers[key] = fn as UIFunctionLike;\n  //     }\n  //   });\n  // }\n\n  // for (const key in currentValue) {\n  //   const event = currentValue[key]();\n  //   if (event && typeof event === 'function') {\n  //     try {\n  //       const clazz = new event();\n  //       this.events[key] = clazz[key].bind(this);\n  //       if (event[key] instanceof Promise) {\n  //         await clazz[key].bind(this)();\n  //       } else {\n  //         clazz[key].bind(this)();\n  //       }\n  //     } catch (error: unknown) {\n  //       this.log\n  //         .for(this.ngOnChanges)\n  //         .error(\n  //           `Error occurred while processing event \"${key}\": ${(error as Error)?.message || (error as string)}`\n  //         );\n  //     }\n  //   }\n  // }\n\n  // parseEvents<T extends DecafComponent<Model>>(\n  //   events: Record<string, UIFunctionLike>,\n  // ): UIEventProperty {\n  //   const result: UIEventProperty = {};\n  //   Object.entries(events).forEach(([key, fn]) => {\n  //     const event = (fn as UIFunctionLike)();\n  //     if (isClassConstructor<DecafComponent<Model>>(event)) {\n  //       const fn = new event()[key as keyof DecafComponent<Model>] || undefined;\n  //       if (fn) {\n  //         this.events[key] = fn;\n  //         result[key] = fn;\n  //       }\n  //     } else {\n  //       this.events[key] = fn as UIFunctionLike;\n  //       result[key] = fn;\n  //     }\n  //   });\n  //   return result;\n  // }\n\n  /**\n   * @description Retrieves or sets the locale context for the component.\n   * @summary Gets the locale identifier from the locale context system. If a locale parameter\n   * is provided, it updates the localeRoot property and resolves the new locale context.\n   * If no locale is currently set, it initializes it from the localeRoot.\n   * @protected\n   * @param {string} [locale] - Optional locale identifier to set\n   * @return {string} The current locale identifier\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  protected getLocale(locale?: string): string {\n    if (locale || !this.locale) {\n      if (locale) this.localeRoot = locale;\n      if (this.localeRoot) this.locale = getLocaleContext(this.localeRoot as string);\n    }\n    return this.locale as string;\n  }\n\n  /**\n   * @description Retrieves or generates the route path for the component.\n   * @summary Gets the navigation route associated with this component. If no route is explicitly\n   * set and a model is available, it automatically generates a route based on the model's\n   * class name using the pattern `/model/{ModelName}`. Returns an empty string if neither\n   * a route nor a model is available.\n   * @return {string} The route path for this component\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  getRoute(): string {\n    if (!this.route && this.model instanceof Model) this.route = `/model/${this.model?.constructor.name}`;\n    return this.route || '';\n  }\n\n  /**\n   * @description Resolves and initializes a model from various input formats.\n   * @summary Accepts a model in multiple formats (string name, Model instance, or ModelConstructor)\n   * and resolves it to a Model instance. When a string is provided, it looks up the model\n   * by name in the Model registry. After resolution, it delegates to setModelDefinitions\n   * to complete the model initialization and configuration.\n   * @template M - The model type extending from Model\n   * @param {string | Model | ModelConstructor<M>} model - The model to resolve and initialize\n   * @return {void}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  getModel<M extends Model>(model: string | Model | ModelConstructor<M>): void {\n    if (!(model instanceof Model) && typeof model === Primitives.STRING)\n      model = Model.get(model as string) as ModelConstructor<M>;\n    this.setModelDefinitions(this.model as Model);\n  }\n\n  /**\n   * @description Configures component properties based on model decorators and metadata.\n   * @summary Extracts rendering configuration from the model's decorators using the rendering\n   * engine. This includes props, item configuration, and child component definitions. It sets\n   * up the mapper for field transformations, configures the item renderer with appropriate\n   * properties, and establishes the route for navigation. This method bridges the model's\n   * decorator metadata with the component's runtime configuration.\n   * @param {Model} model - The model instance to extract definitions from\n   * @return {void}\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  setModelDefinitions(model: Model): void {\n    if (model instanceof Model) {\n      this.getRoute();\n      this.model = model;\n      const engine = NgxRenderingEngine.get() as unknown as NgxRenderingEngine;\n      const field = engine.getDecorators(this.model as Model, {});\n      const { props, item, children } = field;\n      this.props = Object.assign(props || {}, { children: children || [] }, this.props, {\n        handlers: props?.['handlers'] || {},\n      });\n      if (item?.props?.['mapper']) this.mapper = item?.props!['mapper'] || {};\n      this.item = {\n        tag: item?.tag || '',\n        ...item?.props,\n        ...(this.mapper ? { mapper: this.mapper } : {}),\n        ...{ route: item?.props?.['route'] || this.route },\n      } as KeyValue;\n    }\n  }\n\n  /**\n   * @description Parses and applies properties from the props object to the component instance.\n   * @summary This method iterates through the properties of the provided instance object\n   * and applies any matching properties from the component's props configuration to the\n   * component instance. This allows for dynamic property assignment based on configuration\n   * stored in the props object, enabling flexible component customization without requiring\n   * explicit property binding for every possible configuration option.\n   * The method performs a safe property assignment by checking if each key from the instance\n   * exists in the props object before applying it. This prevents accidental property\n   * overwriting and ensures only intended properties are modified.\n   * @param {KeyValue} instance - The component instance object to process\n   * @param {string[]} [skip=[]] - Array of property names to skip during parsing\n   * @return {void}\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as Component\n   *   participant D as NgxComponentDirective\n   *   participant P as Props Object\n   *\n   *   C->>D: parseProps(instance, skip)\n   *   D->>D: Get Object.keys(instance)\n   *   loop For each key in instance\n   *     D->>D: Check if key in skip array\n   *     alt Key not in skip\n   *       D->>P: Check if key exists in this.props\n   *       alt Key exists in props\n   *         D->>D: Set this[key] = this.props[key]\n   *         D->>P: delete this.props[key]\n   *       else Key not in props\n   *         Note over D: Skip this key\n   *       end\n   *     end\n   *   end\n   * @protected\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  protected parseProps(instance: KeyValue, skip: string[] = [AngularEngineKeys.CHILDREN]): void {\n    const props = this.props as KeyValue;\n    Object.keys(instance).forEach((key) => {\n      if (Object.keys(this.props).includes(key) && !skip.includes(key)) {\n        (this as KeyValue)[key] = props[key];\n        if (key === BaseComponentProps.HANDLERS) {\n          const handlers = Object.assign({}, props[key] || {}, instance?.[key] || {});\n          this.parseHandlers(handlers, this as unknown as DecafEventHandler);\n        }\n        if (key === UIKeys.EVENTS) {\n          const events = Object.assign({}, props[key] || {}, instance?.[key] || {});\n          this.parseEvents(events, this);\n        }\n        delete props[key];\n      }\n    });\n  }\n\n  /**\n   * @description Tracks items in ngFor loops for optimal change detection performance.\n   * @summary Provides a tracking function for Angular's *ngFor directive to optimize rendering\n   * performance. This method generates unique identifiers for list items based on their index\n   * and content, allowing Angular to efficiently track changes and minimize DOM manipulations\n   * during list updates. The tracking function is essential for maintaining component state\n   * and preventing unnecessary re-rendering of unchanged items.\n   * @protected\n   * @param {number} index - The index of the item in the list\n   * @param {KeyValue | string | number} item - The item data to track\n   * @return {string | number} A unique identifier for the item\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  protected trackItemFn(index: number, item: KeyValue | string | number): string | number {\n    return `${index}-${item}`;\n  }\n\n  /**\n   * @description Handles custom events from child components or DOM elements.\n   * @summary Processes custom events by extracting event handlers and delegating to appropriate\n   * handler classes. Supports both CustomEvent format with detail property and direct event\n   * objects. If specific handlers are defined in the event, it instantiates the handler class\n   * and invokes its handle method. If no handler is found or defined, the event is emitted\n   * up the component hierarchy via the listenEvent output.\n   * @param {IBaseCustomEvent | ICrudFormEvent | CustomEvent} event - The event to handle\n   * @return {Promise<void>} A promise that resolves when event handling is complete\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as Child Component\n   *   participant D as NgxComponentDirective\n   *   participant H as Event Handler\n   *   participant P as Parent Component\n   *\n   *   C->>D: handleEvent(event)\n   *   alt Event is CustomEvent\n   *     D->>D: Extract event.detail\n   *   end\n   *   D->>D: Get event name and handlers\n   *   alt Handlers defined\n   *     alt Handler exists for event\n   *       D->>H: new Handler(router)\n   *       D->>H: handle(event)\n   *       H-->>D: return result\n   *     else No handler found\n   *       D->>D: log.debug(\"No handler found\")\n   *     end\n   *   else No handlers\n   *     D->>P: listenEvent.emit(event)\n   *   end\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  async handleEvent(event: IBaseCustomEvent & ICrudFormEvent & CustomEvent): Promise<void> {\n    let name = '';\n    if (event instanceof CustomEvent) {\n      if (!event.detail) return this.log.for(this.handleEvent).debug(`No details for custom event ${name}`);\n      name = event.detail?.name;\n      event = event.detail;\n    }\n    name = name || (event as IBaseCustomEvent)?.['name'];\n    const handler = event?.handler || this.handlers[name];\n    if (handler) {\n      try {\n        const { data, role } = event as ICrudFormEvent;\n        return await handler.bind(this)(event, data || {}, role);\n      } catch (e: unknown) {\n        this.log.for(this.handleEvent).error(`Failed to handle ${name} event`, e as Error);\n      }\n    }\n    this.listenEvent.emit(event as IBaseCustomEvent | ICrudFormEvent);\n  }\n\n  // passed for ui decorators\n  // override async submit(...args: unknown[]): Promise<any> {\n  //   this.log.for(this.submit).info(`submit for ${this.componentName} with ${JSON.stringify(args)}`);\n  // }\n\n  /**\n   * @description Determines if a specific operation is allowed in the current context.\n   * @summary This method checks if an operation is included in the list of available\n   * CRUD operations and if it's not the current operation (unless the current operation\n   * is CREATE). This is used to enable/disable or show/hide operation buttons in the UI.\n   * Returns false if the operations array is undefined or the operation is not in the list.\n   * @param {string} operation - The operation to check\n   * @return {boolean} True if the operation is allowed, false otherwise\n   * @mermaid\n   * sequenceDiagram\n   *   participant D as NgxComponentDirective\n   *   participant U as UI\n   *\n   *   U->>D: isAllowed(operation)\n   *   alt operations is undefined\n   *     D-->>U: Return false\n   *   else\n   *     D->>D: Check if operation is in operations\n   *     D->>D: Check if operation is not current operation\n   *     D-->>U: Return result\n   *   end\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  isAllowed(operation: string, operations?: CrudOperations[]): boolean {\n    if (!operations) {\n      operations = this.operations;\n    }\n    if (operations) {\n      return (\n        this.operations.includes(operation as CrudOperations) &&\n        this.operation !== OperationKeys.CREATE &&\n        ((this.operation || '').toLowerCase() !== operation || !this.operation)\n      );\n    }\n    return false;\n  }\n\n  /**\n   * @description Navigates to a different operation for the current model.\n   * @summary This method constructs a navigation URL based on the component's base route,\n   * the requested operation, and optionally a model ID. It then uses the Angular router\n   * service to navigate to the constructed URL. This is typically used when switching\n   * between different CRUD operations (create, read, update, delete) on a model.\n   * The URL format is: {route}/{operation}/{id?}\n   * @param {string} operation - The operation to navigate to (e.g., 'create', 'read', 'update', 'delete')\n   * @param {string} [id] - Optional model ID to include in the navigation URL\n   * @return {Promise<boolean>} A promise that resolves to true if navigation was successful\n   * @mermaid\n   * sequenceDiagram\n   *   participant U as UI\n   *   participant D as NgxComponentDirective\n   *   participant R as Router\n   *\n   *   U->>D: Click operation button\n   *   D->>D: changeOperation(operation, id)\n   *   D->>D: Construct navigation URL\n   *   Note over D: URL: {route}/{operation}/{id?}\n   *   D->>R: navigateByUrl(page)\n   *   R->>R: Navigate to new route\n   *   R-->>D: Return navigation result\n   *   D-->>U: Display new operation view\n   * @memberOf module:lib/engine/NgxComponentDirective\n   */\n  async changeOperation(operation: string, id?: string): Promise<boolean> {\n    let page = `${this.route}/${operation}/`.replace('//', '/');\n    if (!id) id = this.modelId as string;\n    if (this.modelId) page = `${page}${this.modelId || id}`;\n    return this.router.navigateByUrl(page);\n  }\n\n  async initProps<T extends NgxComponentDirective>(\n    props: KeyValue,\n    map: (keyof T)[] | Record<keyof T, unknown> = [],\n    instance?: NgxComponentDirective & T\n  ): Promise<void> {\n    if (!instance) {\n      instance = this as T & KeyValue;\n    }\n    if (Array.isArray(map)) {\n      map.forEach((key: keyof T) => {\n        if (key in instance && instance[key]) {\n          props[key as string] = instance[key];\n        }\n      });\n    } else {\n      props = { ...props, ...map };\n      map = Object.keys(map) as (keyof T)[];\n    }\n    this._props = signal<T>(props as T);\n\n    Object.entries(props).filter(([key, value]) => {\n      const prop = key as keyof T;\n      if (prop in instance || map.includes(prop)) {\n        instance[prop] = value;\n      }\n    });\n    await this.initialize();\n  }\n}\n","/**\n * @module lib.components.card\n * @description Reusable Card UI component module.\n * @summary\n * Exports the `CardComponent`, a standalone Angular component built on Ionic's `IonCard` primitives.\n * The component exposes inputs to control visual style, content and layout and integrates with\n * the application's media service to react to dark-mode changes. See {@link CardComponent}.\n */\nimport { Component, Input, OnInit, ViewEncapsulation } from '@angular/core';\nimport { SafeHtml } from '@angular/platform-browser';\nimport { IonCard, IonCardContent, IonCardHeader, IonCardSubtitle, IonCardTitle } from '@ionic/angular/standalone';\nimport { Color } from '@ionic/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { shareReplay, takeUntil } from 'rxjs';\nimport { AngularEngineKeys } from '../../engine/constants';\nimport { Dynamic } from '../../engine/decorators';\nimport { NgxComponentDirective } from '../../engine/NgxComponentDirective';\n\n/**\n * @description Reusable, presentational card UI component for use across the application.\n * @summary\n * CardComponent is a standalone Angular component built on Ionic's `IonCard` primitives.\n * It exposes several `@Input()` properties to control appearance and content:\n * `type`, `title`, `body`, `subtitle`, `color`, `separator`, `borders`, `inlineContent`, and `inlineContentPosition`.\n * The component integrates with the application's media service to react to dark-mode changes\n * and toggles the dark-palette CSS class on the host element accordingly.\n *\n * @param {('clear'|'shadow')} type - Visual rendering style for the card; 'clear' (default) or 'shadow'.\n * @param {string} title - Primary title text displayed in the card header.\n * @param {('small'|'default'|'blank')} body - Body size preset controlling padding/typography; defaults to 'default'.\n * @param {string} subtitle - Optional subtitle rendered under the title.\n * @param {Color} color - Ionic color token applied to the card header/title.\n * @param {boolean} separator - When true, renders a divider between header and body.\n * @param {boolean} borders - Controls whether borders are rendered; defaults to true.\n * @param {string|SafeHtml} inlineContent - Inline HTML/SafeHtml to render inside the body.\n * @param {('top'|'bottom')} inlineContentPosition - Where to render `inlineContent` relative to the body; defaults to 'bottom'.\n * @return {void}\n * @class CardComponent\n * @example\n * <ngx-decaf-card\n *   [type]=\"'shadow'\"\n *   [title]=\"'Account overview'\"\n *   [subtitle]=\"'Summary for the current user'\"\n *   [color]=\"'primary'\"\n *   [separator]=\"true\"\n *   [borders]=\"true\"\n *   [inlineContent]=\"safeHtmlValue\"\n *   inlineContentPosition=\"top\"\n * >\n *   <!-- card content here -->\n * </ngx-decaf-card>\n *\n * @mermaid\n * sequenceDiagram\n *   participant App as Consumer\n *   participant Card as CardComponent\n *   participant Media as MediaService\n *   App->>Card: instantiate\n *   Card->>Media: isDarkMode()\n *   Media-->>Card: Observable<boolean> (isDark)\n *   Card->>Card: toggleClass(..., isDark)\n */\n@Dynamic()\n@Component({\n  selector: 'ngx-decaf-card',\n  templateUrl: './card.component.html',\n  styleUrls: ['./card.component.scss'],\n  imports: [TranslatePipe, IonCard, IonCardHeader, IonCardContent, IonCardTitle, IonCardSubtitle],\n  standalone: true,\n  encapsulation: ViewEncapsulation.None,\n})\nexport class CardComponent extends NgxComponentDirective implements OnInit {\n  /**\n   * @description Visual rendering style for the card.\n   * @summary Controls the card's surface treatment. Use 'clear' for a flat look or 'shadow' to add elevation.\n   * @type {'clear'|'shadow'}\n   * @default 'clear'\n   */\n  @Input()\n  type: 'clear' | 'shadow' = 'clear';\n\n  /**\n   * @description Primary title text for the card header.\n   * @summary Rendered prominently at the top of the card; consumers should pass a short, human-friendly string.\n   * @type {string}\n   * @default ''\n   */\n  @Input()\n  title: string = '';\n\n  /**\n   * @description Primary title text for the card header.\n   * @summary Rendered prominently at the top of the card; consumers should pass a short, human-friendly string.\n   * @type {string}\n   * @default ''\n   */\n  @Input()\n  margins: boolean = true;\n\n  /**\n   * @description Body size preset for the card.\n   * @summary Adjusts padding and typographic scale inside the card body. 'small' reduces spacing, 'blank' hides the body area.\n   * @type {'small'|'default'|'blank'}\n   * @default 'default'\n   */\n  @Input()\n  body: 'small' | 'default' | 'blank' = 'default';\n\n  /**\n   * @description Optional subtitle shown below the title in the header area.\n   * @summary Use for short secondary text such as an explanation or contextual note.\n   * @type {string}\n   * @default ''\n   */\n  @Input()\n  subtitle: string = '';\n\n  /**\n   * @description Ionic color token applied to the card.\n   * @summary When provided, the color token (for example 'primary' or 'tertiary') is applied to title/header elements where supported.\n   * @type {Color}\n   * @default ''\n   */\n  @Input()\n  color: Color = '';\n\n  /**\n   * @description Toggle to render a visual separator between header and content.\n   * @summary When true, a divider line (or equivalent styling) is rendered to separate the header from the body.\n   * @type {boolean}\n   * @default false\n   */\n  @Input()\n  separator: boolean = false;\n\n  /**\n   * @description Controls whether the card renders borders.\n   * @summary Set to false to remove borders for inline or transparent card designs. Marked `override` to explicitly shadow the base directive's value.\n   * @type {boolean}\n   * @default true\n   */\n  @Input()\n  override borders: boolean = true;\n\n  /**\n   * @description Inline HTML or SafeHtml content to render inside the card body.\n   * @summary Useful for short snippets of rich content provided by the consumer. When passing raw HTML prefer `SafeHtml` to avoid sanitization issues.\n   * @type {string|SafeHtml}\n   */\n  @Input()\n  inlineContent?: string | SafeHtml;\n\n  /**\n   * @description Position where `inlineContent` is rendered within the body.\n   * @summary Pass 'top' to render inline content above the body or 'bottom' to render it below. Defaults to 'bottom'.\n   * @type {'top'|'bottom'}\n   */\n  @Input()\n  inlineContentPosition: 'top' | 'bottom' = 'bottom';\n\n  /**\n   * @description Internal component identifier used by the base `NgxComponentDirective`.\n   * @summary Read-only-ish string identifying the concrete component class for instrumentation, styling helpers and debug logs.\n   * @type {string}\n   */\n  protected override componentName: string = 'CardComponent';\n\n  /**\n   * @description Angular lifecycle hook: component initialization.\n   * @summary\n   * ngOnInit sets the component as initialized and subscribes to the application's media service\n   * dark-mode observable. On each emission it updates the local isDarkMode flag and calls the\n   * media service helper to toggle the dark-palette CSS class on the component host element.\n   * The subscription uses the provided mediaService observable and performs side effects only.\n   *\n   * @return {void}\n   */\n  ngOnInit(): void {\n    this.mediaService\n      .isDarkMode()\n      .pipe(shareReplay({ bufferSize: 1, refCount: true }), takeUntil(this.destroySubscriptions$))\n      .subscribe((isDark) => {\n        this.isDarkMode = isDark;\n        this.mediaService.toggleClass([this.component], AngularEngineKeys.DARK_PALETTE_CLASS, this.isDarkMode);\n      });\n    this.initialize();\n  }\n}\n","<ion-card\n  [class]=\"'dcf-card-component ' + className + ' ' + 'dcf-card-' + body\"\n  [color]=\"color\"\n  mode=\"md\"\n  [class.dcf-card-separator]=\"separator\"\n  [class.dcf-card-shadow]=\"type === 'shadow'\"\n  [class.dcf-card-bordered]=\"borders\"\n  [class.dcf-card-separator]=\"separator\"\n  [class.dcf-remove-margins]=\"!margins\"\n  #component\n>\n  @if (title || subtitle) {\n    <ion-card-header>\n      @if (title) {\n        <ion-card-title>\n          {{ locale ? (title | translate) : title }}\n        </ion-card-title>\n      }\n      @if (subtitle) {\n        <ion-card-subtitle>\n          {{ locale ? (subtitle | translate) : subtitle }}\n        </ion-card-subtitle>\n      }\n    </ion-card-header>\n  }\n  <ion-card-content>\n    @if (inlineContent && inlineContentPosition === 'top') {\n      <div [innerHTML]=\"inlineContent\"></div>\n    }\n\n    <ng-content slot=\"content\"></ng-content>\n\n    @if (inlineContent && inlineContentPosition === 'bottom') {\n      <div [innerHTML]=\"inlineContent\"></div>\n    }\n  </ion-card-content>\n</ion-card>\n","/**\n * @module lib/engine/NgxPageDirective\n * @description Base page component for Decaf Angular applications.\n * @summary Provides a page-level base class (NgxPageDirective) that extends NgxComponentDirective and\n * offers page-focused utilities such as menu management, title handling and router event hooks.\n * @link {@link NgxPageDirective}\n */\nimport { AfterViewInit, Directive, Inject, inject } from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport { NavigationEnd, NavigationStart } from '@angular/router';\nimport { Model } from '@decaf-ts/decorator-validation';\nimport { MenuController } from '@ionic/angular';\nimport { removeFocusTrap } from '../utils/helpers';\nimport { CPTKN } from './constants';\nimport { IMenuItem } from './interfaces';\nimport { NgxComponentDirective } from './NgxComponentDirective';\nimport { KeyValue } from './types';\n\nimport { shareReplay, takeUntil } from 'rxjs';\n\n/**\n * @description Base directive for page-level components in Decaf Angular applications.\n * @summary Abstract directive that provides foundational functionality for page components.\n * Extends NgxComponentDirective to add page-specific features including menu management,\n * page title handling, and Ionic lifecycle hooks. This directive serves as the base class for\n * all page-level components, providing consistent behavior for navigation, routing, and UI state.\n * @class NgxPageDirective\n * @extends {NgxComponentDirective}\n * @memberOf module:lib/engine/NgxPageDirective\n */\n@Directive()\nexport abstract class NgxPageDirective extends NgxComponentDirective implements AfterViewInit {\n  /**\n   * @description Application name for display or identification purposes.\n   * @summary Stores the name of the application, which can be used for display in headers,\n   * titles, or for logging and identification throughout the app.\n   * @type {string}\n   * @memberOf module:lib/engine/NgxPageDirective\n   */\n  appName?: string;\n\n  /**\n   * @description Page title text for the current view.\n   * @summary Stores the title text to be displayed for this page. This can be set dynamically\n   * based on the current route or menu configuration and is used to update the browser's\n   * title bar or page header.\n   * @type {string}\n   * @default ''\n   * @memberOf module:lib/engine/NgxPageDirective\n   */\n  title: string = '';\n\n  /**\n   * @description Global key-value pairs for application-wide settings.\n   * @summary This property stores global configuration values that can be accessed\n   * throughout the application. It is typically used to manage shared state or\n   * settings that are relevant across multiple components or services.\n   * @type {KeyValue}\n   * @memberOf module:lib/engine/NgxPageDirective\n   */\n  globals!: KeyValue;\n\n  /**\n   * @description Ionic menu controller service for menu management.\n   * @summary Injected service that provides programmatic control over Ionic menu components.\n   * This service allows the component to open, close, toggle, and manage menu states within\n   * the application. It provides access to menu functionality for implementing navigation\n   * and layout features that require menu interaction.\n   * @protected\n   * @type {MenuController}\n   * @memberOf module:lib/engine/NgxPageDirective\n   */\n  protected menuController: MenuController = inject(MenuController);\n\n  /**\n   * @description Menu items array for page navigation.\n   * @summary Contains the collection of menu items available for this page. Each menu item\n   * defines a navigation option with properties like label, URL, icon, and visibility settings.\n   * This array is used to construct the application's navigation menu and can be filtered or\n   * customized per page.\n   * @protected\n   * @type {IMenuItem[]}\n   * @default []\n   * @memberOf module:lib/engine/NgxPageDirective\n   */\n  protected menu: IMenuItem[] = [];\n\n  /**\n   * @description Angular Title service for browser title management.\n   * @summary Injected service that provides control over the browser's document title.\n   * Used to dynamically set the page title based on the current route or active menu item,\n   * improving SEO and user experience.\n   * @protected\n   * @type {Title}\n   * @memberOf module:lib/engine/NgxPageDirective\n   */\n  protected titleService: Title = inject(Title);\n\n  /**\n   * @description Flag indicating whether the page should display the navigation menu.\n   * @summary Controls the visibility and availability of the application menu for this page.\n   * When set to true, the menu is enabled and accessible to users. When false, the menu\n   * is disabled, which is useful for pages like login screens or standalone views that\n   * should not show navigation options.\n   * @protected\n   * @type {boolean}\n   * @default true\n   * @memberOf module:lib/engine/NgxPageDirective\n   */\n  protected hasMenu: boolean = true;\n\n  /**\n   * @description Currently active route path for the page (without leading slash).\n   * @summary This protected property stores the current route segment used by the\n   * page to determine the displayed title and menu state. It is updated on\n   * NavigationEnd events (see ngAfterViewInit) and consumed by the `pageTitle`\n   * getter and `setPageTitle()` method. When undefined the component will\n   * attempt to resolve the route from the router URL.\n   * @protected\n   * @type {string | undefined}\n   * @default undefined\n   */\n  protected currentRoute?: string;\n\n  /**\n   * @description Constructor for NgxPageDirective.\n   * @summary Initializes the page directive with optional locale root and menu visibility settings.\n   * Calls the parent NgxComponentDirective constructor to set up base functionality including\n   * logging, localization, and component identification.\n   * @param {string} [localeRoot] - Optional locale root key for internationalization\n   * @param {boolean} [hasMenu=true] - Whether this page should display the menu\n   * @memberOf module:lib/engine/NgxPageDirective\n   */\n\n  constructor(\n    // eslint-disable-next-line @angular-eslint/prefer-inject\n    @Inject(CPTKN) localeRoot: string = 'NgxPageDirective',\n    // eslint-disable-next-line @angular-eslint/prefer-inject\n    @Inject(CPTKN) hasMenu: boolean = true\n  ) {\n    super('NgxPageDirective', localeRoot);\n    this.hasMenu = hasMenu;\n    // subscribe to media service color scheme changes\n  }\n\n  get pageTitle(): string {\n    if (this.title) return this.title;\n    if (this.locale) return `${this.locale}.title`;\n    if (this.currentRoute) return `${this.currentRoute}.title`;\n    return `${(this.model as Model).constructor.name}.title`;\n  }\n\n  // async ngOnInit(): Promise<void> {}\n\n  override async initialize(): Promise<void> {\n    await super.initialize();\n    // connect component to media service for color scheme toggling\n    this.currentRoute = this.router.url.replace('/', '');\n    if (!this.route) this.route = this.currentRoute;\n    this.setPageTitle(this.currentRoute);\n  }\n\n  /**\n   * @description Ionic lifecycle hook called when the page is about to enter view.\n   * @summary This lifecycle hook is triggered just before the page becomes visible to the user.\n   * It enables or disables the application menu based on the hasMenu property, allowing pages\n   * to control whether the menu should be accessible. This is useful for pages like login screens\n   * where the menu should be hidden.\n   * @return {Promise<void>} A promise that resolves when menu state is updated\n   * @memberOf module:lib/engine/NgxPageDirective\n   */\n  async ngAfterViewInit(): Promise<void> {\n    this.router.events\n      .pipe(takeUntil(this.destroySubscriptions$), shareReplay({ bufferSize: 1, refCount: true }))\n      .subscribe(async (event) => {\n        if (event instanceof NavigationEnd) {\n          const url = (event?.url || '').replace('/', '');\n          this.currentRoute = url;\n          if (this.hasMenu) this.hasMenu = url !== 'login' && url !== '';\n          this.title = this.pageTitle;\n          await this.setPageTitle(url);\n          this.changeDetectorRef.detectChanges();\n        }\n        if (event instanceof NavigationStart) {\n          const url = (event?.url || '').replace('/', '');\n          if (this.hasMenu) this.hasMenu = url !== 'login' && url !== '';\n          removeFocusTrap();\n        }\n      });\n    if (!this.route) this.route = this.router.url.replace('/', '');\n    await this.menuController.enable(this.hasMenu);\n  }\n\n  /**\n   * @description Sets the browser page title based on the current route.\n   * @summary Updates the browser's document title by finding the active menu item that matches\n   * the provided route. If a matching menu item is found, it sets the title using the format\n   * \"Decaf For Angular - {menu title or label}\". This improves SEO and provides clear context\n   * to users about the current page. If a custom menu array is provided, it uses that instead\n   * of the component's default menu.\n   * @protected\n   * @param {string} route - The current route path to match against menu items\n   * @param {IMenuItem[]} [menu] - Optional custom menu array to search (uses this.menu if not provided)\n   * @return {void}\n   * @memberOf module:lib/engine/NgxPageDirective\n   */\n  protected async setPageTitle(route?: string, menu?: IMenuItem[]): Promise<void> {\n    if (!route) route = this.router.url.replace('/', '');\n    if (!menu) menu = this.menu;\n    const activeMenu = menu.find((item) => item?.url?.includes(route));\n    if (activeMenu) {\n      let label = `${(activeMenu?.title || activeMenu?.label || '').toLowerCase()}`;\n      if (!label.startsWith('menu.')) {\n        label = `menu.${label}`;\n      }\n      const title = `${await this.translate(label)} ${this.appName ? `- ${this.appName}` : ''}`;\n      this.titleService.setTitle(title);\n      if (!this.title) this.title = title;\n    }\n  }\n}\n","import { AfterViewInit, Directive, Input } from '@angular/core';\nimport { Repository } from '@decaf-ts/core';\nimport {\n  CrudOperations,\n  InternalError,\n  IRepository,\n  NotFoundError,\n  OperationKeys,\n  PrimaryKeyType,\n} from '@decaf-ts/db-decorators';\nimport { Constructor, Metadata, uses } from '@decaf-ts/decoration';\nimport { Model, Primitives } from '@decaf-ts/decorator-validation';\nimport { ComponentEventNames } from '@decaf-ts/ui-decorators';\nimport { getOnWindow } from '../utils/helpers';\nimport { NgxPageDirective } from './NgxPageDirective';\nimport { DB_ADAPTER_FLAVOUR_TOKEN, ErrorCodesTranslationKeys } from './constants';\nimport { getModelAndRepository } from './helpers';\nimport { ICrudFormEvent, ILayoutModelContext, IModelComponentSubmitEvent } from './interfaces';\nimport { CrudEvent, DecafRepository, KeyValue } from './types';\n\n@Directive()\nexport abstract class NgxModelPageDirective extends NgxPageDirective implements AfterViewInit {\n  /**\n   * @description The CRUD operation type to be performed on the model.\n   * @summary Specifies which operation (Create, Read, Update, Delete) this component instance\n   * should perform. This determines the UI behavior, form configuration, and available actions.\n   * The operation affects form validation, field availability, and the specific repository\n   * method called during data submission.\n   *\n   * @type {OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE}\n   * @default OperationKeys.READ\n   *  @memberOf ModelPage\n   */\n  @Input()\n  override operation: OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE =\n    OperationKeys.READ;\n\n  /**\n   * @description Error message from failed operations.\n   * @summary Stores error messages that occur during repository operations such as\n   * data loading, creation, update, or deletion. When set, this indicates an error\n   * state that should be displayed to the user. Cleared on successful operations.\n   * @type {string | undefined}\n   * @default undefined\n   * @memberOf NgxModelPageDirective\n   */\n  errorMessage: string | undefined = undefined;\n\n  // constructor(@Inject(CPTKN) hm: boolean = true, @Inject(CPTKN) protected toastController?: ToastController) {\n  //   super(\"NgxModelPageDirective\");\n  // }\n\n  /**\n   * @description Lazy-initialized repository getter with model resolution.\n   * @summary Creates and returns a repository instance for the specified model name.\n   * Resolves the model constructor from the global registry, instantiates the repository,\n   * and creates a new model instance. Throws an InternalError if the model is not\n   * properly registered with the @Model decorator.\n   *\n   * @return {DecafRepository<Model>} The repository instance for the current model\n   *\n   * @throws {InternalError} When the model is not found in the registry\n   */\n  override get repository(): DecafRepository<Model> {\n    const modelName =\n      this.modelName || (typeof this.model === Primitives.STRING ? this.model : this.model?.constructor?.name);\n    try {\n      if (!this._repository && modelName) {\n        const constructor = Model.get(String(modelName));\n        if (!constructor) throw new InternalError('Cannot find model. was it registered with @model?');\n        const dbAdapterFlavour = getOnWindow(DB_ADAPTER_FLAVOUR_TOKEN) || undefined;\n        if (dbAdapterFlavour) {\n          uses(String(dbAdapterFlavour))(constructor);\n        }\n        this._repository = Repository.forModel(\n          constructor,\n          typeof dbAdapterFlavour === Primitives.STRING ? String(dbAdapterFlavour) : undefined\n        ) as DecafRepository<Model>;\n        if (!this.pk) this.pk = Model.pk(constructor) as string;\n        this.model = new constructor() as Model;\n      }\n    } catch (error: unknown) {\n      this.log.warn(`Error getting repository for model: ${modelName}. ${(error as Error).message}`);\n      this._repository = undefined;\n      // throw new InternalError((error as Error)?.message || (error as string));\n    }\n    return this._repository as DecafRepository<Model>;\n  }\n\n  override async initialize(): Promise<void> {\n    this.refreshing = true;\n    await super.initialize();\n    this.getLocale(this.modelName as string);\n  }\n\n  async ionViewWillEnter(): Promise<void> {\n    await this.refresh(this.modelId);\n  }\n\n  /**\n   * @description Refreshes the component data by loading the specified model instance.\n   * @summary Loads model data from the repository based on the current operation type.\n   * For READ, UPDATE, and DELETE operations, fetches the existing model data using\n   * the provided unique identifier. Handles errors gracefully by logging them through\n   * the logger instance.\n   *\n   * @param {string} [uid] - The unique identifier of the model to load; defaults to modelId\n   */\n  override async refresh(uid?: PrimaryKeyType): Promise<void> {\n    this.refreshing = true;\n    if (!uid) {\n      uid = this.modelId;\n    }\n    try {\n      this._repository = this.repository;\n      switch (this.operation) {\n        case OperationKeys.READ:\n        case OperationKeys.UPDATE:\n        case OperationKeys.DELETE:\n          {\n            this.model = await this.handleRead(uid);\n          }\n          break;\n      }\n    } catch (error: unknown) {\n      if (error instanceof NotFoundError) {\n        this.errorMessage = error.message;\n      }\n      this.log.error(error as Error | string);\n    }\n\n    this.refreshing = false;\n  }\n\n  /**\n   * @description Enables CRUD operations except those specified.\n   * @summary Sets the allowed CRUD operations for the component, excluding any operations provided in the 'except' array.\n   *\n   * @param {OperationKeys[]} except - Array of operations to exclude from the allowed operations.\n   */\n  protected enableCrudOperations(except: OperationKeys[] = []): CrudOperations[] {\n    const operations = [\n      OperationKeys.CREATE,\n      OperationKeys.READ,\n      OperationKeys.UPDATE,\n      OperationKeys.DELETE,\n    ] as CrudOperations[];\n    if (!except?.length) {\n      this.operations = [...operations];\n    } else {\n      this.operations = operations.filter((op) => !except.includes(op));\n    }\n    this.changeDetectorRef?.detectChanges();\n    return this.operations;\n  }\n\n  /**\n   * @description Generic event handler for component events.\n   * @summary Processes incoming events from child components and routes them to appropriate\n   * handlers based on the event name. Currently handles SUBMIT events by delegating to\n   * the submit method. This centralized event handling approach allows for easy\n   * extension and consistent event processing.\n   *\n   * @param {IBaseCustomEvent} event - The event object containing event data and metadata\n   */\n  override async handleEvent<M extends Model>(event: CrudEvent<M>, repository?: DecafRepository<M>): Promise<void> {\n    const { name, role, handler, data, modelId, handlers } = event;\n    if (!this.modelId && modelId) {\n      this.modelId = modelId;\n    }\n    if (handler && role) {\n      this.handlers = handlers || {};\n      return await handler.bind(this)(event, data || {}, this, role);\n    }\n    switch (name) {\n      case ComponentEventNames.Submit:\n        await this.submit(event, true, repository);\n        break;\n      default:\n        this.listenEvent.emit(event);\n    }\n  }\n\n  async getTransactionRepository<M extends Model>(\n    event: CrudEvent<M>,\n    repo: DecafRepository<M>\n  ): Promise<DecafRepository<M>> {\n    if (!repo) {\n      repo = this.repository as DecafRepository<M>;\n    }\n    const repoPk = !repo ? undefined : (repo?.class ?? Model.pk(Model.get(repo.class.name)));\n    if (!repo || repo?.class?.name !== this.model?.constructor?.name || typeof repoPk !== 'string') {\n      const { context } = (await this.process(event, this.model as M, false)) as ILayoutModelContext;\n      if (context) {\n        // parse data from main model to event\n        event.data = context.data as M;\n        return context.repository as DecafRepository<M>;\n      }\n    }\n    if (!repo) {\n      repo = this.repository as DecafRepository<M>;\n    }\n    return repo;\n  }\n\n  /**\n   * @description Retrieves a model instance from the repository by unique identifier.\n   * @summary Fetches a specific model instance using the repository's read method.\n   * Handles both string and numeric identifiers by automatically converting numeric\n   * strings to numbers. If no identifier is provided, logs an informational message\n   * and navigates back to the previous page. Returns undefined for missing instances.\n   *\n   * @param {string} uid - The unique identifier of the model instance to retrieve\n   * @return {Promise<Model | undefined>} Promise resolving to the model instance or undefined\n   */\n  async handleRead<M extends Model>(\n    uid?: PrimaryKeyType,\n    repository?: IRepository<M>,\n    modelName?: string\n  ): Promise<Model | undefined> {\n    if (!uid) {\n      this.log.info('No key passed to model page read operation, backing to last page');\n      return undefined;\n    }\n\n    if (!modelName) {\n      modelName = this.modelName;\n      if (!modelName && this.model?.constructor) this.modelName = modelName = this.model.constructor.name;\n    }\n    const getRepository = async (\n      modelName: string,\n      acc: KeyValue = {},\n      parent: string = ''\n    ): Promise<DecafRepository<Model> | void> => {\n      if (this._repository) {\n        return this._repository as DecafRepository<Model>;\n      }\n      const constructor = Model.get(modelName);\n      if (constructor) {\n        const properties = this.getModelProperties(constructor);\n        for (const prop of properties) {\n          const type = this.getModelPropertyType(constructor, prop);\n          const context = getModelAndRepository(type) || getModelAndRepository(prop);\n          if (!context) {\n            acc[prop] = {};\n            return getRepository(type, acc, prop);\n          }\n          const { repository, model, pk, pkType } = context;\n          if (!this.pk) {\n            this.pk = pk;\n            this.pkType = pkType;\n          }\n          uid = this.parsePkValue(uid as PrimaryKeyType, this.pkType);\n          if (!this.modelId) {\n            this.modelId = uid as PrimaryKeyType;\n          }\n          if (modelName === this.modelName) {\n            const data = await repository.read(uid as PrimaryKeyType);\n            acc[prop] = data;\n            const _model =\n              (await this.transactionEnd(data as Model, repository, OperationKeys.READ)) ||\n              Model.build(data, model.constructor.name as string);\n            this.name = prop;\n            this.model = Model.build({ [prop]: _model }, modelName);\n            if (!Object.keys(this._data || {}).length) {\n              this._data = _model as Model;\n            }\n          } else {\n            // model[parent] = {\n            //   ...model[parent],\n            //   [prop]: data,\n            // };\n          }\n        }\n        // this._data = model;\n        // this.changeDetectorRef.detectChanges();\n        // this.model = Model.build(model, this.modelName as string);\n        // this.changeDetectorRef.detectChanges();\n      }\n    };\n    repository = (repository || (await getRepository(modelName as string))) as IRepository<M>;\n    if (!repository) {\n      return this.model as M;\n    }\n    try {\n      if (!this.pk) this.pk = Model.pk(repository.class) as string;\n      return await repository.read(this.parsePkValue(uid as Primitives, this.getModelPkType(repository.class)));\n    } catch (error: unknown) {\n      this.log.for(this.handleRead).info(`Error getting model instance with id ${uid}: ${(error as Error).message}`);\n      return undefined;\n    }\n  }\n\n  async process<M extends Model>(\n    event: CrudEvent<M>,\n    model?: M,\n    submit: boolean = false\n  ): Promise<ILayoutModelContext | IModelComponentSubmitEvent<M>> {\n    const result = { models: {} } as ILayoutModelContext;\n    const eventData = event.data as KeyValue;\n    const iterate = async (evt: ICrudFormEvent & { data: KeyValue }, model: string | M, parent?: string) => {\n      const constructor = this.getModelConstrutor(model);\n      if (constructor) {\n        const properties = Metadata.properties(constructor) as string[];\n        const promises = properties.map(async (prop) => {\n          const type = Metadata.type(constructor as Constructor<Model>, prop).name;\n          let data = evt.data?.[prop] || (parent ? eventData?.[parent as string][prop] : eventData?.[prop]);\n          if (data) {\n            if (parent || Array.isArray(data)) data = [...Object.values(data)];\n            const context = getModelAndRepository(type) || getModelAndRepository(prop);\n            evt = { ...evt, data };\n            if (!context) {\n              await iterate(evt, type, prop);\n            } else {\n              const { repository, model, pk, pkType } = context;\n              if (!this.pk) {\n                this.pk = pk;\n              }\n              if (!result.context) {\n                result.context = {\n                  repository,\n                  model,\n                  pk: pk,\n                  pkType: pkType,\n                  data,\n                };\n                if (!this.modelId) {\n                  this.modelId = (data as KeyValue)[pk];\n                }\n              } else {\n                Object.assign(result.context.data, {\n                  [prop]: Array.isArray(data) ? this.buildTransactionModel(data, repository) : data,\n                });\n              }\n              Object.assign(result.models, {\n                [prop]: {\n                  model,\n                  data,\n                  repository: repository,\n                  pk,\n                },\n              });\n              delete (evt.data as KeyValue)?.[prop];\n              evt = { ...evt, data: evt.data };\n            }\n          }\n        });\n        await Promise.all(promises);\n      }\n    };\n    if (!model) {\n      model = this.model as M;\n    }\n    await iterate(event, model);\n    return result;\n    // return (await this.batchOperation(result)) as IModelComponentSubmitEvent<M>;\n  }\n\n  /**\n   * @description Handles form submission events for CRUD operations.\n   * @summary Processes form submission by executing the appropriate repository operation\n   * based on the current operation type. Handles CREATE, UPDATE, and DELETE operations,\n   * processes the form data, refreshes the repository cache, navigates back to the previous\n   * page, and displays success notifications. Comprehensive error handling ensures robust\n   * operation with detailed logging.\n   *\n   * @param {CrudEvent<M>} event - The submit event containing form data\n   * @return {Promise<IModelComponentSubmitEvent|void>} Promise that resolves on success or throws on error\n   */\n  override async submit<M extends Model>(\n    event: CrudEvent<M>,\n    redirect: boolean = false,\n    repo?: DecafRepository<M>,\n    pk?: keyof M\n  ): Promise<IModelComponentSubmitEvent<M>> {\n    let success = false;\n    let message = '';\n    let result = null;\n    try {\n      const repository = await this.getTransactionRepository<M>(event, repo!);\n      const { data, role, isModalChild } = event;\n      if (isModalChild) {\n        this.isModalChild = true;\n      }\n      const operation = (role || this.operation) as CrudOperations;\n      if (data) {\n        if (!pk) {\n          pk = Model.pk(repository.class) as keyof M;\n        }\n        if (!this.modelId) {\n          this.modelId = data?.[pk] as PrimaryKeyType;\n        }\n        const model = await this.transactionBegin(data, repository, operation);\n        if (!model) {\n          return {\n            success: false,\n            aborted: true,\n            model: null,\n            message: 'Operation aborted by before hook',\n          };\n        }\n\n        switch (operation) {\n          case OperationKeys.CREATE:\n            result = await (!Array.isArray(model) ? repository.create(model as M) : repository.createAll(model as M[]));\n            break;\n          case OperationKeys.UPDATE: {\n            const models = (!Array.isArray(model) ? [model] : model) as M[];\n            for (const m of models) {\n              const uid = m[pk as keyof M] as PrimaryKeyType;\n              const check = uid ? await repository.read(uid as PrimaryKeyType) : false;\n              result = await (!check ? repository.create(m as M) : repository.update(m as M));\n            }\n            break;\n          }\n          case OperationKeys.DELETE:\n            result = await (!Array.isArray(model)\n              ? repository.delete(model as PrimaryKeyType)\n              : repository.deleteAll(model as []));\n            break;\n        }\n        success = result ? true : false;\n        if (success) {\n          if ((result as KeyValue)?.[this.pk]) {\n            this.modelId = (result as KeyValue)[this.pk];\n          }\n          if (redirect && !isModalChild) {\n            this.location.back();\n          }\n        }\n        message = (await this.translate(`operations.${operation}.${result ? 'success' : 'error'}`, {\n          '0': repository.class.name || pk,\n          '1': this.modelId || '',\n        })) as string;\n      }\n    } catch (error: unknown) {\n      this.log\n        .for(this.submit)\n        .error(\n          `Error during ${this.operation} operation: ${error instanceof Error ? error.message : (error as string)}`\n        );\n      if ((error as KeyValue)?.['code']) {\n        const { code } = error as KeyValue;\n        message = 'errors.generic';\n        if (Object.keys(ErrorCodesTranslationKeys).includes(`${code}`)) {\n          message = ErrorCodesTranslationKeys[`${code}`];\n        }\n      } else {\n        message = error instanceof Error ? error.message : (error as string);\n      }\n    }\n    if (this.isModalChild) {\n      this.listenEvent.emit({\n        ...event,\n        data: result || event.data,\n      });\n    }\n    return { ...event, success, message, model: result, aborted: false };\n  }\n\n  // async batchOperation(context: ILayoutModelContext, redirect: boolean = false): Promise<any> {\n  // const { data, repository, pk } = context.context;\n  // return data;\n  // return await this.submit({data}, false, repository, pk);\n  // const result: boolean[] = [];\n  // let resultMessage = '';\n  // const promises = Object.keys(models).map(async(m) => {\n  //   const {model, repository} = models[m];\n  //   const {success} = await this.submit({data: model}, false, repository as IRepository<Model>);\n  //   if(success)\n  //     resultMessage = await this.translate('operations.multiple.success');\n  //   result.push(success);\n  // })\n  // await Promise.all(promises);\n  // const success = result.every((r: boolean) => r);\n  // if (success && redirect)\n  //   this.location.back();\n  // return {...{data: models}, success, message: resultMessage};\n  // }\n}\n","import {\n  Directive,\n  ElementRef,\n  EventEmitter,\n  Input,\n  OnChanges,\n  OnDestroy,\n  SimpleChanges,\n  TemplateRef,\n  Type,\n  ViewChild,\n  ViewContainerRef,\n} from '@angular/core';\nimport { Model, ModelKeys } from '@decaf-ts/decorator-validation';\nimport { shareReplay, takeUntil } from 'rxjs';\nimport { AngularDynamicOutput, IRenderedModel } from './interfaces';\nimport { NgxModelPageDirective } from './NgxModelPageDirective';\nimport { NgxRenderingEngine } from './NgxRenderingEngine';\nimport { CrudEvent, FormParent, KeyValue } from './types';\n\n@Directive()\nexport class NgxRenderableComponentDirective\n  extends NgxModelPageDirective\n  implements OnChanges, OnDestroy, IRenderedModel\n{\n  /**\n   * @description Reference to the container where the dynamic component will be rendered.\n   * @summary This ViewContainerRef provides the container where the dynamically created\n   * component will be inserted into the DOM. It's marked as static to ensure it's available\n   * during the ngOnInit lifecycle hook when the component is created.\n   *\n   * @type {ViewContainerRef}\n   * @memberOf NgxRenderableComponentDirective\n   */\n\n  @ViewChild('componentOuter', { static: true, read: ViewContainerRef })\n  protected vcr!: ViewContainerRef;\n\n  @ViewChild('componentInner', { read: TemplateRef, static: true })\n  inner?: TemplateRef<unknown>;\n\n  /**\n   * @description Global properties to pass to the rendered component.\n   * @summary This input property allows passing a set of properties to the dynamically\n   * rendered component. These properties will be mapped to the component's inputs if they\n   * match. Properties that don't match any input on the target component will be filtered out\n   * with a warning.\n   *\n   * @type {Record<string, unknown>}\n   * @default {}\n   * @memberOf NgxComponentDirective\n   */\n  @Input()\n  override globals: Record<string, unknown> = {};\n\n  /**\n   * @description Repository model for data operations.\n   * @summary The data model repository that this component will use for CRUD operations.\n   * This provides a connection to the data layer for retrieving and manipulating data.\n   *\n   * @type {Model| undefined}\n   * @memberOf NgxComponentDirective\n   */\n  @Input()\n  parentForm!: FormParent | ElementRef<unknown> | undefined;\n\n  @Input()\n  projectable: boolean = true;\n\n  @Input()\n  rendererId?: string;\n\n  protected output?: AngularDynamicOutput;\n\n  protected instance!: KeyValue | undefined;\n\n  protected readonly JSON = JSON;\n\n  // @Output()\n  // listenEvent: EventEmitter<IBaseCustomEvent> =\n  //   new EventEmitter<IBaseCustomEvent>();\n\n  /**\n   * @description Cleans up resources when the component is destroyed.\n   * @summary Performs cleanup operations when the component is being destroyed by Angular.\n   * This includes unsubscribing from all event emitters of the dynamic component and\n   * destroying the rendering engine instance to prevent memory leaks.\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant A as Angular Lifecycle\n   *   participant C as ComponentRendererComponent\n   *   participant R as NgxRenderingEngine\n   *\n   *   A->>C: ngOnDestroy()\n   *   alt component exists\n   *     C->>C: unsubscribeEvents()\n   *     C->>R: destroy()\n   *   end\n   *\n   * @return {Promise<void>} A promise that resolves when cleanup is complete\n   * @memberOf NgxComponentDirective\n   */\n  override async ngOnDestroy(): Promise<void> {\n    super.ngOnDestroy();\n    if (this.instance) {\n      this.unsubscribeEvents();\n      await NgxRenderingEngine.destroy();\n    }\n    this.output = undefined;\n  }\n\n  /**\n   * @description Lifecycle hook that is called when data-bound properties of a directive change\n   * @param {SimpleChanges} changes - Object containing changes\n   */\n  override async ngOnChanges(changes: SimpleChanges): Promise<void> {\n    if (changes[ModelKeys.MODEL]) {\n      const { currentValue } = changes[ModelKeys.MODEL];\n      if (currentValue) {\n        this.render(currentValue);\n      }\n    }\n  }\n\n  /**\n   * @description Subscribes to events emitted by the dynamic component.\n   * @summary This method sets up subscriptions to all EventEmitter properties of the\n   * dynamically created component. When an event is emitted by the dynamic component,\n   * it is captured and re-emitted through the listenEvent output property with additional\n   * metadata about the event source.\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as ComponentRendererComponent\n   *   participant D as Dynamic Component\n   *   participant P as Parent Component\n   *\n   *   C->>C: subscribeEvents()\n   *   C->>D: Get instance properties\n   *   loop For each property\n   *     C->>C: Check if property is EventEmitter\n   *     alt is EventEmitter\n   *       C->>D: Subscribe to event\n   *       D-->>C: Event emitted\n   *       C->>P: Re-emit event with metadata\n   *     end\n   *   end\n   *\n   * @private\n   * @return {void}\n   * @memberOf NgxComponentDirective\n   */\n  protected async subscribeEvents<M extends Model>(component?: Type<unknown>): Promise<void> {\n    if (!component) component = this?.output?.component;\n    if (!this.instance && component) this.instance = component;\n    const isModalChild = this.instance?.['isModalChild'] ?? false;\n\n    if (this.instance && component) {\n      const componentKeys = Object.keys(this.instance);\n      for (const key of componentKeys) {\n        const value = this.instance[key];\n        if (value instanceof EventEmitter)\n          (this.instance as KeyValue)[key]\n            .pipe(shareReplay({ bufferSize: 1, refCount: true }), takeUntil(this.destroySubscriptions$))\n            .subscribe(async (event: Event) => {\n              await this.handleEvent({\n                component: component.name || '',\n                name: key,\n                isModalChild,\n                ...event,\n              } as CrudEvent<M>);\n            });\n      }\n    }\n  }\n\n  /**\n   * @description Unsubscribes from all events of the dynamic component.\n   * @summary This method cleans up event subscriptions when the component is being destroyed.\n   * It iterates through all properties of the dynamic component instance and unsubscribes\n   * from any EventEmitter properties to prevent memory leaks and unexpected behavior after\n   * the component is destroyed.\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as ComponentRendererComponent\n   *   participant D as Dynamic Component\n   *\n   *   C->>C: unsubscribeEvents()\n   *   C->>D: Get instance properties\n   *   loop For each property\n   *     C->>C: Check if property is EventEmitter\n   *     alt is EventEmitter\n   *       C->>D: Unsubscribe from event\n   *     end\n   *   end\n   *\n   * @private\n   * @return {void}\n   * @memberOf NgxComponentDirective\n   */\n  protected unsubscribeEvents(): void {\n    if (this.instance) {\n      const componentKeys = Object.keys(this.instance);\n      for (const key of componentKeys) {\n        const value = this.instance[key];\n        if (value instanceof EventEmitter) this.instance[key].unsubscribe();\n      }\n    }\n  }\n}\n","import {\n  Component,\n  ComponentMirror,\n  Injector,\n  Input,\n  OnDestroy,\n  OnInit,\n  reflectComponentType,\n  TemplateRef,\n  Type,\n} from '@angular/core';\n/**\n * @module module:lib/components/component-renderer/component-renderer.component\n * @description Component renderer module.\n * @summary Provides `ComponentRendererComponent` which renders dynamic child\n * components based on configuration or data. Useful for rendering custom\n * fields, nested components or templated content at runtime.\n *\n * @link {@link ComponentRendererComponent}\n */\nimport { NgComponentOutlet } from '@angular/common';\n\nimport { NgxRenderingEngine } from '../../engine/NgxRenderingEngine';\nimport { KeyValue } from '../../engine/types';\nimport { AngularEngineKeys, BaseComponentProps } from '../../engine/constants';\nimport { NgxRenderableComponentDirective } from '../../engine/NgxRenderableComponentDirective';\n\n/**\n * @description Dynamic component renderer for Decaf Angular applications.\n * @summary This component provides a flexible way to dynamically render Angular components\n * at runtime based on a tag name. It handles the creation, property binding, and event\n * subscription for dynamically loaded components. This is particularly useful for\n * building configurable UIs where components need to be determined at runtime.\n *\n * @component {ComponentRendererComponent}\n * @example\n * <ngx-decaf-component-renderer\n *   [tag]=\"tag\"\n *   [globals]=\"globals\"\n *   (listenEvent)=\"listenEvent($event)\">\n * </ngx-decaf-component-renderer>\n *\n * @mermaid\n * classDiagram\n *   class ComponentRendererComponent {\n *     +ViewContainerRef vcr\n *     +string tag\n *     +Record~string, unknown~ globals\n *     +EnvironmentInjector injector\n *     +ComponentRef~unknown~ component\n *     +EventEmitter~IBaseCustomEvent~ listenEvent\n *     +ngOnInit()\n *     +ngOnDestroy()\n *     +ngOnChanges(changes)\n *     -createComponent(tag, globals)\n *     -subscribeEvents()\n *     -unsubscribeEvents()\n *   }\n *   ComponentRendererComponent --|> OnInit\n *   ComponentRendererComponent --|> OnChanges\n *   ComponentRendererComponent --|> OnDestroy\n *\n * @implements {OnInit}\n * @implements {OnChanges}\n * @implements {OnDestroy}\n */\n@Component({\n  selector: 'ngx-decaf-component-renderer',\n  templateUrl: './component-renderer.component.html',\n  styleUrls: ['./component-renderer.component.scss'],\n  imports: [NgComponentOutlet],\n  standalone: true,\n  host: { '[attr.id]': 'uid' },\n})\nexport class ComponentRendererComponent\n  extends NgxRenderableComponentDirective\n  implements OnInit, OnDestroy\n{\n  /**\n   * @description The tag name of the component to be dynamically rendered.\n   * @summary This input property specifies which component should be rendered by providing\n   * its registered tag name. The tag must correspond to a component that has been registered\n   * with the NgxRenderingEngine. This is a required input as it determines which component\n   * to create.\n   *\n   * @type {string}\n   * @required\n   * @memberOf ComponentRendererComponent\n   */\n  @Input({ required: true })\n  tag!: string;\n\n  @Input()\n  children: KeyValue[] = [];\n\n  @Input()\n  override projectable: boolean = true;\n\n  @Input()\n  override pk: string = '';\n\n  @Input()\n  parent: undefined | KeyValue = undefined;\n\n  /**\n   * @description Initializes the component after Angular first displays the data-bound properties.\n   * @summary Sets up the component by creating the dynamic component specified by the tag input.\n   * This method is called once when the component is initialized and triggers the dynamic\n   * component creation process with the provided tag name and global properties.\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant A as Angular Lifecycle\n   *   participant C as ComponentRendererComponent\n   *   participant R as NgxRenderingEngine\n   *\n   *   A->>C: ngOnInit()\n   *   C->>C: createComponent(tag, globals)\n   *   C->>R: components(tag)\n   *   R-->>C: Return component constructor\n   *   C->>C: Process component inputs\n   *   C->>C: Create component instance\n   *   C->>C: subscribeEvents()\n   *\n   * @return {void}\n   * @memberOf ComponentRendererComponent\n   */\n  ngOnInit(): void {\n    if (!this.parent) {\n      this.createComponent(this.tag, this.globals);\n    } else {\n      this.createParentComponent();\n    }\n  }\n\n  /**\n   * @description Creates and renders a dynamic component.\n   * @summary This method handles the creation of a dynamic component based on the provided tag.\n   * It retrieves the component constructor from the rendering engine, processes its inputs,\n   * filters out unmapped properties, creates the component instance, and sets up event subscriptions.\n   *\n   * @param {string} tag - The tag name of the component to create\n   * @param {KeyValue} globals - Global properties to pass to the component\n   * @return {void}\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant C as ComponentRendererComponent\n   *   participant R as NgxRenderingEngine\n   *   participant V as ViewContainerRef\n   *\n   *   C->>R: components(tag)\n   *   R-->>C: Return component constructor\n   *   C->>C: reflectComponentType(component)\n   *   C->>C: Process input properties\n   *   C->>C: Filter unmapped properties\n   *   C->>V: clear()\n   *   C->>R: createComponent(component, props, metadata, vcr, injector, [])\n   *   R-->>C: Return component reference\n   *   C->>C: subscribeEvents()\n   *\n   * @private\n   * @memberOf ComponentRendererComponent\n   */\n  private createComponent(tag: string, globals: KeyValue = {}): void {\n    const component = NgxRenderingEngine.components(tag)?.constructor as Type<unknown>;\n    const metadata = reflectComponentType(component);\n    const componentInputs = (metadata as ComponentMirror<unknown>).inputs;\n    const props = globals?.['item'] || globals?.['props'] || {};\n    if (props?.['tag']) delete props['tag'];\n    if (props?.[AngularEngineKeys.CHILDREN] && !this.children.length)\n      this.children = props[AngularEngineKeys.CHILDREN] as KeyValue[];\n    props[AngularEngineKeys.CHILDREN] = this.children || [];\n    const inputKeys = Object.keys(props);\n    const unmappedKeys: string[] = [];\n\n    for (const input of inputKeys) {\n      if (!inputKeys.length) break;\n      const prop = componentInputs.find((item: { propName: string }) => item.propName === input);\n      if (!prop) {\n        delete props[input];\n        unmappedKeys.push(input);\n      }\n    }\n\n    function hasProperty(key: string): boolean {\n      return Object.values(componentInputs).some(({ propName }) => propName === key);\n    }\n\n    const hasChildrenInput = hasProperty(AngularEngineKeys.CHILDREN);\n    if (!this.projectable && hasChildrenInput) props[AngularEngineKeys.CHILDREN] = this.children;\n\n    const hasRootForm = hasProperty(BaseComponentProps.PARENT_FORM);\n    if (hasRootForm && this.parentForm) props[BaseComponentProps.PARENT_FORM] = this.parentForm;\n\n    props['className'] = props['className']\n      ? props['className'] + ' ' + this.className\n      : this.className || '';\n    this.vcr.clear();\n    // const projectable = (this.children?.length && this.projectable);\n    // const template = projectable ? this.vcr.createEmbeddedView(this.inner as TemplateRef<unknown>, this.injector).rootNodes : [];\n    this.instance = NgxRenderingEngine.createComponent(\n      component,\n      { ...props, ...{ modelId: props?.modelId || this.modelId, pk: props?.pk || this.pk } },\n      this.injector as Injector,\n      metadata as ComponentMirror<unknown>,\n      this.vcr,\n      [],\n    );\n    this.subscribeEvents(component);\n  }\n\n  private createParentComponent() {\n    const { component, inputs } = this.parent as KeyValue;\n    const metadata = reflectComponentType(component) as ComponentMirror<unknown>;\n    const template = this.projectable\n      ? this.vcr.createEmbeddedView(this.inner as TemplateRef<unknown>, this.injector).rootNodes\n      : [];\n    this.instance = NgxRenderingEngine.createComponent(\n      component,\n      inputs,\n      this.injector,\n      metadata,\n      this.vcr,\n      template,\n    );\n    this.subscribeEvents(component);\n  }\n}\n","<!-- Keep to avoid id conflicts -->\n\n<ng-template #componentOuter></ng-template>\n\n<ng-template #componentInner>\n  @if (parent?.children?.length) {\n    @for(child of parent.children; track child) {\n        @if (!child.children?.length) {\n          <ng-container\n                *ngComponentOutlet=\"\n                  child.component;\n                  injector: child.injector;\n                  inputs: child.inputs;\n                  content:child.content;\n                \"\n          />\n        } @else {\n          <ngx-decaf-component-renderer [parent]=\"child\"> </ngx-decaf-component-renderer>\n        }\n    }\n  }\n  @if (projectable) {\n    @if (children?.length) {\n      @for(child of children; track child) {\n        @if (child.children?.length) {\n         <ng-container\n                *ngComponentOutlet=\"\n                  child.component;\n                  injector: child.injector;\n                  inputs: child.inputs;\n                  content:child.content;\n                \"\n          />\n        } @else {\n           <ng-container\n                *ngComponentOutlet=\"\n                  child.component;\n                  injector: child.injector;\n                  inputs: child.inputs;\n                  content:child.content;\n                \"\n          />\n        }\n      }\n    }\n  }\n\n</ng-template>\n\n","/**\n * @module lib/directives/NgxSvgDirective\n * @description Standalone directive that inlines SVG assets into the host element.\n * @summary Provides {@link NgxSvgDirective}, a lightweight Angular directive that resolves\n * an SVG file path from either its input binding or the host element's `src` attribute and\n * delegates the HTTP fetch and DOM injection to {@link NgxMediaService}.\n * @link {@link NgxSvgDirective}\n */\nimport { HttpClient } from '@angular/common/http';\nimport { Directive, ElementRef, inject, Input, OnInit } from '@angular/core';\nimport { NgxMediaService } from '../services/NgxMediaService';\n\n/**\n * @description Angular directive that fetches an SVG file and inlines it into the host element.\n * @summary Standalone directive bound to the `[ngx-decaf-svg]` attribute selector. On\n * initialisation it resolves the SVG asset path from the `[ngx-decaf-svg]` input binding or,\n * as a fallback, the host element's native `src` attribute. Once a non-empty path is determined\n * it calls {@link NgxMediaService.loadSvgObserver}, which performs the HTTP request via\n * {@link HttpClient} and injects the SVG markup directly into the host element's DOM, enabling\n * full CSS styling of the inlined SVG.\n * @class NgxSvgDirective\n * @implements {OnInit}\n * @example\n * ```html\n * <!-- Via directive binding -->\n * <div [ngx-decaf-svg]=\"'/assets/icons/logo.svg'\"></div>\n *\n * <!-- Fallback to src attribute -->\n * <img ngx-decaf-svg src=\"/assets/icons/arrow.svg\" />\n * ```\n */\n@Directive({\n  selector: '[ngx-decaf-svg]',\n  standalone: true,\n})\nexport class NgxSvgDirective implements OnInit {\n  /**\n   * @description URL or asset path to the SVG file to inline.\n   * @summary Bound via the `[ngx-decaf-svg]` attribute. When empty or not provided, the\n   * directive falls back to reading the host element's native `src` attribute during\n   * `ngOnInit`.\n   * @type {string}\n   * @memberOf module:lib/directives/NgxSvgDirective\n   */\n  @Input('ngx-decaf-svg')\n  path!: string;\n\n  /**\n   * @description Service responsible for fetching and inlining the SVG markup.\n   * @summary Injected {@link NgxMediaService} instance used by `ngOnInit` to perform the\n   * HTTP request and inject the resulting SVG markup into the host element's DOM.\n   * @type {NgxMediaService}\n   * @memberOf module:lib/directives/NgxSvgDirective\n   */\n  mediaService: NgxMediaService = inject(NgxMediaService);\n\n  /**\n   * @description Reference to the host DOM element into which the SVG will be injected.\n   * @summary Obtained via Angular's `inject(ElementRef)`. Provides access to the native\n   * element forwarded to {@link NgxMediaService.loadSvgObserver} as the injection target,\n   * and used as a fallback source for the `src` attribute when `path` is not set.\n   * @type {ElementRef}\n   * @memberOf module:lib/directives/NgxSvgDirective\n   */\n  element: ElementRef = inject(ElementRef);\n\n  /**\n   * @description HTTP client instance forwarded to the media service for the SVG fetch.\n   * @summary Injected {@link HttpClient} passed directly to\n   * {@link NgxMediaService.loadSvgObserver} so the service can issue the GET request for\n   * the SVG file without managing its own HTTP dependency.\n   * @type {HttpClient}\n   * @memberOf module:lib/directives/NgxSvgDirective\n   */\n  http: HttpClient = inject(HttpClient);\n\n  /**\n   * @description Resolves the SVG path and triggers the inline load.\n   * @summary Trims `path` and, when empty, falls back to the host element's `src` attribute.\n   * When a valid path is found, delegates to {@link NgxMediaService.loadSvgObserver} to\n   * fetch the file and inject the SVG markup into the host element.\n   * @returns {void}\n   * @memberOf module:lib/directives/NgxSvgDirective\n   */\n  ngOnInit(): void {\n    this.path = this.path?.trim() || this.element?.nativeElement?.getAttribute('src')?.trim() || '';\n    if (this.path) {\n      this.mediaService.loadSvgObserver(this.http, this.path, this.element.nativeElement);\n    }\n  }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n  name: 'truncate',\n  // pure: true,\n  standalone: true,\n})\nexport class DecafTruncatePipe implements PipeTransform {\n  transform(value: string, limit = 30, trail: string = '...'): string {\n    if (!value) {\n      return '';\n    }\n    const sanitized = this.sanitize(value);\n    return sanitized.length > limit ? `${sanitized.substring(0, limit)}${trail}` : sanitized;\n  }\n\n  sanitize(value: string): string {\n    return value.replace(/<[^>]+>/g, '').trim();\n  }\n}\n","/**\n * @module DecafTooltipDirective\n * @description Provides a tooltip directive for the decaf-ts for-angular library.\n * @summary This module defines the {@link DecafTooltipDirective}, a standalone Angular directive\n * that dynamically appends a tooltip element to any host element it decorates. It also supports\n * optional text truncation using the {@link DecafTruncatePipe}.\n */\n\nimport { Directive, ElementRef, inject, Input, OnChanges, Renderer2 } from '@angular/core';\nimport { ITooltipConfig } from '../engine/interfaces';\nimport { DecafTruncatePipe } from '../pipes/truncate.pipe';\n\n/**\n * @description Angular directive that appends a tooltip `<span>` to the host element and\n * optionally truncates its visible text content.\n * @summary The `DecafTooltipDirective` is a standalone Angular directive bound to the\n * `[ngx-decaf-tooltip]` attribute selector. It processes the {@link TooltipConfig} provided\n * via the `options` input, sanitizes the text, and appends a `.dcf-tooltip` `<span>` containing\n * the sanitized full text to the host element. The directive also applies the `dcf-tooltip-parent`\n * CSS class to the host for tooltip positioning. When truncation is enabled, the host element's\n * inner content is replaced with the truncated text before the tooltip span is added.\n * @example\n * ```html\n * <!-- Basic tooltip -->\n * <span [ngx-decaf-tooltip]=\"{ text: 'Full description here' }\">Hover me</span>\n *\n * <!-- Truncated visible text with tooltip showing the full content -->\n * <span [ngx-decaf-tooltip]=\"{ text: veryLongLabel, truncate: true, limit: 20, trail: '…' }\">\n *   {{ veryLongLabel }}\n * </span>\n * ```\n * @class DecafTooltipDirective\n */\n\n/**\n * @description Angular lifecycle hook invoked whenever one or more input properties change.\n * @summary Processes the {@link ITooltipConfig} options, sanitizes the text, and updates the\n * host element's content and tooltip span accordingly. Applies the `dcf-tooltip-parent` CSS class\n * to the host for styling.\n * @return {void}\n */\n@Directive({\n  selector: '[ngx-decaf-tooltip]',\n  providers: [DecafTruncatePipe],\n  standalone: true,\n})\nexport class DecafTooltipDirective implements OnChanges {\n  @Input('ngx-decaf-tooltip')\n  options!: ITooltipConfig;\n\n  /**\n   * @description Reference to the host DOM element into which the SVG will be injected.\n   * @summary Obtained via Angular's `inject(ElementRef)`. Provides access to the native\n   * element forwarded to {@link NgxMediaService.loadSvgObserver} as the injection target,\n   * and used as a fallback source for the `src` attribute when `path` is not set.\n   * @type {ElementRef}\n   * @memberOf module:lib/directives/NgxSvgDirective\n   */\n  element: ElementRef = inject(ElementRef);\n  renderer: Renderer2 = inject(Renderer2);\n  truncatePipe: DecafTruncatePipe = inject(DecafTruncatePipe);\n\n  /**\n   * @description Angular lifecycle hook invoked whenever one or more input properties change.\n   * @summary Processes the {@link TooltipConfig} options, sanitizes the text, and updates the\n   * host element's content and tooltip span accordingly. Applies the `dcf-tooltip-parent` CSS class\n   * to the host for styling.\n   * @return {void}\n   */\n  ngOnChanges(): void {\n    const options = {\n      truncate: false,\n      limit: 30,\n      ...{ position: 'top' },\n      ...this.options,\n    };\n    if (options?.text && options?.text.trim().length) {\n      const value = options.text.replace(/<[^>]+>/g, '').trim();\n      if (value.length > options.limit) {\n        const text = !options.truncate\n          ? value\n          : this.truncatePipe.transform(value, options.limit, options.trail || '...');\n\n        const element = this.element?.nativeElement ? this.element?.nativeElement : this.element;\n        if (options.truncate) {\n          this.renderer.setProperty(element, 'innerHTML', '');\n          const textNode = this.renderer.createText(text);\n          this.renderer.appendChild(element, textNode);\n        }\n\n        // creating tooltip element\n        const tooltip = this.renderer.createElement('span');\n        this.renderer.addClass(tooltip, `dcf-tooltip`);\n        this.renderer.addClass(tooltip, `dcf-tooltip-${options.position}`);\n        this.renderer.appendChild(tooltip, this.renderer.createText(this.truncatePipe.sanitize(value)));\n        this.renderer.appendChild(element, tooltip);\n        this.renderer.addClass(element, 'dcf-tooltip-parent');\n      }\n    }\n  }\n}\n","/**\n * @module lib/engine/NgxFormFieldDirective\n * @description Base directive for CRUD form fields in Decaf Angular applications.\n * @summary Provides the NgxFormFieldDirective abstract class that implements ControlValueAccessor\n * and FieldProperties to enable form field integration with Angular's reactive forms system.\n * This directive handles form control lifecycle, validation, multi-entry forms, and CRUD operations.\n */\nimport { Directive, Inject, Input, OnChanges, SimpleChanges } from '@angular/core';\nimport { AbstractControl, ControlValueAccessor, FormArray, FormControl, FormGroup } from '@angular/forms';\nimport { CrudOperations, InternalError, OperationKeys } from '@decaf-ts/db-decorators';\nimport { Primitives } from '@decaf-ts/decorator-validation';\nimport { sf } from '@decaf-ts/logging';\nimport {\n  ComponentEventNames,\n  FieldProperties,\n  HTML5InputTypes,\n  RenderingError,\n  UIEventProperty,\n  UIValidator,\n} from '@decaf-ts/ui-decorators';\nimport { SelectCustomEvent } from '@ionic/angular/standalone';\nimport { take, timer } from 'rxjs';\nimport { NgxFormService } from '../services/NgxFormService';\nimport { stripHTML } from '../utils/helpers';\nimport { AngularEngineKeys, CPTKN } from './constants';\nimport { NgxComponentDirective } from './NgxComponentDirective';\nimport { FormParent, FunctionLike, KeyValue, PossibleInputTypes } from './types';\n\n/**\n * @description Abstract base directive for CRUD form fields in Angular applications.\n * @summary Provides the foundation for all form field components in Decaf applications by implementing\n * Angular's ControlValueAccessor interface and FieldProperties for validation. This directive manages\n * form control integration, validation state, multi-entry forms (FormArrays), and CRUD operation context.\n * It handles form group lifecycle, error messaging, change detection, and parent-child form relationships.\n * Extend this class to create custom form field components that seamlessly integrate with Angular's\n * reactive forms and Decaf's validation system.\n * @class NgxFormFieldDirective\n * @extends {NgxComponentDirective}\n * @implements {ControlValueAccessor}\n * @implements {FieldProperties}\n * @example\n * ```typescript\n * @Component({\n *   selector: 'app-text-field',\n *   templateUrl: './text-field.component.html',\n *   providers: [{\n *     provide: NG_VALUE_ACCESSOR,\n *     useExisting: forwardRef(() => TextFieldComponent),\n *     multi: true\n *   }]\n * })\n * export class TextFieldComponent extends NgxFormFieldDirective {\n *   constructor() {\n *     super();\n *   }\n * }\n * ```\n */\n@Directive()\nexport abstract class NgxFormFieldDirective\n  extends NgxComponentDirective\n  implements OnChanges, ControlValueAccessor, FieldProperties\n{\n  /**\n   * @description Index of the currently active form group in a form array.\n   * @summary When working with multiple form groups (form arrays), this indicates\n   * which form group is currently active or being edited. This is used to manage\n   * focus and data binding in multi-entry scenarios.\n   * @type {number}\n   * @default 0\n   * @public\n   */\n  @Input()\n  activeFormGroupIndex: number = 0;\n\n  @Input({ required: true })\n  override operation: CrudOperations = OperationKeys.CREATE;\n\n  /**\n   * @description Parent form container for this field.\n   * @summary Reference to the parent FormGroup or FormArray that contains this field.\n   * When this field is part of a multi-entry structure, this contains the FormArray\n   * with all form groups. This enables management of multiple instances of the same\n   * field structure within a single form.\n   * @type {FormParent}\n   * @public\n   */\n  @Input()\n  parentForm!: FormParent;\n\n  /**\n   * @description Field mapping configuration for options.\n   * @summary Defines how fields from the data model should be mapped to properties used by the component.\n   * This allows for flexible data binding between the model and the component's display logic.\n   * Can be either a key-value mapping object or a function that performs the mapping.\n   * @type {KeyValue | FunctionLike}\n   * @public\n   */\n  @Input()\n  optionsMapper: KeyValue | FunctionLike = {};\n\n  /**\n   * @description Angular FormControl instance for this field.\n   * @summary The FormControl that manages this field's value, validation state, and user interactions.\n   * @type {FormControl}\n   * @public\n   */\n  formControl!: FormControl;\n\n  /**\n   * @description Dot-separated path to this field in the form structure.\n   * @summary Used to locate this field within nested form structures.\n   * @type {string}\n   * @public\n   */\n  path!: string;\n\n  /**\n   * @description The input type of this field.\n   * @summary Determines the HTML input type or component type to render.\n   * @type {PossibleInputTypes}\n   * @public\n   */\n  type!: PossibleInputTypes;\n\n  /**\n   * @description Whether the field is disabled.\n   * @summary When true, the field cannot be edited by the user.\n   * @type {boolean}\n   * @public\n   */\n  disabled?: boolean;\n\n  /**\n   * @description Page number for multi-page forms.\n   * @summary Indicates which page this field belongs to in a multi-page form structure.\n   * @type {number}\n   * @public\n   */\n  page!: number;\n\n  override events!: UIEventProperty;\n\n  // Validation properties\n\n  /**\n   * @description Date/time format string for parsing and display.\n   * @type {string}\n   * @public\n   */\n  format?: string;\n\n  /**\n   * @description Maximum value or date allowed.\n   * @type {number | Date}\n   * @public\n   */\n  max?: number | Date;\n\n  /**\n   * @description Maximum length for text input.\n   * @type {number}\n   * @public\n   */\n  maxlength?: number;\n\n  /**\n   * @description Minimum value or date allowed.\n   * @type {number | Date}\n   * @public\n   */\n  min?: number | Date;\n\n  /**\n   * @description Minimum length for text input.\n   * @type {number}\n   * @public\n   */\n  minlength?: number;\n\n  /**\n   * @description Regex pattern for validation.\n   * @type {string | undefined}\n   * @public\n   */\n  pattern?: string | undefined;\n\n  /**\n   * @description Whether the field is required.\n   * @type {boolean}\n   * @public\n   */\n  required?: boolean;\n\n  /**\n   * @description Step value for numeric inputs.\n   * @type {number}\n   * @public\n   */\n  step?: number;\n\n  /**\n   * @description Field name that this field's value must equal.\n   * @type {string}\n   * @public\n   */\n  equals?: string;\n\n  /**\n   * @description Field name that this field's value must differ from.\n   * @type {string}\n   * @public\n   */\n  different?: string;\n\n  /**\n   * @description Field name that this field's value must be less than.\n   * @type {string}\n   * @public\n   */\n  lessThan?: string;\n\n  /**\n   * @description Field name that this field's value must be less than or equal to.\n   * @type {string}\n   * @public\n   */\n  lessThanOrEqual?: string;\n\n  /**\n   * @description Field name that this field's value must be greater than.\n   * @type {string}\n   * @public\n   */\n  greaterThan?: string;\n\n  /**\n   * @description Field name that this field's value must be greater than or equal to.\n   * @type {string}\n   * @public\n   */\n  greaterThanOrEqual?: string;\n\n  /**\n   * @description Current value of the field.\n   * @summary Can be a string, number, date, or array of strings for multi-select fields.\n   * @type {string | number | Date | string[]}\n   * @public\n   */\n  override value!: string | number | Date | string[];\n\n  /**\n   * @description Whether the field supports multiple values.\n   * @summary When true, the field is rendered as part of a FormArray structure.\n   * @type {boolean}\n   * @public\n   */\n  multiple!: boolean;\n\n  /**\n   * @description Custom type definitions for field validation.\n   * @summary Allows specifying custom types beyond HTML5 input types to support specialized validation logic.\n   * Can be a single type string or an array of type strings for multi-type validation scenarios.\n   * @type {string | string[] | undefined}\n   * @public\n   */\n  customTypes?: string | string[] | undefined;\n\n  /**\n   * @description Whether the field is currently checked.\n   * @summary Used for checkbox and radio button fields to track the checked state independently from the value.\n   * @type {boolean}\n   * @default false\n   * @public\n   */\n  checked: boolean = false;\n\n  /**\n   * @description Flag tracking if validation error event has been dispatched.\n   * @summary Proverride  duplicate validation error override  from being dispatched.\n   * @type {boolean}\n   * @private\n   */\n  private validationErrorEventDispatched: boolean = false;\n\n  /**\n   * @description Reference to the parent HTML element.\n   * @summary Used for DOM manipulation and event handling.\n   * @type {HTMLElement}\n   * @protected\n   */\n  protected parent?: HTMLElement;\n\n  /**\n   * @description Reference to HTML5 input type constants for template usage.\n   * @summary Exposes the HTML5InputTypes enum to the component template, enabling\n   * conditional rendering and behavior based on input field types. This protected\n   * readonly property ensures that template logic can access input type constants\n   * while maintaining encapsulation and preventing accidental modification.\n   * @type {HTML5InputTypes}\n   * @protected\n   * @readonly\n   */\n  readonly HTML5InputTypes = HTML5InputTypes;\n\n  errorMessage?: string;\n\n  // eslint-disable-next-line @angular-eslint/prefer-inject\n  constructor(@Inject(CPTKN) componentName: string = 'ComponentCrudField') {\n    super(componentName);\n    if (!UIValidator.translateService) {\n      UIValidator.translateService = this.translateService;\n    }\n  }\n\n  /**\n   * @description Gets the currently active form group based on context.\n   * @summary Returns the appropriate FormGroup based on whether this field supports\n   * multiple values. For single-value fields, returns the main form group.\n   * For multi-value fields, returns the form group at the active index from the parent FormArray.\n   * If no formGroup is set, returns the parent of the formControl.\n   * @return {FormGroup} The currently active FormGroup for this field\n   * @public\n   */\n  get activeFormGroup(): FormGroup {\n    if (!this.formGroup) return this.formControl.parent as FormGroup;\n\n    if (this.multiple) {\n      if (this.formGroup instanceof FormArray) return this.formGroup.at(this.activeFormGroupIndex) as FormGroup;\n      return this.formGroup;\n    }\n\n    return this.formGroup as FormGroup;\n  }\n\n  /**\n   * @description String formatting utility function.\n   * @summary Provides access to the sf (string format) function for formatting error messages\n   * and other string templates. Used primarily for localizing and parameterizing validation messages.\n   * @type {function(string, ...string): string}\n   * @public\n   */\n  sf = sf;\n\n  /**\n   * @description Callback function invoked when the field value changes.\n   * @summary Function registered by Angular's forms system through registerOnChange.\n   * Called automatically when the field's value is updated to notify the form of the change.\n   * @type {function(): unknown}\n   * @public\n   */\n  // eslint-disable-next-line @typescript-eslint/no-empty-function\n  onChange: () => unknown = () => {};\n\n  /**\n   * @description Callback function invoked when the field is touched.\n   * @summary Function registered by Angular's forms system through registerOnTouched.\n   * Called when the field is blurred or otherwise marked as touched.\n   * @type {function(): unknown}\n   * @public\n   */\n  // eslint-disable-next-line @typescript-eslint/no-empty-function\n  onTouch: () => unknown = () => {};\n\n  /**\n   * @description Writes a value to the form field.\n   * @summary Part of Angular's ControlValueAccessor interface. Sets the field's value\n   * when the form programmatically updates it. This is called by Angular forms when\n   * the model value changes.\n   * @param {string} obj - The value to be set\n   * @return {void}\n   * @public\n   */\n  writeValue(obj: string): void {\n    this.value = obj;\n  }\n\n  /**\n   * @description Registers the onChange callback function.\n   * @summary Part of Angular's ControlValueAccessor interface. Stores the function\n   * that Angular forms provides to be called when the field value changes.\n   * @param {function(): unknown} fn - The function to be called on change\n   * @return {void}\n   * @public\n   */\n  registerOnChange(fn: () => unknown): void {\n    this.onChange = fn;\n  }\n\n  /**\n   * @description Registers the onTouched callback function.\n   * @summary Part of Angular's ControlValueAccessor interface. Stores the function\n   * that Angular forms provides to be called when the field is touched/blurred.\n   * @param {function(): unknown} fn - The function to be called on touch\n   * @return {void}\n   * @public\n   */\n  registerOnTouched(fn: () => unknown): void {\n    this.onTouch = fn;\n  }\n\n  /**\n   * @description Sets the disabled state of the field.\n   * @summary Part of Angular's ControlValueAccessor interface. Called by Angular forms\n   * when the disabled state of the control changes.\n   * @param {boolean} isDisabled - Whether the field should be disabled\n   * @return {void}\n   * @public\n   */\n  setDisabledState?(isDisabled: boolean): void {\n    this.disabled = isDisabled;\n  }\n\n  /**\n   * @description Performs setup after the view has been initialized.\n   * @summary Retrieves and returns the parent HTML element based on the current CRUD operation.\n   * For READ and DELETE operations, returns the immediate parent element. For CREATE and UPDATE\n   * operations, finds the parent div element and registers it with the form service.\n   * @return {HTMLElement} The parent element of the field\n   * @throws {RenderingError} If unable to retrieve parent form element for CREATE/UPDATE operations\n   * @throws {InternalError} If the operation is invalid\n   * @public\n   */\n  afterViewInit(): HTMLElement {\n    this.checkDarkMode();\n    let parent: HTMLElement;\n    if (this.component?.nativeElement)\n      this.isModalChild = this.component.nativeElement.closest('ion-modal') ? true : false;\n\n    switch (this.operation) {\n      case OperationKeys.READ:\n      case OperationKeys.DELETE:\n        return this.component.nativeElement.parentElement;\n      case OperationKeys.CREATE:\n      case OperationKeys.UPDATE:\n        try {\n          parent = NgxFormService.getParentEl(this.component.nativeElement, 'div');\n        } catch (e: unknown) {\n          throw new RenderingError(\n            `Unable to retrieve parent form element for the ${this.operation}: ${e instanceof Error ? e.message : e}`\n          );\n        }\n        // NgxFormService.register(parent.id, this.formGroup, this as AngularFieldDefinition);\n        return parent;\n      default:\n        throw new InternalError(`Invalid operation: ${this.operation}`);\n    }\n  }\n\n  /**\n   * @description Angular lifecycle hook for detecting input property changes.\n   * @summary Overrides the parent ngOnChanges to handle changes to activeFormGroupIndex and value.\n   * When activeFormGroupIndex changes in a multiple field scenario, updates the active form group\n   * and form control. When value changes, updates the form control value. Delegates to parent\n   * implementation for initial change detection.\n   * @param {SimpleChanges} changes - Object containing the changed properties\n   * @return {void}\n   * @public\n   */\n  override async ngOnChanges(changes: SimpleChanges): Promise<void> {\n    if (!this.initialized) {\n      await super.ngOnChanges(changes);\n    }\n    if (\n      changes['activeFormGroupIndex'] &&\n      this.multiple &&\n      !changes['activeFormGroupIndex'].isFirstChange() &&\n      changes['activeFormGroupIndex'].currentValue !== this.activeFormGroupIndex\n    ) {\n      this.activeFormGroupIndex = changes['activeFormGroupIndex'].currentValue;\n      this.formGroup = this.activeFormGroup;\n      this.formControl = this.formGroup.get(this.name) as FormControl;\n    }\n    if (\n      changes['value'] &&\n      !changes['value'].isFirstChange() &&\n      changes['value'].currentValue !== undefined &&\n      changes['value'].currentValue !== this.value\n    )\n      this.setValue(changes['value'].currentValue);\n  }\n\n  /**\n   * @description Cleanup logic when the component is destroyed.\n   * @summary Unregisters the form group from the form service to prevent memory leaks\n   * and clean up form references.\n   * @return {void}\n   * @public\n   */\n  onDestroy(): void {\n    if (this.formGroup) NgxFormService.unregister(this.formGroup);\n  }\n\n  getValue(): unknown {\n    const value = this.formControl?.value || this.formGroup?.get(this.name)?.value;\n    if (value) {\n      this.value = value;\n    }\n    return value;\n  }\n\n  /**\n   * @description Sets the value of the form control.\n   * @summary Updates the form control's value and triggers validation. This is used\n   * when the value needs to be programmatically updated from outside the form control.\n   * @param {unknown} value - The value to set\n   * @return {void}\n   * @public\n   */\n  setValue(value: unknown): void {\n    if (this.formControl) {\n      this.formControl.setValue(value);\n      this.formControl.updateValueAndValidity();\n    }\n    this.value = value as string | number | Date | string[];\n  }\n\n  /**\n   * @description Clears the current form control value as a response to a UI interact\n   * @summary Set field value as undefined and proverride  event propagation.\n   * @param {Event} event - The value to set\n   * @return {void}\n   * @public\n   */\n  handleClearValue(event: Event): void {\n    event.preventDefault();\n    event.stopPropagation();\n    this.setValue(undefined);\n  }\n\n  /**\n   * @description Handles IonSelect change override  emitted from modal child components.\n   * @summary Forces change detection when rendered inside a modal and synchronizes the select value with the directive state.\n   * @param {SelectCustomEvent<SelectChangeEventDetail>} event - IonSelect change event containing the selected value.\n   * @return {void}\n   * @public\n   */\n  handleModalChildChanges(event?: SelectCustomEvent, formControl?: AbstractControl): void {\n    const element = this.component?.nativeElement;\n    if (this.type === HTML5InputTypes.SELECT && event) {\n      const { value } = event.detail;\n      if (value?.length) {\n        this.value = value;\n      }\n    }\n    if (element && formControl && !formControl.valid && formControl.updateOn === 'change') {\n      element.dispatchEvent(new Event('ionBlur'));\n    }\n    if (this.isModalChild) {\n      this.changeDetectorRef.detectChanges();\n    }\n\n    this.parseSelectLabel();\n  }\n\n  parseSelectLabel() {\n    const element = this.component?.nativeElement;\n\n    if (this.type === HTML5InputTypes.SELECT && !this.translatable) {\n      const label = element.shadowRoot.querySelector('.select-text');\n      //strip html from element text content to prevent html tags from being rendered in the label\n      timer(25)\n        .pipe(take(1))\n        .subscribe(() => {\n          if (label) {\n            const button = element.shadowRoot.querySelector('button');\n            if (button) {\n              const textContent = stripHTML(button.getAttribute('aria-label').split(',')?.[1] || '');\n              if (typeof textContent === Primitives.STRING && String(textContent).length) {\n                label.textContent = textContent;\n              }\n            }\n          }\n        });\n    }\n  }\n\n  private validateControl(formControl: AbstractControl): boolean {\n    return (\n      (!formControl.valid && (formControl.touched || !formControl.pristine)) ||\n      (!formControl.valid && formControl.dirty && formControl.updateOn === 'change')\n    );\n  }\n\n  private getErrorMessage(error: Record<string, string>): string {\n    const instance = this as KeyValue;\n    let { message } = error;\n    const { key } = error;\n    const prop = instance[key];\n    let args = [] as string[];\n    if (typeof message === Primitives.STRING) {\n      if (message.includes('|')) {\n        const parts = message.split('|');\n        message = parts[0];\n        parts.shift();\n        parts.forEach((part) => {\n          args = [...args, part];\n        });\n      } else {\n        if (prop) {\n          args = [prop];\n        }\n      }\n    } else {\n      args = Object.values(message).map((v) => `${v || prop}`) as string[];\n      message = key;\n    }\n    // Check if string already be translated by validator\n    const translate = (message: string, args: string[]): string => {\n      return this.translateService.instant(\n        !message.includes(AngularEngineKeys.ERRORS) ? `${AngularEngineKeys.ERRORS}.${message}` : message,\n        args\n      );\n    };\n    return /\\s/.test(message) && message !== key ? message : translate(message, args);\n  }\n\n  /**\n   * @description Retrieves validation error messages for the field.\n   * @summary Checks the form control for validation errors and returns formatted error messages.\n   * If errors exist, dispatches a validation error event to parent accordion components.\n   * Error messages are translated and formatted with relevant field properties.\n   * @param {HTMLElement} parent - The parent HTML element used to find accordion components\n   * @return {string | void} Formatted error message string, or void if no errors\n   * @public\n   */\n  getErrors(parent: HTMLElement): string | void {\n    const formControl = this.formControl;\n    if (formControl) {\n      const accordionComponent = parent.closest('ngx-decaf-fieldset')?.querySelector('ion-accordion-group');\n      const invalid = this.validateControl(formControl);\n      if (invalid) {\n        const errors: Record<string, string>[] = Object.entries(formControl.errors ?? {}).map(([key, value]) => {\n          const message = typeof value === 'boolean' ? key : value;\n          return {\n            key: key,\n            message,\n          };\n        });\n\n        if (errors.length) {\n          if (accordionComponent && !this.validationErrorEventDispatched) {\n            const validationErrorEvent = new CustomEvent(ComponentEventNames.ValidationError, {\n              detail: { fieldName: this.name, hasErrors: true },\n              bubbles: true,\n            });\n            accordionComponent.dispatchEvent(validationErrorEvent);\n            this.validationErrorEventDispatched = true;\n          }\n          for (const error of errors) {\n            this.errorMessage = `* ${this.getErrorMessage(error)}`;\n            return this.errorMessage;\n          }\n        } else {\n          this.errorMessage = '';\n        }\n      }\n    }\n  }\n}\n","import { Component, ElementRef, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';\nimport { IonButton, IonIcon } from '@ionic/angular/standalone';\nimport { Color } from '@ionic/core';\nimport { addIcons } from 'ionicons';\nimport * as allIcons from 'ionicons/icons';\nimport { shareReplay, Subject, takeUntil } from 'rxjs';\n\nimport { NgxSvgDirective } from '../../directives/svg.directive';\nimport { Dynamic } from '../../engine/decorators';\nimport { NgxMediaService } from '../../services/NgxMediaService';\nimport { generateRandomValue } from '../../utils';\n\n@Dynamic()\n@Component({\n  selector: 'ngx-decaf-icon',\n  templateUrl: './icon.component.html',\n  styleUrls: ['./icon.component.scss'],\n  imports: [NgxSvgDirective, IonIcon, IonButton],\n  standalone: true,\n  host: { '[attr.id]': 'uid', '[attr.aria-hidden]': '!button' },\n})\nexport class IconComponent implements OnInit, OnDestroy {\n  @ViewChild('component', { read: ElementRef, static: false })\n  component!: ElementRef;\n\n  @Input()\n  name?: string;\n\n  @Input()\n  uid: string = generateRandomValue(8);\n\n  @Input()\n  color: Color = 'dark';\n\n  @Input()\n  slot?: 'start' | 'end' | 'icon-only' = 'icon-only';\n\n  @Input()\n  button: boolean = false;\n\n  @Input()\n  buttonFill: 'clear' | 'outline' | 'solid' | 'default' = 'clear';\n\n  @Input()\n  buttonShape: 'round' | 'default' = 'round';\n\n  @Input()\n  width!: string;\n\n  @Input()\n  size?: 'large' | 'small' | 'default' = 'default';\n\n  type: 'image' | 'ionic' | 'icon' = 'ionic';\n\n  isSvg: boolean = false;\n\n  initialized: boolean = false;\n\n  @Input()\n  inline: boolean = false;\n\n  isDarkMode: boolean = false;\n\n  mediaService: NgxMediaService = new NgxMediaService();\n\n  protected destroySubscriptions$ = new Subject<void>();\n\n  constructor() {\n    addIcons(allIcons);\n  }\n\n  ngOnInit(): void {\n    if (this.button) this.slot = 'icon-only';\n    if (this.name?.includes('.')) {\n      this.type = 'image';\n      this.isSvg = this.name.endsWith('.svg');\n    }\n\n    if (this.name?.includes('ti-')) {\n      this.type = 'icon';\n      this.name = `ti-${this.name.replace(/ti-/g, '')}`;\n    }\n    this.mediaService\n      .isDarkMode()\n      .pipe(shareReplay({ bufferSize: 1, refCount: true }), takeUntil(this.destroySubscriptions$))\n      .subscribe((isDark) => {\n        this.isDarkMode = isDark;\n      });\n    this.initialized = true;\n  }\n\n  /**\n   * @description Cleanup lifecycle hook invoked when the directive is destroyed.\n   * @summary Ensures any resources allocated by the directive's media service are\n   * released (DOM listeners, timers, subscriptions, etc.). Implementations should\n   * keep `mediaService.destroy()` idempotent; calling it here prevents leaks when\n   * components are torn down.\n   * @returns {Promise<void>}\n   */\n  async ngOnDestroy(): Promise<void> {\n    this.mediaService.destroy();\n    if (this.destroySubscriptions$) {\n      this.destroySubscriptions$.next();\n      this.destroySubscriptions$.complete();\n    }\n  }\n}\n","<div class=\"dcf-icon-component\" #component>\n  @if (initialized) {\n    @if (button) {\n      <ion-button [fill]=\"buttonFill\" [shape]=\"buttonShape\" [color]=\"isDarkMode ? 'light' : color\" [size]=\"size\">\n        @if (type === \"image\") {\n          @if (isSvg) {\n            <span\n              aria-hidden=\"true\"\n              [slot]=\"slot\"\n              [class]=\"color ? 'dcf-color-' + color : ''\"\n              [style.width]=\"width\"\n              [ngx-decaf-svg]=\"name\"\n            ></span>\n          } @else {\n            <img\n              aria-hidden=\"true\"\n              [alt]=\"name\"\n              [title]=\"name\"\n              [slot]=\"slot\"\n              [src]=\"name\"\n              [style.width]=\"width\"\n              title=\"icon\"\n            />\n          }\n        }\n        @if(type === 'ionic') {\n          <ion-icon\n            aria-hidden=\"true\"\n            [slot]=\"slot\"\n            [ios]=\"name\"\n            [md]=\"name\"\n            [color]=\"isDarkMode ? 'light' : color\"\n            [name]=\"name\"\n          />\n        }\n        @if(type === 'icon') {\n          <span\n            aria-hidden=\"true\"\n            [slot]=\"slot\"\n            [class]=\"'dcf-icon-button ti ' +name + ' ' + size + ' dcf-color-' + color\">\n          </span>\n        }\n      </ion-button>\n    } @else {\n      @if (type === \"image\") {\n        @if (isSvg) {\n          <span\n            aria-hidden=\"true\"\n            [slot]=\"slot\"\n            [class]=\"color ? 'dcf-color-' + color : ''\"\n            [style.width]=\"width\"\n            [ngx-decaf-svg]=\"name\"\n          >\n          </span>\n        } @else {\n          <img\n            aria-hidden=\"true\"\n            [alt]=\"name\"\n            [title]=\"name\"\n            [slot]=\"slot\"\n            [src]=\"name\"\n            [style.width]=\"width\"\n            title=\"icon\"\n          />\n        }\n      }\n      @if (type === \"ionic\") {\n        <ion-icon\n          aria-hidden=\"true\"\n          [slot]=\"slot\"\n          [ios]=\"name\"\n          [md]=\"name\"\n          [size]=\"size\"\n          [color]=\"isDarkMode ? 'light' : color\"\n          [name]=\"name\"\n        />\n      }\n      @if(type === 'icon') {\n        <span\n          aria-hidden=\"true\"\n          [slot]=\"slot\"\n          [class]=\"'ti ' + name + ' ' + size + ' dcf-color-' + color\">\n        </span>\n      }\n    }\n  }\n</div>\n","/**\n * @module module:lib/engine/NgxParentComponentDirective\n * @description Directive base for parent container components used by the rendering system.\n * @summary Provides NgxParentComponentDirective which offers inputs for children metadata,\n * column/row configuration and parent component wiring used by layout and container components.\n *\n * @link {@link NgxParentComponentDirective}\n */\nimport { Directive, Input } from '@angular/core';\nimport { NgxComponentDirective } from './NgxComponentDirective';\nimport { FormParent, KeyValue } from './types';\nimport {\n  FieldDefinition,\n  IPagedComponentProperties,\n  UIMediaBreakPoints,\n  UIMediaBreakPointsType,\n  UIModelMetadata,\n} from '@decaf-ts/ui-decorators';\nimport { Model } from '@decaf-ts/decorator-validation';\nimport { IComponentProperties } from './interfaces';\nimport { Subscription, timer } from 'rxjs';\n\n/**\n * @description Layout component for creating responsive grid layouts in Angular applications.\n * @summary This component provides a flexible grid system that can be configured with dynamic\n * rows and columns. It supports responsive breakpoints and can render child components within\n * the grid structure. The component extends NgxComponentDirective to inherit common functionality\n * and integrates with the model and component renderer systems.\n *\n * @class NgxParentComponentDirective\n * @extends {NgxComponentDirective}\n * @implements {OnInit}\n */\n@Directive()\nexport class NgxParentComponentDirective extends NgxComponentDirective {\n  @Input()\n  override refreshing: boolean = false;\n\n  /**\n   * @description Unique identifier for the current record.\n   * @summary A unique identifier for the current record being displayed or manipulated.\n   * This is typically used in conjunction with the primary key for operations on specific records.\n   *\n   * @type {string | number}\n   */\n  @Input()\n  page: number = 1;\n\n  /**\n   * @description Unique identifier for the current record.\n   * @summary A unique identifier for the current record being displayed or manipulated.\n   * This is typically used in conjunction with the primary key for operations on specific records.\n   *\n   * @type {string | number}\n   */\n  @Input()\n  pages: number | IPagedComponentProperties[] = 1;\n\n  /**\n   * @description Array of UI model metadata for the currently active page.\n   * @summary Contains only the UI model metadata for fields that should be displayed\n   * on the currently active page. This is a filtered subset of the children array,\n   * updated whenever the user navigates between pages.\n   *\n   * @type { UIModelMetadata | UIModelMetadata[] | FieldDefinition | FieldDefinition[] | undefined }\n   */\n  activePage:\n    | UIModelMetadata\n    | UIModelMetadata[]\n    | FieldDefinition\n    | FieldDefinition[]\n    | undefined = undefined;\n\n  /**\n   * @description The currently active page number.\n   * @summary Tracks which page of the multi-step form is currently being displayed.\n   * This property is updated as users navigate through the form steps using\n   * the next/back buttons or programmatic navigation.\n   *\n   * @type {number}\n   */\n  activeIndex: number = 1;\n\n  /**\n   * @description The parent form object that represents the parent-child relationship in the form hierarchy.\n   * @summary This input binds the parent form object to the directive, enabling hierarchical form structures.\n   * It allows the directive to interact with the parent form and manage child components effectively.\n   *\n   * @type {FormParent}\n   */\n  @Input()\n  parentForm!: FormParent;\n\n  /**\n   * @description Array of UI model metadata for all form fields.\n   * @summary Contains the complete collection of UI model metadata that defines\n   * the structure, validation, and presentation of form fields across all pages.\n   * Each metadata object contains information about field type, validation rules,\n   * page assignment, and display properties.\n   *\n   * @type {UIModelMetadata[]}\n   */\n  @Input()\n  children: UIModelMetadata[] | IComponentProperties[] | FieldDefinition[] | KeyValue[] = [];\n\n  /**\n   * @description Number of columns or array of column definitions for the grid layout.\n   * @summary Defines the column structure of the grid. When a number is provided, it creates\n   * that many equal-width columns. When an array is provided, each element can define specific\n   * column properties or sizing. This allows for flexible grid layouts that can adapt to\n   * different content requirements.\n   *\n   * @type {(number | string[])}\n   * @default 1\n   */\n  @Input()\n  cols: number | string[] = 1;\n\n  /**\n   * @description Number of rows or array of row definitions for the grid layout.\n   * @summary Defines the row structure of the grid. When a number is provided, it creates\n   * that many equal-height rows. When an array is provided, each element can define specific\n   * row properties or sizing. This provides control over vertical spacing and content organization.\n   *\n   * @type {(number | string[])}\n   * @default 1\n   */\n  @Input()\n  rows: number | KeyValue[] | string[] = 1;\n\n  /**\n   * @description Defines the body style of the card.\n   * @summary Specifies the appearance of the card body, allowing customization\n   * between default, small, or blank styles. This input is used to control the\n   * visual presentation of the card content.\n   * @type {'default' | 'small' | 'blank'}\n   * @default 'default'\n   */\n  @Input()\n  cardBody: 'default' | 'small' | 'blank' = 'default';\n\n  /**\n   * @description Specifies the type of the card.\n   * @summary Determines the card's visual style, such as clear or shadowed.\n   * This input allows for flexible styling of the card component to match\n   * different design requirements.\n   * @type {'clear' | 'shadow'}\n   * @default 'clear'\n   */\n  @Input()\n  cardType: 'clear' | 'shadow' = 'clear';\n\n  /**\n   * @description Media breakpoint for responsive behavior.\n   * @summary Determines the responsive breakpoint at which the layout should adapt.\n   * This affects how the grid behaves on different screen sizes, allowing for\n   * mobile-first or desktop-first responsive design patterns. The breakpoint\n   * is automatically processed to ensure compatibility with the UI framework.\n   *\n   * @type {UIMediaBreakPointsType}\n   * @default 'medium'\n   */\n  @Input()\n  breakpoint?: UIMediaBreakPointsType | string = UIMediaBreakPoints.MEDIUM;\n\n  /**\n   * @description Determines if the layout should match the parent container's size or configuration.\n   * @summary Boolean flag that controls whether the component should adapt its layout to match its parent.\n   * When true, the component will attempt to align or size itself according to the parent container.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  @Input()\n  match: boolean = true;\n\n  /**\n   * @description Preloads card placeholders for rendering.\n   * @summary Used to create an array of placeholder elements for card components,\n   * typically to reserve space or trigger rendering logic before actual data is loaded.\n   *\n   * @type {any[]}\n   * @default [undefined]\n   */\n  preloadCards: string[] = new Array(1);\n\n  /**\n   * @description Subscription for timer-based operations.\n   * @summary Manages the timer subscription used for asynchronous operations\n   * like updating active children after page transitions. This subscription\n   * is cleaned up in ngOnDestroy to prevent memory leaks.\n   *\n   * @private\n   * @type {Subscription}\n   * @memberOf SteppedFormComponent\n   */\n  protected timerSubscription!: Subscription;\n\n  override async initialize(model?: Model | string): Promise<void> {\n    await super.initialize();\n    if (model) {\n      this.model = model;\n    }\n    if (this.model && !this.repository) {\n      this._repository = this.repository;\n    }\n  }\n\n  override async ngOnDestroy(): Promise<void> {\n    await super.ngOnDestroy();\n    if (this.timerSubscription) this.timerSubscription.unsubscribe();\n  }\n\n  protected getActivePage(\n    page: number,\n    firstClick: boolean = true,\n  ): UIModelMetadata | UIModelMetadata[] | FieldDefinition | undefined {\n    if (firstClick || this.activeIndex !== page) {\n      const content = this.children[page] as FieldDefinition;\n      this.activePage = undefined;\n      this.preloadCards = [...new Array(1)];\n      this.timerSubscription = timer(25).subscribe(\n        () => (this.activePage = { ...(this.children[page] as FieldDefinition) }),\n      );\n      this.activeIndex = page;\n      if (content) return content;\n      return undefined;\n    }\n  }\n}\n","/**\n * @module module:lib/components/model-renderer/model-renderer.component\n * @description Model renderer component module.\n * @summary Exposes `ModelRendererComponent` which dynamically renders UI components\n * from model definitions using the `NgxRenderingEngine`. It handles model changes,\n * event subscription and lifecycle for the rendered output.\n *\n * @link {@link ModelRendererComponent}\n */\n\nimport { Component, Input } from '@angular/core';\nimport { Model, Primitives, sf } from '@decaf-ts/decorator-validation';\nimport { CrudOperationKeys, Renderable } from '@decaf-ts/ui-decorators';\nimport { AngularEngineKeys } from '../../engine/constants';\nimport { AngularDynamicOutput } from '../../engine/interfaces';\nimport { NgxRenderableComponentDirective } from '../../engine/NgxRenderableComponentDirective';\n\n/**\n * @description Component for rendering dynamic models\n * @summary This component is responsible for dynamically rendering models,\n * handling model changes, and managing event subscriptions for the rendered components.\n * It uses the NgxRenderingEngine to render the models and supports both string and Model inputs.\n * @class\n * @template M - Type extending Model\n * @param {Injector} injector - Angular Injector for dependency injection\n * @example\n * <ngx-decaf-model-renderer\n *   [model]=\"myModel\"\n *   [globals]=\"globalVariables\"\n *   (listenEvent)=\"handleEvent($event)\">\n * </ngx-decaf-model-renderer>\n * @mermaid\n * sequenceDiagram\n *   participant App\n *   participant ModelRenderer\n *   participant RenderingEngine\n *   participant Model\n *   App->>ModelRenderer: Input model\n *   ModelRenderer->>Model: Parse if string\n *   Model-->>ModelRenderer: Parsed model\n *   ModelRenderer->>RenderingEngine: Render model\n *   RenderingEngine-->>ModelRenderer: Rendered output\n *   ModelRenderer->>ModelRenderer: Subscribe to events\n *   ModelRenderer-->>App: Emit events\n */\n@Component({\n  standalone: true,\n  imports: [],\n  selector: 'ngx-decaf-model-renderer',\n  templateUrl: './model-renderer.component.html',\n  styleUrl: './model-renderer.component.scss',\n  host: { '[attr.id]': 'uid' },\n})\nexport class ModelRendererComponent<M extends Model> extends NgxRenderableComponentDirective {\n  /**\n   * @description Set if render content projection is allowed\n   * @default true\n   */\n  @Input()\n  override projectable: boolean = true;\n\n  // private injector: Injector = inject(Injector);\n\n  // constructor() {}\n\n  /**\n   * @description Refreshes the rendered model\n   * @param {string | M} model - The model to be rendered\n   */\n  override async render(model: string | M): Promise<void> {\n    model = typeof model === Primitives.STRING ? (Model.build({}, String(model)) as M) : model;\n\n    if (model) {\n      this.output = (model as unknown as Renderable).render<AngularDynamicOutput>(\n        this.globals || {},\n        this.vcr,\n        this.injector,\n        this.inner,\n        this.projectable\n      );\n      if (this.output?.inputs)\n        this.rendererId = sf(\n          AngularEngineKeys.RENDERED_ID,\n          (this.output.inputs as Record<string, unknown>)['rendererId'] as string\n        );\n      this.instance = this.output?.component;\n      const { operation } = this.globals || {};\n      // const {inputs} = this.output;\n      // await this.initProps(inputs || {});\n      if (operation) {\n        this.operation = operation as CrudOperationKeys;\n      }\n      this.subscribeEvents();\n    }\n  }\n}\n","  <!-- Keep to avoid id conflicts -->\n  <div class=\"dcf-hidden\" [id]=\"uid\"></div>\n\n  <ng-template #componentOuter></ng-template>\n  <!-- <ng-template #inner>\n    <div class=\"dcf-grid dcf-grid-small dcf-model-renderer-component dcf-child-width-1-1\"  [id]=\"rendererId || ''\">\n      @for (child of output?.children; track child) {\n        @if (child?.children?.length) {\n          <ngx-decaf-component-renderer [parent]=\"child\" />\n        } @else {\n          <ng-container\n            #childComponents\n            *ngComponentOutlet=\"\n              child.component;\n              injector: child.injector;\n              inputs: child.inputs;\n              content:child.content;\n            \"\n          />\n        }\n      }\n    </div>\n  </ng-template> -->\n","import {\n  Component,\n  effect,\n  EnvironmentInjector,\n  EventEmitter,\n  inject,\n  Input,\n  OnInit,\n  Output,\n  runInInjectionContext,\n  ViewChild,\n} from '@angular/core';\nimport { Color, modalController, OverlayEventDetail } from '@ionic/core';\nimport { TranslatePipe } from '@ngx-translate/core';\n\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { OperationKeys } from '@decaf-ts/db-decorators';\nimport { Model } from '@decaf-ts/decorator-validation';\nimport { ComponentEventNames, IDecafModal, UIFunctionLike, uihandlers } from '@decaf-ts/ui-decorators';\nimport {\n  IonButton,\n  IonButtons,\n  IonContent,\n  IonHeader,\n  IonModal,\n  IonSpinner,\n  IonTitle,\n  IonToolbar,\n  ModalOptions,\n} from '@ionic/angular/standalone';\nimport { ActionRoles, DefaultModalOptions, ListComponentsTypes } from '../../engine/constants';\nimport { Dynamic } from '../../engine/decorators';\nimport { IBaseCustomEvent } from '../../engine/interfaces';\nimport { NgxFormDirective } from '../../engine/NgxFormDirective';\nimport { NgxParentComponentDirective } from '../../engine/NgxParentComponentDirective';\nimport { NgxRenderingEngine } from '../../engine/NgxRenderingEngine';\nimport { CrudEvent, KeyValue, SelectOption } from '../../engine/types';\nimport { removeFocusTrap } from '../../utils/helpers';\nimport { ComponentRendererComponent } from '../component-renderer/component-renderer.component';\nimport { CrudFormComponent } from '../crud-form/crud-form.component';\nimport { IconComponent } from '../icon/icon.component';\nimport { ListComponent } from '../list/list.component';\nimport { ModelRendererComponent } from '../model-renderer/model-renderer.component';\n\n/**\n * @description Modal component for displaying dynamic content in a modal dialog.\n * @summary This component provides a flexible and reusable modal dialog implementation\n * for Angular applications. It supports dynamic content rendering, customizable options,\n * and event handling for modal lifecycle events. The modal can be used for various purposes,\n * such as displaying forms, lightboxes, or selection dialogs.\n *\n * @class ModalComponent\n * @example\n * ```typescript\n * <ngx-decaf-modal [isOpen]=\"true\" [title]=\"'Example Modal'\"></ngx-decaf-modal>\n * ```\n * @mermaid\n * sequenceDiagram\n *   participant User\n *   participant ModalComponent\n *   User->>ModalComponent: Open modal\n *   ModalComponent->>ModalController: Initialize modal\n *   ModalController-->>ModalComponent: Modal options set\n *   User->>ModalComponent: Interact with modal\n *   ModalComponent->>ModalController: Handle dismiss event\n */\n\n@Dynamic()\n@Component({\n  selector: 'ngx-decaf-modal',\n  templateUrl: 'modal.component.html',\n  styleUrls: ['modal.component.scss'],\n  standalone: true,\n  imports: [\n    IonModal,\n    ComponentRendererComponent,\n    ModelRendererComponent,\n    TranslatePipe,\n    IconComponent,\n    IonSpinner,\n    IonButton,\n    IonButtons,\n    IonContent,\n    IonHeader,\n    IonTitle,\n    IonToolbar,\n  ],\n  host: { '[attr.id]': 'uid' },\n})\n/**\n * @description A reusable modal component that wraps Ionic's IonModal functionality.\n * @summary Provides a flexible modal dialog implementation with support for custom content, positioning, fullscreen mode, and lightbox mode. Extends NgxParentComponentDirective to inherit common component functionality.\n *\n * @extends {NgxParentComponentDirective}\n * @implements {OnInit}\n *\n * @example\n * ```typescript\n * // Basic usage in template\n * <app-modal\n *   [isOpen]=\"showModal\"\n *   [title]=\"'Confirmation'\"\n *   [inlineContent]=\"'Are you sure?'\"\n *   (willDismissEvent)=\"handleDismiss($event)\">\n * </app-modal>\n *\n * // Programmatic usage\n * const modal = await modalComponent.create({ title: 'Settings' });\n * ```\n *\n * @remarks\n * - The modal supports inline content that can be positioned at the top or bottom\n * - Fullscreen and lightbox modes are available for different display needs\n * - The component automatically sanitizes HTML content for security\n * - Modal dismissal can be handled through cancel or confirm actions\n * - Global configuration can be passed through the globals input\n *\n * @public\n */\nexport class ModalComponent extends NgxParentComponentDirective implements IDecafModal, OnInit {\n  /**\n   * @description Reference to the rendered Ionic modal instance.\n   * @summary Captures the underlying `IonModal` so the component can control presentation and dismissal.\n   * @type {IonModal}\n   * @private\n   */\n  @ViewChild('component')\n  modal!: IonModal;\n\n  /**\n   * @description Title of the modal dialog.\n   * @summary Specifies the title text displayed in the modal header.\n   * @type {string | undefined}\n   */\n  @Input()\n  title?: string;\n\n  /**\n   * @description Determines whether the modal is open.\n   * @summary Controls the visibility of the modal dialog. When set to true, the modal is displayed.\n   * @type {boolean}\n   * @default false\n   */\n  @Input()\n  isOpen: boolean = false;\n\n  /**\n   * @description Tag identifier for the modal.\n   * @summary Provides a unique tag for identifying the modal instance.\n   * @type {string | undefined}\n   */\n  @Input()\n  tag?: string;\n\n  /**\n   * @description Options for configuring the modal.\n   * @summary Allows customization of modal behavior and appearance through the ModalOptions interface.\n   * @type {ModalOptions | undefined}\n   */\n  @Input()\n  options?: Partial<ModalOptions>;\n\n  /**\n   * @description Global key-value pairs for modal configuration.\n   * @summary Stores global settings that can be accessed within the modal instance.\n   * @type {KeyValue | undefined}\n   */\n  @Input()\n  globals?: KeyValue;\n\n  /**\n   * @description Inline content to be displayed in the modal.\n   * @summary Specifies the HTML or SafeHtml content to be rendered inside the modal.\n   * @type {string | SafeHtml | undefined}\n   */\n  @Input()\n  inlineContent?: string | SafeHtml;\n\n  /**\n   * @description Position of the inline content within the modal.\n   * @summary Determines whether the inline content is displayed at the top or bottom of the modal.\n   * @type {'top' | 'bottom'}\n   * @default 'bottom'\n   */\n  @Input()\n  inlineContentPosition: 'top' | 'bottom' = 'bottom';\n\n  /**\n   * @description Enables fullscreen mode for the modal.\n   * @summary When set to true, the modal occupies the entire screen.\n   * @type {boolean}\n   * @default false\n   */\n  @Input()\n  fullscreen: boolean = false;\n\n  /**\n   * @description Enables expandable mode for the modal.\n   * @summary When set to true, the modal can be expanded.\n   * @type {boolean}\n   * @default false\n   */\n  @Input()\n  expandable: boolean = false;\n\n  /**\n   * @description Controls whether modal content renders with visual borders.\n   * @summary When set to true, border styles are applied according to inherited\n   * component styling rules; when false, border rendering is disabled.\n   * @type {boolean}\n   * @default true\n   */\n  @Input()\n  override borders: boolean = true;\n\n  /**\n   * @description Enables lightbox mode for the modal.\n   * @summary When set to true, the modal is displayed as a lightbox.\n   * @type {boolean}\n   * @default false\n   */\n  @Input()\n  lightBox: boolean = false;\n\n  /**\n   * @description Controls the transparency of the modal header.\n   * @summary When set to true, the modal header is rendered with a transparent background.\n   * @type {boolean}\n   * @default false\n   */\n  @Input()\n  headerTransparent: boolean = false;\n\n  /**\n   * @description Sets the background color of the modal header.\n   * @summary Controls the Ionic color used for the modal header background.\n   * @type {Color}\n   * @default 'transparent'\n   */\n  @Input()\n  headerBackground: Color = 'transparent';\n\n  /**\n   * @description Controls the visibility of the modal header.\n   * @summary When set to true, the modal header is displayed; when false, it is hidden.\n   * @type {boolean}\n   * @default true\n   */\n  @Input()\n  showHeader: boolean = true;\n\n  /**\n   * @description Controls the visibility of the modal close button.\n   * @summary When true, the close (X) button renders in the header; when false, it is omitted.\n   * @type {boolean}\n   * @default true\n   */\n  @Input()\n  showCloseButton: boolean = true;\n\n  /**\n   * @description Event emitted when the modal is about to be dismissed.\n   * @summary Emits an OverlayEventDetail object containing details about the dismiss event.\n   * @type {EventEmitter<OverlayEventDetail>}\n   */\n  @Output()\n  willDismissEvent: EventEmitter<OverlayEventDetail> = new EventEmitter<OverlayEventDetail>();\n\n  /**\n   * @description Sanitizer instance for bypassing security and sanitizing HTML content.\n   * @summary Used to sanitize dynamic HTML content, ensuring it is safe to render in the DOM.\n   * @type {DomSanitizer}\n   */\n  domSanitizer: DomSanitizer = inject(DomSanitizer);\n\n  /**\n   * @description Indicates whether the modal content is expanded.\n   * @summary When set to true, the modal displays in an expanded state; when false, it is collapsed or in its default size.\n   * @type {boolean}\n   */\n  expanded: boolean = false;\n\n  /**\n   * @description Defines the color used for icons within the modal.\n   * @summary Controls the Ionic color of icons rendered in the modal (for example, in the header or action buttons).\n   * @type {Color}\n   */\n  iconColor: Color = 'dark';\n\n  /**\n   * @description Event handlers registered on the modal instance.\n   * @summary Allows consumers to attach custom UI handler functions to the modal lifecycle and actions.\n   * @type {Record<string, UIFunctionLike>}\n   */\n  @Input()\n  override handlers: Record<string, UIFunctionLike> = {};\n\n  /**\n   * @description Creates a new modal component instance.\n   * @summary Initializes the base parent directive with the component name used by the rendering engine.\n   */\n  constructor() {\n    super('ModalComponent');\n  }\n\n  /**\n   * @description Lifecycle hook that initializes the modal component.\n   * @summary Sets up the modal controller and sanitizes inline content if provided.\n   *\n   * @returns {Promise<void>} - A promise that resolves when initialization is complete.\n   */\n  async ngOnInit(): Promise<void> {\n    await super.initialize();\n    this.parseInlineContent();\n  }\n\n  /**\n   * @description Initializes the modal with the provided options.\n   * @summary Merges default options with user-provided options and sets global configuration.\n   *\n   * @param {KeyValue} [options={}] - Additional options for modal initialization.\n   * @returns {Promise<void>} - A promise that resolves when initialization is complete.\n   */\n  async prepare(options: KeyValue = {}): Promise<void> {\n    this.options = Object.assign({}, DefaultModalOptions, this.options, options);\n    this.globals = Object.assign({}, this.globals || {}, { isModalChild: true });\n    let handlers = this.globals?.['handlers'] || this.handlers;\n\n    // binding custom handlers to the model\n    if (Object.keys(handlers).length) {\n      handlers = typeof this.handlers === 'function' ? { confirm: handlers } : handlers;\n      uihandlers(handlers)((this.model as Model).constructor);\n    }\n    if (this.globals?.['props']) {\n      this.globals['props'] = Object.assign({}, this.globals['props'], { isModalChild: true });\n    }\n    if (!this.model && this.globals?.['model']) this.model = this.globals?.['model'];\n\n    if (this.expandable && !this.className.includes('dcf-modal-expand'))\n      this.className = `${this.className} dcf-modal-expand`;\n    if (['primary', 'secondary', 'tertiary', 'danger', 'medium', 'dark'].includes(this.headerBackground))\n      this.iconColor = 'light';\n  }\n\n  /**\n   * @description Normalizes and sanitizes inline modal content.\n   * @summary Converts DOM elements to HTML strings when needed and safely trusts the result for rendering.\n   *\n   * @returns {void} - Does not return a value.\n   */\n  parseInlineContent(): void {\n    if (this.inlineContent) {\n      if (this.inlineContent instanceof HTMLElement) {\n        this.inlineContent = this.inlineContent.outerHTML;\n      }\n      this.inlineContent = this.domSanitizer.bypassSecurityTrustHtml(this.inlineContent as string);\n    }\n  }\n\n  /**\n   * @description Creates and presents the modal.\n   * @summary Initializes the modal with the provided properties and displays it.\n   *\n   * @param {KeyValue} [props={}] - Properties to initialize the modal.\n   * @returns {Promise<ModalComponent>} - A promise that resolves with the modal instance.\n   */\n  async create(props: KeyValue = {}): Promise<ModalComponent> {\n    await this.prepare(props);\n    await this.present();\n    const modal = this as ModalComponent;\n    runInInjectionContext(this.injector, () => {\n      effect(async () => {\n        const event = this.popStateSignal();\n        if (event) {\n          await modal.cancel();\n        }\n      });\n    });\n    return modal;\n  }\n\n  /**\n   * @description Presents the modal.\n   * @summary Sets the modal's visibility to true and triggers change detection.\n   *\n   * @returns {Promise<void>} - A promise that resolves when the modal is presented.\n   */\n  async present(): Promise<void> {\n    removeFocusTrap();\n    this.parseInlineContent();\n    this.isOpen = true;\n    this.changeDetectorRef.detectChanges();\n  }\n\n  /**\n   * @description Handles custom events for the modal.\n   * @summary Stops event propagation and triggers confirm or cancel actions based on event data.\n   *\n   * @param {IBaseCustomEvent} event - The custom event to handle.\n   * @returns {Promise<void>} - A promise that resolves when the event is handled.\n   */\n  override async handleEvent(event: CustomEvent & IBaseCustomEvent): Promise<void> {\n    if (event instanceof Event) {\n      event.stopImmediatePropagation();\n    }\n    await (event?.data ? this.confirm(event) : this.cancel());\n  }\n\n  /**\n   * @description Handles the modal dismiss event.\n   * @summary This method is triggered when the modal is about to be dismissed. It emits the `willDismissEvent` with the event details.\n   *\n   * @param {CustomEvent<OverlayEventDetail>} event - The dismiss event containing overlay details.\n   * @returns {Promise<OverlayEventDetail>} - A promise that resolves with the overlay event details.\n   */\n  async handleWillDismiss(event: CustomEvent<OverlayEventDetail>): Promise<OverlayEventDetail> {\n    const { detail } = event;\n    this.willDismissEvent.emit((detail?.data || event) as OverlayEventDetail);\n    return detail;\n  }\n\n  /**\n   * @description Toggles the expanded state of the modal content.\n   * @summary This method switches the modal between expanded and collapsed views and triggers change detection.\n   *\n   * @returns {void} - Does not return a value.\n   */\n  handleExpandToggle(): void {\n    this.expanded = !this.expanded;\n    this.changeDetectorRef.detectChanges();\n  }\n\n  /**\n   * @description Cancels the modal and dismisses it with a cancel action.\n   * @summary This method is used to programmatically close the modal with a cancel action.\n   *\n   * @returns {Promise<void>} - A promise that resolves when the modal is dismissed.\n   */\n  async cancel(): Promise<void> {\n    const modal = this.modal || modalController;\n    await modal.dismiss(undefined, ActionRoles.cancel);\n  }\n\n  /**\n   * @description Confirms the modal and dismisses it with a confirm action.\n   * @summary This method is used to programmatically close the modal with a confirm action, passing optional event data.\n   *\n   * @param {IBaseCustomEvent} event - The custom event containing data to pass during confirmation.\n   * @returns {Promise<void>} - A promise that resolves when the modal is dismissed.\n   */\n  async confirm(event?: IBaseCustomEvent): Promise<void> {\n    const modal = this.modal || modalController;\n    await modal.dismiss(event?.data || undefined, ActionRoles.confirm);\n  }\n}\n\n/**\n * @description Retrieves a modal component instance.\n * @summary Creates and initializes a modal component with the provided properties and options.\n *\n * @param {Partial<ModalComponent>}- Properties to initialize the modal component.\n * @param {Partial<ModalOptions>} [modalProps={}] - Additional modal options.\n * @param {EnvironmentInjector} [injector] - Optional environment injector for dependency injection.\n * @returns {Promise<IonModal>} - A promise that resolves with the modal instance.\n */\nexport async function getNgxModalComponent(\n  props: Partial<ModalComponent> = {},\n  modalProps: Partial<ModalOptions> = {},\n  injector?: EnvironmentInjector\n): Promise<IonModal> {\n  const { globals } = { ...props };\n  if (!globals || !globals?.['operation']) props.globals = { ...(globals || {}), operation: OperationKeys.CREATE };\n  const component = await (\n    NgxRenderingEngine.createComponent(ModalComponent, props, injector || undefined) as ModalComponent\n  ).create(modalProps);\n  return component.modal;\n}\n\n/**\n * @description Retrieves a modal component instance.\n * @summary Creates and initializes a modal component with the provided properties and options.\n *\n * @param {Partial<ModalComponent>} [props={}] - Properties to initialize the modal component.\n * @param {Partial<ModalOptions>} [modalProps={}] - Additional modal options.\n * @param {EnvironmentInjector} [injector] - Optional environment injector for dependency injection.\n * @returns {Promise<IonModal>} - A promise that resolves with the modal instance.\n */\nexport async function getNgxModalCrudComponent<M extends Model>(\n  model: Partial<M>,\n  props: Partial<ModalComponent> = {},\n  formProps: Partial<CrudFormComponent> = {},\n  modalProps: Partial<ModalOptions> = {},\n  injector?: EnvironmentInjector\n): Promise<IonModal> {\n  if (!props || !props?.['operation']) {\n    props.operation = OperationKeys.CREATE;\n  }\n  const { handlers } = props;\n  // if has not custom handlers passed, create a generic confirm handler for crud operations and bind it to the model using uihandlers decorator\n  if (Model.isModel(model) && !handlers) {\n    uihandlers({\n      [ComponentEventNames.Submit]: (event: CrudEvent<M>, data: M, instance: NgxFormDirective) => {\n        instance.listenEvent.emit(event);\n      },\n    })(model.constructor);\n  }\n  const component = await (\n    NgxRenderingEngine.createComponent(\n      ModalComponent,\n      {\n        model,\n        globals: formProps,\n        props: props,\n      },\n      injector || undefined\n    ) as ModalComponent\n  ).create(modalProps);\n  return component.modal;\n}\n\n/**\n * @description Presents a lightbox modal with inline content.\n * @summary Displays a modal in lightbox mode with the specified content and properties.\n *\n * @param {string | SafeHtml} inlineContent - The content to display in the lightbox modal.\n * @param {Partial<ModalComponent>} [props={}] - Properties to initialize the modal component.\n * @param {EnvironmentInjector} [injector] - Optional environment injector for dependency injection.\n * @returns {Promise<void>} - A promise that resolves when the modal is presented.\n */\nexport async function presentNgxLightBoxModal(\n  inlineContent: string | SafeHtml,\n  props: Partial<ModalComponent> = {},\n  injector?: EnvironmentInjector\n): Promise<void> {\n  return (\n    await getNgxModalComponent({ props, ...{ inlineContent, lightBox: true } }, {}, injector || undefined)\n  ).present();\n}\n\n/**\n * @description Presents modal with inline content.\n * @summary Displays a modal with the specified content and properties.\n *\n * @param {string | SafeHtml} inlineContent - The content to display in the modal.\n * @param {Partial<ModalComponent>} [props={}] - Properties to initialize the modal component.\n * @param {EnvironmentInjector} [injector] - Optional environment injector for dependency injection.\n * @returns {Promise<void>} - A promise that resolves when the modal is presented.\n */\nexport async function presentNgxInlineModal(\n  inlineContent: string | SafeHtml,\n  props: Partial<ModalComponent> = {},\n  injector?: EnvironmentInjector\n): Promise<void> {\n  (await getNgxInlineModal(inlineContent, props, injector)).present();\n}\n\n/**\n * @description get modal with inline content instance.\n * @summary Get modal component instance for show inline content\n *\n * @param {string | SafeHtml} inlineContent - The content to display in the lightbox modal.\n * @param {Partial<ModalComponent>} [props={}] - Properties to initialize the modal component.\n * @param {EnvironmentInjector} [injector] - Optional environment injector for dependency injection.\n * @returns {Promise<void>} - A promise that resolves when the modal is presented.\n */\nexport async function getNgxInlineModal(\n  inlineContent: string | SafeHtml,\n  props: Partial<ModalComponent> = {},\n  injector?: EnvironmentInjector\n): Promise<IonModal> {\n  return await getNgxModalComponent(\n    {\n      props,\n      ...{\n        inlineContent: inlineContent ?? '<div></div>',\n        className: `${props?.className ?? ''} dcf-modal`,\n      },\n    },\n    {},\n    injector || undefined\n  );\n}\n\n/**\n * @description Retrieves a modal for selecting options.\n * @summary Creates and initializes a modal component for displaying a list of selectable options.\n *\n * @param {SelectOption[]} options - The list of options to display in the modal.\n * @param {EnvironmentInjector} injector - Optional environment injector for dependency injection.\n * @returns {Promise<IonModal>} - A promise that resolves with the modal instance.\n */\nexport async function getNgxSelectOptionsModal(\n  title: string,\n  options: SelectOption[] | Model | string,\n  globals: Partial<ListComponent> = {},\n  uid?: string,\n  injector?: EnvironmentInjector\n): Promise<IonModal> {\n  if (Array.isArray(options)) {\n    globals.data = options;\n  } else {\n    globals.model = options;\n  }\n  const props = {\n    tag: 'ngx-decaf-list',\n    title,\n    globals: {\n      data: [],\n      showSearchbar: true,\n      // showSearchbar: options?.length > 10,\n      item: { tag: true, emitEvent: true },\n      pk: 'value',\n      mapper: { title: 'text', uid: 'value' },\n      ...globals,\n      empty: { showButton: false },\n      limit: 25,\n      type: ListComponentsTypes.INFINITE,\n      isModalChild: true,\n    } as Partial<ListComponent>,\n    className: `dcf-modal dcf-modal-select-interface ${uid ? `dcf-modal-${uid.toLowerCase()}` : ''}`,\n  };\n  const component = await (\n    NgxRenderingEngine.createComponent(ModalComponent, props, injector || undefined) as ModalComponent\n  ).create(props);\n  const modal = component.modal;\n  await modal.present();\n  const childComponent = component.component?.nativeElement;\n  if (childComponent) {\n    const searchbar = childComponent.querySelector('ion-searchbar input') as HTMLInputElement;\n    if (searchbar) {\n      searchbar.focus();\n    }\n  }\n  return modal;\n}\n","<ion-modal\n  [id]=\"uid\"\n  [class]=\"'dcf-modal-component ' + className\"\n  [isOpen]=\"isOpen\"\n  (willDismiss)=\"handleWillDismiss($event)\"\n  [backdropDismiss]=\"options?.backdropDismiss\"\n  [showBackdrop]=\"options?.showBackdrop\"\n  [animated]=\"options?.animated\"\n  [canDismiss]=\"options?.canDismiss\"\n  [class.dcf-fullscreen-modal]=\"fullscreen\"\n  [class.dcf-no-borders]=\"!borders\"\n  [class.dcf-fullscreen-expanded]=\"expanded\"\n  [class.dcf-lightbox-modal]=\"lightBox\"\n  [class.dcf-modal-no-header]=\"!showHeader\"\n  [class.dcf-header-transparent]=\"headerTransparent\"\n  [class.dcf-no-title]=\"!title?.length\"\n  #component\n>\n  <ng-template>\n    <ion-header>\n      <ion-toolbar [color]=\"headerBackground\">\n        @if (title?.length) {\n          <ion-title [innerHTML]=\"title | translate\"></ion-title>\n        }\n        <ion-buttons slot=\"end\">\n          @if (expandable && !fullscreen) {\n            <ion-button\n              fill=\"clear\"\n              size=\"small\"\n              type=\"button\"\n              class=\"dcf-button-expand\"\n              [attr.aria-label]=\"locale + '.buttons.expand' | translate\"\n              (click)=\"handleExpandToggle()\"\n            >\n              <ngx-decaf-icon\n                [attr.aria-hidden]=\"true\"\n                [color]=\"iconColor\"\n                [name]=\"expanded ? 'ti-maximize-off' : 'ti-maximize'\"\n              />\n            </ion-button>\n          }\n          @if (showCloseButton) {\n            <ion-button\n              size=\"small\"\n              type=\"button\"\n              class=\"dcf-button-close\"\n              [attr.aria-label]=\"locale + '.buttons.close' | translate\"\n              (click)=\"cancel()\"\n            >\n              <ngx-decaf-icon\n                [attr.aria-hidden]=\"true\"\n                [color]=\"iconColor\"\n                name=\"ti-x\"\n              />\n            </ion-button>\n          }\n        </ion-buttons>\n      </ion-toolbar>\n    </ion-header>\n\n    <ion-content>\n      <section\n        class=\"dcf-modal-body\"\n        [class.dcf-has-title]=\"title?.length\"\n      >\n        @if (!tag && !model && !inlineContent) {\n          <div class=\"dcf-loading-container\">\n            <ion-spinner\n              name=\"crescent\"\n              color=\"primary\"\n            ></ion-spinner>\n          </div>\n        } @else {\n          @if (inlineContent && inlineContentPosition === 'top') {\n            <div\n              class=\"dcf-modal-content\"\n              id=\"dcf-modal-content\"\n              [innerHTML]=\"inlineContent\"\n            ></div>\n          }\n          @if (!tag && model) {\n            <ngx-decaf-model-renderer\n              (listenEvent)=\"handleEvent($event)\"\n              [model]=\"model\"\n              [globals]=\"globals\"\n            />\n          } @else if (tag && globals) {\n            <ngx-decaf-component-renderer\n              [tag]=\"tag\"\n              (listenEvent)=\"handleEvent($event)\"\n              [model]=\"model\"\n              [globals]=\"{ props: globals }\"\n            />\n          }\n          @if (inlineContent && inlineContentPosition === 'bottom') {\n            <div\n              class=\"dcf-modal-content\"\n              id=\"dcf-modal-content\"\n              [innerHTML]=\"inlineContent\"\n            ></div>\n          }\n        }\n      </section>\n    </ion-content>\n  </ng-template>\n</ion-modal>\n","/**\n * @module module:lib/components/crud-field/crud-field.component\n * @description CRUD field component module.\n * @summary Exposes `CrudFieldComponent`, a dynamic form field used in CRUD forms supporting\n * many input types, validation and integration with `NgxFormFieldDirective` utilities.\n *\n * @link {@link CrudFieldComponent}\n */\n\nimport { AfterViewInit, Component, ElementRef, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';\nimport { FormArray, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';\nimport { CrudOperations, OperationKeys } from '@decaf-ts/db-decorators';\nimport { Primitives } from '@decaf-ts/decorator-validation';\nimport { CrudOperationKeys, HTML5InputTypes } from '@decaf-ts/ui-decorators';\nimport {\n  IonBadge,\n  IonCheckbox,\n  IonInput,\n  IonItem,\n  IonLabel,\n  IonRadio,\n  IonRadioGroup,\n  IonSelect,\n  IonSelectOption,\n  IonText,\n  IonTextarea,\n} from '@ionic/angular/standalone';\nimport { AutocompleteTypes, CheckboxCustomEvent, LoadingOptions, SelectInterface } from '@ionic/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { addIcons } from 'ionicons';\nimport { chevronDownOutline, chevronUpOutline } from 'ionicons/icons';\nimport { take, timer } from 'rxjs';\nimport { DecafTooltipDirective } from '../../directives';\nimport { NgxFormFieldDirective } from '../../engine/NgxFormFieldDirective';\nimport { ActionRoles, SelectFieldInterfaces } from '../../engine/constants';\nimport { Dynamic } from '../../engine/decorators';\nimport { getModelAndRepository } from '../../engine/helpers';\nimport {\n  CheckboxOption,\n  CrudFieldOption,\n  FieldUpdateMode,\n  FormParent,\n  FunctionLike,\n  KeyValue,\n  PossibleInputTypes,\n  SelectOption,\n} from '../../engine/types';\nimport { getLocaleContextByKey } from '../../i18n/Loader';\nimport { dataMapper, generateRandomValue, stripHTML } from '../../utils';\nimport { IconComponent } from '../icon/icon.component';\nimport { getNgxSelectOptionsModal } from '../modal/modal.component';\n\n/**\n * @description A dynamic form field component for CRUD operations.\n * @summary The CrudFieldComponent is a versatile form field component that adapts to different\n * input types and CRUD operations. It extends NgxFormFieldDirective to inherit form handling capabilities\n * and implements lifecycle hooks to properly initialize, render, and clean up. This component\n * supports various input types (text, number, date, select, etc.), validation rules, and styling\n * options, making it suitable for building dynamic forms for create, read, update, and delete\n * operations.\n *\n * @param {CrudOperations} operation - The CRUD operation being performed (create, read, update, delete)\n * @param {string} name - The field name, used as form control identifier\n * @param {PossibleInputTypes} type - The input type (text, number, date, select, etc.)\n * @param {string|number|Date} value - The initial value of the field\n * @param {boolean} disabled - Whether the field is disabled\n * @param {string} label - The display label for the field\n * @param {string} placeholder - Placeholder text when field is empty\n * @param {string} format - Format pattern for the field value\n * @param {boolean} hidden - Whether the field should be hidden\n * @param {number|Date} max - Maximum allowed value\n * @param {number} maxlength - Maximum allowed length\n * @param {number|Date} min - Minimum allowed value\n * @param {number} minlength - Minimum allowed length\n * @param {string} pattern - Validation pattern\n * @param {boolean} readonly - Whether the field is read-only\n * @param {boolean} required - Whether the field is required\n * @param {number} step - Step value for number inputs\n * @param {FormGroup} formGroup - The parent form group\n * @param {StringOrBoolean} translatable - Whether field labels should be translated\n *\n * @component CrudFieldComponent\n * @example\n * <ngx-decaf-crud-field\n *   operation=\"create\"\n *   name=\"firstName\"\n *   type=\"text\"\n *   label=\"<NAME>\"\n *   placeholder=\"<NAME>\"\n *   [value]=\"model.firstName\"\n *   [disabled]=\"model.readOnly\">\n *\n *\n * @memberOf module:for-angular\n */\n@Dynamic()\n@Component({\n  standalone: true,\n  imports: [\n    ReactiveFormsModule,\n    TranslatePipe,\n    IonInput,\n    IonItem,\n    IonCheckbox,\n    IonRadioGroup,\n    IonRadio,\n    IonSelect,\n    IonSelectOption,\n    IonLabel,\n    IonBadge,\n    IonText,\n    IonTextarea,\n    IconComponent,\n    DecafTooltipDirective,\n  ],\n  selector: 'ngx-decaf-crud-field',\n  templateUrl: './crud-field.component.html',\n  styleUrl: './crud-field.component.scss',\n  // schemas: [CUSTOM_ELEMENTS_SCHEMA],\n  host: { '[attr.id]': 'uid', '[attr.class]': 'className' },\n})\nexport class CrudFieldComponent extends NgxFormFieldDirective implements OnInit, OnDestroy, AfterViewInit {\n  /**\n   * @description The CRUD operation being performed.\n   * @summary Specifies which CRUD operation (Create, Read, Update, Delete) the field is being used for.\n   * This affects how the field behaves and is rendered. For example, fields might be read-only in\n   * 'read' mode but editable in 'create' or 'update' modes.\n   *\n   * @type {CrudOperations}\n   * @memberOf CrudFieldComponent\n   */\n  @Input({ required: true })\n  override operation!: CrudOperations;\n\n  /**\n   * @summary  The flat field name used as the form control identifier in immediate parent FormGroup.\n   * @description\n   * Specifies the name of the field, which is used as the FormControl identifier in immediate parent FormGroup.\n   * This value must be unique within the immediate parent FormGroup context and should not contain dots or nesting.\n   *\n   * @type {string}\n   * @memberOf CrudFieldComponent\n   */\n  @Input({ required: true })\n  override name!: string;\n\n  @Input()\n  override className: string = 'dcf-width-1-1';\n\n  /**\n   * @summary The full field path used for form control resolution.\n   * @description Specifies the hierarchical path of the field, used to resolve its location within the parent FormGroup (or nested FormGroups).\n   * It is used as the identifier in the rendered HTML, and may include nesting (e.g., 'address.billing.street') and\n   * should match the structure of the data model\n   *\n   * @type {string}\n   * @memberOf CrudFieldComponent\n   */\n  @Input({ required: true })\n  override path!: string;\n\n  /**\n   * @description The parent field path, if this field is nested.\n   * @summary Specifies the full dot-delimited path of the parent field. This is only set when the field is nested.\n   *\n   * @type {string}\n   * @memberOf CrudFieldComponent\n   */\n  /**\n   * @description The parent field path for nested field structures.\n   * @summary Specifies the full dot-delimited path of the parent field when this field\n   * is part of a nested structure. This is used for hierarchical form organization\n   * and proper form control resolution in complex form structures.\n   *\n   * @type {string}\n   * @default ''\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override childOf: string = '';\n\n  /**\n   * @description The input type of the field.\n   * @summary Defines the type of input to render, such as text, number, date, select, etc.\n   * This determines which Ionic form component will be used to render the field and how\n   * the data will be formatted and validated.\n   *\n   * @type {PossibleInputTypes}\n   * @memberOf CrudFieldComponent\n   */\n  @Input({ required: true })\n  override type!: PossibleInputTypes;\n\n  /**\n   * @description Secondary input type used to refine component behavior for specific field variants.\n   * @summary Provides an optional subtype hint when the primary `type` needs additional context\n   * for rendering or handling values.\n   *\n   * @type {PossibleInputTypes}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  subType!: PossibleInputTypes;\n\n  /**\n   * @description Validation message(s) displayed when the field is invalid.\n   * @summary Supports a single message or multiple messages for complex validation scenarios.\n   *\n   * @type {string | string[]}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  validationMessage?: string | string[];\n\n  /**\n   * @description Maximum character count before text content is truncated. `-1` disables truncation.\n   * @type {number}\n   * @default -1\n   */\n  @Input()\n  maxContentLength: number = -1;\n\n  /**\n   * @description The initial value of the field.\n   * @summary Sets the initial value of the form field. This can be a string, number, or Date\n   * depending on the field type. For select fields, this should match one of the option values.\n   *\n   * @type {string | number | Date}\n   * @default ''\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override value: string | number | Date | string[] = '';\n\n  /**\n   * @description Whether the field is disabled.\n   * @summary When true, the field will be rendered in a disabled state, preventing user interaction.\n   * Disabled fields are still included in the form model but cannot be edited by the user.\n   *\n   * @type {boolean}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override disabled?: boolean;\n\n  /**\n   * @description The display label for the field.\n   * @summary The text label displayed alongside the field to identify it to the user.\n   * This label can be translated if the translatable property is set to true.\n   *\n   * @type {string}\n   * @memberOf CrudFieldComponent\n   */\n  @Input({ required: true })\n  override label!: string;\n\n  /**\n   * @description Placeholder text when field is empty.\n   * @summary Text that appears in the input when it has no value. This provides a hint to the user\n   * about what kind of data is expected. The placeholder disappears when the user starts typing.\n   *\n   * @type {string}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  placeholder!: string;\n\n  /**\n   * @description Format pattern for the field value.\n   * @summary Specifies a format pattern for the field value, which can be used for date formatting,\n   * number formatting, or other type-specific formatting requirements.\n   *\n   * @type {string}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override format?: string;\n\n  /**\n   * @description Whether the field should be hidden.\n   * @summary When true, the field will not be visible in the UI but will still be part of the form model.\n   * This is useful for fields that need to be included in form submission but should not be displayed to the user.\n   *\n   * @type {boolean}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override hidden: boolean | CrudOperationKeys[] = false;\n\n  /**\n   * @description Maximum allowed value for the field.\n   * @summary For number inputs, this sets the maximum allowed numeric value.\n   * For date inputs, this sets the latest allowed date.\n   *\n   * @type {number | Date}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override max?: number | Date;\n\n  /**\n   * @description Maximum allowed length for text input.\n   * @summary For text inputs, this sets the maximum number of characters allowed.\n   * This is used for validation and may also be used to limit input in the UI.\n   *\n   * @type {number}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override maxlength?: number;\n\n  /**\n   * @description Minimum allowed value for the field.\n   * @summary For number inputs, this sets the minimum allowed numeric value.\n   * For date inputs, this sets the earliest allowed date.\n   *\n   * @type {number | Date}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override min?: number | Date;\n\n  /**\n   * @description Minimum allowed length for text input.\n   * @summary For text inputs, this sets the minimum number of characters required.\n   * This is used for validation to ensure the input meets a minimum length requirement.\n   *\n   * @type {number}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override minlength?: number;\n\n  /**\n   * @description Validation pattern for text input.\n   * @summary A regular expression pattern used to validate text input.\n   * The input value must match this pattern to be considered valid.\n   *\n   * @type {string}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override pattern?: string;\n\n  /**\n   * @description Whether the field is read-only.\n   * @summary When true, the field will be rendered in a read-only state. Unlike disabled fields,\n   * read-only fields are still focusable but cannot be modified by the user.\n   *\n   * @type {boolean}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override readonly: boolean = false;\n\n  /**\n   * @description Whether the field is required.\n   * @summary When true, the field must have a value for the form to be valid.\n   * Required fields are typically marked with an indicator in the UI.\n   *\n   * @type {boolean}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override required?: boolean;\n\n  /**\n   * @description Step value for number inputs.\n   * @summary For number inputs, this sets the increment/decrement step when using\n   * the up/down arrows or when using a range slider.\n   *\n   * @type {number}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override step?: number;\n\n  /**\n   * @description Field name for equality validation comparison.\n   * @summary Specifies another field name that this field's value must be equal to for validation.\n   * This is commonly used for password confirmation fields or other scenarios where\n   * two fields must contain the same value.\n   *\n   * @type {string | undefined}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override equals?: string;\n\n  /**\n   * @description Field name for inequality validation comparison.\n   * @summary Specifies another field name that this field's value must be different from for validation.\n   * This is used to ensure that two fields do not contain the same value, which might be\n   * required for certain business rules or security constraints.\n   *\n   * @type {string | undefined}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override different?: string;\n\n  /**\n   * @description Field name for less-than validation comparison.\n   * @summary Specifies another field name that this field's value must be less than for validation.\n   * This is commonly used for date ranges, numeric ranges, or other scenarios where\n   * one field must have a smaller value than another.\n   *\n   * @type {string | undefined}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override lessThan?: string;\n\n  /**\n   * @description Field name for less-than-or-equal validation comparison.\n   * @summary Specifies another field name that this field's value must be less than or equal to\n   * for validation. This provides inclusive upper bound validation for numeric or date comparisons.\n   *\n   * @type {string | undefined}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override lessThanOrEqual?: string;\n\n  /**\n   * @description Field name for greater-than validation comparison.\n   * @summary Specifies another field name that this field's value must be greater than for validation.\n   * This is commonly used for date ranges, numeric ranges, or other scenarios where\n   * one field must have a larger value than another.\n   *\n   * @type {string | undefined}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override greaterThan?: string;\n\n  /**\n   * @description Field name for greater-than-or-equal validation comparison.\n   * @summary Specifies another field name that this field's value must be greater than or equal to\n   * for validation. This provides inclusive lower bound validation for numeric or date comparisons.\n   *\n   * @type {string | undefined}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override greaterThanOrEqual?: string;\n\n  /**\n   * @description Alignment of the field content.\n   * @summary Controls the horizontal alignment of the field content.\n   * This affects how the content is positioned within the field container.\n   *\n   * @type {'start' | 'center'}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  alignment?: 'start' | 'center';\n\n  /**\n   * @description Initial checked state for checkbox or toggle inputs.\n   * @summary For checkbox or toggle inputs, this sets the initial checked state.\n   * When true, the checkbox or toggle will be initially checked.\n   *\n   * @type {boolean}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override checked: boolean = false;\n\n  /**\n   * @description Justification of items within the field.\n   * @summary Controls how items are justified within the field container.\n   * This is particularly useful for fields with multiple elements, such as radio groups.\n   *\n   * @type {'start' | 'end' | 'space-between'}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  justify?: 'start' | 'end' | 'space-between';\n\n  /**\n   * @description Text for the cancel button in select inputs.\n   * @summary For select inputs with a cancel button, this sets the text displayed on the cancel button.\n   * This is typically used in select dialogs to provide a way for users to dismiss the selection without making a change.\n   *\n   * @type {string}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  cancelText?: string;\n\n  /**\n   * @description Interface style for select inputs.\n   * @summary Specifies the interface style for select inputs, such as 'alert', 'action-sheet', or 'popover'.\n   * This determines how the select options are presented to the user.\n   *\n   * @type {SelectInterface}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  interface: SelectInterface = SelectFieldInterfaces.POPOVER;\n\n  /**\n   * @description Options for select or radio inputs.\n   * @summary Provides the list of options for select or radio inputs. Each option can have a value and a label.\n   * This is used to populate the dropdown or radio group with choices.\n   *\n   * @type {CrudFieldOption[]}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  options!: FunctionLike | CrudFieldOption[] | KeyValue[];\n\n  /**\n   * @description Mode of the field.\n   * @summary Specifies the visual mode of the field, such as 'ios' or 'md'.\n   * This affects the styling and appearance of the field to match the platform style.\n   *\n   * @type {'ios' | 'md'}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  mode?: 'ios' | 'md';\n\n  /**\n   * @description Spellcheck attribute for text inputs.\n   * @summary Enables or disables spellchecking for text inputs.\n   * When true, the browser will check the spelling of the input text.\n   *\n   * @type {boolean}\n   * @default false\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  spellcheck: boolean = false;\n\n  /**\n   * @description Spellcheck attribute for text inputs.\n   * @summary Enables or disables spellchecking for text inputs.\n   * When true, the browser will check the spelling of the input text.\n   *\n   * @type {boolean}\n   * @default true\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  startEmpty: boolean = true;\n\n  /**\n   * @description Input mode for text inputs.\n   * @summary Hints at the type of data that might be entered by the user while editing the element.\n   * This can affect the virtual keyboard layout on mobile devices.\n   *\n   * @type {'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'}\n   * @default 'none'\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  inputmode: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search' = 'text';\n\n  /**\n   * @description Autocomplete behavior for the field.\n   * @summary Specifies whether and how the browser should automatically complete the input.\n   * This can improve user experience by suggesting previously entered values.\n   *\n   * @type {AutocompleteTypes}\n   * @default 'off'\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  autocomplete: AutocompleteTypes = 'off';\n\n  /**\n   * @description Fill style for the field.\n   * @summary Determines the fill style of the field, such as 'outline' or 'solid'.\n   * This affects the border and background of the field.\n   *\n   * @default 'outline'\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  fill: 'outline' | 'solid' = 'outline';\n\n  /**\n   * @description Placement of the label relative to the field.\n   * @summary Specifies where the label should be placed relative to the field.\n   * Options include 'start', 'end', 'floating', 'stacked', and 'fixed'.\n   *\n   * @type {'start' | 'end' | 'floating' | 'stacked' | 'fixed'}\n   * @default 'floating'\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  labelPlacement: 'start' | 'end' | 'floating' | 'stacked' | 'fixed' = 'floating';\n\n  /**\n   * @description Update mode for the field.\n   * @summary Determines when the field value should be updated in the form model.\n   * Options include 'change', 'blur', and 'submit'.\n   *\n   * @type {FieldUpdateMode}\n   * @default 'change'\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  updateOn: FieldUpdateMode = 'change';\n\n  /**\n   * @description Reference to the field component.\n   * @summary Provides a reference to the field component element, allowing direct access to its properties and methods.\n   *\n   * @type {ElementRef}\n   * @memberOf CrudFieldComponent\n   */\n  @ViewChild('component', { read: ElementRef })\n  override component!: ElementRef;\n\n  /**\n   * @description Parent form group.\n   * @summary References the parent form group to which this field belongs.\n   * This is necessary for integrating the field with Angular's reactive forms.\n   *\n   * @type {FormGroup}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override formGroup: FormGroup | undefined;\n\n  /**\n   * @description Angular FormControl instance for this field.\n   * @summary The specific FormControl instance that manages this field's state, validation,\n   * and value. This provides direct access to Angular's reactive forms functionality\n   * for this individual field within the broader form structure.\n   *\n   * @type {FormControl}\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override formControl!: FormControl;\n\n  /**\n   * @description Indicates if this field supports multiple values.\n   * @summary When true, this field can handle multiple values, typically used in\n   * multi-select scenarios or when the field is part of a form array structure\n   * that allows multiple entries of the same field type.\n   *\n   * @type {boolean}\n   * @default false\n   * @memberOf CrudFieldComponent\n   */\n  @Input()\n  override multiple: boolean = false;\n\n  /**\n   * @description Unique identifier for the current record.\n   * @summary A unique identifier for the current record being displayed or manipulated.\n   * This is typically used in conjunction with the primary key for operations on specific records.\n   *\n   * @type {string | number}\n   */\n  @Input()\n  override uid: string = generateRandomValue(12);\n\n  @Input()\n  override page!: number;\n\n  constructor() {\n    super();\n    addIcons({ chevronDownOutline, chevronUpOutline });\n  }\n\n  /**\n   * @description Component initialization lifecycle method.\n   * @summary Initializes the field component based on the operation type and field configuration.\n   * For READ and DELETE operations, removes the form group to make fields read-only.\n   * For other operations, sets up icons, configures multi-value support if needed,\n   * and sets default values for radio buttons if no value is provided.\n   *\n   * @returns {void}\n   * @memberOf CrudFieldComponent\n   */\n  async ngOnInit(): Promise<void> {\n    if (Array.isArray(this.hidden) && !(this.hidden as string[]).includes(this.operation)) this.hidden = false;\n\n    if (this.readonly && typeof this.readonly === Function.name.toLocaleLowerCase())\n      if (this.hidden && (this.hidden as OperationKeys[]).includes(this.operation)) this.hidden = true;\n\n    if ([OperationKeys.READ, OperationKeys.DELETE].includes(this.operation)) {\n      this.formGroup = undefined;\n      this.value = `${this.value ?? ''}`;\n    } else {\n      this.options = await this.getOptions();\n      if (!this.formControl && this.formGroup instanceof FormGroup) {\n        this.formControl = this.formGroup.get(this.name) as FormControl;\n      }\n      if ((!this.parentForm && this.formGroup instanceof FormGroup) || this.formGroup instanceof FormArray)\n        this.parentForm = (this.formGroup.root || this.formControl?.root) as FormParent;\n      if (this.multiple) {\n        this.formGroup = this.activeFormGroup as FormGroup;\n        if (!this.parentForm) this.parentForm = this.formGroup.parent as FormArray;\n        this.formControl = (this.formGroup as FormGroup).get(this.name) as FormControl;\n      }\n      if (HTML5InputTypes.SELECT === this.type && !this.value) {\n        if (this.options?.length) {\n          const selected = this.options.find((o) => o['selected']);\n          this.parseSelectLabel();\n          // if (this.interface === SelectFieldInterfaces.MODAL) {\n          //   if (selected && selected?.value.length) {\n          //     this.setValue(selected.value);\n          //   }\n          // } else {\n          //   this.setValue(selected ? selected.value : (this.options as CrudFieldOption[])[0].value);\n          //   this.changeDetectorRef.detectChanges();\n          // }\n          this.setValue(selected ? selected.value : (this.options as CrudFieldOption[])[0].value);\n        }\n      }\n      if (this.type === HTML5InputTypes.CHECKBOX) {\n        if (this.labelPlacement === 'floating') {\n          this.labelPlacement = 'end';\n        }\n        this.setValue(this.value);\n      }\n    }\n    await super.initialize();\n  }\n\n  /**\n   * @description Component after view initialization lifecycle method.\n   * @summary Calls the parent afterViewInit method for READ and DELETE operations.\n   * This ensures proper initialization of read-only fields that don't require\n   * form functionality but still need view setup.\n   *\n   * @returns {Promise<void>}\n   * @memberOf CrudFieldComponent\n   */\n  async ngAfterViewInit(): Promise<void> {\n    if (this.type === HTML5InputTypes.RADIO && this.formGroup && !this.value) {\n      if (typeof this.options === 'function') {\n        this.options = await (this.options as FunctionLike)();\n      }\n      const options = this.options as CheckboxOption[];\n      let checked = options.find((o) => o.checked);\n      if (!checked) {\n        checked = options.find((o) => o.value !== undefined);\n      }\n      if (checked) {\n        this.setValue(checked.value);\n        this.changeDetectorRef.detectChanges();\n      }\n      this.setValue(this.value);\n    }\n  }\n\n  /**\n   * Returns a list of options for select or radio inputs, with their `text` property\n   * localized if it does not already include the word 'options'. The localization key\n   * is generated from the component's label, replacing 'label' with 'options'.\n   *\n   * @returns {CrudFieldOption[]} The array of parsed and localized options.\n   * @memberOf CrudFieldComponent\n   */\n  async getOptions(): Promise<CrudFieldOption[]> {\n    if (!this.options) return [];\n\n    if (this.options instanceof Function) {\n      if (this.options.name === 'options') this.options = (await this.options()) as FunctionLike;\n      const fnName = (this.options as FunctionLike)?.name;\n      if (fnName) {\n        if (fnName === 'function') {\n          this.options = (await (this.options as FunctionLike)()) as KeyValue[];\n        } else {\n          const repo = getModelAndRepository((this.options as KeyValue)?.['name'], this);\n          if (repo) {\n            const { repository } = repo;\n            if (typeof this.optionsMapper === 'object' && !Object.keys(this.optionsMapper).length)\n              this.optionsMapper = { value: this.pk, text: this.pk };\n            this.options = await repository.select().execute();\n          }\n        }\n      }\n    }\n\n    const container = this.component?.nativeElement?.closest('.dcf-grid-col');\n\n    if (typeof this.options === Primitives.STRING) {\n      if (container) {\n        container.classList.add('dcf-hidden');\n      }\n      return [];\n    }\n\n    if (container) {\n      container.classList.remove('dcf-hidden');\n    }\n\n    if (this.optionsMapper) {\n      if (this.optionsMapper instanceof Function || typeof this.optionsMapper === 'function') {\n        const mapper = this.optionsMapper as (option: KeyValue) => CrudFieldOption;\n        this.options = (this.options as (CrudFieldOption | KeyValue)[]).map((option: KeyValue) => {\n          return mapper(option);\n        });\n      } else if (Object.keys(this.optionsMapper).length > 0) {\n        this.options = dataMapper(this.options as KeyValue[], this.optionsMapper as Record<string, string>);\n      }\n    }\n    if (this.options.length > 10 && this.interface === SelectFieldInterfaces.POPOVER)\n      this.interface = SelectFieldInterfaces.MODAL;\n    if (this.options.length <= 1) {\n      this.interface = SelectFieldInterfaces.POPOVER;\n    }\n    const translateOptions = (this.options as SelectOption[]).map(async (option) => {\n      const text = !this.translatable\n        ? option.text\n        : await this.translate(\n            !option.text?.includes('options')\n              ? getLocaleContextByKey(`${this.label.toLowerCase().replace('label', 'options')}`, option.text)\n              : option.text\n          );\n      return {\n        value: option.value,\n        text: this.interface === SelectFieldInterfaces.MODAL ? text : stripHTML(text as string),\n        selected: option?.selected ?? false,\n        hidden: option?.hidden ?? false,\n        disabled: option?.disabled ?? false,\n      };\n    });\n\n    this.options = await Promise.all(translateOptions);\n    if (this.type !== HTML5InputTypes.SELECT) return this.options as CrudFieldOption[];\n\n    if (this.options.length === 0 && !this.required) this.value = '';\n    const options = (\n      !this.required || (this.options?.length > 1 && this.startEmpty)\n        ? [{ value: '', text: '', selected: true, disabled: this.required }, ...this.options]\n        : this.options\n    ) as CrudFieldOption[];\n    this.options = [...options];\n    return this.options as CrudFieldOption[];\n  }\n\n  /**\n   * Handles the opening of select options based on the specified interface type.\n   * If the `selectInterface` is 'modal', it prevents the default event behavior,\n   * stops propagation, and opens a modal to display the select options.\n   * Once the modal is dismissed, it sets the selected value if the action role\n   * is confirmed and the selected value differs from the current value.\n   *\n   * @param {Event} event - The event triggered by the user interaction.\n   * @param {SelectInterface} selectInterface - The interface type for displaying select options.\n   * Currently supports 'modal'.\n   * @returns {Promise<void>} A promise that resolves when the operation is complete.\n   */\n  async openSelectOptions(event: Event, selectInterface: SelectInterface): Promise<void> {\n    if (selectInterface === SelectFieldInterfaces.MODAL) {\n      this.updateOn = 'blur';\n      event.preventDefault();\n      event.stopImmediatePropagation();\n      const loading = await this.loadingController.create({} as LoadingOptions);\n      await loading.present();\n      timer(100)\n        .pipe(take(1))\n        .subscribe(async () => {\n          const modal = await getNgxSelectOptionsModal(this.label, this.options as SelectOption[], {}, this.name);\n          // this.changeDetectorRef.detectChanges();\n          await loading.dismiss();\n          const { data, role } = await modal.onWillDismiss();\n          if (role === ActionRoles.confirm && data !== this.value) {\n            this.setValue(data);\n            this.component.nativeElement.ionChange.emit({ value: data });\n          }\n        });\n    }\n  }\n\n  /**\n   * @description Component cleanup lifecycle method.\n   * @summary Performs cleanup operations for READ and DELETE operations by calling\n   * the parent onDestroy method. This ensures proper resource cleanup for\n   * read-only field components.\n   *\n   * @returns {void}\n   * @memberOf CrudFieldComponent\n   */\n  override async ngOnDestroy(): Promise<void> {\n    await super.ngOnDestroy();\n    if ([OperationKeys.READ, OperationKeys.DELETE].includes(this.operation)) this.onDestroy();\n  }\n\n  toggleOptionSelection(val: string, event: CheckboxCustomEvent) {\n    const { checked } = event.detail;\n    let value = Array.isArray(this.formControl.value) ? this.formControl.value : [];\n    if (checked) {\n      if (!value.includes(val)) value = [...value, val];\n    } else {\n      value = value.filter((v) => v !== val);\n    }\n    this.setValue(value);\n    this.formControl.updateValueAndValidity();\n  }\n\n  isOptionChecked(value: string): boolean {\n    if (!this.formControl.value || !Array.isArray(this.formControl.value)) {\n      return false;\n    }\n    return this.formControl.value.includes(value);\n  }\n\n  // /**\n  //  * @description Handles fieldset group update events from parent fieldsets.\n  //  * @summary Processes events triggered when an existing group needs to be updated.\n  //  * Updates the active form group index and refreshes the form group and form control\n  //  * references to point to the group being edited.\n  //  *\n  //  * @param {CustomEvent} event - The fieldset update group event containing update details\n  //  * @returns {void}\n  //  * @memberOf CrudFieldComponent\n  //  */\n  // @HostListener('window:fieldsetUpdateGroupEvent', ['$event'])\n  // handleFieldsetUpdateGroupEvent(event: CustomEvent): void {\n  //   const {formGroup, index} = event.detail;\n  //   this.activeFormGroupIndex = index;\n  //   this.formGroup = formGroup;\n  //   this.formControl = (this.formGroup as FormGroup).get(this.name) as FormControl;\n  //   this.value = this.formControl.value;\n  // }\n}\n","@if (\n  operation === OperationKeys.READ ||\n  operation === OperationKeys.DELETE ||\n  readonly\n) {\n  @if (!hidden) {\n    <ng-container>\n      <div>\n        <ion-item\n          [class.dcf-item-readonly]=\"\n            readonly && operation !== OperationKeys.READ\n          \"\n          [class]=\"'dcf-input-item ' + operation\"\n          #component\n        >\n          <ion-label [id]=\"name\">\n            @if (refreshing) {\n              <br />\n              <ion-skeleton-text [animated]=\"true\" />\n            } @else {\n              {{ label | translate }}\n              <br />\n              @if (type !== 'checkbox') {\n                <ion-text\n                  [class.dcf-empty]=\"!value?.length\"\n                  [ngx-decaf-tooltip]=\"\n                    maxContentLength > 0 && value?.length\n                      ? {\n                          text: value,\n                          truncate: true,\n                          limit: maxContentLength,\n                          position: 'over',\n                        }\n                      : {}\n                  \"\n                  [innerHTML]=\"\n                    type === 'password'\n                      ? '********'\n                      : value?.length\n                        ? value\n                        : '-'\n                  \"\n                />\n              } @else {\n                <ion-badge\n                  mode=\"md\"\n                  color=\"light\"\n                >\n                  <ion-text\n                    [color]=\"!value ? 'danger' : 'primary'\"\n                    [innerHTML]=\"value\"\n                  />\n                </ion-badge>\n              }\n            }\n          </ion-label>\n        </ion-item>\n      </div>\n    </ng-container>\n  }\n} @else {\n  @if (formControl) {\n    <ng-container [formGroup]=\"multiple ? activeFormGroup : formControl.parent\">\n      <div\n        [id]=\"uid\"\n        #container\n        [class]=\"'dcf-input-item ' + (operation || 'create')\"\n        [class.dcf-field-required]=\"required\"\n        [class.dcf-field-readonly]=\"readonly\"\n      >\n        @if (type === HTML5InputTypes.TEXTAREA) {\n          <ion-textarea\n            (ionInput)=\"handleModalChildChanges($event, formControl)\"\n            (ionChange)=\"handleModalChildChanges($event, formControl)\"\n            [id]=\"name\"\n            [mode]=\"'md'\"\n            [hidden]=\"hidden\"\n            [autoGrow]=\"true\"\n            [minlength]=\"minlength !== undefined ? minlength : null\"\n            [maxlength]=\"maxlength !== undefined ? maxlength : null\"\n            [attr.readonly]=\"readonly !== undefined ? readonly : null\"\n            [inputmode]=\"inputmode\"\n            [spellcheck]=\"spellcheck\"\n            [rows]=\"rows\"\n            [labelPlacement]=\"labelPlacement\"\n            [value]=\"value\"\n            [fill]=\"fill\"\n            [errorText]=\"getErrors(container)\"\n            [placeholder]=\"placeholder | translate\"\n            [formControlName]=\"name\"\n            [label]=\"label | translate\"\n            #component\n          ></ion-textarea>\n        } @else if (type === HTML5InputTypes.CHECKBOX) {\n          @if (!options?.length) {\n            <ion-item\n              class=\"dcf-width-1-1\"\n              [hidden]=\"hidden\"\n            >\n              <ion-checkbox\n                (ionInput)=\"handleModalChildChanges($event, formControl)\"\n                (ionChange)=\"handleModalChildChanges($event, formControl)\"\n                [id]=\"name\"\n                [mode]=\"'md'\"\n                [errorText]=\"getErrors(container)\"\n                [hidden]=\"hidden\"\n                [labelPlacement]=\"labelPlacement\"\n                [justify]=\"justify || 'start'\"\n                [value]=\"value\"\n                [checked]=\"checked\"\n                [attr.readonly]=\"readonly\"\n                [formControlName]=\"name\"\n                [attr.aria-label]=\"\n                  translatable ? (option?.text | translate) : option?.text\n                \"\n                #component\n              >\n                <span>{{ label | translate }}</span>\n              </ion-checkbox>\n            </ion-item>\n          } @else {\n            <div class=\"dcf-checkbox-group\">\n              <label\n                class=\"dcf-label\"\n                [for]=\"path\"\n              >\n                {{ label | translate }}\n              </label>\n              @for (option of options; track trackItemFn($index, option.text)) {\n                <ion-item\n                  class=\"dcf-width-1-1\"\n                  [button]=\"true\"\n                >\n                  <ion-checkbox\n                    (ionInput)=\"handleModalChildChanges($event, formControl)\"\n                    (ionChange)=\"handleModalChildChanges($event, formControl)\"\n                    [id]=\"path\"\n                    [mode]=\"'md'\"\n                    [labelPlacement]=\"labelPlacement\"\n                    [justify]=\"justify\"\n                    [value]=\"option.value\"\n                    [attr.readonly]=\"readonly\"\n                    [checked]=\"isOptionChecked(option.value)\"\n                    (ionChange)=\"toggleOptionSelection(option.value, $event)\"\n                    #component\n                  >\n                    <span>\n                      {{ $index + 1 }}.\n                      {{\n                        translatable ? (option?.text | translate) : option?.text\n                      }}\n                    </span>\n                  </ion-checkbox>\n                </ion-item>\n              }\n              @if (getErrors(container)) {\n                <ion-text\n                  class=\"dcf-input-error\"\n                  [innerHTML]=\"errorMessage || getErrors(container)\"\n                />\n              }\n            </div>\n          }\n        } @else if (type === HTML5InputTypes.RADIO && options?.length) {\n          <ion-radio-group\n            class=\"dcf-width-1-1\"\n            [formControlName]=\"name\"\n            [value]=\"value\"\n            #component\n          >\n            <label\n              class=\"dcf-radio-group-label\"\n              [for]=\"path\"\n            >\n              {{ label | translate }}\n            </label>\n            @for (option of options; track $index) {\n              <ion-item>\n                <ion-radio\n                  (ionInput)=\"handleModalChildChanges($event, formControl)\"\n                  (ionChange)=\"handleModalChildChanges($event, formControl)\"\n                  [id]=\"path\"\n                  [mode]=\"'md'\"\n                  [hidden]=\"hidden\"\n                  [labelPlacement]=\"labelPlacement\"\n                  [alignment]=\"alignment\"\n                  [justify]=\"justify\"\n                  [attr.readonly]=\"readonly\"\n                  [value]=\"option.value\"\n                  [attr.aria-label]=\"\n                    translatable ? (option?.text | translate) : option?.text\n                  \"\n                >\n                  {{ translatable ? (option?.text | translate) : option?.text }}\n                </ion-radio>\n              </ion-item>\n            }\n          </ion-radio-group>\n          @if (getErrors(container)) {\n            <ion-text\n              class=\"dcf-input-error\"\n              [innerHTML]=\"errorMessage || getErrors(container)\"\n            />\n          }\n        } @else if (type === HTML5InputTypes.SELECT) {\n          <div>\n            <ion-select\n              (ionInput)=\"handleModalChildChanges($event)\"\n              (ionChange)=\"handleModalChildChanges($event)\"\n              (click)=\"handleModalChildChanges($event, formControl)\"\n              [id]=\"name\"\n              toggleIcon=\"chevron-down-outline\"\n              expandedIcon=\"chevron-up-outline\"\n              [interface]=\"interface\"\n              [mode]=\"'md'\"\n              [hidden]=\"hidden || !options?.length\"\n              [labelPlacement]=\"labelPlacement\"\n              [label]=\"label | translate\"\n              [value]=\"value ?? null\"\n              (click)=\"openSelectOptions($event, interface)\"\n              [fill]=\"fill\"\n              [placeholder]=\"placeholder | translate\"\n              [formControlName]=\"name\"\n              [interface]=\"interface\"\n              #component\n            >\n              @if (options?.length) {\n                @for (\n                  option of options;\n                  track trackItemFn($index, option.text)\n                ) {\n                  @if (interface !== 'modal') {\n                    <ion-select-option\n                      [value]=\"option.value\"\n                      [class.dcf-disabled]=\"option.disabled\"\n                      [class.dcf-hidden]=\"option.hidden\"\n                      [hidden]=\"option.hidden\"\n                    >\n                      {{\n                        !translatable ? option.text : (option.text | translate)\n                      }}\n                    </ion-select-option>\n                  } @else {\n                    @if (\n                      option.value?.toLowerCase() === value?.toLowerCase() ||\n                      option.selected\n                    ) {\n                      <ion-select-option [value]=\"option.value\">\n                        {{ option.text }}\n                      </ion-select-option>\n                    }\n                  }\n                }\n              }\n              @if (\n                (value && !required) ||\n                (!required && value !== undefined && value !== '')\n              ) {\n                <ion-button\n                  fill=\"clear\"\n                  (click)=\"handleClearValue($event)\"\n                  slot=\"end\"\n                  [attr.aria-label]=\"'Clear field'\"\n                >\n                  <ngx-decaf-icon\n                    size=\"small\"\n                    slot=\"icon-only\"\n                    [name]=\"'ti-input-x'\"\n                  />\n                </ion-button>\n              }\n            </ion-select>\n            @if (initialized) {\n              @if (getErrors(container)) {\n                <ion-text\n                  class=\"dcf-input-error\"\n                  [innerHTML]=\"errorMessage || getErrors(container)\"\n                />\n              }\n            }\n          </div>\n        } @else {\n          <ion-input\n            (ionInput)=\"handleModalChildChanges($event, formControl)\"\n            (ionChange)=\"handleModalChildChanges($event, formControl)\"\n            [id]=\"name\"\n            [type]=\"type\"\n            [mode]=\"'md'\"\n            [hidden]=\"hidden\"\n            [inputmode]=\"inputmode ?? undefined\"\n            [labelPlacement]=\"labelPlacement\"\n            [minlength]=\"minlength !== undefined ? minlength : null\"\n            [maxlength]=\"maxlength !== undefined ? maxlength : null\"\n            [max]=\"max !== undefined ? max : null\"\n            [min]=\"min !== undefined ? min : null\"\n            [step]=\"step !== undefined ? step : null\"\n            [fill]=\"fill\"\n            [placeholder]=\"placeholder | translate\"\n            [formControlName]=\"name\"\n            [errorText]=\"getErrors(container)\"\n            [label]=\"label | translate\"\n            #component\n          />\n\n          <!-- <span class=\"dcf-input-error\" [innerHTML]=\"getErrors(container)\"></span> -->\n        }\n      </div>\n    </ng-container>\n  } @else {\n    <div>\n      <p class=\"dcf-input-error\">\n        {{ 'errors.form.control' | translate: { '0': name } }}\n      </p>\n    </div>\n  }\n}\n","import {\n  AfterViewInit,\n  Directive,\n  ElementRef,\n  EventEmitter,\n  Input,\n  OnDestroy,\n  Output,\n  SimpleChanges,\n  ViewChild,\n} from '@angular/core';\nimport { FormArray, FormGroup } from '@angular/forms';\nimport { CrudOperations, OperationKeys } from '@decaf-ts/db-decorators';\nimport { ComponentEventNames, FieldDefinition, UIFunctionLike, UIModelMetadata } from '@decaf-ts/ui-decorators';\nimport { timer } from 'rxjs';\nimport { NgxFormService } from '../services/NgxFormService';\nimport { generateRandomValue } from '../utils';\nimport { ActionRoles } from './constants';\nimport { IBaseCustomEvent, ICrudFormButtons, ICrudFormEvent, IFormElement, IRenderedModel } from './interfaces';\nimport { NgxFormFieldDirective } from './NgxFormFieldDirective';\nimport { NgxParentComponentDirective } from './NgxParentComponentDirective';\nimport { FieldUpdateMode, FormParent, HTMLFormTarget, KeyValue } from './types';\n\n@Directive()\nexport abstract class NgxFormDirective\n  extends NgxParentComponentDirective\n  implements AfterViewInit, IFormElement, OnDestroy, IRenderedModel\n{\n  /**\n   * @description Reactive form group associated with this fieldset.\n   * @summary The FormGroup instance that contains all form controls within this fieldset.\n   * Used for form validation, value management, and integration with Angular's reactive forms.\n   *\n   * @type {FormGroup}\n   */\n  @Input()\n  parentFormId!: string;\n\n  @Input()\n  deepMerge: boolean = false;\n\n  @Input()\n  path: string = '';\n\n  /**\n   * @description Enables multiple item management within the fieldset.\n   * @summary Boolean flag that determines if the fieldset supports adding multiple values.\n   * When true, displays a reorderable list of items with add/remove functionality.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  @Input()\n  multiple: boolean = false;\n\n  /**\n   * @description Reference to the reactive form DOM element.\n   * @summary ViewChild reference that provides direct access to the form's DOM element.\n   * This enables programmatic manipulation of the form element and access to native\n   * HTML form properties and methods when needed.\n   *\n   * @type {ElementRef}\n   */\n  @ViewChild('component', { static: false, read: ElementRef })\n  override component!: ElementRef;\n\n  /**\n   * @description Field update trigger mode for form validation.\n   * @summary Determines when form field validation should be triggered. Options include\n   * 'change', 'blur', or 'submit'. This affects the user experience by controlling\n   * when validation feedback is shown to the user during form interaction.\n   *\n   * @type {FieldUpdateMode}\n   * @default 'change'\n   */\n  @Input()\n  updateOn: FieldUpdateMode = 'change';\n\n  /**\n   * @description Form submission target specification.\n   * @summary Specifies where to display the response after form submission, similar\n   * to the HTML form target attribute. Options include '_self', '_blank', '_parent',\n   * '_top', or a named frame. Controls the browser behavior for form responses.\n   *\n   * @type {HTMLFormTarget}\n   * @default '_self'\n   */\n  @Input()\n  target: HTMLFormTarget = '_self';\n\n  /**\n   * @description HTTP method or submission strategy for the form.\n   * @summary Defines how the form should be submitted. 'get' and 'post' correspond\n   * to standard HTTP methods for traditional form submission, while 'event' uses\n   * Angular event-driven submission for single-page application workflows.\n   *\n   * @type {'get' | 'post' | 'event'}\n   * @default 'event'\n   */\n  @Input()\n  method: 'get' | 'post' | 'event' = 'event';\n\n  /**\n   * @description Configuration options for the CRUD form behavior.\n   * @summary Contains various configuration settings that control form rendering,\n   * validation, and behavior. These options are merged with default settings\n   * during component initialization to customize the form's functionality.\n   *\n   * @type {ICrudFormButtons}\n   */\n  @Input()\n  buttons!: ICrudFormButtons;\n\n  /**\n   * @description Optional action identifier for form submission context.\n   * @summary Specifies a custom action name that will be included in the submit event.\n   * If not provided, defaults to the standard submit event constant. Used to\n   * distinguish between different types of form submissions within the same component.\n   *\n   * @type {string | undefined}\n   */\n  @Input()\n  action?: string;\n\n  /**\n   * @description The current CRUD operation being performed.\n   * @summary Specifies the type of operation this form is handling (CREATE, READ, UPDATE, DELETE).\n   * This is a required input that determines form behavior, validation rules, and available actions.\n   * The operation affects form state, button visibility, and submission logic.\n   *\n   * @type {CrudOperations}\n   * @required\n   */\n  @Input({ required: true })\n  override operation: CrudOperations = OperationKeys.CREATE;\n\n  /**\n   * @description Custom event handlers for form actions.\n   * @summary A record of event handler functions keyed by event names that can be\n   * triggered during form operations. These handlers provide extensibility for\n   * custom business logic and can be invoked for various form events and actions.\n   *\n   * @type {Record<string, UIFunctionLike>}\n   */\n  @Input()\n  override handlers!: Record<string, UIFunctionLike>;\n\n  /**\n   * @description Unique identifier for the form renderer.\n   * @summary A unique string identifier used to register and manage this form\n   * instance within the NgxFormService. This ID is also used as the HTML id\n   * attribute for the form element, enabling DOM queries and form management.\n   *\n   * @type {string}\n   */\n  @Input()\n  rendererId!: string;\n\n  /**\n   * @description Event emitter for form submission events.\n   * @summary Emits ICrudFormEvent objects when the form is submitted, providing\n   * form data, component information, and any associated handlers to parent\n   * components. This enables decoupled handling of form submission logic.\n   *\n   * @type {EventEmitter<ICrudFormEvent>}\n   */\n  @Output()\n  submitEvent: EventEmitter<ICrudFormEvent> = new EventEmitter<ICrudFormEvent>();\n\n  /**\n   * @description Unique identifier for the current record instance.\n   * @summary This property holds a unique string value that identifies the specific record being managed by the form.\n   * It is automatically generated if not provided, ensuring each form instance has a distinct identifier.\n   * The uid is used for tracking, referencing, and emitting events related to the current record, and may be used\n   * in conjunction with the primary key for CRUD operations.\n   *\n   * @type {string}\n   * @default Randomly generated 12-character string\n   */\n  @Input()\n  allowClear: boolean = false;\n\n  @Input()\n  override match: boolean = false;\n\n  @Output()\n  private formGroupLoadedEvent: EventEmitter<IBaseCustomEvent> = new EventEmitter<IBaseCustomEvent>();\n\n  // protected override enableDarkMode: boolean = true;\n\n  //   /**\n  //  * @description Angular change detection service.\n  //  * @summary Injected service that provides manual control over change detection cycles.\n  //  * This is essential for ensuring that programmatic DOM changes (like setting accordion\n  //  * attributes) are properly reflected in the component's state and trigger appropriate\n  //  * view updates when modifications occur outside the normal Angular change detection flow.\n  //  *\n  //  * @protected\n  //  * @type {ChangeDetectorRef}\n  //  * @memberOf CrudFormComponent\n  //  */\n  // protected changeDetectorRef: ChangeDetectorRef = inject(ChangeDetectorRef);\n\n  // /**\n  //  * @description Angular Renderer2 service for safe DOM manipulation.\n  //  * @summary Injected service that provides a safe, platform-agnostic way to manipulate DOM elements.\n  //  * This service ensures proper handling of DOM operations across different platforms and environments,\n  //  * including server-side rendering and web workers.\n  //  *\n  //  * @protected\n  //  * @type {Renderer2}\n  //  * @memberOf CrudFormComponent\n  //  */\n  // protected renderer: Renderer2 = inject(Renderer2);\n\n  // /**\n  //  * @description Translation service for internationalization.\n  //  * @summary Injected service that provides translation capabilities for UI text.\n  //  * Used to translate button labels and validation messages based on the current locale.\n  //  *\n  //  * @protected\n  //  * @type {TranslateService}\n  //  * @memberOf CrudFormComponent\n  //  */\n  // protected translateService: TranslateService = inject(TranslateService);\n\n  protected activeFormGroupIndex: number = 0;\n\n  get activeFormGroup(): FormParent {\n    return this.getFormArrayIndex(this.activeFormGroupIndex) as FormParent;\n  }\n\n  /**\n   * @description Component initialization lifecycle method.\n   * @summary Initializes the component by setting up the logger, configuring form state\n   * based on the operation type, and merging configuration options. For READ and DELETE\n   * operations, the formGroup is set to undefined since these operations don't require\n   * form input. Configuration options are merged with default settings.\n   *\n   * @returns {Promise<void>}\n   */\n\n  override async initialize(): Promise<void> {\n    await super.initialize();\n\n    if (!this.uid) {\n      this.uid = generateRandomValue(12);\n    }\n    // dont call super.ngOnInit to model conflicts\n    if (this.operation === OperationKeys.READ || this.operation === OperationKeys.DELETE) {\n      this.formGroup = undefined;\n    }\n  }\n\n  override async ngOnChanges(changes: SimpleChanges): Promise<void> {\n    await super.ngOnChanges(changes);\n\n    // if (changes[BaseComponentProps.MODEL_ID]) {\n    //   const { previousValue, currentValue } = changes[BaseComponentProps.MODEL_ID];\n    //   if (!previousValue && currentValue) {\n    //     await this.refresh(this.operation);\n    //   }\n    // }\n  }\n\n  async ngAfterViewInit(): Promise<void> {\n    const formElement = this.component?.nativeElement;\n    // if (this.isModalChild && formElement) {\n    //   const ionContent = await formElement.closest('ion-content');\n    //   const formHeigth = interval(50)\n    //     .pipe(\n    //       map(() => Math.ceil(formElement.getBoundingClientRect().height)),\n\n    //       filter((h) => h > 0), // só passa quando tiver altura real\n    //       take(1)\n    //     )\n    //     .subscribe(async (height) => {\n    //       const scrollElement = await ionContent.getScrollElement();\n    //       const extraSpace = 24; // margem para evitar corte no final\n    //       const targetHeight = height + extraSpace * 10000;\n    //       this.renderer.setStyle(scrollElement, 'height', `auto !important`);\n    //       this.renderer.setStyle(ionContent, 'min-height', `${targetHeight}px`);\n    //       this.renderer.setStyle(scrollElement, 'overflow-y', 'auto');\n    //     });\n    // }\n    //TODO: ver se isso é necessário\n    // if (this.formGroup)\n    //   this.formGroupLoadedEvent.emit({\n    //     name: ComponentEventNames.FormGroupLoaded,\n    //     data: this.formGroup as FormParent,\n    //   });\n    this.changeDetectorRef.detectChanges();\n  }\n\n  /**\n   * @description Component cleanup lifecycle method.\n   * @summary Performs cleanup operations when the component is destroyed.\n   * Unregisters the FormGroup from the NgxFormService to prevent memory leaks\n   * and ensure proper resource cleanup.\n   *\n   * @returns {void}\n   */\n  override async ngOnDestroy(): Promise<void> {\n    await super.ngOnDestroy();\n    if (this.formGroup) NgxFormService.unregister(this.formGroup);\n  }\n\n  getFormArrayIndex(index: number): FormParent | undefined {\n    if (!(this.formGroup instanceof FormArray) && this.formGroup) {\n      if (this.formGroup.disabled) (this.formGroup as FormParent).enable();\n      return this.formGroup;\n    }\n\n    const formGroup = (this.formGroup as FormArray).at(index) as FormGroup;\n    if (formGroup.disabled) (formGroup as FormParent).enable();\n    if (formGroup) {\n      if (this.children.length) {\n        const children = [...this.children];\n        this.children = [];\n        this.changeDetectorRef.detectChanges();\n        this.children = [\n          ...children.map((child) => {\n            const props = (child.props || {}) as NgxFormFieldDirective;\n            const name = props.name;\n            const control = formGroup.get(name);\n            child.props.value = control?.value;\n            child.props.formGroup = formGroup;\n            child.props.activeFormGroupIndex = index;\n            child.props.formControl = control;\n            return child;\n          }),\n        ];\n        this.changeDetectorRef.detectChanges();\n      }\n    }\n    return formGroup || undefined;\n  }\n\n  // override async handleEvent(event: IBaseCustomEvent): Promise<void> {\n  //   await super.handleEvent(event);\n  // }\n\n  /**\n   * @description Handles form reset or navigation back functionality.\n   * @summary Provides different reset behavior based on the current operation.\n   * For CREATE and UPDATE operations, resets the form to its initial state.\n   * For READ and DELETE operations, navigates back in the browser history\n   * since these operations don't have modifiable form data to reset.\n   *\n   * @returns {void}\n   */\n  handleReset(): void {\n    if (this.isModalChild) return this.submitEventEmit(null, this.componentName, ActionRoles.cancel);\n    if (![OperationKeys.DELETE, OperationKeys.READ].includes(this.operation) && this.allowClear)\n      return NgxFormService.reset(this.formGroup as FormGroup);\n    this.location.back();\n  }\n\n  override async submit(event?: SubmitEvent, eventName?: string, componentName?: string): Promise<boolean | void> {\n    if (event) {\n      event.preventDefault();\n      event.stopImmediatePropagation();\n    }\n    const formGroup = this.formGroup as FormGroup;\n    const isValid = NgxFormService.validateFields(formGroup);\n\n    function getFormErrors(): KeyValue {\n      const errors = {} as KeyValue;\n      Object.keys(formGroup.controls).forEach((key) => {\n        const control = formGroup.get(key);\n        if (control && control.errors) {\n          errors[key] = control.errors;\n        }\n      });\n      return errors;\n    }\n\n    if (!isValid) {\n      this.log\n        .for(this.submit)\n        .warn(`Form is invalid. Please correct the errors and try again. ${JSON.stringify(getFormErrors())}`);\n      this.changeDetectorRef.detectChanges();\n      NgxFormService.enableAllGroupControls(formGroup);\n      return false;\n    }\n\n    this.changeDetectorRef.detectChanges();\n    const data = NgxFormService.getFormData(formGroup);\n    if (Object.keys(data).length > 0) return this.submitEventEmit(data, eventName, componentName, this.handlers);\n  }\n  protected submitEventEmit(\n    data: unknown,\n    componentName?: string,\n    eventName?: string,\n    handlers?: Record<string, UIFunctionLike>,\n    role?: CrudOperations\n  ): void {\n    const name = eventName || this.action || ComponentEventNames.Submit;\n    const handler = handlers?.[name] || this.handlers?.[name] || undefined;\n    this.submitEvent.emit({\n      data,\n      component: componentName || this.componentName,\n      name: eventName || this.action || ComponentEventNames.Submit,\n      role: role || this.operation,\n      handler: handler,\n      handlers: this.handlers || {},\n      ...(this.operation !== OperationKeys.CREATE ? { modelId: this.modelId } : {}),\n    });\n  }\n\n  /**\n   * @description Updates the active form group and children for the specified page.\n   * @summary Extracts the FormGroup for the given page from the FormArray and filters\n   * the children to show only fields belonging to that page. Uses a timer to ensure\n   * proper Angular change detection when updating the activeContent.\n   *\n   * @param {number} page - The page number to activate\n   * @return {UIModelMetadata | UIModelMetadata[] | FieldDefinition | undefined}\n   *\n   * @private\n   * @mermaid\n   * sequenceDiagram\n   *   participant S as SteppedFormComponent\n   *   participant F as FormArray\n   *   participant T as Timer\n   *\n   *   S->>F: Extract FormGroup at index (page - 1)\n   *   F-->>S: Return page FormGroup\n   *   S->>S: Set activeContent = undefined\n   *   S->>T: timer(10).subscribe()\n   *   T-->>S: Filter children for active page\n   *   S->>S: Set activeContent\n   *\n   * @memberOf SteppedFormComponent\n   */\n  protected override getActivePage(page: number): UIModelMetadata | UIModelMetadata[] | FieldDefinition | undefined {\n    if (!(this.formGroup instanceof FormArray)) this.formGroup = this.formGroup?.parent as FormArray;\n    this.formGroup = (this.formGroup as FormArray).at(page - 1) as FormGroup;\n    this.activePage = undefined;\n    this.timerSubscription = timer(10).subscribe(\n      () => (this.activePage = (this.children as UIModelMetadata[]).filter((c) => c.props?.['page'] === page))\n    );\n    if (this.activePage) return this.activePage;\n    return undefined;\n  }\n}\n","/**\n * @module module:lib/components/layout/layout.component\n * @description Layout component module.\n * @summary Provides `LayoutComponent` which offers a responsive grid layout\n * for arranging child components using configurable rows, columns and breakpoints.\n * Useful for building responsive UIs that render model and component renderers.\n *\n * @link {@link LayoutComponent}\n */\n\nimport { Component, Input, OnInit } from '@angular/core';\nimport { Primitives } from '@decaf-ts/decorator-validation';\nimport { LayoutGridGaps, UIElementMetadata } from '@decaf-ts/ui-decorators';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { IconComponent } from '../../components/icon/icon.component';\nimport { Dynamic } from '../../engine/decorators';\nimport { IBaseCustomEvent, IComponentProperties } from '../../engine/interfaces';\nimport { NgxParentComponentDirective } from '../../engine/NgxParentComponentDirective';\nimport { KeyValue, LayoutGridGap } from '../../engine/types';\nimport { filterString } from '../../utils/helpers';\nimport { CardComponent } from '../card/card.component';\nimport { ComponentRendererComponent } from '../component-renderer/component-renderer.component';\nimport { ModelRendererComponent } from '../model-renderer/model-renderer.component';\n\n/**\n * @description Layout component for creating responsive grid layouts in Angular applications.\n * @summary This component provides a flexible grid system that can be configured with dynamic\n * rows and columns. It supports responsive breakpoints and can render child components within\n * the grid structure. The component extends NgxParentComponentDirective to inherit common functionality\n * and integrates with the model and component renderer systems.\n *\n * @class LayoutComponent\n * @extends {NgxParentComponentDirective}\n * @implements {OnInit}\n * @memberOf LayoutComponent\n */\n@Dynamic()\n@Component({\n  selector: 'ngx-decaf-layout',\n  templateUrl: './layout.component.html',\n  styleUrls: ['./layout.component.scss'],\n  imports: [TranslatePipe, CardComponent, IconComponent, ModelRendererComponent, ComponentRendererComponent],\n  standalone: true,\n})\nexport class LayoutComponent extends NgxParentComponentDirective implements OnInit {\n  /**\n   * @description Media breakpoint for responsive behavior.\n   * @summary Determines the responsive breakpoint at which the layout should adapt.\n   * This affects how the grid behaves on different screen sizes, allowing for\n   * mobile-first or desktop-first responsive design patterns. The breakpoint\n   * is automatically processed to ensure compatibility with the UI framework.\n   *\n   * @type {UIMediaBreakPointsType}\n   * @default 'medium'\n   * @memberOf LayoutComponent\n   */\n  @Input()\n  gap: LayoutGridGap = LayoutGridGaps.collapse;\n\n  /**\n   * @description Media breakpoint for responsive behavior.\n   * @summary Determines the responsive breakpoint at which the layout should adapt.\n   * This affects how the grid behaves on different screen sizes, allowing for\n   * mobile-first or desktop-first responsive design patterns. The breakpoint\n   * is automatically processed to ensure compatibility with the UI framework.\n   *\n   * @type {UIMediaBreakPointsType}\n   * @default 'medium'\n   * @memberOf LayoutComponent\n   */\n  @Input()\n  grid: boolean = true;\n\n  /**\n   * @description Media breakpoint for responsive behavior.\n   * @summary Determines the responsive breakpoint at which the layout should adapt.\n   * This affects how the grid behaves on different screen sizes, allowing for\n   * mobile-first or desktop-first responsive design patterns. The breakpoint\n   * is automatically processed to ensure compatibility with the UI framework.\n   *\n   * @type {UIMediaBreakPointsType}\n   * @default 'medium'\n   * @memberOf LayoutComponent\n   */\n  @Input()\n  flexMode: boolean = false;\n\n  /**\n   * @description Media breakpoint for responsive behavior.\n   * @summary Determines the responsive breakpoint at which the layout should adapt.\n   * This affects how the grid behaves on different screen sizes, allowing for\n   * mobile-first or desktop-first responsive design patterns. The breakpoint\n   * is automatically processed to ensure compatibility with the UI framework.\n   *\n   * @type {UIMediaBreakPointsType}\n   * @default 'medium'\n   * @memberOf LayoutComponent\n   */\n  @Input()\n  rowCard: boolean = true;\n\n  /**\n   * @description Maximum number of columns allowed in the grid layout.\n   * @summary Specifies the upper limit for the number of columns that can be displayed in the grid.\n   * This ensures that the layout remains visually consistent and prevents excessive columns\n   * from being rendered, which could disrupt the design.\n   *\n   * @type {number}\n   * @default 6\n   * @memberOf LayoutComponent\n   */\n  @Input()\n  private maxColsLength: number = 6;\n\n  @Input()\n  accordion: boolean = false;\n\n  collapsed: boolean = true;\n\n  /**\n   * @description Creates an instance of LayoutComponent.\n   * @summary Initializes a new LayoutComponent with the component name \"LayoutComponent\".\n   * This constructor calls the parent NgxParentComponentDirective constructor to set up base\n   * functionality and component identification.\n   *\n   * @memberOf LayoutComponent\n   */\n  constructor() {\n    super('LayoutComponent');\n  }\n\n  /**\n   * @description Getter that converts columns input to an array format.\n   * @summary Transforms the cols input property into a standardized string array format.\n   * When cols is a number, it creates an array with that many empty string elements.\n   * When cols is already an array, it returns the array as-is. This normalization\n   * ensures consistent handling of column definitions in the template.\n   *\n   * @type {string[]}\n   * @readonly\n   * @memberOf LayoutComponent\n   */\n  get _cols(): string[] {\n    let cols = this.cols;\n    if (typeof cols === Primitives.BOOLEAN) {\n      cols = 1;\n      this.flexMode = true;\n    }\n    if (typeof cols === Primitives.NUMBER) cols = Array.from({ length: Number(cols) }, () => '');\n    return cols as string[];\n  }\n\n  /**\n   * @description Calculates the number of columns for a given row.\n   * @summary Determines the effective number of columns in a row based on the row's column definitions,\n   * the total number of columns in the layout, and the maximum allowed columns.\n   *\n   * @param {KeyValue | IComponentProperties} row - The row object containing column definitions.\n   * @returns {number} The number of columns for the row, constrained by the layout's maximum column limit.\n   * @memberOf LayoutComponent\n   */\n  getRowColsLength(row: KeyValue | IComponentProperties): number {\n    let length: number = (row.cols as [])?.length ?? 1;\n    const colsLength = (this.cols as [])?.length;\n    const rowsLength = (typeof this.rows === Primitives.NUMBER ? this.rows : (this.rows as [])?.length) as number;\n    if (length > this.maxColsLength) length = this.maxColsLength;\n\n    if (length !== colsLength) {\n      length = colsLength;\n      if (this.flexMode) {\n        length = row.cols.reduce((acc: number, curr: KeyValue) => {\n          if (rowsLength > 1) return acc + (typeof curr['col'] === Primitives.NUMBER ? curr['col'] : 1);\n          return (\n            acc + (typeof curr['col'] === Primitives.NUMBER ? curr['col'] : curr['col'] === 'full' ? 0 : curr['col'])\n          );\n        }, 0);\n      }\n    }\n    return length;\n  }\n\n  /**\n   * @description Getter that converts rows input to an array format.\n   * @summary Transforms the rows input property into a standardized string array format.\n   * When rows is a number, it creates an array with that many empty string elements.\n   * When rows is already an array, it returns the array as-is. This normalization\n   * ensures consistent handling of row definitions in the template.\n   *\n   * @type {KeyValue[]}\n   * @readonly\n   * @memberOf LayoutComponent\n   */\n  get _rows(): KeyValue[] {\n    let rows = this.rows;\n    if (typeof rows === Primitives.NUMBER)\n      rows = Array.from({ length: Number(rows) }, () => ({\n        title: '',\n      })) as Partial<IComponentProperties>[];\n\n    let rowsLength = (rows as string[]).length;\n    if (rowsLength === 1 && this.flexMode) {\n      this.children.forEach((child) => {\n        const row = child?.['props'].row || 1;\n        if (row > rowsLength) {\n          rowsLength += 1;\n          (rows as KeyValue[]).push({ title: '' });\n        }\n      });\n\n      this.rows = rowsLength;\n    }\n    return (rows as KeyValue[])\n      .map((row, index) => {\n        const rowsLength = this.rows;\n        return {\n          title: typeof row === Primitives.STRING ? row : row?.['title'] || '',\n          cols: this.children.filter((child) => {\n            let row = (child as UIElementMetadata).props?.['row'] ?? 1;\n            if (row > rowsLength) row = rowsLength as number;\n            child['col'] = (child as UIElementMetadata).props?.['col'] ?? (this.cols as string[])?.length ?? 1;\n            if (row === index + 1) return child;\n          }),\n        };\n      })\n      .map((row, index) => {\n        const colsLength = this.getRowColsLength(row);\n        row.cols = row.cols.map((c: KeyValue) => {\n          let { col } = c;\n          if (typeof col === Primitives.STRING) col = col === 'half' ? '1-2' : col === 'full' ? '1-1' : col;\n\n          if (!this.flexMode) {\n            if (typeof col === Primitives.NUMBER) {\n              col = col === colsLength ? `1-1` : col > colsLength ? `${colsLength}-${col}` : `${col}-${colsLength}`;\n            }\n          } else {\n            if (typeof col === Primitives.NUMBER)\n              col = colsLength <= this.maxColsLength ? `${col}-${colsLength}` : `${index + 1}-${col}`;\n            col = ['2-4', '3-6'].includes(col) ? `1-2` : col;\n          }\n          col = `dcf-child-${col}-${this.breakpoint} dcf-width-${col}`;\n          const childClassName = c?.['props']?.className || '';\n          const colClass = `${col}@${this.breakpoint} ${filterString(childClassName, '-width-')}`;\n          // to prevent layout glitches, before send class to child component remove width classes\n          if (c?.['props']?.className) c['props'].className = filterString(c?.['props']?.className, '-width-', false);\n          return Object.assign(c, { colClass }, { refreshing: this.refreshing });\n        });\n        return row;\n      });\n  }\n\n  /**\n   * @description Angular lifecycle hook that runs after component initialization.\n   * @summary Called once, after the first ngOnChanges(). This method triggers the\n   * component's initialization process, which includes property parsing and grid\n   * setup. It ensures the component is properly configured before rendering.\n   *\n   * @memberOf LayoutComponent\n   */\n  async ngOnInit(): Promise<void> {\n    // must always parse props first, parse children case of layout depends on it\n    super.parseProps(this, !this.children.length ? [] : ['children']);\n    if (this.breakpoint)\n      this.breakpoint =\n        `${this.breakpoint.startsWith('x') ? this.breakpoint.substring(0, 2) : this.breakpoint.substring(0, 1)}`.toLowerCase();\n    this.cols = this._cols;\n    this.rows = this._rows;\n\n    await super.initialize();\n    this.changeDetectorRef.detectChanges();\n  }\n\n  override async handleEvent(event: IBaseCustomEvent): Promise<void> {\n    this.listenEvent.emit(event);\n  }\n\n  toggleCollapse(container: HTMLElement): void {\n    this.collapsed = !this.collapsed;\n    this.changeDetectorRef.detectChanges();\n  }\n}\n","<section class=\"dcf-layout-container\">\n  @if (initialized) {\n    @for (row of rows; track trackItemFn($index, row); let rowIndex = $index) {\n      @if (row?.cols?.length) {\n        <div\n          [id]=\"uid\"\n          [class]=\"\n            (!grid\n              ? 'dcf-layout-row '\n              : 'dcf-layout-row dcf-grid ' + 'dcf-grid-' + gap) +\n            ' ' +\n            (className || '')\n          \"\n          [class.dcf-grid-match]=\"match\"\n          [class.dcf-grid-bordered]=\"borders\"\n          [class.dcf-accordion]=\"accordion\"\n          [class.open]=\"accordion && !collapsed\"\n        >\n          @if (row?.title?.length) {\n            <div class=\"dcf-width-1-1 dcf-grid-title\">\n              <h3 class=\"\">{{ row.title | translate }}</h3>\n            </div>\n          }\n          @for (\n            child of row.cols;\n            track trackItemFn($index, child.col);\n            let colIndex = $index\n          ) {\n            <div\n              [class.dcf-collapsed]=\"accordion && collapsed && $index !== 0\"\n              [class]=\"'dcf-grid-col ' + child.colClass\"\n              [class.dcf-first-column]=\"$index === 0\"\n              [class.dcf-hidden]=\"child.props?.hidden?.includes(operation)\"\n              #collapsableElement\n            >\n              <div\n                [class]=\"\n                  accordion && !collapsed && $index !== 0\n                    ? 'dcf-animation dcf-animation-slide-top-small dcf-animation-fast'\n                    : ''\n                \"\n              >\n                @if (accordion && $index === 0 && row.cols.length > 1) {\n                  <div class=\"dcf-button-toggle\">\n                    <ngx-decaf-icon\n                      (click)=\"toggleCollapse(collapsableElement)\"\n                      [button]=\"true\"\n                      [name]=\"collapsed ? 'ti-eye' : 'ti-eye-off'\"\n                    />\n                  </div>\n                }\n                @if (child.tag === 'ngx-decaf-crud-form') {\n                  <ngx-decaf-card\n                    [className]=\"\n                      (match ? 'dcf-height-1-1 dcf-card-layout' : '') +\n                      className\n                    \"\n                    [body]=\"cardBody\"\n                    [type]=\"cardType\"\n                  >\n                    <ngx-decaf-model-renderer\n                      [model]=\"child.props.name\"\n                      [pk]=\"pk\"\n                      (listenEvent)=\"handleEvent($event)\"\n                    />\n                  </ngx-decaf-card>\n                } @else {\n                  @if (refreshing) {\n                    <ion-item>\n                      <ion-skeleton-text [animated]=\"true\"></ion-skeleton-text>\n                    </ion-item>\n                  } @else {\n                    <ngx-decaf-component-renderer\n                      [tag]=\"child.tag\"\n                      [pk]=\"pk\"\n                      [className]=\"\n                        (match ? 'dcf-height-1-1 dcf-card-layout' : '') +\n                        className\n                      \"\n                      [parentForm]=\"\n                        parentForm || child.parentForm || child?.formGroup\n                      \"\n                      [children]=\"child?.children || []\"\n                      (listenEvent)=\"handleEvent($event)\"\n                      [globals]=\"{ props: child.props }\"\n                    />\n                  }\n                }\n              </div>\n            </div>\n          }\n        </div>\n      }\n    }\n  }\n</section>\n","/**\n * @module module:lib/components/crud-form/crud-form.component\n * @description CRUD form component module.\n * @summary Provides `CrudFormComponent` — a wrapper that composes dynamic form\n * fields and layout to produce create/read/update/delete forms with validation\n * and submission handling.\n *\n * @link {@link CrudFormComponent}\n */\n\nimport { Component, Input, OnInit } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { OperationKeys } from '@decaf-ts/db-decorators';\nimport { ComponentEventNames } from '@decaf-ts/ui-decorators';\nimport { IonButton, IonIcon } from '@ionic/angular/standalone';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { DefaultFormButtonsOptions } from '../../engine/constants';\nimport { Dynamic } from '../../engine/decorators';\nimport { NgxFormDirective } from '../../engine/NgxFormDirective';\nimport { LayoutComponent } from '../layout/layout.component';\n\nimport { getModelAndRepository } from '../../engine/helpers';\n\n@Dynamic()\n@Component({\n  standalone: true,\n  selector: 'ngx-decaf-crud-form',\n  templateUrl: './crud-form.component.html',\n  styleUrls: ['./crud-form.component.scss'],\n  imports: [TranslatePipe, ReactiveFormsModule, LayoutComponent, IonButton, IonIcon],\n  host: { '[attr.id]': 'uid' },\n})\nexport class CrudFormComponent extends NgxFormDirective implements OnInit {\n  @Input()\n  showCancelButton = true;\n\n  constructor() {\n    super('CrudFormComponent');\n  }\n\n  /**\n   * @description Component initialization lifecycle method.\n   * @summary Initializes the component by setting up the logger, configuring form state\n   * based on the operation type, and merging configuration options. For READ and DELETE\n   * operations, the formGroup is set to undefined since these operations don't require\n   * form input. Configuration options are merged with default settings.\n   *\n   * @returns {Promise<void>}\n   * @memberOf CrudFormComponent\n   */\n  async ngOnInit(): Promise<void> {\n    this.buttons = Object.assign(\n      {},\n      DefaultFormButtonsOptions,\n      { submit: { text: this.operation.toLowerCase() } },\n      this.buttons || {}\n    );\n    if (!this.pk && this.modelName) {\n      const repo = getModelAndRepository(this.modelName);\n      if (repo) {\n        this.pk = repo.pk;\n      }\n    }\n\n    await super.initialize();\n  }\n\n  /**\n   * @description Handles delete operations by emitting delete events.\n   * @summary Processes delete requests by emitting a submit event with the\n   * record's unique identifier as data. This allows parent components to\n   * handle the actual deletion logic while maintaining separation of concerns.\n   * The event includes the uid and standard component identification.\n   *\n   * @returns {void}\n   * @memberOf CrudFormComponent\n   */\n  handleDelete(): void {\n    super.submitEventEmit(\n      this.model,\n      'CrudFormComponent',\n      ComponentEventNames.Submit,\n      this.handlers,\n      OperationKeys.DELETE\n    );\n  }\n}\n","@if (operation !== 'read' && operation !== 'delete') {\n  <form\n    [class]=\"'dcf-form-grid ' + operation\"\n    #component\n    [id]=\"rendererId\"\n    [formGroup]=\"formGroup\"\n    (ngSubmit)=\"submit($event)\"\n    novalidate\n    [target]=\"target\"\n  >\n    @if (!children?.length) {\n      <ng-content #formContent></ng-content>\n    } @else {\n      <ngx-decaf-layout\n        [className]=\"'dcf-crud-form-grid dcf-grid-nested '\"\n        [children]=\"children || []\"\n        [isModalChild]=\"isModalChild\"\n        [pk]=\"pk\"\n        (listenEvent)=\"handleEvent($event)\"\n        [parentForm]=\"formGroup || parentForm\"\n        [operation]=\"operation\"\n        [modelId]=\"modelId\"\n        [cardType]=\"cardType ?? 'blank'\"\n        [match]=\"match ?? false\"\n        [refreshing]=\"refreshing\"\n        [gap]=\"'small'\"\n        [flexMode]=\"props.flexMode || false\"\n        [rows]=\"rows\"\n        [borders]=\"borders ?? false\"\n        [breakpoint]=\"breakpoint ?? 'large'\"\n        [cols]=\"cols\"\n      />\n    }\n    @if (initialized) {\n      <div\n        class=\"dcf-buttons-grid dcf-grid dcf-grid-small dcf-flex dcf-flex-right\"\n      >\n        @if (!action) {\n          <div [class.dcf-hidden]=\"!showCancelButton\">\n            <ion-button\n              fill=\"clear\"\n              (click)=\"handleReset()\"\n            >\n              @if (buttons.clear?.icon) {\n                <ion-icon\n                  aria-hidden=\"true\"\n                  [slot]=\"buttons.clear?.iconSlot\"\n                  [name]=\"buttons.clear?.icon\"\n                ></ion-icon>\n              }\n              {{\n                locale + '.' + (allowClear ? buttons.clear?.text : 'back')\n                  | translate\n              }}\n            </ion-button>\n          </div>\n        }\n        <div>\n          <ion-button\n            type=\"submit\"\n            [expand]=\"action ? 'block' : 'default'\"\n          >\n            @if (buttons.submit.icon) {\n              <ion-icon\n                aria-hidden=\"true\"\n                [slot]=\"buttons.submit.iconSlot\"\n                [name]=\"buttons.submit.icon\"\n              ></ion-icon>\n            }\n            {{\n              action ? action : (locale + '.' + buttons.submit.text | translate)\n            }}\n          </ion-button>\n        </div>\n      </div>\n    }\n  </form>\n} @else {\n  <section\n    #component\n    [id]=\"uid\"\n  >\n    <ngx-decaf-layout\n      [className]=\"''\"\n      [pk]=\"pk\"\n      [isModalChild]=\"isModalChild\"\n      [modelId]=\"modelId\"\n      [children]=\"children || []\"\n      [operation]=\"operation\"\n      [cardType]=\"cardType ?? 'blank'\"\n      [modelId]=\"modelId\"\n      [match]=\"match ?? false\"\n      [gap]=\"'small'\"\n      [isModalChild]=\"isModalChild\"\n      (listenEvent)=\"handleEvent($event)\"\n      [flexMode]=\"props.flexMode || false\"\n      [rows]=\"rows\"\n      [borders]=\"borders ?? false\"\n      [breakpoint]=\"breakpoint ?? 'large'\"\n      [cols]=\"cols\"\n    />\n  </section>\n\n  <section\n    [class]=\"\n      'dcf-buttons-grid dcf-grid dcf-grid-small dcf-flex dcf-flex-left ' +\n      operation\n    \"\n    [id]=\"uid\"\n  >\n    @if ([OperationKeys.DELETE].includes(operation) && modelId) {\n      <div>\n        <ion-button\n          (click)=\"handleDelete()\"\n          color=\"danger\"\n          type=\"button\"\n        >\n          @if (buttons.submit.icon) {\n            <ion-icon\n              aria-hidden=\"true\"\n              [slot]=\"buttons.submit.iconSlot\"\n              [name]=\"buttons.submit.icon\"\n            ></ion-icon>\n          }\n          {{ locale + '.delete' | translate }}\n        </ion-button>\n      </div>\n    }\n    @if (\n      operation === OperationKeys.CREATE || operation === OperationKeys.UPDATE\n    ) {\n      <div>\n        <ion-button type=\"submit\">\n          @if (buttons.submit.icon) {\n            <ion-icon\n              aria-hidden=\"true\"\n              [slot]=\"buttons.submit.iconSlot\"\n              [name]=\"buttons.submit.icon\"\n            ></ion-icon>\n          }\n          {{\n            action\n              ? action\n              : !translatable\n                ? buttons.submit.text\n                : (locale + '.' + buttons.submit.text | translate)\n          }}\n        </ion-button>\n      </div>\n    }\n    <div>\n      <ion-button\n        fill=\"clear\"\n        (click)=\"handleReset()\"\n      >\n        @if (buttons.clear?.icon) {\n          <ion-icon\n            aria-hidden=\"true\"\n            [slot]=\"buttons.clear?.iconSlot\"\n            [name]=\"buttons.clear?.icon\"\n          ></ion-icon>\n        }\n        {{\n          !translatable\n            ? buttons.clear?.text\n            : [\n                  OperationKeys.DELETE,\n                  OperationKeys.READ,\n                  OperationKeys.UPDATE,\n                ].includes(operation)\n              ? (locale + '.back' | translate)\n              : (locale + '.' + buttons.clear.text | translate)\n        }}\n      </ion-button>\n    </div>\n  </section>\n}\n","/**\n * @module module:lib/components/empty-state/empty-state.component\n * @description Empty state component module.\n * @summary Exposes `EmptyStateComponent` which displays a standardized empty\n * state UI with optional icon, title, subtitle and action button. Supports\n * localization and sanitized HTML for dynamic subtitles.\n *\n * @link {@link EmptyStateComponent}\n */\n\nimport { Component, inject, Input, OnInit } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { ElementSizes } from '@decaf-ts/ui-decorators';\nimport { IonButton, IonSpinner } from '@ionic/angular/standalone';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { IconComponent } from '../../components/icon/icon.component';\nimport { Dynamic } from '../../engine/decorators';\nimport { ElementSize, FunctionLike, StringOrBoolean } from '../../engine/types';\nimport { stringToBoolean } from '../../utils/helpers';\nimport { CardComponent } from '../card/card.component';\n\n/**\n * @description Component for displaying empty state messages with optional actions.\n * @summary This component provides a standardized way to display empty state messages\n * when no data is available or when a user needs to take an action to populate content.\n * It includes customizable title, subtitle, icon, and action button elements that can be\n * styled and configured through input properties. The component supports localization\n * and can trigger navigation or custom actions when the button is clicked.\n *\n * @mermaid\n * classDiagram\n *   class EmptyStateComponent {\n *     +string title\n *     +string titleColor\n *     +string subtitle\n *     +string subtitleColor\n *     +StringOrBoolean showIcon\n *     +string icon\n *     +string iconSize\n *     +string iconColor\n *     +string|Function buttonLink\n *     +string buttonText\n *     +string buttonFill\n *     +string buttonColor\n *     +string buttonSize\n *     +string searchValue\n *     -Router Router\n *     +ngOnInit()\n *     +handleClick()\n *   }\n *   EmptyStateComponent --|> NgxBaseComponentDirective\n *   EmptyStateComponent --|> OnInit\n *\n * @extends {NgxBaseComponentDirective}\n * @implements {OnInit}\n */\n@Dynamic()\n@Component({\n  selector: 'ngx-decaf-empty-state',\n  templateUrl: './empty-state.component.html',\n  styleUrls: ['./empty-state.component.scss'],\n  standalone: true,\n  imports: [IconComponent, TranslatePipe, IonSpinner, IonButton, CardComponent],\n})\nexport class EmptyStateComponent extends CardComponent implements OnInit {\n  /**\n   * @description The main title displayed in the empty state.\n   * @summary Specifies the primary message to show in the empty state component.\n   * This text is typically used to inform the user about why they're seeing an empty view.\n   * If translatable is true, this will be processed through the localization system.\n   *\n   * @type {string}\n   * @default \"title\"\n   * @memberOf EmptyStateComponent\n   */\n  @Input()\n  override title: string = 'title';\n\n  /**\n   * @description The color of the title text.\n   * @summary Specifies the color for the title text using the application's color system.\n   * The value should correspond to a color variable defined in the application's theme.\n   * The component will automatically prefix this with \"color-\" to create the CSS class.\n   *\n   * @type {string}\n   * @default 'gray-6'\n   * @memberOf EmptyStateComponent\n   */\n  @Input()\n  titleColor: string = 'gray-6';\n\n  /**\n   * @description The secondary message displayed in the empty state.\n   * @summary Provides additional context or instructions below the main title.\n   * This text is typically used to guide the user on what actions they can take.\n   * If translatable is true, this will be processed through the localization system.\n   *\n   * @type {string | undefined}\n   * @memberOf EmptyStateComponent\n   */\n  @Input()\n  override subtitle: string = '';\n\n  /**\n   * @description The color of the subtitle text.\n   * @summary Specifies the color for the subtitle text using the application's color system.\n   * The value should correspond to a color variable defined in the application's theme.\n   * The component will automatically prefix this with \"color-\" to create the CSS class.\n   *\n   * @type {string}\n   * @default 'gray-4'\n   * @memberOf EmptyStateComponent\n   */\n  @Input()\n  subtitleColor: string = 'gray-4';\n\n  /**\n   * @description Controls whether the icon is displayed.\n   * @summary Determines if the visual icon should be shown in the empty state.\n   * This can be provided as a boolean or a string that will be converted to a boolean.\n   * Icons help visually communicate the empty state context to users.\n   *\n   * @type {StringOrBoolean}\n   * @default true\n   * @memberOf EmptyStateComponent\n   */\n  @Input()\n  showIcon: StringOrBoolean = true;\n\n  /**\n   * @description The name of the icon to display.\n   * @summary Specifies which icon to show when showIcon is true.\n   * The component uses the icon system defined in the application,\n   * and this value should correspond to an available icon name.\n   *\n   * @type {string}\n   * @default \"folder-open-outline\"\n   * @memberOf EmptyStateComponent\n   */\n  @Input()\n  icon: string = 'folder-open-outline';\n\n  /**\n   * @description The size of the displayed icon.\n   * @summary Controls the size of the icon shown in the empty state.\n   * Can be either 'large' or 'small' to accommodate different layout needs.\n   *\n   * @type {'large' | 'small' | undefined}\n   * @default 'large'\n   * @memberOf EmptyStateComponent\n   */\n  @Input()\n  iconSize?: Extract<ElementSize, 'large' | 'small'> = ElementSizes.large;\n\n  /**\n   * @description The color of the displayed icon.\n   * @summary Specifies the color for the icon using Ionic's predefined color system.\n   * This allows the icon to match the application's color scheme.\n   *\n   * @type {string}\n   * @default 'medium'\n   * @memberOf EmptyStateComponent\n   */\n  @Input()\n  iconColor?: string = 'medium';\n\n  /**\n   * @description The navigation target or action for the button.\n   * @summary Specifies where the button should navigate to when clicked or what function\n   * it should execute. This can be either a URL string or a function that handles navigation.\n   * When not provided, the button will not perform any action.\n   *\n   * @type {string | FunctionLike | undefined}\n   * @memberOf EmptyStateComponent\n   */\n  @Input()\n  buttonLink?: string | FunctionLike;\n\n  /**\n   * @description The text displayed on the action button.\n   * @summary Specifies the label for the action button in the empty state.\n   * If translatable is true, this will be processed through the localization system.\n   * If not provided, the button will not display any text.\n   *\n   * @type {string | undefined}\n   * @memberOf EmptyStateComponent\n   */\n  @Input()\n  buttonText?: string;\n\n  /**\n   * @description The fill style of the action button.\n   * @summary Controls the visual style of the button using Ionic's button fill options.\n   * 'solid' creates a button with a solid background, 'outline' creates a button with\n   * just a border, and 'clear' creates a button with no background or border.\n   *\n   * @type {'clear' | 'solid' | 'outline'}\n   * @default 'solid'\n   * @memberOf EmptyStateComponent\n   */\n  @Input()\n  buttonFill: 'clear' | 'solid' | 'outline' = 'solid';\n\n  /**\n   * @description The color of the action button.\n   * @summary Specifies the color for the button using Ionic's color system.\n   * This allows the button to match the application's color scheme.\n   *\n   * @type {string}\n   * @default 'primary'\n   * @memberOf EmptyStateComponent\n   */\n  @Input()\n  buttonColor: string = 'primary';\n\n  /**\n   * @description The size of the action button.\n   * @summary Controls the size of the button shown in the empty state.\n   * Can be 'large', 'small', or 'default' to accommodate different layout needs.\n   *\n   * @type {'large' | 'small' | 'default'}\n   * @default 'default'\n   * @memberOf EmptyStateComponent\n   */\n  @Input()\n  buttonSize: Extract<ElementSize, 'large' | 'small' | 'default'> = 'default';\n\n  /**\n   * @description The search value that resulted in no results.\n   * @summary When the empty state is shown due to a search with no results,\n   * this property can hold the search term that was used. This can be displayed\n   * in the empty state message to provide context to the user.\n   *\n   * @type {string}\n   * @memberOf EmptyStateComponent\n   */\n  @Input()\n  override searchValue!: string;\n\n  /**\n   * @description Sanitizer instance for bypassing security and sanitizing HTML content.\n   * @summary Used to sanitize dynamic HTML content, ensuring it is safe to render in the DOM.\n   * @type {DomSanitizer}\n   * @memberOf EmptyStateComponent\n   */\n  private sanitizer: DomSanitizer = inject(DomSanitizer);\n\n  /**\n   * @description The sanitized subtitle for search results.\n   * @summary Holds the processed and sanitized HTML content for the subtitle when a search yields no results.\n   * @type {SafeHtml}\n   * @memberOf EmptyStateComponent\n   */\n  searchSubtitle!: SafeHtml;\n\n  /**\n   * @description Flag to enable creation by model route.\n   * @summary Indicates whether the component should allow creation of new items via a model route when no button link is provided.\n   * @type {boolean}\n   * @default false\n   * @memberOf EmptyStateComponent\n   */\n  enableCreationByModelRoute: boolean = false;\n\n  /**\n   * @description Creates an instance of EmptyStateComponent.\n   * @summary Initializes a new EmptyStateComponent by calling the parent class constructor\n   * with the component name for logging and identification purposes. This component provides\n   * a standardized way to display empty state messages with optional icons and action buttons.\n   *\n   * @memberOf EmptyStateComponent\n   */\n  constructor() {\n    super('EmptyStateComponent');\n    this.type = 'clear';\n    this.componentName = 'EmptyStateComponent';\n    this.enableDarkMode = true;\n  }\n\n  /**\n   * @description Initializes the component after Angular first displays the data-bound properties.\n   * @summary Sets up the component by processing boolean inputs, applying localization to text\n   * elements if translation is enabled, and formatting CSS classes for title and subtitle colors.\n   * This method prepares the component for user interaction by ensuring all properties are\n   * properly initialized and localized.\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant A as Angular Lifecycle\n   *   participant E as EmptyStateComponent\n   *\n   *   A->>E: ngOnInit()\n   *   E->>E: Process translatable flag\n   *   E->>E: Process showIcon flag\n   *   E->>E: Get locale settings\n   *   alt translatable is true\n   *     E->>E: Localize title\n   *     E->>E: Localize subtitle\n   *     E->>E: Localize buttonText\n   *   end\n   *   E->>E: Format title CSS class\n   *   E->>E: Format subtitle CSS class\n   *\n   * @return {Promise<void>}\n   * @memberOf EmptyStateComponent\n   */\n  override async ngOnInit(): Promise<void> {\n    super.ngOnInit();\n    this.showIcon = stringToBoolean(this.showIcon);\n    this.titleColor = `dcf-title dcf-color-${this.titleColor}`;\n    this.subtitleColor = `dcf-subtitle dcf-color-${this.subtitleColor}`;\n    if (this.searchValue) this.searchSubtitle = await this.getSearchSubtitle(this.subtitle as string);\n    if (!this.buttonLink && this.model && this.route) this.enableCreationByModelRoute = true;\n    await super.initialize();\n  }\n\n  /**\n   * @description Handles click events on the action button.\n   * @summary This method is triggered when the user clicks the action button in the empty state\n   * component. It supports three navigation patterns: 1) no action when buttonLink is not provided,\n   * 2) custom function execution when buttonLink is a function, and 3) navigation to a specific URL\n   * when buttonLink is a string. This flexibility allows the empty state to trigger various actions\n   * based on the context in which it's used.\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant U as User\n   *   participant E as EmptyStateComponent\n   *   participant N as Router\n   *\n   *   U->>E: Click action button\n   *   E->>E: handleClick()\n   *   alt buttonLink is not provided\n   *     E-->>U: Return false (no action)\n   *   else buttonLink is a function\n   *     E->>E: Execute buttonLink function\n   *     E-->>U: Return function result\n   *   else buttonLink is a URL string\n   *     E->>N: navigateForward(buttonLink)\n   *     N-->>E: Return navigation result\n   *     E-->>U: Return navigation result\n   *   end\n   *\n   * @return {boolean | void | Promise<boolean> | FunctionLike}\n   *   - false if no action is taken\n   *   - The result of the buttonLink function if it's a function\n   *   - A Promise resolving to the navigation result if buttonLink is a URL\n   * @memberOf EmptyStateComponent\n   */\n  async handleClick(): Promise<void> {\n    const link = this.buttonLink;\n    if (link) {\n      if (link instanceof Function) {\n        const fn = link.bind(this);\n        if (fn instanceof Promise) return await fn;\n        fn();\n      } else {\n        await this.router.navigate([link as string]);\n      }\n    }\n  }\n\n  /**\n   * @description Generates a localized and sanitized subtitle for search results.\n   * @summary This method takes a content string, typically the subtitle, and processes it\n   * through the translation service. It replaces a placeholder ('0') with the actual\n   * search value, then sanitizes the result to safely use as HTML. This is particularly\n   * useful for displaying dynamic, localized messages in the empty state when a search\n   * yields no results.\n   *\n   * @param {string} content - The content string to be translated and processed\n   * @return {Promise<SafeHtml>} A promise that resolves to a sanitized HTML string\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant E as EmptyStateComponent\n   *   participant T as TranslateService\n   *   participant S as DomSanitizer\n   *\n   *   E->>T: instant(content, {'0': searchValue})\n   *   T-->>E: Return translated string\n   *   E->>S: bypassSecurityTrustHtml(translatedString)\n   *   S-->>E: Return sanitized SafeHtml\n   *\n   * @memberOf EmptyStateComponent\n   */\n  async getSearchSubtitle(content: string): Promise<SafeHtml> {\n    const result = await this.translate(content, { '0': this.searchValue });\n    return this.sanitizer.bypassSecurityTrustHtml(result as string);\n  }\n}\n","<div class=\"decaf-empty-state-component\" #component>\n  <ngx-decaf-card [className]=\"className\" [borders]=\"borders\" [body]=\"body\">\n    @if (refreshing) {\n      <div class=\"dcf-spinner-container\">\n        <ion-spinner color=\"primary\" name=\"circular\" />\n      </div>\n    } @else {\n      @if (icon && showIcon) {\n        <div class=\"dcf-icon-container\">\n          <ngx-decaf-icon\n            aria-hidden=\"true\"\n            [name]=\"icon\"\n            [size]=\"iconSize\"\n            [color]=\"!this.isDarkMode ? iconColor : ''\"\n          />\n        </div>\n      }\n      @if (title) {\n        <h4 class=\"dcf-ititle\" [class]=\"isDarkMode ? 'light' : titleColor\" [innerHTML]=\"title\"></h4>\n      }\n      @if (subtitle) {\n        <p\n          [class]=\"isDarkMode ? 'light' : subtitleColor\"\n          [innerHTML]=\"searchValue ? searchSubtitle : subtitle\"\n        ></p>\n      }\n      @if (!enableCreationByModelRoute) {\n        @if (buttonLink) {\n          <div>\n            <ion-button\n              [size]=\"buttonSize\"\n              [fill]=\"buttonFill\"\n              [color]=\"buttonColor\"\n              (click)=\"handleClick()\"\n            >\n              {{ buttonText || (locale + '.button_create' | translate) }}\n            </ion-button>\n          </div>\n        }\n      } @else {\n        <div>\n          <ion-button\n            class=\"dcf-margin-top\"\n            [size]=\"buttonSize\"\n            [fill]=\"buttonFill\"\n            [color]=\"buttonColor\"\n            (click)=\"changeOperation(OperationKeys.CREATE)\"\n            fill=\"clear\"\n          >\n            {{ buttonText?.length ? buttonText : (locale + '.button_create' | translate) }}\n          </ion-button>\n        </div>\n      }\n    }\n  </ngx-decaf-card>\n</div>\n","import { Component, EnvironmentInjector, Input, OnInit } from '@angular/core';\nimport { CrudOperations, OperationKeys } from '@decaf-ts/db-decorators';\nimport { IonButton, IonModal } from '@ionic/angular/standalone';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { ActionRoles } from '../../engine/constants';\nimport { Dynamic } from '../../engine/decorators';\nimport { ActionRole, KeyValue } from '../../engine/types';\nimport { generateRandomValue } from '../../utils';\nimport { IconComponent } from '../icon/icon.component';\nimport { getNgxModalComponent, ModalComponent } from './modal.component';\n\n@Dynamic()\n@Component({\n  selector: 'ngx-decaf-modal-confirm',\n  templateUrl: 'modal-confirm.component.html',\n  standalone: true,\n  imports: [TranslatePipe, IonButton, IconComponent],\n  host: { '[attr.id]': 'uid' },\n})\nexport class ModalConfirmComponent extends ModalComponent implements OnInit {\n  @Input()\n  override translatable: boolean = false;\n\n  @Input()\n  override title?: string;\n\n  /**\n   * @description Data used to generate the confirmation message.\n   * @summary Carries the item label, primary key, and unique identifier for the entity being confirmed.\n   * @type {KeyValue | undefined}\n   */\n  @Input()\n  data?: KeyValue;\n\n  /**\n   * @description CRUD operation represented by the confirmation modal.\n   * @summary Defines which operation the modal is confirming, such as create, update, or delete.\n   * @type {CrudOperations | undefined}\n   */\n  @Input()\n  role?: CrudOperations;\n\n  /**\n   * @description Custom confirmation message.\n   * @summary Overrides the localized default message when provided.\n   * @type {string | undefined}\n   */\n  @Input()\n  message?: string;\n\n  /**\n   * @description Enables alert-style confirmation behavior.\n   * @summary When true, the modal is styled and configured as an alert confirmation.\n   * @type {boolean}\n   * @default false\n   */\n  @Input()\n  alert: boolean = false;\n\n  /**\n   * @description Controls the visibility of the modal cancel button.\n   * @summary When true, the cancel button renders in the header; when false, it is omitted.\n   * @type {boolean}\n   * @default true\n   */\n  @Input()\n  showCancelButton: boolean = true;\n\n  /**\n   * @description Controls the visibility of the modal confirm button.\n   * @summary When true, the confirm button renders in the header; when false, it is omitted.\n   * @type {boolean}\n   * @default true\n   */\n  @Input()\n  showConfirmButton: boolean = true;\n\n  /**\n   * @description Controls whether the confirm code input is required.\n   * @summary When true, the confirm code input is required; when false, it is omitted.\n   * @type {boolean}\n   * @default true\n   */\n  @Input()\n  requireConfirmCode: boolean = false;\n\n  /**\n   * @description Code used to allow submission of the modal.\n   * @summary When provided, the modal is submitted when the code matches the confirm code.\n   * @type {string}\n   */\n  confirmCode: string = generateRandomValue(6).toLowerCase();\n\n  /**\n   * @description Allows the submission of the modal.\n   * @summary When true, the submit button is enabled; when false, it is disabled.\n   * @type {boolean}\n   * @default true\n   */\n  allowSubmit: boolean = false;\n\n  /**\n   * @description Initializes the confirmation modal content.\n   * @summary Resolves localized title and message text from the current role and injected data, then prepares the base modal.\n   *\n   * @returns {Promise<void>} - A promise that resolves when initialization is complete.\n   */\n  override async ngOnInit(): Promise<void> {\n    const { uid, item, pk } = this.data || {};\n    const role = this.role || OperationKeys.DELETE;\n    if (this.requireConfirmCode) {\n      this.confirmCode = generateRandomValue(6).toLowerCase();\n      this.showConfirmButton = true;\n      this.allowSubmit = false;\n    }\n    this.changeDetectorRef.detectChanges();\n\n    // if (!this.title) {\n    //   this.title = await this.translate(`${this.locale}.confirm.operations.${role}.title`, {\n    //     '0': item,\n    //   });\n    //   this.translatable = false;\n    // }\n    if (!this.message) {\n      this.message = (await this.translate(`${this.locale}.confirm.operations.${role}.message`, {\n        '0': uid,\n        '1': item,\n        '2': pk,\n      })) as string;\n      this.translatable = false;\n    }\n    this.changeDetectorRef.detectChanges();\n    await this.initialize();\n  }\n\n  /**\n   * @description Handles the confirmation modal action.\n   * @summary Confirms the modal when requested and passes the selected payload, otherwise cancels the modal.\n   *\n   * @param {string} - The action to perform.\n   * @returns {Promise<void>} - A promise that resolves when the action completes.\n   */\n  async handleAction(role: 'confirm' | 'cancel' = 'confirm'): Promise<void> {\n    if (role === ActionRoles.confirm)\n      return await this.confirm({\n        name: 'ModalConfirmComponent',\n        data: {\n          role,\n          data: this.data,\n        },\n      });\n    return await this.cancel();\n  }\n\n  handleConfirmInputChanges(event: Event) {\n    const value = (event?.target as HTMLInputElement)?.value;\n    this.allowSubmit = value === this.confirmCode;\n    this.changeDetectorRef.detectChanges();\n  }\n}\n\n/**\n * @description Presents a standard confirmation modal.\n * @summary Opens the confirmation modal with transparent header styling and a hidden close button.\n *\n * @param {ModalConfirmProps} props - Properties used to initialize the confirmation modal.\n * @param {ActionRole} role - The dismiss role applied to the modal.\n * @param {EnvironmentInjector} injector - Optional environment injector for dependency injection.\n * @returns {Promise<IonModal>} - A promise that resolves with the presented modal instance.\n */\nexport async function presentModalConfirm(\n  props: Partial<ModalConfirmComponent> = {},\n  role: ActionRole = ActionRoles.confirm,\n  injector?: EnvironmentInjector\n): Promise<IonModal> {\n  return await getNgxModalComponent(\n    {\n      tag: 'ngx-decaf-modal-confirm',\n      headerTransparent: true,\n      className: `dcf-modal-confirm dcf-${role}`,\n      globals: Object.assign({}, { role }, props, { alert: false }),\n    },\n    {},\n    injector\n  );\n}\n\n/**\n * @description Presents an alert-style confirmation modal.\n * @summary Opens the confirmation modal with alert styling and a visible close button.\n *\n * @param {Partial<ModalConfirmComponent>} props - Properties used to initialize the alert modal.\n * @param {ActionRole} role - The dismiss role applied to the modal.\n * @param {EnvironmentInjector} injector - Optional environment injector for dependency injection.\n * @returns {Promise<IonModal>} - A promise that resolves with the presented modal instance.\n */\nexport async function presentModalAlert(\n  props: Partial<ModalConfirmComponent> = {},\n  role: ActionRole = ActionRoles.close,\n  injector?: EnvironmentInjector\n): Promise<IonModal> {\n  return await getNgxModalComponent(\n    {\n      tag: 'ngx-decaf-modal-confirm',\n      headerTransparent: true,\n      className: `dcf-modal-confirm dcf-modal-alert dcf-${role}`,\n      showCloseButton: true,\n      globals: Object.assign({}, { role }, props, { alert: true }),\n    },\n    {},\n    injector\n  );\n}\n","<div class=\"dcf-modal-confirm-body\">\n  @if (alert) {\n    <div class=\"dcf-title-container\">\n      <ngx-decaf-icon\n        name=\"ti-alert-square-rounded\"\n        color=\"danger\"\n      />\n\n      @if (title?.lengh) {\n        <h2\n          class=\"dcf-title\"\n          [innerHTML]=\"translatable ? (title | translate) : title\"\n        ></h2>\n      }\n    </div>\n  } @else {\n    <h2\n      class=\"dcf-title\"\n      [innerHTML]=\"translatable ? (title | translate) : title\"\n    ></h2>\n  }\n\n  <div class=\"dcf-content\">\n    <div [innerHTML]=\"translatable ? (message | translate) : message\"></div>\n  </div>\n\n  @if (requireConfirmCode) {\n    <div class=\"dcf-confirm-code-container\">\n      <div\n        class=\"dcf-message\"\n        [innerHTML]=\"\n          'component.modal.confirm.code.message'\n            | translate: { '0': confirmCode }\n        \"\n      ></div>\n      <input\n        aria-label=\"component.modal.confirm.code.message' | translate\"\n        (input)=\"handleConfirmInputChanges($event)\"\n        (blur)=\"handleConfirmInputChanges($event)\"\n        [minlength]=\"confirmCode?.length\"\n        [maxlength]=\"confirmCode?.length\"\n        #confirmCodeComponent\n      />\n    </div>\n  }\n  <div\n    class=\"dcf-buttons-grid dcf-grid dcf-grid-collapse dcf-flex dcf-flex-right\"\n  >\n    @if (!alert) {\n      <div>\n        @if (showCancelButton) {\n          <ion-button\n            fill=\"clear\"\n            (click)=\"handleAction('cancel')\"\n            color=\"primary\"\n          >\n            {{ locale + '.confirm.buttons.cancel' | translate }}\n          </ion-button>\n        }\n      </div>\n\n      <div>\n        @if (showConfirmButton) {\n          <ion-button\n            (click)=\"handleAction()\"\n            [color]=\"role === OperationKeys.DELETE ? 'danger' : 'primary'\"\n            [disabled]=\"!allowSubmit\"\n            [innerHTML]=\"locale + '.confirm.buttons.confirm' | translate\"\n          ></ion-button>\n        }\n      </div>\n    }\n  </div>\n</div>\n","/**\n * @module module:lib/components/fieldset/fieldset.component\n * @description Fieldset component module.\n * @summary Provides `FieldsetComponent` — a dynamic, collapsible fieldset container\n * for grouping form controls with validation, reorder and add/remove capabilities.\n * Ideal for complex forms that require nested groupings and dynamic items.\n *\n * @link {@link FieldsetComponent}\n */\n\nimport { AfterViewInit, Component, Input, OnInit } from '@angular/core';\nimport { FormArray, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';\nimport { CrudOperations, OperationKeys } from '@decaf-ts/db-decorators';\nimport { Model, ReservedModels } from '@decaf-ts/decorator-validation';\nimport { ComponentEventNames, CrudOperationKeys, UIModelMetadata } from '@decaf-ts/ui-decorators';\nimport {\n  IonButton,\n  IonIcon,\n  IonItem,\n  IonLabel,\n  IonList,\n  IonReorder,\n  IonReorderGroup,\n  IonSpinner,\n  IonText,\n  ItemReorderEventDetail,\n} from '@ionic/angular/standalone';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { addIcons } from 'ionicons';\nimport { addOutline, alertCircleOutline, createOutline, trashOutline } from 'ionicons/icons';\nimport { timer } from 'rxjs';\nimport { ActionRoles } from '../../engine/constants';\nimport { Dynamic } from '../../engine/decorators';\nimport { IFieldSetItem, IFieldSetValidationEvent } from '../../engine/interfaces';\nimport { NgxFormDirective } from '../../engine/NgxFormDirective';\nimport { DecafRepository, FormParent, KeyValue } from '../../engine/types';\nimport { NgxFormService } from '../../services/NgxFormService';\nimport { itemMapper } from '../../utils/helpers';\nimport { IconComponent } from '../icon/icon.component';\nimport { LayoutComponent } from '../layout/layout.component';\nimport { presentModalConfirm } from '../modal/modal-confirm.component';\n\n/**\n * @description Dynamic fieldset component with collapsible accordion functionality.\n * @summary This component provides a sophisticated fieldset container that automatically\n * adapts its behavior based on CRUD operations. It integrates seamlessly with Ionic's\n * accordion components to create expandable/collapsible sections for organizing form\n * content and related information. The component intelligently determines its initial\n * state based on the operation type, opening automatically for READ and DELETE operations\n * while remaining closed for CREATE and UPDATE operations.\n *\n * @example\n * ```html\n * <!-- Basic usage with automatic state management -->\n * <ngx-decaf-fieldset\n *   name=\"Personal Information\"\n *   [operation]=\"OperationKeys.READ\"\n *   target=\"_self\">\n *   <ion-input label=\"Name\" placeholder=\"Enter name\"></ion-input>\n *   <ion-input label=\"Email\" type=\"email\" placeholder=\"Enter email\"></ion-input>\n * </ngx-decaf-fieldset>\n *\n * <!-- Advanced usage with custom operation -->\n * <ngx-decaf-fieldset\n *   name=\"Contact Details\"\n *   [operation]=\"currentOperation\"\n *   target=\"_blank\">\n *   <!-- Complex form fields -->\n * </ngx-decaf-fieldset>\n * ```\n *\n * @mermaid\n * sequenceDiagram\n *   participant U as User\n *   participant F as FieldsetComponent\n *   participant I as Ionic Accordion\n *   participant D as DOM\n *\n *   F->>F: ngAfterViewInit()\n *   alt operation is READ or DELETE\n *     F->>F: Set isOpen = true\n *     F->>D: Query accordion element\n *     F->>I: Set value attribute to 'open'\n *     F->>F: Trigger change detection\n *   end\n *   U->>I: Click accordion header\n *   I->>F: handleChange(event)\n *   F->>F: Update isOpen state\n *   F->>I: Reflect new state\n *\n * @memberOf FieldsetComponent\n */\n@Dynamic()\n@Component({\n  standalone: true,\n  selector: 'ngx-decaf-fieldset',\n  templateUrl: './fieldset.component.html',\n  styleUrls: ['./fieldset.component.scss'],\n  schemas: [],\n  imports: [\n    TranslatePipe,\n    ReactiveFormsModule,\n    IonList,\n    IonItem,\n    IonLabel,\n    IonText,\n    IonReorder,\n    IonReorderGroup,\n    IonButton,\n    IonIcon,\n    LayoutComponent,\n    IonSpinner,\n    IconComponent,\n  ],\n})\nexport class FieldsetComponent extends NgxFormDirective implements OnInit, AfterViewInit {\n  /**\n   * @description The display name or title of the fieldset section.\n   * @summary Sets the legend or header text that appears in the accordion header. This text\n   * provides a clear label for the collapsible section, helping users understand what content\n   * is contained within. The name is displayed prominently and serves as the clickable area\n   * for expanding/collapsing the fieldset.\n   *\n   * @type {string}\n   * @default 'Child'\n   * @memberOf FieldsetComponent\n   */\n  @Input()\n  formControl!: FormControl;\n\n  /**\n   * @description The parent component identifier for hierarchical fieldset relationships.\n   * @summary Specifies the parent component name that this fieldset belongs to in a hierarchical\n   * form structure. This property is used for event bubbling and establishing parent-child\n   * relationships between fieldsets in complex forms with nested structures.\n   *\n   * @type {string}\n   * @default 'Child'\n   * @memberOf FieldsetComponent\n   */\n  @Input()\n  // collapsable: boolean = true;\n\n  /**\n   * @description Custom type definitions for specialized fieldset behavior.\n   * @summary Defines custom data types or validation rules that should be applied to this fieldset.\n   * Can be a single type string or array of types that determine how the fieldset handles\n   * data validation, formatting, and display behavior for specialized use cases.\n   *\n   * @type {string | string[]}\n   * @memberOf FieldsetComponent\n   */\n  @Input()\n  customTypes!: string | string[];\n\n  /**\n   * @description Primary title text for the fieldset content.\n   * @summary Display title used for fieldset identification and content organization.\n   * Provides semantic meaning to the grouped form fields.\n   *\n   * @type {string}\n   * @memberOf FieldsetComponent\n   */\n  @Input()\n  title!: string;\n\n  /**\n   * @description Secondary descriptive text for the fieldset.\n   * @summary Additional information that provides context or instructions\n   * related to the fieldset content and purpose.\n   *\n   * @type {string}\n   * @memberOf FieldsetComponent\n   */\n  @Input()\n  description!: string;\n\n  /**\n   * @description Enables multiple item management within the fieldset.\n   * @summary Boolean flag that determines if the fieldset supports adding multiple values.\n   * When true, displays a reorderable list of items with add/remove functionality.\n   *\n   * @type {boolean}\n   * @default false\n   * @memberOf FieldsetComponent\n   */\n  @Input()\n  override multiple: boolean = true;\n\n  /**\n   * @description Array of raw values stored in the fieldset.\n   * @summary Contains the actual data values that have been added to the fieldset.\n   * This is the source of truth for the fieldset's data state.\n   *\n   * @type {KeyValue[]}\n   * @default []\n   * @memberOf FieldsetComponent\n   */\n  @Input()\n  override value: KeyValue[] = [];\n\n  /**\n   * @description Controls whether borders are displayed around the fieldset.\n   * @summary Boolean flag that determines if the fieldset should be visually outlined with borders.\n   * When true, borders are shown to visually separate the fieldset from surrounding content.\n   *\n   * @type {boolean}\n   * @default true\n   * @memberOf FieldsetComponent\n   */\n  @Input()\n  override borders: boolean = true;\n\n  /**\n   * @description Array of formatted items for UI display.\n   * @summary Contains the processed items ready for display in the component template.\n   * These items are mapped from the raw values using the mapper configuration.\n   *\n   * @type {IFieldSetItem[]}\n   * @default []\n   * @memberOf FieldsetComponent\n   */\n  items: IFieldSetItem[] = [];\n\n  /**\n   * @description Currently selected item for update operations.\n   * @summary Holds the item being edited when in update mode. Used to track\n   * which item is being modified and apply changes to the correct item.\n   *\n   * @type {IFieldSetItem | undefined}\n   * @memberOf FieldsetComponent\n   */\n  updatingItem!: IFieldSetItem | undefined;\n\n  /**\n   * @description Current state of the accordion (expanded or collapsed).\n   * @summary Boolean flag that tracks whether the fieldset accordion is currently open or closed.\n   * This property is automatically managed based on user interactions and initial operation state.\n   * It serves as the single source of truth for the component's visibility state and is used\n   * to coordinate between user actions and programmatic state changes. The value is automatically\n   * set based on CRUD operations during initialization and updated through user interactions.\n   *\n   * @type {boolean}\n   * @default false\n   * @memberOf FieldsetComponent\n   */\n  isOpen: boolean = false;\n\n  /**\n   * @description Indicates whether the fieldset contains required form fields.\n   * @summary Boolean flag that signals the presence of mandatory input fields within the fieldset.\n   * This property is automatically set by the CollapsableDirective when required fields are detected,\n   * and can be used to apply special styling, validation logic, or UI indicators to highlight\n   * fieldsets that contain mandatory information. It helps with form validation feedback and\n   * user experience by making required sections more prominent.\n   *\n   * @type {boolean}\n   * @default false\n   * @memberOf FieldsetComponent\n   */\n  isRequired: boolean = false;\n\n  /**\n   * @description Indicates whether the fieldset contains validation errors.\n   * @summary Boolean flag that tracks if any form fields within the fieldset have validation errors.\n   * This property is used to control accordion behavior when errors are present, preventing\n   * users from collapsing the accordion when they need to see and address validation issues.\n   * It's automatically updated when validation error events are received from child form fields.\n   *\n   * @type {boolean}\n   * @default false\n   * @memberOf FieldsetComponent\n   */\n  hasValidationErrors: boolean = false;\n\n  /**\n   * @description Validation error message for duplicate values.\n   * @summary Stores the error message when a user attempts to add a duplicate value\n   * to the fieldset. Used to display uniqueness validation feedback.\n   *\n   * @type {string | undefined}\n   * @memberOf FieldsetComponent\n   */\n  isUniqueError: string | undefined = undefined;\n\n  /**\n   * @description Localized label text for action buttons.\n   * @summary Dynamic button label that changes based on the current operation mode.\n   * Shows \"Add\" for create operations and \"Update\" for edit operations.\n   *\n   * @type {string}\n   * @memberOf FieldsetComponent\n   */\n  buttonLabel!: string;\n\n  /**\n   * @description Localized label text for action buttons.\n   * @summary Dynamic button label that changes based on the current operation mode.\n   * Shows \"Cancel\" for update operations\n   *\n   * @type {string}\n   * @memberOf FieldsetComponent\n   */\n  buttonCancelLabel!: string;\n\n  /**\n   * @description Maximum allowed items in the fieldset.\n   * @summary Numeric limit that controls how many items can be added when `multiple` is true.\n   * When set to Infinity there is no limit.\n   *\n   * @type {number}\n   * @default Infinity\n   * @memberOf FieldsetComponent\n   */\n  @Input()\n  max: number | undefined = undefined;\n\n  /**\n   * @description Maximum allowed items in the fieldset.\n   * @summary Numeric limit that controls how many items can be added when `multiple` is true.\n   * When set to Infinity there is no limit.\n   *\n   * @type {number}\n   * @default Infinity\n   * @memberOf FieldsetComponent\n   */\n  @Input()\n  required: boolean = false;\n\n  /**\n   * @description Determines if the fieldset items can be reordered.\n   * @summary Boolean flag that enables or disables the drag-and-drop reordering functionality\n   * for the items within the fieldset. When set to true, users can rearrange the order\n   * of items using drag-and-drop gestures. This is particularly useful for managing\n   * lists where the order of items is significant.\n   *\n   * @type {boolean}\n   * @default true\n   * @memberOf FieldsetComponent\n   */\n  @Input()\n  ordenable: boolean = true;\n\n  /**\n   * @description Determines if the fieldset items can be edited by the user.\n   * @summary Boolean flag that enables or disables the editing functionality\n   * for the items within the fieldset. When set to true, users can modify the items.\n   *\n   * @type {boolean}\n   * @default true\n   * @memberOf FieldsetComponent\n   * @default true\n   */\n  @Input()\n  editable: boolean = true;\n\n  /**\n   * @description Component constructor that initializes the fieldset with icons and component name.\n   * @summary Calls the parent NgxFormDirective constructor with the component name and\n   * required Ionic icons (alertCircleOutline for validation errors and createOutline for add actions).\n   * Sets up the foundational component structure and icon registry.\n   *\n   * @memberOf FieldsetComponent\n   */\n  constructor() {\n    super('FieldsetComponent');\n    addIcons({ alertCircleOutline, addOutline, trashOutline, createOutline });\n  }\n\n  /**\n   * @description Component initialization lifecycle method.\n   * @summary Initializes the component by setting up repository relationships if a model exists,\n   * and configures the initial button label for the add action based on the current locale.\n   * This method ensures proper setup of translation services and component state.\n   *\n   * @returns {void}\n   * @memberOf FieldsetComponent\n   */\n  async ngOnInit(): Promise<void> {\n    if (this.max && this.max === 1) this.multiple = false;\n    this.buttonLabel = this.translateService.instant(this.locale + '.add');\n    this.buttonCancelLabel = this.translateService.instant(this.locale + '.cancel');\n\n    if (!this.multiple) this.ordenable = false;\n\n    if ([OperationKeys.CREATE, OperationKeys.UPDATE].includes(this.operation)) {\n      if (!this.formGroup) {\n        if (this.parentForm instanceof FormGroup) {\n          // iterate on childOf path to get correct formGroup\n          const parts = (this.childOf as string).split('.');\n          let formGroup = this.parentForm as FormParent;\n          for (const part of parts) formGroup = (formGroup as FormGroup).controls[part] as FormParent;\n          this.formGroup = formGroup;\n          if (this.formGroup instanceof FormGroup) this.formGroup = this.formGroup.parent as FormArray;\n        }\n        if (!this.formGroup && this.parentForm instanceof FormArray) this.formGroup = this.parentForm;\n        if (!this.formGroup && (this.children[0] as KeyValue)?.['formGroup'] instanceof FormGroup)\n          this.formGroup = (this.children[0] as KeyValue)?.['formGroup'].parent as FormArray;\n        if (this.formGroup && !(this.formGroup instanceof FormArray))\n          this.formGroup = (this.formGroup as FormParent)?.parent as FormArray;\n      }\n    }\n    if (this.multiple) {\n      this.formGroup?.setErrors(null);\n      this.formGroup?.disable();\n      if (this.required) {\n        // this.collapsable = false;\n        this.activePage = this.getActivePage();\n      }\n    } else {\n      this.activePage = this.getActivePage();\n    }\n\n    if (this.pk) {\n      this.mapper = Object.assign(this.mapper || {}, { [this.pk]: this.pk });\n    }\n    await this.initialize();\n  }\n\n  override async initialize(): Promise<void> {\n    await super.initialize();\n    await this.refresh();\n  }\n\n  /**\n   * @description Initializes the component state after view and child components are rendered.\n   * @summary This lifecycle hook implements intelligent auto-state management based on the current\n   * CRUD operation. For READ and DELETE operations, the fieldset automatically opens to provide\n   * immediate access to information, while CREATE and UPDATE operations keep it closed to maintain\n   * a clean initial interface. The method directly manipulates the DOM to ensure proper accordion\n   * synchronization and triggers change detection to reflect the programmatic state changes.\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant A as Angular Lifecycle\n   *   participant F as FieldsetComponent\n   *   participant D as DOM\n   *   participant C as ChangeDetector\n   *\n   *   A->>F: ngAfterViewInit()\n   *   alt operation is READ or DELETE\n   *     F->>F: Set isOpen = true\n   *     F->>D: Query ion-accordion-group element\n   *     alt accordion element exists\n   *       F->>D: Set value attribute to 'open'\n   *     end\n   *   end\n   *   F->>C: detectChanges()\n   *   C->>F: Update view with new state\n   *\n   * @returns {Promise<void>}\n   * @memberOf FieldsetComponent\n   */\n  override async ngAfterViewInit(): Promise<void> {\n    await super.ngAfterViewInit();\n  }\n\n  override async refresh(operation?: CrudOperationKeys): Promise<void> {\n    if (operation) {\n      this.operation = operation;\n      this.changeDetectorRef.detectChanges();\n    }\n    if (this._data && !this.value?.length) {\n      function resolvePath(obj: KeyValue, path: string) {\n        return path.split('.').reduce((acc, key) => {\n          if (acc && key in acc) {\n            return acc[key];\n          }\n          return false;\n        }, obj);\n      }\n      if (!Array.isArray(this._data)) {\n        this._data = resolvePath(this._data, this.childOf as string);\n      }\n      if (this._data) {\n        const data = this._data || [];\n        if ([OperationKeys.READ, OperationKeys.DELETE].includes(this.operation)) {\n          if (!Array.isArray(data)) this._data = [data];\n          this.items = [\n            ...this._data.map((v: KeyValue) => {\n              return this.children.map((child) => {\n                const { props, tag } = child as KeyValue;\n                return {\n                  tag,\n                  props: {\n                    ...props,\n                    value: v[props.name] || '',\n                  },\n                };\n              });\n            }),\n          ];\n        } else {\n          if (Array.isArray(data)) {\n            this.value = [];\n            data.map((v) => {\n              const formGroup = this.activeFormGroup as FormGroup;\n              if (data.length > (formGroup.parent as FormArray).length)\n                NgxFormService.addGroupToParent(formGroup.parent as FormArray);\n\n              if (!Object.keys(this.mapper).length) this.mapper = this.getMapper(v as KeyValue);\n              Object.entries(v).forEach(([key, value]) => {\n                if (key === this.pk) formGroup.addControl(key, new FormControl({ value: value, disabled: false }));\n                const control = formGroup.get(key);\n                if (control instanceof FormControl) {\n                  control.setValue(value);\n                  control.updateValueAndValidity();\n                  formGroup.updateValueAndValidity();\n                }\n              });\n              this.activeFormGroupIndex = (formGroup.parent as FormArray).length - 1;\n            });\n            this.setValue();\n            // this.changeDetectorRef.detectChanges();\n          }\n          // this.getItems(data as []);\n        }\n      }\n    }\n    // this.refreshing = true;\n    // this.changeDetectorRef.detectChanges();\n    // if ([OperationKeys.READ, OperationKeys.DELETE].includes(this.operation)) {\n    //   // if(!this.multiple) {\n    //   //   this.required = this.collapsable = false;\n    //   // }\n    //   this.items = [\n    //     ...this.value.map((v) => {\n    //       return this.children.map((child) => {\n    //         const { props, tag } = child as KeyValue;\n    //         return {\n    //           tag,\n    //           props: {\n    //             ...props,\n    //             value: v[props.name] || \"\",\n    //           },\n    //         };\n    //       });\n    //     }),\n    //   ] as UIElementMetadata[][];\n    // }\n    // if ([OperationKeys.CREATE, OperationKeys.UPDATE].includes(this.operation)) {\n    //   const value = [...this.value];\n    //   this.value = [];\n    //   value.map((v) => {\n    //     const formGroup = this.activeFormGroup as FormGroup;\n    //     if (value.length > (formGroup.parent as FormArray).length)\n    //       NgxFormService.addGroupToParent(formGroup.parent as FormArray);\n\n    //     if (!Object.keys(this.mapper).length)\n    //       this.mapper = this.getMapper(v as KeyValue);\n    //     Object.entries(v).forEach(([key, value]) => {\n    //       if (key === this.pk)\n    //         formGroup.addControl(\n    //           key,\n    //           new FormControl({ value: value, disabled: false })\n    //         );\n    //       const control = formGroup.get(key);\n    //       if (control instanceof FormControl) {\n    //         control.setValue(value);\n    //         control.updateValueAndValidity();\n    //         formGroup.updateValueAndValidity();\n    //       }\n    //     });\n    //     this.activeFormGroupIndex = (formGroup.parent as FormArray).length - 1;\n    //   });\n    //   this.setValue();\n    //   this.changeDetectorRef.detectChanges();\n    // }\n    // this.refreshing = false;\n    // this.changeDetectorRef.detectChanges();\n  }\n\n  /**\n   * @description Handles removal of the fieldset with slide animation.\n   * @summary Initiates the removal process for the fieldset with a smooth slide-up animation.\n   * The method applies CSS classes for the slide animation and then safely removes the\n   * element from the DOM using Renderer2. This provides a polished user experience\n   * when removing fieldset instances from dynamic forms.\n   *\n   * @param {Event} event - DOM event from the remove button click\n   * @returns {void}\n   * @memberOf FieldsetComponent\n   */\n  handleClear(event?: Event): void {\n    if (event) event.stopImmediatePropagation();\n    this.formGroup?.disable();\n    this.isOpen = false;\n    this.items = [];\n    this.value = undefined as unknown as KeyValue[];\n    this.activePage = undefined;\n    this.activeFormGroupIndex = 0;\n    this.changeDetectorRef.detectChanges();\n  }\n\n  /**\n   * @description Handles creating new items or triggering group addition events.\n   * @summary Processes form validation events for item creation or emits events to trigger\n   * the addition of new fieldset groups. When called with validation event data, it validates\n   * uniqueness and adds the item to the fieldset. When called without parameters, it triggers\n   * a group addition event for parent components to handle.\n   *\n   * @param {CustomEvent<IFieldSetValidationEvent>} [event] - Optional validation event containing form data\n   * @returns {Promise<void>}\n   * @memberOf FieldsetComponent\n   *\n   * @example\n   * ```typescript\n   * // Called from form validation\n   * handleCreateItem(validationEvent);\n   *\n   * // Called to trigger group addition\n   * handleCreateItem();\n   * ```\n   */\n  async handleCreateItem(event?: CustomEvent<IFieldSetValidationEvent>): Promise<void | boolean> {\n    if (event && event instanceof CustomEvent) event.stopImmediatePropagation();\n    if (!this.activePage) {\n      this.activePage = this.getActivePage();\n      if (this.operation === OperationKeys.UPDATE) return this.handleCreateItem(event);\n      return;\n    }\n    const formGroup = this.activeFormGroup as FormGroup;\n    const value = formGroup.value;\n    const hasSomeValue = this.hasValue(value);\n    if (hasSomeValue) {\n      const action = this.updatingItem ? OperationKeys.UPDATE : OperationKeys.CREATE;\n      const isValid = NgxFormService.validateFields(formGroup);\n\n      // must pass correct pk here\n      const isUnique = NgxFormService.isUniqueOnGroup(\n        formGroup,\n        action,\n        action === OperationKeys.UPDATE ? this.updatingItem?.index : undefined\n      );\n      if (isValid) {\n        this.mapper = this.getMapper(value as KeyValue);\n        if (isUnique) {\n          this.isUniqueError = this.updatingItem = undefined;\n          this.setValue();\n          if (!this.max || (formGroup.parent as FormArray)?.length < this.max) {\n            NgxFormService.addGroupToParent(formGroup.parent as FormArray);\n            this.activeFormGroupIndex = (formGroup.parent as FormArray).length - 1;\n            this.activePage = this.getActivePage();\n          }\n        } else {\n          this.isUniqueError =\n            typeof value === ReservedModels.OBJECT.name.toLowerCase()\n              ? (value as KeyValue)?.[this.pk] || undefined\n              : value;\n        }\n      }\n    }\n  }\n\n  hasValue(value: KeyValue = {}): boolean {\n    return Object.keys(value).some((key) => value[key] !== null && value[key] !== undefined && value[key] !== '');\n  }\n\n  handleUpdateItem(index: number): void {\n    const formGroup = this.getFormArrayIndex(index);\n    if (formGroup) {\n      this.updatingItem = Object.assign({}, formGroup.value || {}, { index });\n      this.activeFormGroupIndex = index;\n      this.activePage = this.getActivePage();\n    }\n  }\n\n  /**\n   * @description Cancels the update mode and resets the UI state.\n   * @summary Exits the update mode by resetting the button label and clearing the updating item,\n   * restoring the component to its default state for adding new items. Notifies parent components\n   * that the update operation has been cancelled.\n   *\n   * @returns {void}\n   * @memberOf FieldsetComponent\n   */\n  handleCancelUpdateItem(): void {\n    this.buttonLabel = this.translateService.instant(this.locale + '.add');\n    this.updatingItem = undefined;\n    this.activeFormGroupIndex = (this.formGroup as FormArray)?.length - 1;\n    this.getFormArrayIndex(this.activeFormGroupIndex);\n  }\n\n  /**\n   * @description Handles item removal operations with form array management.\n   * @summary Processes item removal by either handling validation events or removing specific\n   * items from the form array. When called with a validation event, it triggers value updates.\n   * When called with an identifier, it locates and removes the matching item from the form array.\n   *\n   * @param {number} index - The identifier of the item to remove\n   * @returns {void}\n   * @memberOf FieldsetComponent\n   */\n  async handleRemoveItem(\n    index: number,\n    confirmed: boolean = false,\n    value: KeyValue | undefined = undefined\n  ): Promise<void> {\n    const repository = this._repository;\n    const formArray = this.formGroup as FormArray;\n    if (!value) {\n      value = this.value?.length ? formArray?.at(index)?.value || {} : this.items[index];\n    }\n    // only ask for confirmation for items already saved in the repository\n    if (repository && !confirmed && value?.[this.pk] !== undefined) {\n      const item = await this.translate(this.title);\n      const modal = await presentModalConfirm(\n        {\n          data: {\n            item,\n            pk: this.pk,\n            uid: value[this.pk],\n          },\n        },\n        ActionRoles.delete,\n        this.injector\n      );\n      await modal.present();\n      const { role } = await modal.onDidDismiss();\n      if (role === ActionRoles.confirm) return this.handleRemoveItem(index, true, value);\n      return;\n    }\n    this.items = this.items.filter((_, i) => i !== index);\n\n    if (this.value.length) {\n      if (formArray.length === 1) {\n        const currentGroup = formArray.at(0) as FormGroup;\n        Object.keys(currentGroup?.controls).forEach((controlName) => {\n          currentGroup.get(controlName)?.setValue(undefined);\n        });\n      } else {\n        formArray.removeAt(index);\n      }\n      this.setValue();\n    }\n    if (repository && value?.[this.pk] !== undefined) {\n      this.handleEmitEvent(value || {}, OperationKeys.DELETE);\n    }\n    if (this.items.length > 0) {\n      if (this.activeFormGroupIndex > 0) this.activeFormGroupIndex = this.activeFormGroupIndex - 1;\n    } else {\n      this.handleClear();\n    }\n  }\n\n  /**\n   * @description Handles reordering of items within the fieldset list.\n   * @summary Processes drag-and-drop reorder events from the ion-reorder-group component.\n   * Updates both the display items array and the underlying value array to maintain\n   * consistency between UI state and data state. Preserves item indices after reordering.\n   *\n   * @param {CustomEvent<ItemReorderEventDetail>} event - Ionic reorder event containing source and target indices\n   * @returns {void}\n   * @memberOf FieldsetComponent\n   *\n   * @example\n   * ```html\n   * <ion-reorder-group (ionItemReorder)=\"handleReorder($event)\">\n   *   <!-- Reorderable items -->\n   * </ion-reorder-group>\n   * ```\n   */\n  handleReorderItems(event: CustomEvent<ItemReorderEventDetail>): void {\n    const fromIndex = event.detail.from;\n    const toIndex = event.detail.to;\n\n    const items = [...this.items]; // visual data\n    const formArray = this.formGroup as FormArray; // FormArray\n\n    if (fromIndex !== toIndex) {\n      this.items = [];\n      // reorder visual data\n      const itemToMove = items.splice(fromIndex, 1)[0];\n      items.splice(toIndex, 0, itemToMove);\n      items.forEach((item, index) => ((item as IFieldSetItem)['index'] = index + 1));\n\n      // reorder FormArray controls\n      const controlToMove = formArray.at(fromIndex);\n      formArray.removeAt(fromIndex);\n      formArray.insert(toIndex, controlToMove);\n    }\n    this.items = [...(items as IFieldSetItem[])];\n    event.detail.complete();\n  }\n\n  /**\n   * @description Handles accordion state change events from user interactions.\n   * @summary Processes CustomEvent objects triggered when users expand or collapse the accordion.\n   * This method extracts the new state from the event details and updates the component's\n   * internal state accordingly. It specifically listens for ION-ACCORDION-GROUP events to\n   * ensure proper event source validation and prevent handling of unrelated events.\n   *\n   * @param {CustomEvent} event - The event object containing accordion state change details\n   * @returns {void}\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant U as User\n   *   participant I as Ion-Accordion\n   *   participant F as FieldsetComponent\n   *\n   *   U->>I: Click accordion header\n   *   I->>F: handleChange(CustomEvent)\n   *   F->>F: Extract target and detail from event\n   *   F->>F: Validate target is ION-ACCORDION-GROUP\n   *   alt valid target\n   *     F->>F: Update isOpen = !!value\n   *   end\n   *   F->>I: Reflect updated state\n   *\n   * @memberOf FieldsetComponent\n   */\n\n  handleEmitEvent(value: KeyValue, operation: CrudOperations): void {\n    if (this._repository && this.operation === OperationKeys.UPDATE && value[this.pk] !== undefined) {\n      this.listenEvent.emit({\n        name: ComponentEventNames.Submit,\n        role: operation,\n        component: this.componentName,\n        handler: this.handlers[ComponentEventNames.Submit] || undefined,\n        data: value,\n        context: {\n          repository: this._repository as DecafRepository<Model>,\n          modelName: this.name as string,\n        },\n      });\n    }\n  }\n\n  /**\n   * @description Handles validation error events from child form fields.\n   * @summary Processes validation error events dispatched by form fields within the fieldset.\n   * When errors are detected, the accordion is forced open and prevented from collapsing\n   * to ensure users can see the validation messages. This method updates the component's\n   * error state and accordion visibility accordingly.\n   *\n   * @param {CustomEvent} event - Custom event containing validation error details\n   * @returns {UIModelMetadata[] | undefined}\n   * @memberOf FieldsetComponent\n   */\n  // handleValidationError(event: CustomEvent): void {\n  //   event.stopImmediatePropagation();\n  //   const {hasErrors} = event.detail;\n  //   this.isOpen = this.hasValidationErrors = hasErrors;\n  //   if (hasErrors)\n  //     this.accordionComponent.value = 'open';\n  // }\n\n  protected override getActivePage(): UIModelMetadata[] | undefined {\n    this.activePage = undefined;\n    this.isOpen = true;\n    this.changeDetectorRef.detectChanges();\n    this.timerSubscription = timer(10).subscribe(() => {\n      this.children = this.children.map((child) => {\n        if (!child.props) child.props = {};\n        child.props = Object.assign(child.props, {\n          activeFormGroup: this.activeFormGroupIndex,\n          multiple: this.multiple,\n        });\n        return child;\n      });\n    });\n    if (this.multiple && [OperationKeys.CREATE, OperationKeys.UPDATE].includes(this.operation))\n      this.getFormArrayIndex(this.activeFormGroupIndex);\n    return this.children as UIModelMetadata[];\n  }\n\n  /**\n   * @description Processes and stores a new or updated value in the fieldset.\n   * @summary Handles both create and update operations for fieldset items. Parses and cleans\n   * the input value, determines the operation type based on the updating state, and either\n   * adds a new item or updates an existing one. Maintains data integrity and UI consistency.\n   *\n   * @returns {void}\n   * @private\n   * @memberOf FieldsetComponent\n   */\n  protected setValue(): void {\n    const formGroup = this.formGroup as FormArray;\n    if (formGroup?.length) {\n      const value = formGroup.controls.map(({ value }) => value).filter((v) => this.hasValue(v));\n      this.value = value;\n      this.getItems(value);\n    }\n    this.updatingItem = undefined;\n  }\n\n  private getItems(value: KeyValue[]): void {\n    if (value) {\n      if (!Array.isArray(value)) {\n        value = [value];\n      }\n      this.items = [\n        ...value\n\n          .filter((v) => {\n            // return `${v[this.pk] || \"\"}`.trim().length;\n            return Object.entries(v).some(([k, v]) => k !== 'index' && v !== undefined && String(v).trim().length);\n          })\n          .map((v, index) => {\n            const item = {\n              ...itemMapper(Object.assign({}, v), this.mapper, {\n                [this.pk]: this.pk || undefined,\n              }),\n            };\n            index = v?.['index'] > 1 ? v?.['index'] : index + 1;\n            return {\n              ...item,\n              index,\n            } as IFieldSetItem;\n          }),\n      ];\n    }\n  }\n\n  /**\n   * @description Automatically configures the field mapping based on the value structure.\n   * @summary Analyzes the provided value object to automatically determine the primary key\n   * and create appropriate field mappings for display purposes. Sets up the mapper object\n   * with title, description, and index fields based on the available data structure.\n   *\n   * @param {KeyValue} value - Sample value object used to determine field mappings\n   * @returns {KeyValue} The configured mapper object\n   * @private\n   * @memberOf FieldsetComponent\n   */\n  private getMapper(value: KeyValue): KeyValue {\n    if (!this.pk) this.pk = Object.keys(value)[0];\n    if (!Object.keys(this.mapper).length) (this.mapper as KeyValue)['title'] = this.pk;\n    (this.mapper as KeyValue)['index'] = 'index';\n    for (const key in value) {\n      if (Object.keys(this.mapper).length >= 2 || Object.keys(this.mapper).length === Object.keys(value).length) break;\n      if (!(this.mapper as KeyValue)['title']) {\n        (this.mapper as KeyValue)['title'] = key;\n      } else {\n        (this.mapper as KeyValue)['description'] = key;\n      }\n    }\n    return this.mapper;\n  }\n}\n","@if (['create', 'update'].includes(operation) || !multiple) {\n  <div\n    [attr.role]=\"['create', 'update'].includes(operation) ? 'group' : 'region'\"\n    [class]=\"'dcf-fieldset-component ' + operation\"\n    [class.dcf-blank]=\"!borders\"\n    [class.dcf-empty]=\"!items?.length\"\n    [class.dcf-open]=\"isOpen\"\n    [id]=\"name?.toLowerCase() + '-fieldset'\"\n    #component\n  >\n    <div class=\"dcf-width-1-1\">\n      <div>\n        <div\n          class=\"dcf-grid dcf-grid-collapse dcf-flex dcf-flex-middle dcf-width-1-1\"\n        >\n          <div class=\"dcf-width-expand\">\n            <legend>{{ (title ? title : name) | translate }}</legend>\n          </div>\n          @if (!isRequired && ['create'].includes(operation) && multiple) {\n            <div class=\"dcf-width-auto dcf-delete\">\n              <ion-button\n                fill=\"clear\"\n                size=\"small\"\n                (click)=\"handleClear($event)\"\n                [class.dcf-invisible]=\"!isOpen\"\n                [attr.aria-label]=\"\n                  (items?.length\n                    ? locale + '.clear_items'\n                    : locale + '.hidden_form'\n                  ) | translate\n                \"\n              >\n                <ngx-decaf-icon\n                  slot=\"icon-only\"\n                  [name]=\"'ti-' + (items?.length ? 'trash' : 'eye-off')\"\n                />\n              </ion-button>\n            </div>\n          }\n        </div>\n      </div>\n      <div\n        class=\"dcf-fieldset-content\"\n        [class.dcf-empty]=\"!items?.length && !isOpen\"\n        slot=\"content\"\n      >\n        @if (activePage) {\n          <div\n            class=\"dcf-animation dcf-animation-slide-top-small dcf-animation-fast\"\n            [class.dcf-disabled]=\"!activePage\"\n          >\n            <ngx-decaf-layout\n              [isModalChild]=\"isModalChild\"\n              [className]=\"''\"\n              [flexMode]=\"props.flexMode ?? false\"\n              [match]=\"false\"\n              [gap]=\"'small'\"\n              [pk]=\"pk\"\n              [modelId]=\"modelId\"\n              [operation]=\"operation\"\n              [children]=\"activePage || []\"\n              [parentForm]=\"formGroup || parentForm\"\n              [rows]=\"rows\"\n              [cols]=\"cols\"\n              [borders]=\"activePage?.borders ?? false\"\n              [breakpoint]=\"breakpoint ?? 'large'\"\n              [hidden]=\"items.length === max && !updatingItem\"\n            />\n          </div>\n        }\n\n        @if (multiple && ['create', 'update'].includes(operation)) {\n          @if (multiple && items.length) {\n            <ion-list class=\"dcf-fields-list\">\n              <ion-reorder-group\n                [formGroup]=\"formGroup.parent\"\n                [disabled]=\"updatingItem\"\n                (ionItemReorder)=\"handleReorderItems($any($event))\"\n                #accordionComponent\n              >\n                @for (\n                  item of items;\n                  track trackItemFn(item.index, item.title)\n                ) {\n                  <ion-item\n                    [class.not-unique]=\"\n                      isUniqueError && item.title === isUniqueError\n                    \"\n                    [class.updating]=\"\n                      updatingItem?.['index'] === item.index - 1\n                    \"\n                    lines=\"full\"\n                    [button]=\"false\"\n                    [title]=\"item?.[pk] ?? pk + ': ' + item[pk]\"\n                  >\n                    @if (ordenable) {\n                      @if (items?.length > 1 && !updatingItem) {\n                        <ion-reorder slot=\"start\">\n                          <ion-icon\n                            aria-hidden=\"true\"\n                            name=\"swap-vertical-outline\"\n                          ></ion-icon>\n                        </ion-reorder>\n                      } @else {\n                        <div slot=\"start\">\n                          <ion-icon\n                            aria-hidden=\"true\"\n                            class=\"dcf-reorder-disabled\"\n                            size=\"small\"\n                            name=\"swap-vertical-outline\"\n                            disabled\n                          ></ion-icon>\n                        </div>\n                      }\n                    }\n\n                    <ion-label\n                      [color]=\"\n                        item.title === isUniqueError &&\n                        !updatingItem?.[pk] === item.title\n                          ? 'danger'\n                          : ''\n                      \"\n                    >\n                      {{ item.index }}.{{ item.title }}\n                      <!-- @if (ordenable) {\n                        {{ item.index }}.{{ item.title }}\n                      } @else {\n                        @if (item[pk]) {\n                          {{ pk }}: {{ item[pk] }} -\n                        }\n                        {{ item.title }}\n                      } -->\n                      @if (item.description?.length > 0) {\n                        <br />\n                        <ion-text class=\"dcf-subtitle\">\n                          {{ item.description }}\n                        </ion-text>\n                      }\n                    </ion-label>\n                    @if (item.info?.length || item.subinfo?.length) {\n                      <ion-note slot=\"end\">\n                        @if (item.info?.length) {\n                          {{ item.info }}\n                          <br />\n                        }\n                        @if (item.subinfo) {\n                          {{ item.subinfo }}\n                        }\n                      </ion-note>\n                    }\n                    <div slot=\"end\">\n                      @if (editable) {\n                        @if (\n                          !updatingItem || updatingItem?.[pk] !== item.title\n                        ) {\n                          <ion-button\n                            fill=\"clear\"\n                            size=\"small\"\n                            (click)=\"handleUpdateItem($index)\"\n                            [attr.aria-label]=\"\n                              locale + '.edit_item' | translate\n                            \"\n                          >\n                            <ngx-decaf-icon\n                              slot=\"icon-only\"\n                              size=\"small\"\n                              name=\"ti-cash-edit\"\n                              [color]=\"!isDarkMode ? 'dark' : 'light'\"\n                            ></ngx-decaf-icon>\n                          </ion-button>\n                        }\n                      }\n                      @if (!updatingItem) {\n                        <ion-button\n                          fill=\"clear\"\n                          size=\"small\"\n                          color=\"danger\"\n                          (click)=\"handleRemoveItem($index)\"\n                          [attr.aria-label]=\"\n                            locale + '.remove_item' | translate\n                          \"\n                        >\n                          <ngx-decaf-icon\n                            slot=\"icon-only\"\n                            size=\"small\"\n                            name=\"ti-row-remove\"\n                            [color]=\"!isDarkMode ? 'dark' : 'light'\"\n                          />\n                        </ion-button>\n                      }\n                    </div>\n                  </ion-item>\n                }\n              </ion-reorder-group>\n            </ion-list>\n          }\n\n          @if (isUniqueError) {\n            <div\n              class=\"dcf-not-unique-container dcf-animation dcf-animation-bottom-small dcf-animation-fast\"\n            >\n              <div class=\"dcf-grid dcf-grid-collapse dcf-width-1-1\">\n                <div\n                  class=\"dcf-auto\"\n                  [attr.style]=\"'max-width: 50px'\"\n                >\n                  <ion-icon\n                    aria-hidden=\"true\"\n                    name=\"alert-circle-outline\"\n                  ></ion-icon>\n                </div>\n                <div class=\"dcf-width-expand\">\n                  <ion-text\n                    color=\"danger\"\n                    class=\"dcf-text-small\"\n                  >\n                    {{\n                      locale + '.not_unique'\n                        | translate: { value: isUniqueError }\n                    }}\n                  </ion-text>\n                </div>\n              </div>\n            </div>\n          }\n\n          @if (max) {\n            <div class=\"dcf-width-1-1 dcf-max-message-container\">\n              <ion-text\n                class=\"dcf-text-small\"\n                [color]=\"\n                  items.length !== max\n                    ? !isDarkMode\n                      ? 'medium'\n                      : ''\n                    : 'primary'\n                \"\n              >\n                {{\n                  locale +\n                    (items.length !== max ? '.max_items' : '.max_items_reached')\n                    | translate: { '0': max }\n                }}\n              </ion-text>\n            </div>\n          }\n\n          <div class=\"dcf-grid dcf-grid-small dcf-flex dcf-buttons-container\">\n            @if (updatingItem) {\n              <div>\n                <ion-button\n                  size=\"small\"\n                  fill=\"clear\"\n                  color=\"danger\"\n                  (click)=\"handleCancelUpdateItem()\"\n                  [attr.aria-label]=\"locale + '.cancel_update' | translate\"\n                >\n                  {{ locale + '.cancel' | translate }}\n                </ion-button>\n              </div>\n              <div>\n                <ion-button\n                  size=\"small\"\n                  fill=\"clear\"\n                  (click)=\"handleCreateItem()\"\n                  [attr.aria-label]=\"locale + '.update_item' | translate\"\n                >\n                  <ion-icon\n                    aria-hidden=\"true\"\n                    name=\"refresh-outline\"\n                    slot=\"start\"\n                  ></ion-icon>\n                  {{ locale + '.update_item' | translate }}\n                </ion-button>\n              </div>\n            } @else {\n              @if (items.length < max || !max) {\n                <div>\n                  <ion-button\n                    size=\"small\"\n                    fill=\"clear\"\n                    class=\"dcf-button-add\"\n                    [color]=\"isDarkMode ? 'light' : 'dark'\"\n                    (click)=\"handleCreateItem()\"\n                    [attr.aria-label]=\"locale + '.create_item' | translate\"\n                  >\n                    <!-- <ion-icon aria-hidden=\"true\" name=\"add-outline\" slot=\"start\"></ion-icon> -->\n                    <ngx-decaf-icon\n                      slot=\"icon-only\"\n                      name=\"ti-code-plus\"\n                      slot=\"start\"\n                    />\n                    {{\n                      locale +\n                        (required\n                          ? items.length\n                            ? '.add'\n                            : '.add_first'\n                          : items.length\n                            ? '.add'\n                            : isOpen\n                              ? '.add_first'\n                              : '.show_form') | translate\n                    }}\n                  </ion-button>\n                </div>\n              }\n            }\n          </div>\n        }\n      </div>\n    </div>\n  </div>\n} @else {\n  @if (refreshing) {\n    <div class=\"dcf-loading-container\">\n      <ion-spinner\n        name=\"crescent\"\n        color=\"primary\"\n      ></ion-spinner>\n    </div>\n  } @else {\n    <legend>{{ (title ? title : name) | translate }}</legend>\n    @if (!items.length) {\n      <div class=\"dcf-padding-xsmall\">\n        <ion-text>{{ locale + '.empty' | translate }}</ion-text>\n      </div>\n    } @else {\n      @for (item of items; track trackItemFn($index, item)) {\n        <div\n          class=\"dcf-fieldset-read-item\"\n          [class.dcf-accordion]=\"multiple\"\n        >\n          <div>\n            <ngx-decaf-layout\n              [isModalChild]=\"isModalChild\"\n              [className]=\"operation\"\n              [accordion]=\"multiple\"\n              [operation]=\"operation\"\n              [pk]=\"pk\"\n              [model]=\"model\"\n              [modelId]=\"modelId\"\n              [flexMode]=\"item?.props?.flexMode ?? false\"\n              [match]=\"false\"\n              [gap]=\"'collapse'\"\n              [children]=\"item || []\"\n              [rows]=\"rows\"\n              [cols]=\"cols\"\n              [borders]=\"item?.props?.borders ?? false\"\n              [breakpoint]=\"breakpoint ?? 'large'\"\n            />\n          </div>\n        </div>\n      }\n    }\n  }\n}\n","import { CommonModule } from '@angular/common';\nimport { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild } from '@angular/core';\nimport { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';\nimport { ComponentEventNames, ElementSizes, HTML5InputTypes } from '@decaf-ts/ui-decorators';\nimport { IonButton, IonItem, IonLabel, IonList, IonText } from '@ionic/angular/standalone';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { InputComponentErrors } from '../../engine/constants';\nimport { Dynamic } from '../../engine/decorators';\nimport { IBaseCustomEvent, IFileUploadError } from '../../engine/interfaces';\nimport { NgxFormFieldDirective } from '../../engine/NgxFormFieldDirective';\nimport { ElementSize, FlexPosition, FunctionLike, KeyValue, PossibleInputTypes } from '../../engine/types';\nimport { CardComponent } from '../card/card.component';\nimport { IconComponent } from '../icon/icon.component';\nimport { presentNgxInlineModal, presentNgxLightBoxModal } from '../modal/modal.component';\n\n/**\n * @description File upload component for Angular applications.\n * @summary This component provides a user interface for uploading files with support for drag-and-drop,\n * file validation, and preview functionality. It integrates seamlessly with Angular reactive forms\n * and supports multiple file uploads, directory mode, and custom file size limits.\n *\n * @class FileUploadComponent\n * @example\n * ```typescript\n * <ngx-decaf-file-upload [formGroup]=\"formGroup\" [name]=\"'fileInput'\" [multiple]=\"true\"></ngx-decaf-file-upload>\n * ```\n * @mermaid\n * sequenceDiagram\n *   participant User\n *   participant FileUploadComponent\n *   User->>FileUploadComponent: Select or drag files\n *   FileUploadComponent->>FileUploadComponent: Validate files\n *   FileUploadComponent->>FileUploadComponent: Emit change event\n *   User->>FileUploadComponent: Remove file\n *   FileUploadComponent->>FileUploadComponent: Update file list\n */\n@Dynamic()\n@Component({\n  selector: 'ngx-decaf-file-upload',\n  templateUrl: './file-upload.component.html',\n  styleUrls: ['./file-upload.component.scss'],\n  standalone: true,\n  imports: [\n    CommonModule,\n    ReactiveFormsModule,\n    CardComponent,\n    IonText,\n    IconComponent,\n    IonList,\n    IonLabel,\n    IonItem,\n    TranslatePipe,\n    IonButton,\n  ],\n})\nexport class FileUploadComponent extends NgxFormFieldDirective implements OnInit, OnDestroy {\n  @ViewChild('component', { static: true })\n  override component!: ElementRef<HTMLInputElement>;\n\n  /**\n   * @description Parent form group.\n   * @summary References the parent form group to which this field belongs.\n   * This is necessary for integrating the field with Angular's reactive forms.\n   *\n   * @type {FormGroup}\n   */\n  @Input()\n  override formGroup: FormGroup | undefined;\n\n  /**\n   * @summary The flat field name used as the form control identifier in immediate parent FormGroup.\n   * @description Specifies the name of the field, which is used as the FormControl identifier in immediate parent FormGroup.\n   * This value must be unique within the immediate parent FormGroup context and should not contain dots or nesting.\n   *\n   * @type {string}\n   */\n  @Input()\n  override name!: string;\n\n  /**\n   * @description Angular FormControl instance for this field.\n   * @summary The specific FormControl instance that manages this field's state, validation,\n   * and value. This provides direct access to Angular's reactive forms functionality\n   * for this individual field within the broader form structure.\n   *\n   * @type {FormControl}\n   */\n  @Input()\n  override formControl!: FormControl;\n\n  /**\n   * @description Whether the field is required.\n   * @summary When true, the field must have a value for the form to be valid.\n   * Required fields are typically marked with an indicator in the UI.\n   *\n   * @type {boolean}\n   */\n  @Input()\n  override required?: boolean;\n\n  /**\n   * @description Allows multiple file selection.\n   * @summary When true, the user can select multiple files for upload.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  @Input()\n  override multiple: boolean = false;\n\n  /**\n   * @description Specifies the input type for the file upload field.\n   * @summary Defines the type of input element used for file uploads, such as file or directory.\n   *\n   * @type {PossibleInputTypes}\n   * @default HTML5InputTypes.FILE\n   */\n  @Input()\n  override type: PossibleInputTypes = HTML5InputTypes.FILE;\n\n  /**\n   * @description Specifies the value type for the file upload.\n   * @summary Determines the format in which the uploaded file's value is returned.\n   * Options include 'base64' for base64-encoded strings or 'files' for File objects.\n   *\n   * @type {'base64' | 'files'}\n   * @default 'base64'\n   */\n  @Input()\n  valueType: 'base64' | 'files' = 'base64';\n\n  /**\n   * @description Label for the upload button.\n   * @summary Specifies the text displayed on the file upload button.\n   *\n   * @type {string | undefined}\n   */\n  @Input()\n  buttonLabel?: string;\n\n  /**\n   * @description Size of the file upload component.\n   * @summary Determines the visual size of the file upload component, such as large, small, or default.\n   *\n   * @type {Extract<ElementSize, 'large' | 'small' | 'default'>}\n   * @default ElementSizes.large\n   */\n  @Input()\n  size: Extract<ElementSize, 'large' | 'small' | 'default'> = ElementSizes.large;\n\n  /**\n   * @description Flex positioning of the container's content.\n   * @summary Controls how child elements are positioned within the container when flex layout\n   * is enabled. Options include 'center', 'top', 'bottom', 'left', 'right', and combinations\n   * like 'top-left'. This property is only applied when the flex property is true.\n   *\n   * @type {FlexPosition}\n   * @default 'center'\n   */\n  @Input()\n  position: FlexPosition = 'center';\n\n  /**\n   * @description Accepted file types for upload.\n   * @summary Specifies the file types that are allowed for upload, such as images or documents.\n   *\n   * @type {string | string[]}\n   * @default ['image/*']\n   */\n  @Input()\n  accept: string | string[] = ['image/*'];\n\n  /**\n   * @description Whether to show an icon in the file upload field.\n   * @summary When true, an icon is displayed alongside the file upload input.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  @Input()\n  showIcon: boolean = true;\n\n  /**\n   * @description Enables directory mode for file uploads.\n   * @summary When true, the user can upload entire directories instead of individual files.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  @Input()\n  enableDirectoryMode: boolean = false;\n\n  /**\n   * @description Custom handler used to preview the selected file.\n   * @summary Allows callers to override the default preview behavior with a function-like callback.\n   *\n   * @type {FunctionLike | undefined}\n   */\n  @Input()\n  previewHandler?: FunctionLike;\n\n  /**\n   * @description Maximum file size allowed for upload.\n   * @summary Specifies the maximum size (in MB) for files that can be uploaded.\n   *\n   * @type {number}\n   * @default 1\n   */\n  @Input()\n  maxFileSize: number = 1;\n\n  /**\n   * @description Event emitted when the file upload field changes.\n   * @summary Emits an event containing details about the change in the file upload field.\n   *\n   * @type {EventEmitter<IBaseCustomEvent>}\n   */\n  @Output()\n  changeEvent: EventEmitter<IBaseCustomEvent> = new EventEmitter<IBaseCustomEvent>();\n\n  /**\n   * @description Preview of the first file in the upload list.\n   * @summary Stores the data URL of the first file in the upload list for preview purposes.\n   * This is typically used to display a thumbnail or preview image.\n   *\n   * @type {string | undefined}\n   */\n  previewFile: string | undefined = undefined;\n\n  /**\n   * @description List of files selected for upload.\n   * @summary Contains the files selected by the user for upload. This array is updated\n   * whenever files are added or removed from the upload list.\n   *\n   * @type {File[]}\n   */\n  files: File[] | KeyValue[] = [];\n\n  /**\n   * @description List of errors encountered during file validation.\n   * @summary Stores validation errors for files that do not meet the specified criteria,\n   * such as file type or size restrictions. Each error includes the file name, size, and error message.\n   *\n   * @type {IFileUploadError[]}\n   */\n  errors: IFileUploadError[] = [];\n\n  /**\n   * @description Indicates whether a drag operation is in progress.\n   * @summary This flag is set to true when a file is being dragged over the upload area.\n   * It is used to provide visual feedback to the user during drag-and-drop operations.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  dragging: boolean = false;\n\n  /**\n   * @description Counter for drag events.\n   * @summary Tracks the number of drag events to ensure proper handling of drag-and-drop\n   * operations. The counter is incremented on drag enter and decremented on drag leave.\n   *\n   * @type {number}\n   * @default 0\n   */\n  private dragCounter: number = 0;\n\n  /**\n   * @description Specifies the subtype of the file upload.\n   * @summary Lock subtype to 'text' to ensure that the value is processed as a JSON string containing data URLs or Files.\n   * This property will be used to avoid validation errors and to determine how the value is processed and emitted.\n   *\n   * @type {string}\n   * @default 'text'\n   */\n  @Input()\n  subType: string = 'text';\n\n  /**\n   * @description Creates a new file upload component instance.\n   * @summary Initializes the parent field directive and clears any previous selection state.\n   */\n  constructor() {\n    super('FileUploadComponent');\n    this.handleClear();\n  }\n\n  /**\n   * @description Lifecycle hook that is called after Angular has initialized all data-bound properties of a directive.\n   * @summary Sets up the component by enabling directory mode if specified, formatting the accepted file types,\n   * and converting the maximum file size from megabytes to bytes.\n   *\n   * @returns {Promise<void>}\n   */\n  async ngOnInit(): Promise<void> {\n    if (this.enableDirectoryMode) {\n      this.multiple = true;\n    }\n    if (Array.isArray(this.accept)) {\n      this.accept = this.accept.join(',');\n    }\n    // Convert maxFileSize from MB to bytes\n    this.maxFileSize = this.maxFileSize * 1024 * 1024;\n    await this.initialize();\n  }\n\n  /**\n   * @description Initializes the component value state after the base directive is ready.\n   * @summary Restores any serialized value back into files and preview data after the parent initialization completes.\n   *\n   * @returns {Promise<void>} - A promise that resolves when initialization is complete.\n   */\n  override async initialize(): Promise<void> {\n    await super.initialize();\n    await this.parseValue(true);\n  }\n\n  /**\n   * @description Lifecycle hook that is called when a directive, pipe, or service is destroyed.\n   * @summary Cleans up the component by calling the parent ngOnDestroy method and clearing the file upload state.\n   *\n   * @returns {Promise<void>}\n   */\n  override async ngOnDestroy(): Promise<void> {\n    await super.ngOnDestroy();\n    this.handleClear();\n  }\n\n  /**\n   * @description Handles the click event to trigger file selection.\n   * @summary Simulates a click on the hidden file input element to open the file selection dialog.\n   * This method is used to allow users to select files programmatically.\n   *\n   * @returns {void}\n   */\n  async handleClickToSelect(): Promise<void> {\n    const element = this.component.nativeElement;\n    if (element) {\n      (element.querySelector('#dcf-file-input') as HTMLButtonElement)?.click();\n    }\n  }\n\n  /**\n   * @description Handles the file selection event.\n   * @summary Processes the files selected by the user, validates them, and updates the file list.\n   * This method is triggered when the user selects files using the file input element.\n   *\n   * @param {Event} event - The file selection event.\n   * @returns {Promise<void> }\n   */\n  async handleSelection(event: Event): Promise<void> {\n    this.clearErrors();\n    const input = event.target as HTMLInputElement;\n    if (input.files) {\n      const fileList = Array.from(input.files);\n      this.handleSelectionConfirm(fileList);\n      input.value = '';\n    }\n  }\n\n  /**\n   * @description Handles the drop event for drag-and-drop file uploads.\n   * @summary Processes the files dropped by the user, validates them, and updates the file list.\n   * This method is triggered when the user drops files onto the upload area.\n   *\n   * @param {DragEvent} event - The drag-and-drop event.\n   * @returns {void}\n   */\n  handleDrop(event: DragEvent): void {\n    event.preventDefault();\n    event.stopPropagation();\n    this.dragCounter = 0;\n    this.dragging = false;\n    this.clearErrors();\n    if (!event.dataTransfer) return;\n    const fileList = Array.from(event.dataTransfer.files);\n    this.handleSelectionConfirm(fileList);\n  }\n\n  /**\n   * @description Handles the drag over event for drag-and-drop file uploads.\n   * @summary Sets the dragging flag to true to provide visual feedback during drag-and-drop operations.\n   * This method is triggered when the user drags files over the upload area.\n   *\n   * @param {DragEvent} event - The drag over event.\n   * @returns {void}\n   */\n  handleDragOver(event: DragEvent): void {\n    event.preventDefault();\n    event.stopPropagation();\n    this.dragging = true;\n  }\n\n  /**\n   * @description Handles the drag leave event for drag-and-drop file uploads.\n   * @summary Decrements the drag counter and clears the dragging flag when the counter reaches zero.\n   * This method is triggered when the user drags files out of the upload area.\n   *\n   * @param {DragEvent} event - The drag leave event.\n   * @returns {void}\n   */\n  handleDragLeave(event: DragEvent): void {\n    event.preventDefault();\n    event.stopPropagation();\n    this.dragCounter = Math.max(0, this.dragCounter - 1);\n    if (this.dragCounter === 0) {\n      this.dragging = false;\n    }\n  }\n\n  /**\n   * @description Clears the file list and validation errors.\n   * @summary Resets the file upload component by clearing the selected files, preview, and errors.\n   * This method is used to reset the component state.\n   *\n   * @returns {void}\n   */\n  handleClear(): void {\n    this.clearErrors();\n    this.previewFile = undefined;\n    if (this.formControl instanceof FormControl) {\n      this.formControl.setValue(null);\n    }\n    this.files = [];\n  }\n\n  /**\n   * @description Confirms the file selection and updates the component state.\n   * @summary Validates each file in the selection, updates the file list, and emits\n   * the change event. If multiple or directory mode is enabled, adds files to the existing list.\n   * Otherwise, replaces the existing files with the new selection.\n   *\n   * @param {File[]} files - The array of files selected by the user.\n   * @returns {Promise<void>}\n   */\n  private async handleSelectionConfirm(files: File[]): Promise<void> {\n    const validFiles: File[] = [];\n    for (const file of files) {\n      const isValid = this.validateFile(file);\n      if (isValid === true) {\n        validFiles.push(file);\n      } else {\n        this.errors.push({\n          name: file.name,\n          error: isValid,\n          size: file.size,\n        });\n      }\n    }\n    if (this.multiple || this.enableDirectoryMode) {\n      this.files = this.files.concat(validFiles);\n    } else {\n      this.files = [validFiles[0]];\n    }\n    if (this.files.length) {\n      this.files = this.files.sort((a, b) => {\n        const aIsImage = a?.['type'].includes('image');\n        const bIsImage = b?.['type'].includes('image');\n        if (aIsImage && !bIsImage) {\n          return 1;\n        }\n        if (!aIsImage && bIsImage) {\n          return -1;\n        }\n        return 0;\n      });\n      this.setValue(await this.parseValue());\n    }\n    await this.getPreview();\n    this.changeEventEmit();\n    this.changeDetectorRef.detectChanges();\n  }\n\n  /**\n   * @description Converts between the component's internal file state and its serialized value.\n   * @summary When `revert` is false, serializes the selected files into the form value. When true, parses\n   * the current value back into the component file list and restores the preview state.\n   *\n   * @param {boolean} [revert=false] - Whether to restore files from the current value instead of serializing them.\n   * @returns {Promise<string | void>} - A serialized value when converting files to a form value, otherwise void.\n   */\n  async parseValue(revert: boolean = false): Promise<string | void> {\n    if (!revert) {\n      const files = this.files as File[];\n      if (files?.length) {\n        if (this.valueType === 'base64') {\n          return JSON.stringify(await this.getDataURLs(files));\n        } else {\n          const data = [];\n          for (const file of files) {\n            const source = await this.getDataURLs(file);\n            data.push({\n              name: file.name,\n              size: file.size,\n              type: file.type,\n              source,\n            });\n          }\n          return JSON.stringify(data);\n        }\n      }\n    }\n    if (this.value) {\n      try {\n        let value;\n        try {\n          value = JSON.parse(this.value as string);\n        } catch (error: unknown) {\n          value = this.value;\n        }\n        const files = Array.isArray(value) ? value : [value];\n        if (files?.length) {\n          this.files = files\n            .map((file) => {\n              if (this.isBase64String(file)) {\n                const mime = this.getFileMime(file)?.split('/') || [];\n                const type = mime?.[0] === 'text' ? mime?.[1] : `${mime?.[0]}/${mime?.[1]}`;\n                return {\n                  name: mime?.[0] || 'file',\n                  type: `${type}` || 'image/*',\n                  source: file as string,\n                } as KeyValue;\n              }\n              return false;\n            })\n            .filter(Boolean) as KeyValue[];\n\n          this.getPreview();\n        }\n      } catch (error: unknown) {\n        this.log.for(this.initialize).error(`Error parsing file list: ${(error as Error).message || error}`);\n      }\n    }\n  }\n\n  /**\n   * @description Validates a single file against the component's constraints.\n   * @summary Checks the file type and size against the accepted values and limits.\n   * Returns true if the file is valid, or an error code if it is not.\n   *\n   * @param {File} file - The file to be validated.\n   * @returns {true | string} - Returns true if valid, error code otherwise.\n   */\n  private validateFile(file: File): true | string {\n    if (this.accept && this.accept !== '*') {\n      const acceptedExtensions = Array.isArray(this.accept)\n        ? this.accept\n        : this.accept.split(',').map((ext) => ext.trim());\n      const accept = acceptedExtensions.some((ext) => {\n        if (ext === '*') return true;\n        if (ext.endsWith('/*')) return file.type.startsWith(ext.replace(/\\/\\*$/, ''));\n        const fileExtension = file.type.split('/').pop() || '';\n        return file.type === ext || fileExtension === ext || file.name.toLowerCase().endsWith(ext.replace('.', ''));\n      });\n      if (!accept) return InputComponentErrors.notAllowed;\n    }\n    if (this.maxFileSize && file.size > this.maxFileSize) return InputComponentErrors.maxSize;\n    return true;\n  }\n\n  /**\n   * @description Displays a preview of the selected file in a lightbox.\n   * @summary If the file is an image, its data URL is retrieved and displayed in a modal lightbox.\n   * The lightbox shows the image at its natural size, constrained to the viewport dimensions.\n   *\n   * @param {File | string} [file] - The file to be previewed. If not provided, the current preview file is used.\n   * @returns {Promise<void>}\n   */\n  override async preview(file: File | string, fileExtension: string = 'image/'): Promise<void> {\n    this.log.for(this).info(`Previewing file of type: ${fileExtension}`);\n    let content: string | undefined;\n    if (file instanceof File) {\n      const dataUrl = (await this.getDataURLs(file)) as string[];\n      if (dataUrl) {\n        file = Array.isArray(dataUrl) ? dataUrl[0] : dataUrl;\n      }\n    }\n    if (fileExtension.includes('image')) content = '<img src=\"' + file + '\" style=\"max-width: 100%; height: auto;\" />';\n\n    if (fileExtension.includes('xml')) {\n      const parseXml = (xmlString: string): string | undefined => {\n        try {\n          xmlString = (xmlString as string).replace(/^data:[^;]+;base64,/, '').replace(/\\s+/g, '');\n          const decodedString = atob(xmlString);\n          const parser = new DOMParser();\n          const xmlDoc = parser.parseFromString(decodedString, 'text/xml');\n\n          // const encoder = new TextEncoder(); // gera bytes UTF-8\n          // const utf8Bytes = encoder.encode(xmlDoc.documentElement.outerHTML);\n          // return new TextDecoder(\"utf-8\").decode(utf8Bytes);\n\n          return xmlDoc.documentElement.outerHTML;\n        } catch (error: unknown) {\n          this.log.error((error as Error)?.message);\n          return undefined;\n        }\n      };\n\n      if (this.previewHandler && typeof this.previewHandler === 'function') {\n        return await this.previewHandler(this, { data: file });\n      } else {\n        content = parseXml(file as string);\n      }\n      return await presentNgxInlineModal(content as string);\n    }\n\n    await presentNgxLightBoxModal(content || '', { className: 'dcf-file-preview' });\n  }\n\n  /**\n   * @description Checks if a file is an image based on its MIME type.\n   * @summary Determines if the file can be accepted as an image by checking\n   * if its type starts with 'image/'.\n   *\n   * @param {File} file - The file to be checked.\n   * @returns {boolean} - True if the file is an image, false otherwise.\n   */\n  isImageFile(file: File): boolean {\n    return file && file.type.startsWith('image/');\n  }\n\n  /**\n   * @description Checks whether a string is a valid base64 payload or data URL.\n   * @summary Supports both raw base64 strings and `data:*;base64` URLs for file reconstruction and preview handling.\n   *\n   * @param {string} value - The string to validate.\n   * @returns {boolean} - True when the string matches a base64 or base64 data URL pattern.\n   */\n  isBase64String(value: string): boolean {\n    const pure = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;\n    const dataUrl = /^data:([a-zA-Z0-9.+-]+\\/[a-zA-Z0-9.+-]+);base64,[A-Za-z0-9+/]+={0,2}$/;\n    return pure.test(value) || dataUrl.test(value);\n  }\n\n  /**\n   * @description Extracts the MIME type from a base64 data URL.\n   * @summary Parses the `data:` prefix and returns the embedded MIME type so files can be reconstructed\n   * with the correct content type.\n   *\n   * @param {string} base64 - The base64 data URL to inspect.\n   * @returns {string} - The extracted MIME type or an empty string when none is present.\n   */\n  getFileMime(base64: string): string {\n    const match = base64.match(/^data:(.*?);base64,/);\n    return match ? match[1] : '';\n  }\n\n  /**\n   * @description Removes a file from the selection.\n   * @summary Updates the file list to exclude the file at the specified index.\n   * Emits the change event and updates the preview if necessary.\n   *\n   * @param {number} index - The index of the file to be removed.\n   * @returns {Promise<void>}\n   */\n  async handleRemove(index: number): Promise<void> {\n    const totalFiles = this.files.length;\n    if (index <= this.files.length) {\n      this.files = [...this.files.filter((_, i) => i !== index)];\n    }\n    if (totalFiles <= 2) {\n      await this.getPreview();\n    }\n    this.changeEventEmit();\n  }\n\n  /**\n   * @description Retrieves the preview image for the selected files.\n   * @summary If the first selected file is an image, its data URL is retrieved and set as the preview.\n   * If the file is not an image, the preview is cleared.\n   *\n   * @returns {Promise<void>}\n   */\n  private async getPreview(): Promise<void> {\n    this.previewFile = undefined;\n    const file = this.files && this.files.length ? this.files[0] : null;\n    if (file instanceof File) {\n      const dataUrl = (await this.getDataURLs(file as File)) as string[];\n      if (dataUrl) {\n        this.previewFile = Array.isArray(dataUrl) ? dataUrl[0] : dataUrl;\n      }\n    } else {\n      this.previewFile = (file as KeyValue)?.['source'] as string;\n    }\n  }\n\n  /**\n   * @description Emits the change event for the file upload field.\n   * @summary Triggers the change event, notifying any listeners that the value has changed.\n   * The event contains the updated value, component name, and event type.\n   *\n   * @returns {void}\n   */\n  private changeEventEmit(): void {\n    this.changeEvent.emit({\n      data: this.value,\n      component: this.componentName,\n      name: ComponentEventNames.Change,\n    });\n  }\n\n  /**\n   * @description Retrieves the data URLs for the selected files.\n   * @summary Converts the selected image files to data URLs using FileReader.\n   * The resulting data URLs can be used for previewing images in the browser.\n   *\n   * @param {File[] | File} [files] - The files for which to generate data URLs.\n   * If not provided, the currently selected files are used.\n   *\n   * @returns {Promise<string[] | undefined>} - A promise that resolves to an array of data URLs, or undefined if an error occurs.\n   */\n  async getDataURLs(files?: File[] | File): Promise<string | string[] | undefined> {\n    if (!files) {\n      files = this.files as File[];\n    }\n    files = !Array.isArray(files) ? [files] : files;\n    return this.readFile(files)\n      .then((urls) => {\n        // validate generated DataURLs\n        const invalid = urls.some((u) => !this.isValidDataURL(u));\n        if (invalid) return undefined;\n        if (this.multiple || this.enableDirectoryMode) {\n          return urls.length === 1 ? urls[0] : urls;\n        }\n        return urls.length ? [urls[0]] : undefined;\n      })\n      .catch(() => {\n        return undefined;\n      });\n  }\n\n  /**\n   * @description Validates the format of a data URL.\n   * @summary Checks if the data URL is a non-empty string and matches the expected pattern\n   * for base64-encoded image data URLs. Uses a regular expression to validate the format.\n   *\n   * @param {string | undefined} dataURL - The data URL to be validated.\n   * @returns {boolean} - True if the data URL is valid, false otherwise.\n   */\n  private isValidDataURL(dataURL: string | undefined): boolean {\n    if (!dataURL || typeof dataURL !== 'string') {\n      return false;\n    }\n\n    // Regex para qualquer MIME type seguido de ;base64\n    const match = dataURL.match(/^data:([a-zA-Z0-9.+-\\\\/]+);base64,([A-Za-z0-9+/=\\s]+)$/);\n    if (!match) return false;\n\n    const payload = match[2];\n    try {\n      if (typeof atob === 'function') {\n        // remove espaços e tenta decodificar\n        atob(payload.replace(/\\s+/g, ''));\n      }\n      return true;\n    } catch {\n      return false;\n    }\n  }\n\n  /**\n   * @description Clears all error messages from the component.\n   * @summary Resets the error state, removing all error messages from the display.\n   *\n   * @returns {void}\n   */\n  private clearErrors(): void {\n    this.errors = [];\n  }\n\n  /**\n   * @description Reads the selected files as data URLs.\n   * @summary Uses the FileReader API to read each file as a data URL.\n   * Returns a promise that resolves to an array of data URLs.\n   *\n   * @param {File[]} files - The files to be read.\n   * @returns {Promise<string[]>} - A promise that resolves to an array of data URLs.\n   */\n  private readFile(files: File[]): Promise<string[]> {\n    return Promise.all(\n      files.map(\n        (file) =>\n          new Promise<string>((resolve, reject) => {\n            const reader = new FileReader();\n            reader.onerror = () => reject(reader.error);\n            reader.onload = () => resolve(String(reader.result || ''));\n            reader.readAsDataURL(file);\n          })\n      )\n    );\n  }\n}\n","<div\n  class=\"decaf-file-component\"\n  #component\n>\n  <input\n    id=\"dcf-file-input\"\n    type=\"file\"\n    placeholder=\"Select files\"\n    [attr.accept]=\"accept\"\n    [attr.multiple]=\"multiple ? true : null\"\n    (change)=\"handleSelection($event)\"\n    [multiple]=\"multiple\"\n    hidden\n    [attr.webkitdirectory]=\"enableDirectoryMode ? true : null\"\n  />\n\n  <ngx-decaf-card\n    [className]=\"className\"\n    [body]=\"'blank'\"\n  >\n    @if (['create', 'update'].includes(operation)) {\n      <div>\n        <div\n          [class]=\"\n            'dcf-drop-area ' +\n            ' dcf-' +\n            size +\n            ' dcf-flex dcf-flex-' +\n            position +\n            ' dcf-text-' +\n            position\n          \"\n          [class.dcf-dragging]=\"dragging\"\n          [class.dcf-has-files]=\"files.length\"\n          (drop)=\"!files?.length ? handleDrop($event) : (dragging = false)\"\n          (dragover)=\"\n            !files?.length ? handleDragOver($event) : (dragging = false)\n          \"\n          (dragleave)=\"\n            !files?.length ? handleDragLeave($event) : (dragging = false)\n          \"\n        >\n          <div>\n            @if (!previewFile) {\n              @if (showIcon) {\n                <ngx-decaf-icon\n                  name=\"cloud-upload-outline\"\n                  size=\"large\"\n                />\n              }\n              <p class=\"dcf-drag-description\">\n                {{\n                  label\n                    ? (label | translate)\n                    : (locale + '.drag_file' | translate)\n                }}\n              </p>\n              <ion-button\n                class=\"dcf-button-select\"\n                (click)=\"handleClickToSelect()\"\n                size=\"small\"\n              >\n                {{\n                  buttonLabel\n                    ? (buttonLabel | translate)\n                    : (locale +\n                        (enableDirectoryMode\n                          ? '.buttons.select_directory'\n                          : '.buttons.select') | translate)\n                }}\n              </ion-button>\n              <div #container>\n                <span\n                  class=\"dcf-file-error\"\n                  [innerHTML]=\"getErrors(container)\"\n                ></span>\n              </div>\n            } @else {\n              @if (!directoryMode && !multiple) {\n                <div\n                  class=\"dcf-preview dcf-grid dcf-grid-match dcf-grid-collapse\"\n                >\n                  <div\n                    class=\"dcf-width-1-4@m dcf-width-1-3@s dcf-flex dcf-flex-center dcf-flex-middle\"\n                  >\n                    <div class=\"dcf-preview-image\">\n                      <ion-img\n                        [src]=\"previewFile\"\n                        [title]=\"locale + '.preview' | translate\"\n                        [alt]=\"locale + '.preview' | translate\"\n                      />\n                      <div class=\"dcf-overlay\">\n                        <ion-button\n                          (click)=\"preview(previewFile)\"\n                          fill=\"clear\"\n                          color=\"light\"\n                          size=\"small\"\n                        >\n                          {{ locale + '.buttons.preview' | translate }}\n                        </ion-button>\n                      </div>\n                    </div>\n                  </div>\n                  <div\n                    class=\"description dcf-flex dcf-flex-middle dcf-width-expand@s\"\n                  >\n                    <div>\n                      <p class=\"dcf-title\">\n                        {{ locale + '.preview' | translate }}\n                      </p>\n                      <p class=\"subtitle\">{{ files[0].name }}</p>\n                      <ion-button\n                        (click)=\"handleClear()\"\n                        fill=\"clear\"\n                        color=\"danger\"\n                        size=\"small\"\n                      >\n                        {{ locale + '.buttons.clear' | translate }}\n                      </ion-button>\n                    </div>\n                  </div>\n                </div>\n              } @else {\n                <div\n                  class=\"dcf-flex dcf-flex-middle\"\n                  [class.dcf-multiple-files]=\"files.length > 1\"\n                >\n                  @if (files.length > 1) {\n                    <ngx-decaf-icon\n                      name=\"ti-files-off\"\n                      [button]=\"true\"\n                      color=\"danger\"\n                      (click)=\"handleClear()\"\n                      [title]=\"locale + '.buttons.clear' | translate\"\n                    />\n                  }\n                  {{ locale + \".selection\" | translate: { \"0\": files.length > 10 ? files.length : `0${files.length}` } }}\n                </div>\n\n                @if (errors.length > 0) {\n                  <div class=\"dcf-error-message\">\n                    {{ locale + \".selection_error\" | translate: { \"0\": errors.length > 10 ? errors.length : `0${errors.length}` } }}\n                  </div>\n                }\n\n                <div class=\"dcf-preview-list-container\">\n                  <ion-list class=\"dcf-preview-list\">\n                    @for (file of errors; track $index) {\n                      <ion-item\n                        lines=\"full\"\n                        class=\"dcf-error-item\"\n                      >\n                        <ion-label slot=\"start\">{{ file.name }}</ion-label>\n                        <div\n                          class=\"dcf-error-message\"\n                          slot=\"end\"\n                        >\n                          {{\n                            locale + '.errors.' + file.error\n                              | translate\n                                : {\n                                    '0':\n                                      file.error === 'max_size'\n                                        ? maxFileSize / 1024 / 1024\n                                        : file.name.split('.')?.[1],\n                                  }\n                          }}\n                        </div>\n                        <ion-note slot=\"end\">\n                          {{ file.size / 1024 / 1024 | number: '1.1-1' }} MB\n                        </ion-note>\n                      </ion-item>\n                    }\n\n                    @for (file of files; track $index) {\n                      <ion-item lines=\"full\">\n                        <ion-label slot=\"start\">{{ file.name }}</ion-label>\n                        <ion-note slot=\"end\">\n                          {{ file.size / 1024 / 1024 | number: '1.1-1' }} MB\n                        </ion-note>\n                        <div\n                          class=\"dcf-flex dcf-flex-middle\"\n                          slot=\"end\"\n                        >\n                          <ngx-decaf-icon\n                            [button]=\"true\"\n                            [slot]=\"'icon-only'\"\n                            (click)=\"preview(file?.source || file, file.type)\"\n                            [name]=\"\n                              file.type.includes('image')\n                                ? 'image-outline'\n                                : 'document-text-outline'\n                            \"\n                          />\n                          <ngx-decaf-icon\n                            [button]=\"true\"\n                            [slot]=\"'icon-only'\"\n                            [name]=\"'ti-trash'\"\n                            (click)=\"handleRemove($index)\"\n                            [color]=\"'danger'\"\n                            [size]=\"'small'\"\n                          />\n                        </div>\n                      </ion-item>\n                    }\n                  </ion-list>\n                </div>\n              }\n            }\n          </div>\n        </div>\n      </div>\n    } @else {\n      <div [class]=\"files?.length > 1 ? 'dcf-preview-list-container' : ''\">\n        <ion-label [class]=\"operation ?? 'read'\">\n          {{ label | translate }}\n        </ion-label>\n        @if (!files?.length) {\n          <div class=\"dcf-padding-xsmall\">\n            @if (!refreshing && initialized) {\n              <ion-text>{{ locale + '.empty' | translate }}</ion-text>\n            } @else {\n              <ion-skeleton-text animated></ion-skeleton-text>\n            }\n          </div>\n        } @else {\n          @if (files?.length === 1 && isImageFile(files[0])) {\n            <div\n              class=\"dcf-preview dcf-grid dcf-grid-match dcf-grid-collapse read dcf-single-file\"\n            >\n              <div\n                class=\"dcf-width-1-4@m dcf-width-1-3@s dcf-flex dcf-flex-center dcf-flex-middle\"\n              >\n                <div class=\"dcf-preview-image\">\n                  <ion-img\n                    [src]=\"previewFile\"\n                    [title]=\"locale + '.preview' | translate\"\n                    [alt]=\"locale + '.preview' | translate\"\n                  />\n                  <div class=\"dcf-overlay\">\n                    <ion-button\n                      (click)=\"preview(previewFile)\"\n                      fill=\"clear\"\n                      color=\"light\"\n                      size=\"small\"\n                    >\n                      {{ locale + '.buttons.preview' | translate }}\n                    </ion-button>\n                  </div>\n                </div>\n              </div>\n              <div\n                class=\"description dcf-flex dcf-flex-middle dcf-width-expand@s\"\n              >\n                <div>\n                  <p class=\"dcf-title\">{{ locale + '.preview' | translate }}</p>\n                  <p class=\"subtitle\">{{ files[0].name }}</p>\n                </div>\n              </div>\n            </div>\n          } @else {\n            <ion-list class=\"dcf-preview-list\">\n              @for (file of files; track $index) {\n                <ion-item\n                  [lines]=\"files?.length > 1 ? 'full' : 'none'\"\n                  (click)=\"preview(file.source, file.type)\"\n                >\n                  @if (file?.name) {\n                    <ion-label slot=\"start\">\n                      {{ files?.length > 1 ? file.name : name }}\n                    </ion-label>\n                  }\n                  <div\n                    class=\"dcf-flex dcf-flex-middle\"\n                    slot=\"end\"\n                  >\n                    <ngx-decaf-icon\n                      [button]=\"true\"\n                      [slot]=\"'icon-only'\"\n                      [name]=\"\n                        file.type.includes('image')\n                          ? 'image-outline'\n                          : 'document-text-outline'\n                      \"\n                    />\n                  </div>\n                </ion-item>\n              }\n            </ion-list>\n          }\n        }\n      </div>\n    }\n  </ngx-decaf-card>\n</div>\n","/**\n * @description Abstract base class for dynamic Angular modules\n * @summary The DynamicModule serves as a base class for Angular modules that need to be\n * dynamically loaded or configured at runtime. It provides a common type for the rendering\n * engine to identify and work with dynamic modules.\n * @class DynamicModule\n * @example\n * ```typescript\n * @NgModule({\n *   declarations: [MyComponent],\n *   imports: [CommonModule]\n * })\n * export class MyDynamicModule extends DynamicModule {}\n * ```\n */\nexport abstract class DynamicModule {}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * @module module:lib/engine/NgxEventHandler\n * @description Event handler base class used by Decaf components.\n * @summary Defines NgxEventHandler which standardizes event handling logic and provides\n * logging support for handlers that process custom events emitted by components.\n *\n * @link {@link NgxEventHandler}\n */\nimport { ChangeDetectorRef, EnvironmentInjector, Renderer2 } from '@angular/core';\nimport { Model } from '@decaf-ts/decorator-validation';\nimport { DecafEventHandler } from '@decaf-ts/ui-decorators';\nimport { ICrudFormEvent } from './interfaces';\nimport { NgxComponentDirective } from './NgxComponentDirective';\nimport { DecafRepositoryAdapter, KeyValue } from './types';\n\nexport abstract class NgxEventHandler extends DecafEventHandler {\n  _data: Model | KeyValue | KeyValue[] | null = null;\n  //TODO: pass to ui decorator decaf componnet\n  override changeDetectorRef!: ChangeDetectorRef;\n\n  renderer!: Renderer2;\n\n  injector!: EnvironmentInjector;\n\n  protected adapter!: DecafRepositoryAdapter;\n\n  // eslint-disable-next-line @typescript-eslint/no-useless-constructor\n  constructor() {\n    super();\n  }\n\n  override async render(...args: unknown[]): Promise<any> {\n    this.log.for(this.handle).info(`Handle called with args:, ${args}`);\n  }\n\n  override async handle<T extends NgxComponentDirective>(\n    event: Partial<ICrudFormEvent>,\n    data?: KeyValue,\n    instance?: T,\n    ...args: unknown[]\n  ): Promise<void> {\n    this.log.for(this.handle).info(`Handle called with args: ${event}, ${data}, ${instance}, ${args}`);\n  }\n\n  from(...args: unknown[]): NgxEventHandler {\n    this.log.for(this.process).info(`Process called with args: ${args}`);\n    return this as NgxEventHandler;\n  }\n\n  async process(...args: unknown[]): Promise<any> {\n    this.log.for(this.process).info(`Process called with args: ${args}`);\n  }\n\n  async delete(...args: unknown[]): Promise<any> {\n    this.log.for(this.delete).info(`Delete called with args: ${args}`);\n  }\n\n  async batchOperation(...args: unknown[]): Promise<any> {\n    this.log.for(this.batchOperation).info(`batchOperation called with args: ${args}`);\n  }\n\n  async beforeCreate(...args: unknown[]): Promise<any> {\n    this.log.for(this.beforeCreate).info(`beforeCreate called with args: ${args}`);\n  }\n\n  async beforeUpdate(...args: unknown[]): Promise<any> {\n    this.log.for(this.beforeUpdate).info(`beforeUpdate called with args: ${args}`);\n  }\n\n  async afterCreate(...args: unknown[]): Promise<any> {\n    this.log.for(this.afterCreate).info(`afterCreate called with args: ${args}`);\n  }\n\n  async afterUpdate(...args: unknown[]): Promise<any> {\n    this.log.for(this.afterUpdate).info(`afterUpdate called with args: ${args}`);\n  }\n}\n","import type {\n  AllOperationKeys,\n  Context,\n  ContextOf,\n  ContextualArgs,\n  DirectionLimitOffset,\n  EventIds,\n  Repo,\n} from '@decaf-ts/core';\nimport { PersistenceKeys, PreparedStatementKeys } from '@decaf-ts/core';\nimport type { PrimaryKeyType } from '@decaf-ts/db-decorators';\nimport { BaseError } from '@decaf-ts/db-decorators';\nimport type { Constructor } from '@decaf-ts/decoration';\nimport { Hashing, Model, ModelKeys } from '@decaf-ts/decorator-validation';\nimport type { AxiosFlags, HttpConfig } from '@decaf-ts/for-http';\nimport { AxiosFlavour, AxiosHttpAdapter } from '@decaf-ts/for-http';\nimport { AxiosRequestConfig } from 'axios';\nimport { auditTime, shareReplay, Subject } from 'rxjs';\nimport { KeyValue } from './types';\n\ninterface ObservableEvent {\n  table: Constructor<Model> | string;\n  event: AllOperationKeys;\n  id: EventIds;\n  args: ContextualArgs<ContextOf<Repo<Model>>>;\n}\n\nexport class DecafAxiosHttpAdapter extends AxiosHttpAdapter {\n  bookmark: Record<string, DirectionLimitOffset[]> = {};\n\n  static disableEvents = false;\n  static token?: string;\n\n  private updateObservers$ = new Subject<ObservableEvent>();\n\n  static lastEventId?: string;\n\n  constructor(config: HttpConfig & { events?: boolean }, alias: string = AxiosFlavour) {\n    super(\n      { eventHeaderResolver: DecafAxiosHttpAdapter.getEventHeaders, eventsListenerPath: '/events', ...config },\n      AxiosFlavour\n    );\n    if (config?.events === false) {\n      DecafAxiosHttpAdapter.disableEvents = true;\n    } else {\n      this.updateObservers$\n        .pipe(auditTime(0), shareReplay({ bufferSize: 1, refCount: true }))\n        .subscribe(async ({ table, event, id, args }) => {\n          await super.updateObservers(table, event, id, ...args);\n        });\n    }\n  }\n\n  static getEventHeaders(): KeyValue {\n    return !this.token || DecafAxiosHttpAdapter.disableEvents\n      ? {}\n      : {\n          withCredentials: true,\n          headers: {\n            authorization: `Bearer ${this.token}`,\n          },\n        };\n  }\n\n  getAllRawQueryParams(url: string): Record<string, string> {\n    const query = new URL(url).search.slice(1); // remove o '?'\n    if (!query) return {};\n\n    const params: Record<string, string> = {};\n\n    for (const pair of query.split('&')) {\n      const [key, value = ''] = pair.split('=');\n      params[key] = value;\n    }\n\n    return params;\n  }\n\n  getBookmarkEntryKey(url: string): string | undefined {\n    const parts = url.split('/'); // transforma em array\n    const index = parts.indexOf(PersistenceKeys.STATEMENT);\n    if (index > 0) {\n      return parts[index - 1];\n    }\n    return undefined;\n  }\n\n  setOnBookmark(url: string): void {\n    const key = this.getBookmarkEntryKey(url);\n    if (key) {\n      if (!this.bookmark[key]) {\n        this.bookmark[key] = [];\n      }\n      this.bookmark[key].push(this.getAllRawQueryParams(url));\n    }\n  }\n\n  parseBookmarkURL(url: string): string {\n    let bookmark = this.getOnQueryParams(url, 'bookmark');\n    const cached = this.getFromBookmark(url);\n    if (!bookmark) {\n      if (cached) {\n        bookmark = cached.bookmark as string;\n        url = url.replace(/bookmark=[^&]*/, `bookmark=${bookmark}`);\n      }\n    } else {\n      if (cached?.bookmark && bookmark !== cached.bookmark) {\n        url = url.replace(/bookmark=[^&]*/, `bookmark=${cached.bookmark}`);\n      } else {\n        this.setOnBookmark(url);\n      }\n    }\n    return url;\n  }\n\n  getFromBookmark(url: string): DirectionLimitOffset | undefined {\n    const key = this.getBookmarkEntryKey(url);\n    const offset = this.getOnQueryParams(url, 'offset');\n    if (key) {\n      const cached = this.bookmark?.[key];\n      if (Number(offset) <= 2) {\n        this.bookmark[key] = [];\n      }\n      if (cached) {\n        return cached.find((item) => Number(item.offset) === Number(offset));\n      }\n    }\n    return undefined;\n  }\n\n  getOnQueryParams(url: string, param: string): string {\n    return new URL(url).searchParams.get(param) || '';\n  }\n\n  hasQueryParam(url: string, param: string): boolean {\n    return new URLSearchParams(url).has(param);\n  }\n\n  parseStatementURL(url: string): string {\n    const urlArray = url.split('/');\n    if (urlArray.includes(PersistenceKeys.STATEMENT)) {\n      if (!urlArray.includes(PreparedStatementKeys.PAGE_BY)) {\n        if (urlArray.includes(PreparedStatementKeys.FIND)) {\n          const direction = urlArray.pop();\n          url = urlArray.filter((part) => part !== PersistenceKeys.STATEMENT).join('/');\n          url = `${url}?direction=${direction}`;\n        } else {\n          return urlArray.filter((part) => part !== PersistenceKeys.STATEMENT).join('/');\n        }\n      } else {\n        const hasBookmark = this.hasQueryParam(url, 'bookmark');\n        if (hasBookmark) {\n          url = this.parseBookmarkURL(url);\n        }\n      }\n    }\n    return url;\n  }\n\n  override async request<V>(details: AxiosRequestConfig, ...args: ContextualArgs<Context<AxiosFlags>>): Promise<V> {\n    let overrides = {};\n    try {\n      const { ctx } = this.logCtx(args, this.request);\n      overrides = this.toRequest(ctx);\n    } catch (err: unknown) {\n      // do nothing\n    }\n\n    if (DecafAxiosHttpAdapter.token) {\n      overrides = {\n        withCredentials: true,\n        headers: {\n          authorization: `Bearer ${DecafAxiosHttpAdapter.token}`,\n          // 'access-control-allow-origin': '*',\n        },\n      };\n    }\n    const { method } = details || undefined;\n    switch (method) {\n      case 'PUT':\n      case 'POST':\n      case 'PATCH': {\n        const headers = (overrides as AxiosRequestConfig)?.headers || {};\n\n        overrides = {\n          ...overrides,\n          headers: {\n            ...headers,\n            'Content-Type': 'application/json; charset=utf-8',\n          },\n        };\n        break;\n      }\n    }\n\n    return await this.client.request(\n      Object.assign({}, details, { url: this.parseStatementURL(details.url || '') }, overrides)\n    );\n  }\n\n  override async create<M extends Model>(\n    tableName: Constructor<M>,\n    id: PrimaryKeyType,\n    model: M,\n    ...args: ContextualArgs<Context<AxiosFlags>>\n  ): Promise<Record<string, unknown>> {\n    const { log, ctx } = this.logCtx(args, this.create);\n    try {\n      const url = this.url(tableName);\n      const cfg = this.toRequest(ctx);\n      log.debug(`POSTing to ${url} with ${JSON.stringify(model)} and cfg ${JSON.stringify(cfg)} and primary key ${id}`);\n      const result = await this.request<Record<string, unknown>>(\n        {\n          url,\n          method: 'POST',\n          data: JSON.stringify(\n            Object.assign({}, model, {\n              [ModelKeys.ANCHOR]: tableName.name,\n            })\n          ),\n          ...cfg,\n        },\n        ctx\n      );\n      return result;\n    } catch (error: unknown) {\n      throw this.parseError(error as BaseError);\n    }\n  }\n\n  override async updateObservers<M extends Model>(\n    table: Constructor<M> | string,\n    event: AllOperationKeys,\n    id: EventIds,\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    ...args: ContextualArgs<ContextOf<any>>\n  ) {\n    if (!DecafAxiosHttpAdapter.disableEvents) {\n      const [model] = args;\n      if (!id) {\n        const pk = Model.pk(Model.get(table as string));\n        if (pk && pk in model) {\n          id = model[pk] as EventIds;\n        }\n      }\n      // await super.updateObservers(table, event, id, ...args);\n      const eventId = await Hashing.hash(`${table}, ${event}, ${id}, ${JSON.stringify(args)}`);\n      if (eventId !== DecafAxiosHttpAdapter.lastEventId) {\n        DecafAxiosHttpAdapter.lastEventId = eventId;\n        this.updateObservers$.next({ table, event, id, args });\n      }\n    }\n  }\n  // override async parseResponse<M extends Model>(\n  //   clazz: Constructor<M>,\n  //   method: OperationKeys | string,\n  //   res: (AxiosResponse & { body: unknown; error: Error | AxiosError }) | any\n  // ) {\n  //   if (method === PreparedStatementKeys.FIND_BY && res === '') {\n\n  //   }\n  //   return await super.parseResponse(clazz, method, res);\n  // }\n\n  // override async parseResponse<M extends Model>(\n  //   clazz: Constructor<M>,\n  //   method: OperationKeys | string,\n  //   res: AxiosResponse & { body: unknown; error: Error | AxiosError }\n  // ) {\n  //   if (!res.status && method !== PersistenceKeys.STATEMENT) throw new InternalError('this should be impossible');\n  //   if (res.status >= 400) {\n  //     throw this.parseError(\n  //       res?.request?.response ? JSON.parse(res.request.response)?.error : res.error || `${res.status}`\n  //     );\n  //   }\n  //   if (!res.body && res.data) {\n  //     res.body = { data: JSON.parse(res.data) };\n  //   }\n\n  // res = await super.parseResponse(clazz, method, res);\n  //   switch (method) {\n  //     case BulkCrudOperationKeys.CREATE_ALL:\n  //     case BulkCrudOperationKeys.READ_ALL:\n  //     case BulkCrudOperationKeys.UPDATE_ALL:\n  //     case BulkCrudOperationKeys.DELETE_ALL:\n  //     case OperationKeys.CREATE:\n  //     case OperationKeys.READ:\n  //     case OperationKeys.UPDATE:\n  //     case OperationKeys.DELETE:\n  //       return res?.data || res?.body || undefined;\n  //     case PreparedStatementKeys.FIND_BY:\n  //     case PreparedStatementKeys.LIST_BY:\n  //     case PreparedStatementKeys.PAGE_BY:\n  //     case PreparedStatementKeys.FIND_ONE_BY:\n  //     case PersistenceKeys.STATEMENT:\n  //       return !res || typeof res === 'string' ? [] : res?.data || res;\n  //     default:\n  //       return res?.data || res?.body || undefined;\n  //   }\n  // }\n}\n","/**\n * @module engine\n * @description Angular rendering engine for Decaf applications\n * @summary The engine module provides core functionality for rendering Angular components\n * in Decaf applications. It includes constants, decorators, rendering engines, and utility types\n * that enable dynamic component creation, property mapping, and component lifecycle management.\n * Key exports include {@link NgxRenderingEngine}, {@link DynamicModule}, and various decorators\n * for component configuration.\n */\nexport * from '../services/NgxFormService';\nexport * from '../services/NgxMediaService';\nexport * from './constants';\nexport * from './decorators';\nexport * from './DynamicModule';\nexport * from './helpers';\nexport * from './interfaces';\nexport * from './NgxComponentDirective';\nexport * from './NgxEventHandler';\nexport * from './NgxFormDirective';\nexport * from './NgxFormFieldDirective';\nexport * from './NgxModelPageDirective';\nexport * from './NgxPageDirective';\nexport * from './NgxParentComponentDirective';\nexport * from './NgxRenderingEngine';\nexport * from './overrides';\nexport * from './types';\n\n","/**\n * @module module:lib/components/searchbar/searchbar.component\n * @description Searchbar component module.\n * @summary Exposes `SearchbarComponent` providing a configurable search input with\n * debouncing, clear/cancel handling and optional global window events. Use this\n * component to add search UI across lists and pages.\n *\n * @link {@link SearchbarComponent}\n */\n\nimport { Component, EventEmitter, HostListener, Input, OnInit, Output } from '@angular/core';\nimport { Model } from '@decaf-ts/decorator-validation';\nimport { IonSearchbar } from '@ionic/angular/standalone';\nimport { AutocompleteTypes, PredefinedColors } from '@ionic/core';\nimport { addIcons } from 'ionicons';\nimport * as allIcons from 'ionicons/icons';\nimport { getModelAndRepository } from '../../engine';\nimport { NgxComponentDirective } from '../../engine/NgxComponentDirective';\nimport { StringOrBoolean } from '../../engine/types';\nimport { stringToBoolean, windowEventEmitter } from '../../utils/helpers';\n\n/**\n * @description Searchbar component for Angular applications.\n * @summary The SearchbarComponent provides a highly customizable search input field with comprehensive\n * options for appearance, behavior, and interaction patterns. It extends NgxBaseComponentDirective to inherit\n * common functionality and implements OnInit for proper lifecycle management. This component features\n * debounced input handling, window event integration, visibility controls, and extensive styling options.\n * It's designed to be flexible and adaptable to different search requirements within modern web applications.\n *\n * @class SearchbarComponent\n * @extends {NgxBaseComponentDirective}\n * @implements {OnInit}\n * @memberOf SearchbarComponent\n */\n@Component({\n  selector: 'ngx-decaf-searchbar',\n  templateUrl: './searchbar.component.html',\n  styleUrls: ['./searchbar.component.scss'],\n  standalone: true,\n  imports: [IonSearchbar],\n})\nexport class SearchbarComponent extends NgxComponentDirective implements OnInit {\n  /**\n   * @description The mode of the searchbar.\n   * @summary Determines the visual style of the searchbar, either iOS or Material Design.\n   * @type {\"ios\" | \"md\" | undefined}\n   * @default \"ios\"\n   */\n  // @Input()\n  // override mode: \"ios\" | \"md\" | undefined = \"md\";\n\n  /**\n   * @description The autocomplete attribute for the searchbar input.\n   * @summary Specifies whether the browser should enable autocomplete for the input field.\n   * This controls the browser's built-in autocomplete functionality, helping users by\n   * suggesting previously entered values or common inputs. Setting to 'off' disables\n   * this feature for privacy or security reasons.\n   *\n   * @type {AutocompleteTypes | undefined}\n   * @default \"off\"\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  autocomplete: AutocompleteTypes | undefined = 'off';\n\n  /**\n   * @description The autocorrect attribute for the searchbar input.\n   * @summary Controls whether the browser should enable autocorrect functionality for the input field.\n   * When enabled, the browser will automatically correct spelling mistakes as the user types.\n   * This is typically disabled for search fields to preserve the user's exact search terms.\n   *\n   * @type {\"on\" | \"off\"}\n   * @default \"off\"\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  autocorrect: 'on' | 'off' = 'off';\n\n  /**\n   * @description Whether the searchbar should animate.\n   * @summary Controls the animation behavior of the searchbar during appearance and disappearance transitions.\n   * When enabled, the searchbar will use smooth animations for state changes, providing a more\n   * polished user experience. This affects transitions like showing/hiding the component.\n   *\n   * @type {StringOrBoolean}\n   * @default true\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  animated: StringOrBoolean = true;\n\n  /**\n   * @description The text for the cancel button.\n   * @summary Specifies the localized text to be displayed on the cancel button of the searchbar.\n   * This text appears when the cancel button is visible and provides users with a clear\n   * indication of how to dismiss the search interface. The text can be customized for\n   * different languages and cultural contexts.\n   *\n   * @type {string}\n   * @default \"Cancel\"\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  buttonCancelText: string = 'Cancel';\n\n  /**\n   * @description The icon to use for the clear button.\n   * @summary Specifies the icon to be displayed for the clear button of the searchbar.\n   * @type {string | undefined}\n   * @default undefined\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  clearIcon: string | undefined = undefined;\n\n  /**\n   * @description The color of the searchbar.\n   * @summary Specifies the color theme to be applied to the searchbar.\n   * @type {string | undefined}\n   * @default undefined\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  color: string | undefined = undefined;\n\n  /**\n   * @description The amount of time, in milliseconds, to wait to trigger the `ionChange` event after each keystroke.\n   * @summary Controls the debounce time for the search input to reduce the frequency of event emissions.\n   * @type {number}\n   * @default 500\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  debounce: number = 500;\n\n  /**\n   * @description Whether the searchbar is disabled.\n   * @summary Controls whether the searchbar is interactive or not.\n   * @type {StringOrBoolean}\n   * @default false\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  disabled: StringOrBoolean = false;\n\n  /**\n   * @description A hint to the browser for which enter key to display.\n   * @summary Specifies the type of action that will be performed when the enter key is pressed.\n   * @type {\"search\" | \"enter\" | \"done\" | \"go\" | \"next\" | \"previous\" | \"send\" | undefined}\n   * @default \"enter\"\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  enterkeyhint: 'search' | 'enter' | 'done' | 'go' | 'next' | 'previous' | 'send' | undefined = 'enter';\n\n  /**\n   * @description The input mode for the searchbar.\n   * @summary Specifies the type of data that might be entered by the user while editing the element or its contents.\n   * @type {\"text\" | \"search\" | \"none\" | \"email\" | \"tel\" | \"url\" | \"numeric\" | \"decimal\" | undefined}\n   * @default 'search'\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  inputmode: 'text' | 'search' | 'none' | 'email' | 'tel' | 'url' | 'numeric' | 'decimal' | undefined = 'search';\n\n  /**\n   * @description The placeholder for the searchbar input.\n   * @summary Specifies the placeholder text to be displayed in the searchbar when it's empty.\n   * @type {string}\n   * @default \"Search\"\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  placeholder: string = 'Search';\n\n  /**\n   * @description The icon to use for the search button.\n   * @summary Specifies the icon to be displayed for the search button of the searchbar.\n   * @type {string | undefined}\n   * @default \"search-outline\"\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  searchIcon: string | undefined = 'search-outline';\n\n  /**\n   * @description When to show the cancel button.\n   * @summary Controls the visibility of the cancel button in different states of the searchbar.\n   * @type {\"always\" | \"focus\" | \"never\"}\n   * @default \"never\"\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  showCancelButton: 'always' | 'focus' | 'never' = 'never';\n\n  /**\n   * @description When to show the clear button.\n   * @summary Controls the visibility of the clear button in different states of the searchbar.\n   * @type {\"always\" | \"focus\" | \"never\"}\n   * @default \"focus\"\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  showClearButton: 'always' | 'focus' | 'never' = 'focus';\n\n  /**\n   * @description Whether to enable spellcheck on the searchbar input.\n   * @summary Controls whether the browser's spellcheck feature is enabled for the searchbar input.\n   * @type {boolean}\n   * @default false\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  spellcheck: boolean = false;\n\n  /**\n   * @description The type of input to use for the searchbar.\n   * @summary Specifies the type of control to display for the searchbar input.\n   * @type {\"number\" | \"text\" | \"search\" | \"email\" | \"password\" | \"tel\" | \"url\" | undefined}\n   * @default \"search\"\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  type: 'number' | 'text' | 'search' | 'email' | 'password' | 'tel' | 'url' | undefined = 'search';\n\n  /**\n   * @description The value of the searchbar input.\n   * @summary Specifies the current value of the searchbar input.\n   * @type {null | string | undefined}\n   * @default \"\"\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  override value: null | string | undefined = '';\n\n  /**\n   * @description The keys to use for querying.\n   * @summary Specifies the keys to be used when performing a search query.\n   * @type {string | string[]}\n   * @default \"name\"\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  queryKeys: string | string[] = 'name';\n\n  /**\n   * @description Whether the searchbar is visible.\n   * @summary Controls the visibility of the searchbar component.\n   * @type {StringOrBoolean}\n   * @default false\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  isVisible: StringOrBoolean = false;\n\n  /**\n   * @description Whether to wrap the searchbar in a container.\n   * @summary Controls whether the searchbar is wrapped in an additional container element.\n   * @type {StringOrBoolean}\n   * @default false\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  wrapper: StringOrBoolean = false;\n\n  /**\n   * @description The color of the wrapper.\n   * @summary Specifies the color theme to be applied to the wrapper container, if present.\n   * @type {PredefinedColors}\n   * @default \"primary\"\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  wrapperColor: PredefinedColors = 'primary';\n\n  /**\n   * @description Whether to emit events to the window.\n   * @summary Controls whether search events should be emitted as window events.\n   * @type {StringOrBoolean}\n   * @default true\n   * @memberOf SearchbarComponent\n   */\n  @Input()\n  emitEventToWindow: StringOrBoolean = true;\n\n  /**\n   * @description The current value of the searchbar.\n   * @summary Stores the current value of the searchbar input for internal state management and processing.\n   * This property is used to track the search term throughout the component's lifecycle and\n   * coordinate between different event handlers and methods.\n   *\n   * @type {string | undefined}\n   * @memberOf SearchbarComponent\n   */\n  currentValue: string | undefined;\n\n  /**\n   * @description Event emitter for search events.\n   * @summary Emits search events when the user interacts with the searchbar, providing a reactive\n   * interface for parent components to respond to search actions. This event is triggered by\n   * various user interactions including typing, clearing, and explicit search actions.\n   *\n   * @type {EventEmitter<string>}\n   * @memberOf SearchbarComponent\n   */\n  @Output()\n  searchEvent: EventEmitter<string> = new EventEmitter<string>();\n\n  /**\n   * @description Creates an instance of SearchbarComponent.\n   * @summary Initializes the SearchbarComponent with all necessary dependencies and configurations.\n   * During initialization, it adds all available Ionicons to the application's icon registry,\n   * ensuring that search and clear icons are available for use throughout the component's lifecycle.\n   *\n   * @memberOf SearchbarComponent\n   */\n  constructor() {\n    super('SearchbarComponent');\n    addIcons(allIcons);\n  }\n\n  /**\n   * @description Initializes the component after Angular first displays the data-bound properties.\n   * @summary Performs essential component initialization by converting string-based boolean inputs\n   * to proper boolean values using the stringToBoolean utility. This ensures that all boolean\n   * properties work correctly regardless of how they were passed from parent components or templates.\n   *\n   * @return {void}\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant A as Angular Lifecycle\n   *   participant S as SearchbarComponent\n   *   participant U as Utility Functions\n   *\n   *   A->>S: ngOnInit()\n   *   S->>U: stringToBoolean(emitEventToWindow)\n   *   U-->>S: boolean value\n   *   S->>U: stringToBoolean(wrapper)\n   *   U-->>S: boolean value\n   *   S->>U: stringToBoolean(isVisible)\n   *   U-->>S: boolean value\n   *   S->>U: stringToBoolean(disabled)\n   *   U-->>S: boolean value\n   *   S->>U: stringToBoolean(animated)\n   *   U-->>S: boolean value\n   *   Note over S: Component ready for interaction\n   *\n   * @memberOf SearchbarComponent\n   */\n  async ngOnInit(): Promise<void> {\n    this.emitEventToWindow = stringToBoolean(this.emitEventToWindow);\n    this.wrapper = stringToBoolean(this.wrapper);\n    this.isVisible = stringToBoolean(this.isVisible);\n    this.disabled = stringToBoolean(this.disabled);\n    this.animated = stringToBoolean(this.animated);\n    this.placeholder = (await this.translate(`component.searchbar.search`)) as string;\n    if (this.modelName) {\n      const repo = getModelAndRepository(this.modelName || this.constructor.name);\n      if (repo) {\n        this.indexes = Model.defaultQueryAttributes(repo.model) || [];\n      }\n    }\n\n    if (!this.indexes?.length && this.model) {\n      this.indexes = Model.defaultQueryAttributes(this.model as Model) || [];\n    }\n    if (this.indexes.length) {\n      this.placeholder = `component.searchbar.search_by`;\n      let fields = '';\n      for (const index of this.indexes) {\n        const phrase = (await this.translate(`${this.locale}.${index}.label`)) || index;\n        fields = fields ? `${fields}, ${phrase}` : `${phrase}`;\n      }\n      this.placeholder = (await this.translate(`${this.placeholder}`, { '0': fields })) as string;\n      if (this.isModalChild) {\n        this.changeDetectorRef.detectChanges();\n      }\n    }\n  }\n\n  /**\n   * @description Handles the visibility toggle of the searchbar component.\n   * @summary Listens for global window events to toggle the visibility state of the searchbar.\n   * When the searchbar becomes visible, it automatically focuses on the input field after a brief\n   * delay to ensure smooth animation completion. This provides a seamless user experience for\n   * search activation through keyboard shortcuts or programmatic triggers.\n   *\n   * @param {CustomEvent} event - The custom event triggering the visibility toggle (unused but required by HostListener)\n   * @return {void}\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant W as Window\n   *   participant S as SearchbarComponent\n   *   participant E as DOM Element\n   *\n   *   W->>S: toggleSearchbarVisibility event\n   *   S->>S: handleToggleVisibility()\n   *   S->>S: Toggle isVisible state\n   *   alt isVisible is true AND component exists\n   *     S->>S: setTimeout(125ms)\n   *     S->>E: setFocus() on ion-searchbar\n   *   end\n   *\n   * @memberOf SearchbarComponent\n   */\n  @HostListener('window:toggleSearchbarVisibility')\n  handleToggleVisibility(): void {\n    this.isVisible = !this.isVisible;\n    if (this.isVisible && !!this.component.nativeElement) {\n      setTimeout(() => {\n        (this.component.nativeElement as HTMLIonSearchbarElement).setFocus();\n      }, 125);\n    }\n  }\n\n  /**\n   * @description Triggers a manual search event with the current searchbar value.\n   * @summary Retrieves the current value from the searchbar's native element and emits it as a search event.\n   * This method provides a programmatic way to trigger search functionality, useful for external\n   * components or keyboard shortcuts that need to execute search without user interaction with the searchbar itself.\n   *\n   * @return {void}\n   * @memberOf SearchbarComponent\n   */\n  search(): void {\n    const element = this.component.nativeElement as HTMLIonSearchbarElement;\n    this.searchEvent.emit(element.value || undefined);\n  }\n\n  /**\n   * @description Handles value changes in the searchbar input field.\n   * @summary Processes change events from the Ionic searchbar component and extracts the new value\n   * to emit as a search event. This method is triggered when the user finishes editing the searchbar\n   * value, providing a way to react to completed input changes rather than real-time typing.\n   *\n   * @param {CustomEvent} event - The change event from the Ionic searchbar containing the new value\n   * @return {void}\n   * @memberOf SearchbarComponent\n   */\n  handleChange(event: CustomEvent): void {\n    const value = event?.detail?.value;\n    if (value === this.currentValue) return;\n    this.currentValue = value ?? undefined;\n    this.emitEvent(this.currentValue);\n  }\n\n  /**\n   * @description Handles clearing of the searchbar input field.\n   * @summary Emits an undefined value as a search event when the searchbar is cleared by the user.\n   * This method is typically triggered when the user clicks the clear button or uses other\n   * clear mechanisms, signaling that the search should be reset or cleared.\n   *\n   * @return {void}\n   * @memberOf SearchbarComponent\n   */\n  handleClear(): void {\n    this.currentValue = undefined;\n    this.emitEvent(this.currentValue);\n  }\n\n  /**\n   * @description Handles real-time input events on the searchbar.\n   * @summary Processes input events as the user types, providing immediate feedback for search functionality.\n   * This method implements smart clearing behavior - if the input becomes empty, it automatically\n   * triggers the clear handler. Otherwise, it emits the current value for real-time search suggestions\n   * or filtering. This enables responsive search experiences with debounced event handling.\n   *\n   * @param {CustomEvent} event - The input event from the Ionic searchbar containing the current value\n   * @return {void}\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant U as User\n   *   participant S as SearchbarComponent\n   *   participant E as Event System\n   *\n   *   U->>S: Type in searchbar\n   *   S->>S: handleInput(event)\n   *   S->>S: Extract value from event\n   *   alt value is empty or null\n   *     S->>S: handleClear()\n   *     S->>E: Emit undefined\n   *   else value has content\n   *     S->>S: emitEvent(value)\n   *     S->>E: Emit search value\n   *   end\n   *\n   * @memberOf SearchbarComponent\n   */\n  handleInput(event: CustomEvent): void {\n    const value = event?.detail?.value?.length ? event.detail.value : undefined;\n\n    if (value === this.currentValue) return;\n    this.currentValue = value ?? undefined;\n    this.emitEvent(this.currentValue);\n  }\n\n  /**\n   * @description Handles blur events on the searchbar.\n   * @summary Currently an empty method, can be implemented for specific blur behavior.\n   * @param {CustomEvent} event - The blur event from the searchbar\n   * @return {void}\n   */\n  // handleBlur(event: CustomEvent): void {}\n\n  /**\n   * @description Emits search events through multiple channels.\n   * @summary Orchestrates the emission of search events both as component output events and optionally\n   * as global window events. This dual-channel approach enables both direct parent-child communication\n   * and application-wide event broadcasting, supporting flexible integration patterns and loose coupling\n   * between components that need to respond to search actions.\n   *\n   * @param {string | undefined} value - The search value to emit across all configured channels\n   * @return {void}\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant S as SearchbarComponent\n   *   participant P as Parent Component\n   *   participant W as Window Event System\n   *\n   *   S->>S: emitEvent(value)\n   *   S->>P: searchEvent.emit(value)\n   *   alt emitEventToWindow is true\n   *     S->>W: windowEventEmitter('searchbarEvent', {value})\n   *   end\n   *\n   * @memberOf SearchbarComponent\n   */\n  emitEvent(value: string | undefined): void {\n    this.searchEvent.emit(value);\n    if (this.emitEventToWindow) windowEventEmitter('searchbarEvent', { value: value });\n  }\n\n  /**\n   * @description Prevents default behavior of DOM events.\n   * @summary Utility method to prevent unwanted default actions on DOM events, such as form submissions\n   * or navigation triggers. This is commonly used in event handlers where the default browser behavior\n   * would interfere with the component's custom logic or user experience design.\n   *\n   * @param {Event} event - The DOM event whose default behavior should be prevented\n   * @return {void}\n   * @memberOf SearchbarComponent\n   */\n  preventChange(event: Event): void {\n    event.preventDefault();\n  }\n}\n","<div class=\"dcf-searchbar-component\">\n  <ion-searchbar\n    [id]=\"uid\"\n    ngClass=\"dcf-searchbar\"\n    name=\"search\"\n    mode=\"ios\"\n    (keyup.enter)=\"preventChange($event)\"\n    (ionInput)=\"handleInput($event)\"\n    (ionClear)=\"handleClear()\"\n    [autocomplete]=\"autocomplete\"\n    [showCancelButton]=\"showCancelButton\"\n    [cancelButtonText]=\"buttonCancelText\"\n    [clearIcon]=\"clearIcon\"\n    [color]=\"color\"\n    [debounce]=\"debounce\"\n    [disabled]=\"disabled\"\n    [enterkeyhint]=\"enterkeyhint\"\n    [inputmode]=\"inputmode\"\n    [placeholder]=\"placeholder\"\n    [searchIcon]=\"searchIcon\"\n    [showClearButton]=\"showClearButton\"\n    [spellcheck]=\"spellcheck\"\n    [type]=\"type\"\n    #component\n  />\n</div>\n","/**\n * @module module:lib/components/filter/filter.component\n * @description Filter component module.\n * @summary Provides `FilterComponent` which builds advanced, multi-step filter\n * queries (index → condition → value) and emits filter events for data querying.\n * It supports responsive behavior, suggestions and integration with `SearchbarComponent`.\n *\n * @link {@link FilterComponent}\n */\n\nimport { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { NavigationStart } from '@angular/router';\nimport { OrderDirection } from '@decaf-ts/core';\nimport { Constructor } from '@decaf-ts/decoration';\nimport { Model } from '@decaf-ts/decorator-validation';\nimport { IonButton, IonChip, IonIcon, IonSelect, IonSelectOption } from '@ionic/angular/standalone';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { addIcons } from 'ionicons';\nimport {\n  arrowDownOutline,\n  arrowUpOutline,\n  chevronDownOutline,\n  chevronUpOutline,\n  closeOutline,\n  searchOutline,\n  trashOutline,\n} from 'ionicons/icons';\nimport { debounceTime, fromEvent, shareReplay, Subscription, takeUntil } from 'rxjs';\nimport { NgxComponentDirective } from '../../engine/NgxComponentDirective';\nimport { Dynamic } from '../../engine/decorators';\nimport { IFilterQuery, IFilterQueryItem } from '../../engine/interfaces';\nimport { FilterCondition } from '../../engine/types';\nimport { getWindowWidth } from '../../utils/helpers';\nimport { IconComponent } from '../icon/icon.component';\nimport { SearchbarComponent } from '../searchbar/searchbar.component';\n\n/**\n * @description Advanced filter component for creating dynamic search filters with step-by-step construction.\n * @summary This component provides a comprehensive filtering interface that allows users to build\n * complex search criteria using a three-step approach: select index → select condition → enter value.\n * It supports filtering by multiple field indexes, comparison conditions, and values, displaying\n * selected filters as removable chips. The component is responsive and includes auto-suggestions\n * with keyboard navigation support.\n *\n * @example\n * ```html\n * <ngx-decaf-filter\n *   [indexes]=\"['name', 'email', 'department', 'status']\"\n *   [conditions]=\"['Equal', 'Contains', 'Greater Than', 'Less Than']\"\n *   [sort]=\"['createdAt', 'updatedAt']\"\n *   [disableSort]=\"false\"\n *   (filterEvent)=\"onFiltersChanged($event)\">\n * </ngx-decaf-filter>\n * ```\n *\n * @mermaid\n * sequenceDiagram\n *   participant U as User\n *   participant F as FilterComponent\n *   participant P as Parent Component\n *\n *   U->>F: Focus input field\n *   F->>F: handleFocus() - Show available indexes\n *   U->>F: Select index (e.g., \"name\")\n *   F->>F: addFilter() - Step 1 completed\n *   F->>F: Show available conditions\n *   U->>F: Select condition (e.g., \"Contains\")\n *   F->>F: addFilter() - Step 2 completed\n *   F->>F: Show value input prompt\n *   U->>F: Enter value and press Enter\n *   F->>F: addFilter() - Step 3 completed\n *   F->>F: Create complete filter object\n *   F->>P: Emit filterEvent with new filter array\n *   F->>F: Reset to step 1 for next filter\n *\n * @memberOf ForAngularCommonModule\n */\n@Dynamic()\n@Component({\n  selector: 'ngx-decaf-filter',\n  templateUrl: './filter.component.html',\n  styleUrls: ['./filter.component.scss'],\n  imports: [\n    FormsModule,\n    TranslatePipe,\n    IonChip,\n    IonIcon,\n    IonButton,\n    IonSelect,\n    IonSelectOption,\n    IonIcon,\n    SearchbarComponent,\n    IconComponent,\n  ],\n  standalone: true,\n  host: { '[attr.id]': 'uid' },\n})\nexport class FilterComponent extends NgxComponentDirective implements OnInit, OnDestroy {\n  /**\n   * @description Reference to the dropdown options container element.\n   * @summary ViewChild reference used to access and manipulate the dropdown options element\n   * for highlighting filtered items and managing visual feedback during option selection.\n   * This element contains the filterable suggestions that users can interact with.\n   *\n   * @type {ElementRef}\n   * @memberOf FilterComponent\n   */\n  @ViewChild('optionsFilterElement', { read: ElementRef, static: false })\n  optionsFilterElement!: ElementRef;\n\n  /**\n   * @description Allows multiple filters to be added.\n   * @summary When true, users can add multiple filters; when false, only one filter is allowed.\n   *\n   * @type {boolean}\n   * @default true\n   * @memberOf FilterComponent\n   */\n  @Input()\n  multiple: boolean = true;\n\n  /**\n   * @description Available comparison conditions for filters.\n   * @summary Defines the list of comparison operators that can be used when creating filters.\n   * These conditions determine how the filter value is compared against the field value.\n   * Common conditions include equality, containment, and numerical comparison operations.\n   *\n   * @type {string[]}\n   * @default []\n   * @memberOf FilterComponent\n   */\n  @Input()\n  conditions: FilterCondition[] = ['Equal', 'Contains', 'Not Contains', 'Greater Than', 'Less Than', 'Not Equal'];\n\n  /**\n   * @description Available sorting options for the filtered data.\n   * @summary Defines the list of field names that can be used for sorting the filtered results.\n   * When disableSort is false, this array is automatically merged with the indexes array\n   * to provide comprehensive sorting capabilities.\n   *\n   * @type {string[]}\n   * @default []\n   * @memberOf FilterComponent\n   */\n  @Input()\n  sortOptions: { label: string; value: string }[] = [];\n\n  /**\n   * @description Controls whether sorting functionality is disabled.\n   * @summary When set to true, prevents the automatic merging of sort and indexes arrays,\n   * effectively disabling sorting capabilities. This is useful when you want to provide\n   * filtering without sorting options.\n   *\n   * @type {boolean}\n   * @default false\n   * @memberOf FilterComponent\n   */\n  @Input()\n  disableSort: boolean = false;\n\n  /**\n   * @description Current window width for responsive behavior.\n   * @summary Stores the current browser window width in pixels. This value is updated\n   * on window resize events to enable responsive filtering behavior and layout adjustments\n   * based on available screen space.\n   *\n   * @type {number}\n   * @memberOf FilterComponent\n   */\n  windowWidth!: number;\n\n  /**\n   * @description Available options for the current filter step.\n   * @summary Contains the list of options available for selection in the current step.\n   * This array changes dynamically based on the current step: indexes → conditions → empty for value input.\n   *\n   * @type {string[]}\n   * @default []\n   * @memberOf FilterComponent\n   */\n  options: string[] = [];\n\n  /**\n   * @description Filtered options based on user input.\n   * @summary Contains the subset of options that match the current user input for real-time\n   * filtering. This array is updated as the user types to show only relevant suggestions\n   * in the dropdown menu.\n   *\n   * @type {string[]}\n   * @default []\n   * @memberOf FilterComponent\n   */\n  filteredOptions: string[] = [];\n\n  /**\n   * @description Complete filter objects created by the user.\n   * @summary Array of complete filter objects, each containing index, condition, and value properties.\n   * These represent the active filters that can be applied to data operations.\n   *\n   * @type {KeyValue[]}\n   * @default []\n   * @memberOf FilterComponent\n   */\n  filterValue: IFilterQueryItem[] = [];\n\n  /**\n   * @description Current filter being constructed.\n   * @summary Temporary object that accumulates filter properties (index, condition, value)\n   * during the three-step filter creation process. Gets added to filterValue when complete.\n   *\n   * @type {KeyValue}\n   * @default {}\n   * @memberOf FilterComponent\n   */\n  lastFilter: IFilterQueryItem = {};\n\n  /**\n   * @description Current step in the filter creation process.\n   * @summary Tracks the current step of filter creation: 1 = index selection, 2 = condition selection,\n   * 3 = value input. Automatically resets to 1 after completing a filter.\n   *\n   * @type {number}\n   * @default 1\n   * @memberOf FilterComponent\n   */\n  step: number = 1;\n\n  /**\n   * @description Controls dropdown visibility state.\n   * @summary Boolean flag that determines whether the options dropdown is currently visible.\n   * Used to manage the dropdown's open/close state and coordinate with focus/blur events.\n   *\n   * @type {boolean}\n   * @default false\n   * @memberOf FilterComponent\n   */\n  dropdownOpen: boolean = false;\n\n  /**\n   * @description Current input field value.\n   * @summary Stores the current text input value that the user is typing. This value is\n   * bound to the input field and is cleared after each successful filter step completion.\n   *\n   * @type {string}\n   * @default ''\n   * @memberOf FilterComponent\n   */\n  override value: string = '';\n\n  /**\n   * @description Current sorting field value.\n   * @summary Stores the field name currently selected for sorting operations.\n   * This value determines which field is used to order the filtered results.\n   * Defaults to 'id' and can be changed through the sort dropdown selection.\n   *\n   * @type {string}\n   * @default 'id'\n   * @memberOf FilterComponent\n   */\n  sortValue: string = 'id';\n\n  /**\n   * @description Subscription for window resize events.\n   * @summary RxJS subscription that listens for window resize events with debouncing\n   * to update the windowWidth property. This enables responsive behavior and prevents\n   * excessive updates during resize operations.\n   *\n   * @type {Subscription}\n   * @memberOf FilterComponent\n   */\n  windowResizeSubscription!: Subscription;\n\n  /**\n   * @description Event emitter for filter changes.\n   * @summary Emits filter events when the user creates, modifies, or clears filters.\n   * The emitted value contains an array of complete filter objects or undefined when\n   * filters are cleared. Parent components listen to this event to update their data display.\n   *\n   * @type {EventEmitter<KeyValue[] | undefined>}\n   * @memberOf FilterComponent\n   */\n  @Output()\n  filterEvent: EventEmitter<IFilterQuery | undefined> = new EventEmitter<IFilterQuery | undefined>();\n\n  /**\n   * @description Event emitter for search events.\n   * @summary Emits search events when the user interacts with the searchbar.\n   * @type {EventEmitter<string>}\n   * @memberOf FilterComponent\n   */\n  @Output()\n  searchEvent: EventEmitter<string> = new EventEmitter<string>();\n\n  inputElement!: HTMLInputElement;\n\n  /**\n   * @description Constructor for FilterComponent.\n   * @summary Initializes a new instance of the FilterComponent.\n   * Calls the parent constructor with the component name to establish base locale string generation\n   * and internationalization support.\n   *\n   * @memberOf FilterComponent\n   */\n  constructor() {\n    super('FilterComponent');\n    addIcons({\n      chevronDownOutline,\n      trashOutline,\n      closeOutline,\n      searchOutline,\n      arrowDownOutline,\n      arrowUpOutline,\n      chevronUpOutline,\n    });\n  }\n\n  /**\n   * @description Initializes the component after Angular first displays the data-bound properties.\n   * @summary Sets up the component by initializing window width tracking, setting up resize event\n   * subscriptions with debouncing, configuring sorting options, and calling the base initialization.\n   * This method prepares the component for user interaction and responsive behavior.\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant A as Angular Lifecycle\n   *   participant F as FilterComponent\n   *   participant W as Window\n   *   participant R as RxJS\n   *\n   *   A->>F: ngOnInit()\n   *   F->>W: getWindowWidth()\n   *   W-->>F: Return current width\n   *   F->>R: Setup resize subscription with debounce\n   *   R-->>F: Subscription created\n   *   alt disableSort is false\n   *     F->>F: Merge sort and indexes arrays\n   *   end\n   *   F->>F: Call initialize()\n   *\n   * @returns {Promise<void>}\n   * @memberOf FilterComponent\n   */\n  async ngOnInit(): Promise<void> {\n    this.windowWidth = getWindowWidth() as number;\n    this.windowResizeSubscription = fromEvent(window, 'resize')\n      .pipe(debounceTime(300), takeUntil(this.destroySubscriptions$), shareReplay({ bufferSize: 1, refCount: true }))\n      .subscribe(() => {\n        this.windowWidth = getWindowWidth() as number;\n      });\n    this.router.events.pipe(takeUntil(this.destroySubscriptions$)).subscribe(async (event) => {\n      if (event instanceof NavigationStart) await this.ngOnDestroy();\n    });\n    await this.getSortOptions();\n    await super.initialize();\n  }\n\n  /**\n   * @description Retrieves and configures available indexes for filtering and sorting.\n   * @summary Extracts field indexes from the model if available and merges them with\n   * sorting options when sorting is enabled. This method sets up the available field\n   * options for both filtering and sorting operations based on the model structure.\n   *\n   * @returns {void}\n   * @memberOf FilterComponent\n   */\n  async getSortOptions(): Promise<string[]> {\n    const indexes = super.getIndexes(this.model as Model);\n    const modelName = this.model?.constructor?.name || '';\n    const translate = async (value: string): Promise<string> => {\n      return (await this.translate(`${modelName ? modelName + '.' : ''}${value}`)).replace(`${modelName}.`, '');\n    };\n    if (!this.disableSort) {\n      const options = this.sortOptions.map(async (option) => ({\n        label: await translate(option.value),\n        value: option.value,\n      }));\n      const indexOptions = indexes.map(async (value) => ({\n        label: await translate(value),\n        value,\n      }));\n      this.sortOptions = [...(await Promise.all(options)), ...(await Promise.all(indexOptions))];\n      if (this.repository) {\n        const pk = Model.pk(this.repository.class as Constructor<Model>);\n        this.sortValue = pk || this.sortValue;\n      }\n    }\n    return indexes;\n  }\n\n  /**\n   * @description Cleanup method called when the component is destroyed.\n   * @summary Unsubscribes from window resize events to prevent memory leaks.\n   * This is essential for proper cleanup of RxJS subscriptions when the component\n   * is removed from the DOM.\n   *\n   * @returns {void}\n   * @memberOf FilterComponent\n   */\n  override async ngOnDestroy(): Promise<void> {\n    await super.ngOnDestroy();\n    if (this.windowResizeSubscription) this.windowResizeSubscription.unsubscribe();\n    this.clear();\n  }\n\n  /**\n   * @description Handles input events from the text field.\n   * @summary Processes user input and filters the available options based on the typed value.\n   * This method provides real-time filtering of suggestions as the user types in the input field.\n   *\n   * @param {InputEvent} event - The input event containing the new value\n   * @returns {void}\n   * @memberOf FilterComponent\n   */\n  handleInput(event: InputEvent): void {\n    const { value } = event.target as HTMLInputElement;\n    this.filteredOptions = this.filterOptions(value);\n  }\n\n  /**\n   * @description Handles focus events on the input field.\n   * @summary Sets up the available options when the input field receives focus and opens the dropdown.\n   * If no options are provided, automatically determines the appropriate options based on current step.\n   * This method initializes the dropdown with contextually relevant suggestions.\n   *\n   * @param {string[]} options - Optional array of options to display\n   * @returns {void}\n   * @memberOf FilterComponent\n   */\n  handleFocus(options: string[] = []): void {\n    if (!options.length) options = this.getOptions();\n    this.filteredOptions = this.options = options;\n    this.dropdownOpen = true;\n  }\n\n  /**\n   * @description Handles blur events on the input field with delayed closing.\n   * @summary Manages the dropdown closing behavior with a delay to allow for option selection.\n   * Uses a two-phase approach to prevent premature closing when users click on dropdown options.\n   *\n   * @param {boolean} close - Internal flag to control the closing phase\n   * @returns {void}\n   * @memberOf FilterComponent\n   */\n  handleBlur(close: boolean = false): void {\n    if (!close) {\n      this.dropdownOpen = false;\n      setTimeout(() => {\n        this.handleBlur(true);\n      }, 100);\n    } else {\n      if (!this.dropdownOpen && this.options.length) {\n        setTimeout(() => {\n          this.options = [];\n          this.dropdownOpen = false;\n        }, 50);\n      }\n    }\n  }\n\n  /**\n   * @description Resolves the translated label for a given sort key.\n   * @summary Looks up the provided key in the available sort options and returns\n   * its translated label when found. Falls back to returning the original key\n   * when no matching option exists.\n   *\n   * @param {string} key - Sort field key to translate\n   * @returns {string} Translated label when available, otherwise the original key\n   * @memberOf FilterComponent\n   */\n  getKeyTranslation(key: string): string {\n    const option = this.sortOptions.find((option) => option.value === key);\n    if (option) {\n      return option.label;\n    }\n    return key;\n  }\n\n  /**\n   * @description Determines the appropriate options based on the current filter step.\n   * @summary Returns the contextually relevant options for the current step in the filter creation process.\n   * Step 1 shows indexes, Step 2 shows conditions, Step 3 shows no options (value input).\n   *\n   * @returns {string[]} Array of options appropriate for the current step\n   * @memberOf FilterComponent\n   */\n  getOptions(): string[] {\n    switch (this.step) {\n      case 1:\n        this.options = this.indexes;\n        break;\n      case 2:\n        this.options = this.conditions;\n        break;\n      case 3:\n        this.options = [];\n        break;\n    }\n    return this.options;\n  }\n\n  /**\n   * @description Adds a filter step or completes filter creation through a three-step process.\n   * @summary Core method for building filters step by step: Step 1 (Index) → Step 2 (Condition) → Step 3 (Value).\n   * When all steps are complete, creates a complete filter object and adds it to the filter collection.\n   * Handles both keyboard events (Enter to submit) and programmatic calls.\n   *\n   * @param {string} value - The value to add for the current step\n   * @param {CustomEvent} event - Optional event (KeyboardEvent triggers submission when value is empty)\n   * @returns {void}\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant U as User\n   *   participant F as FilterComponent\n   *\n   *   U->>F: addFilter(value, event)\n   *   F->>F: Trim and validate value\n   *   alt KeyboardEvent && empty value\n   *     F->>F: submit() - Send current filters\n   *   else Valid value or step 3\n   *     alt Step 1 (Index)\n   *       F->>F: lastFilter.index = value\n   *       F->>F: options = conditions\n   *     else Step 2 (Condition)\n   *       F->>F: lastFilter.condition = value\n   *       F->>F: options = []\n   *     else Step 3 (Value)\n   *       F->>F: lastFilter.value = value\n   *       F->>F: Add complete filter to filterValue\n   *       F->>F: Reset step to 1\n   *     end\n   *     F->>F: Increment step\n   *     F->>F: Clear input & focus\n   *     F->>F: Show next options\n   *   end\n   *\n   * @memberOf FilterComponent\n   */\n  async addFilter(value: string, event?: CustomEvent): Promise<void> {\n    value = value.trim();\n    if (!this.inputElement) this.inputElement = this.component.nativeElement.querySelector('input');\n    if (event instanceof KeyboardEvent && !value) {\n      this.inputElement.blur();\n      await this.submit();\n    } else {\n      if ((value && !(event instanceof KeyboardEvent)) || this.step === 3) {\n        const filter = this.lastFilter;\n        switch (this.step) {\n          case 1:\n            filter['index'] = value;\n            this.options = this.conditions;\n            break;\n          case 2:\n            filter['condition'] = value;\n            this.options = [];\n            break;\n          case 3:\n            filter['value'] = value;\n            this.options = this.indexes;\n            break;\n        }\n        if (!this.filterValue.length) {\n          this.filterValue.push(filter);\n        } else {\n          if (this.step === 1) this.filterValue.push(filter);\n        }\n        if (this.step === 3) {\n          this.step = 0;\n          this.filterValue[this.filterValue.length - 1] = filter;\n          this.lastFilter = {};\n          this.inputElement.value = '';\n          if (!this.multiple) {\n            if (this.inputElement) this.inputElement.disabled = true;\n            this.inputElement.blur();\n            return await this.submit();\n          }\n        }\n        this.step++;\n        this.value = '';\n        if (this.options.length) this.handleFocus(this.options);\n        this.component.nativeElement.querySelector('#dcf-filter-field').focus();\n      }\n    }\n  }\n\n  /**\n   * @description Selects an option from the dropdown suggestions.\n   * @summary Handles option selection when a user clicks on a suggestion in the dropdown.\n   * This method acts as a bridge between dropdown clicks and the main addFilter logic.\n   *\n   * @param {CustomEvent} event - The click event from the dropdown option\n   * @param {string} value - The selected option value\n   * @returns {void}\n   * @memberOf FilterComponent\n   */\n  selectOption(value: string): void {\n    this.addFilter(value);\n  }\n\n  /**\n   * @description Determines if a filter option can be individually removed.\n   * @summary Checks whether a filter component should display a close icon for removal.\n   * Only value options can be removed individually; index and condition options are part\n   * of the complete filter structure and cannot be removed separately.\n   *\n   * @param {FilterCondition} option - The filter option to check\n   * @returns {boolean} True if the option can be cleared individually, false otherwise\n   * @memberOf FilterComponent\n   */\n  allowClear(option: FilterCondition): boolean {\n    return this.indexes.indexOf(option) === -1 && this.conditions.indexOf(option) === -1;\n  }\n\n  /**\n   * @description Removes a complete filter from the collection based on filter value.\n   * @summary Removes a complete filter by matching the provided value against filter values\n   * in the collection. Uses string normalization to handle accents and case differences.\n   * After removal, resets the interface to show available indexes for new filter creation.\n   *\n   * @param {string} filter - The filter value to remove (matches against filter.value property)\n   * @returns {void}\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant U as User\n   *   participant F as FilterComponent\n   *\n   *   U->>F: removeFilter(filterValue)\n   *   F->>F: cleanString(filterValue)\n   *   F->>F: Filter out matching filter objects\n   *   F->>F: Clear input value\n   *   F->>F: handleFocus(indexes) - Reset to index selection\n   *   Note over F: Filter removed and UI reset\n   *\n   * @memberOf FilterComponent\n   */\n  removeFilter(filter: string): void {\n    function cleanString(filter: string): string {\n      return filter\n        .toLowerCase() // convert all characters to lowercase\n        .normalize('NFD') // separate accent marks from characters\n        .replace(/[\\u0300-\\u036f]/g, '') // remove accent marks\n        .replace(/\\s+/g, ''); // remove all whitespace\n    }\n    this.value = '';\n    this.filterValue = this.filterValue.filter(\n      (item) => item?.['value'] && cleanString(item?.['value']) !== cleanString(filter)\n    );\n    if (this.filterValue.length === 0) {\n      this.step = 1;\n      this.lastFilter = {};\n    }\n    if (this.inputElement) {\n      this.inputElement.disabled = false;\n      this.handleFocus(this.indexes);\n    }\n  }\n\n  /**\n   * @description Resets the component to its initial state.\n   * @summary Clears all filter data, options, and resets the step counter to 1.\n   * This method provides a clean slate for new filter creation without emitting events.\n   *\n   * @returns {void}\n   * @memberOf FilterComponent\n   */\n  reset(submit: boolean = true): void {\n    this.options = this.filteredOptions = this.filterValue = [];\n    this.step = 1;\n    this.lastFilter = {};\n    this.value = '';\n    if (this.inputElement) this.inputElement.disabled = false;\n    if (submit) {\n      setTimeout(() => {\n        this.submit();\n      }, 100);\n    }\n  }\n\n  /**\n   * @description Clears all filters and notifies parent components.\n   * @summary Resets the component state and emits undefined to notify parent components\n   * that all filters have been cleared. This triggers any connected data refresh logic.\n   *\n   * @param {string} value - Optional parameter (currently unused)\n   * @returns {void}\n   * @memberOf FilterComponent\n   */\n  clear(value?: string): void {\n    this.filterValue = [];\n    if (!value) this.reset();\n  }\n\n  /**\n   * @description Submits the current filter collection to parent components.\n   * @summary Emits the current filter array to parent components when filters are ready\n   * to be applied. Only emits if there are active filters. Clears options after submission.\n   *\n   * @returns {Promise<void>}\n   * @memberOf FilterComponent\n   */\n  override async submit(): Promise<void> {\n    this.filterEvent.emit({\n      query: this.filterValue.length > 0 ? this.filterValue : undefined,\n      sort: {\n        value: this.sortValue,\n        direction: this.sortDirection,\n      },\n    } as IFilterQuery);\n    if (this.filterValue.length === 0) this.options = [];\n  }\n\n  /**\n   * @description Toggles the sort direction between ascending and descending.\n   * @summary Handles sort direction changes by toggling between ASC and DSC values.\n   * When the direction changes, automatically triggers a submit to apply the new\n   * sorting configuration to the filtered results.\n   *\n   * @returns {void}\n   * @memberOf FilterComponent\n   */\n  handleSortDirectionChange(): void {\n    const direction = this.sortDirection === OrderDirection.ASC ? OrderDirection.DSC : OrderDirection.ASC;\n    if (direction !== this.sortDirection) {\n      this.sortDirection = direction;\n      this.submit();\n    }\n  }\n\n  /**\n   * @description Handles sort field selection changes from the dropdown.\n   * @summary Processes sort field changes when users select a different field\n   * from the sort dropdown. Updates the sortValue property and triggers\n   * a submit to apply the new sorting configuration if the value has changed.\n   *\n   * @param {CustomEvent} event - The select change event containing the new sort field value\n   * @returns {void}\n   * @memberOf FilterComponent\n   */\n  handleSortChange(event: CustomEvent): void {\n    const target = event.target as HTMLIonSelectElement;\n    const value = target.value;\n    if (value !== this.sortValue) {\n      this.sortValue = value as string;\n      this.submit();\n    }\n  }\n\n  /**\n   * @description Filters available options based on user input with visual highlighting.\n   * @summary Performs real-time filtering of available options based on user input.\n   * Also handles visual highlighting of matching options in the dropdown. Returns all\n   * options if input is less than 2 characters for performance optimization.\n   *\n   * @param {string | null | undefined} value - The search value to filter by\n   * @returns {string[]} Array of filtered options that match the input\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant U as User\n   *   participant F as FilterComponent\n   *   participant D as DOM\n   *\n   *   U->>F: filterOptions(inputValue)\n   *   alt inputValue < 2 characters\n   *     F->>D: Remove existing highlights\n   *     F-->>U: Return all options\n   *   else inputValue >= 2 characters\n   *     F->>D: Query all option elements\n   *     F->>D: Add highlight to first matching option\n   *     F->>F: Filter options by substring match\n   *     F-->>U: Return filtered options\n   *   end\n   *\n   * @memberOf FilterComponent\n   */\n  filterOptions(value: string | null | undefined): string[] {\n    const optionsElement = this.optionsFilterElement.nativeElement;\n\n    if (!value?.length || !value || value.length < 2) {\n      const filteredOption = optionsElement.querySelector('.dcf-filtering-item');\n      if (filteredOption) filteredOption.classList.remove('dcf-filtering-item');\n      return this.options;\n    }\n    const options = optionsElement.querySelectorAll('.dcf-item');\n    for (const option of options) {\n      const isActive = option.textContent?.toLowerCase().includes(value.toLowerCase());\n      if (isActive) {\n        option.classList.add('dcf-filtering-item');\n        break;\n      }\n    }\n    return this.options.filter((option: string) => option.toLowerCase().includes(value.toLowerCase() as string));\n  }\n\n  /**\n   * @description Handles search events from the integrated searchbar component.\n   * @summary Processes search input from the searchbar and emits search events\n   * to parent components. This method acts as a bridge between the internal\n   * searchbar component and external search event listeners.\n   *\n   * @param {string | undefined} value - The search value entered by the user\n   * @returns {void}\n   * @memberOf FilterComponent\n   */\n  handleSearch(value: string | undefined): void {\n    this.searchEvent.emit(value);\n  }\n}\n","@if (!indexes.length) {\n  <ngx-decaf-searchbar\n    [emitEventToWindow]=\"false\"\n    [debounce]=\"500\"\n    [model]=\"model\"\n    [modelName]=\"modelName\"\n    [locale]=\"locale ?? undefined\"\n    [isModalChild]=\"isModalChild\"\n    (searchEvent)=\"handleSearch($event)\"\n  />\n}\n\n<div\n  [id]=\"uid\"\n  class=\"dcf-grid dcf-grid-small dcf-grid-match dcf-filter-component\"\n  [class.dcf-hidden]=\"!indexes.length\"\n  #component\n>\n  <div class=\"dcf-width-expand\">\n    <div class=\"dcf-filter\">\n      <div class=\"dcf-input\">\n        @for (\n          filter of filterValue;\n          track trackItemFn($index, filter?.['index'])\n        ) {\n          @if (filter?.['index']) {\n            <ion-chip [outline]=\"true\">{{ filter?.['index'] }}</ion-chip>\n          }\n          @if (filter?.['condition']) {\n            <ion-chip [outline]=\"true\">{{ filter?.['condition'] }}</ion-chip>\n          }\n          @if (filter?.['value']) {\n            <ion-chip\n              [outline]=\"true\"\n              class=\"dcf-filter-value\"\n            >\n              {{ filter?.['value'] }}\n              <ion-icon\n                tabindex=\"0\"\n                name=\"close-outline\"\n                (click)=\"removeFilter(filter?.['value'])\"\n                size=\"small\"\n              ></ion-icon>\n            </ion-chip>\n          }\n        }\n        <div class=\"dcf-width-1-1\">\n          <!-- [readonly]=\"step !== 3\" -->\n          <input\n            fill=\"none\"\n            [(ngModel)]=\"value\"\n            (keydown.enter)=\"addFilter(value, $event)\"\n            (keydown.backspace)=\"clear(value)\"\n            (input)=\"handleInput($event)\"\n            (click)=\"handleFocus()\"\n            (blur)=\"handleBlur()\"\n            type=\"text\"\n            id=\"dcf-filter-field\"\n            autocomplete=\"off\"\n            placeholder=\"{{\n              locale + (step === 3 ? '.type' : '.select') | translate\n            }}\"\n          />\n          @if (windowWidth >= 768) {\n            <div\n              [class]=\"\n                'dcf-dropdown ' + (options.length > 0 ? ' dcf-active' : '')\n              \"\n              #optionsFilterElement\n            >\n              <div>\n                @if (filteredOptions.length > 0) {\n                  @for (key of filteredOptions; track key) {\n                    <div\n                      class=\"dcf-item\"\n                      tabindex=\"0\"\n                      (keydown.enter)=\"selectOption(key)\"\n                      (click)=\"selectOption(key)\"\n                    >\n                      {{ key }}\n                    </div>\n                  }\n                } @else {\n                  <div\n                    class=\"dcf-empty\"\n                    (click)=\"filteredOptions = options; value = ''\"\n                    tabindex=\"0\"\n                    (keydown.enter)=\"filteredOptions = options; value = ''\"\n                  >\n                    {{ locale + '.no_suggestions' | translate }}\n                  </div>\n                }\n              </div>\n            </div>\n          }\n        </div>\n      </div>\n      @if (filterValue.length > 0) {\n        <div class=\"dcf-icon-clear\">\n          <ion-button\n            fill=\"clear\"\n            size=\"small\"\n            (click)=\"clear()\"\n          >\n            <ion-icon\n              aria-hidden=\"true\"\n              name=\"trash-outline\"\n              [color]=\"!isDarkMode ? 'dark' : 'light'\"\n              slot=\"icon-only\"\n            ></ion-icon>\n          </ion-button>\n        </div>\n      }\n      <div class=\"dcf-icon-search\">\n        <ion-button\n          fill=\"clear\"\n          size=\"small\"\n          (click)=\"submit()\"\n        >\n          <ion-icon\n            aria-hidden=\"true\"\n            name=\"search-outline\"\n            [color]=\"!isDarkMode ? 'dark' : 'light'\"\n            slot=\"icon-only\"\n          ></ion-icon>\n        </ion-button>\n      </div>\n    </div>\n    @if (windowWidth < 768) {\n      <div\n        [class]=\"'dcf-dropdown ' + (options.length > 0 ? ' dcf-active' : '')\"\n        #optionsFilterElement\n      >\n        <div>\n          @if (filteredOptions.length > 0) {\n            @for (key of filteredOptions; track key) {\n              <div\n                class=\"dcf-item\"\n                tabindex=\"0\"\n                (keydown.enter)=\"selectOption(key)\"\n                (click)=\"selectOption(key)\"\n              >\n                {{\n                  step === 2\n                    ? (locale +\n                        '.operators.' +\n                        key.toLowerCase().replace(' ', '_') | translate)\n                    : getKeyTranslation(key)\n                }}\n              </div>\n            }\n          } @else {\n            <div\n              class=\"dcf-empty\"\n              (click)=\"filteredOptions = options; value = ''\"\n              tabindex=\"0\"\n              (keydown.enter)=\"filteredOptions = options; value = ''\"\n            >\n              {{ locale + '.no_suggestions' | translate }}\n            </div>\n          }\n        </div>\n      </div>\n    }\n  </div>\n  @if (!disableSort) {\n    <div class=\"dcf-width-1-5@m dcf-width-1-1 dcf-sort-container\">\n      <div\n        class=\"dcf-grid dcf-grid-collapse dcf-flex dcf-flex-middle dcf-grid-match\"\n      >\n        <div class=\"dcf-width-expand\">\n          <ion-select\n            toggleIcon=\"chevron-down-outline\"\n            expandedIcon=\"chevron-up-outline\"\n            class=\"dcf-sort-select\"\n            (ionChange)=\"handleSortChange($event)\"\n            interface=\"popover\"\n            [value]=\"sortValue\"\n            label-placement=\"floating\"\n            fill=\"outline\"\n            [label]=\"locale + '.sort' | translate\"\n          >\n            @for (sort of sortOptions; track sort) {\n              <ion-select-option [value]=\"sort.value\">\n                {{ sort.label }}\n              </ion-select-option>\n            }\n          </ion-select>\n        </div>\n        <div class=\"dcf-width-auto\">\n          <ngx-decaf-icon\n            (click)=\"handleSortDirectionChange()\"\n            [button]=\"true\"\n            fill=\"clear\"\n            slot=\"icon-only\"\n            [color]=\"!isDarkMode ? 'primary' : 'light'\"\n            [name]=\"\n              sortDirection === 'desc'\n                ? 'arrow-down-outline'\n                : 'arrow-up-outline'\n            \"\n          />\n        </div>\n      </div>\n    </div>\n  }\n</div>\n","/**\n * @module module:lib/components/list-item/list-item.component\n * @description List item component module.\n * @summary Exposes `ListItemComponent` which renders a single list item with\n * configurable icon, title, description, actions and navigation. The component\n * supports slide actions, popover menus and emits click events for parent\n * components to handle.\n *\n * @link {@link ListItemComponent}\n */\n\nimport {\n  AfterViewInit,\n  Component,\n  ElementRef,\n  EventEmitter,\n  HostListener,\n  Input,\n  OnInit,\n  Output,\n  ViewChild,\n} from '@angular/core';\nimport { CrudOperations, OperationKeys } from '@decaf-ts/db-decorators';\nimport { Model } from '@decaf-ts/decorator-validation';\nimport { ComponentEventNames } from '@decaf-ts/ui-decorators';\nimport {\n  IonButton,\n  IonContent,\n  IonIcon,\n  IonItem,\n  IonItemOption,\n  IonItemOptions,\n  IonItemSliding,\n  IonLabel,\n  IonList,\n  IonListHeader,\n  IonPopover,\n} from '@ionic/angular/standalone';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { addIcons } from 'ionicons';\nimport * as AllIcons from 'ionicons/icons';\nimport { Dynamic } from '../../engine/decorators';\nimport { IListItemCustomEvent } from '../../engine/interfaces';\nimport { NgxComponentDirective } from '../../engine/NgxComponentDirective';\nimport { KeyValue, StringOrBoolean } from '../../engine/types';\nimport { getWindowWidth, removeFocusTrap, stringToBoolean, windowEventEmitter } from '../../utils/helpers';\nimport { IconComponent } from '../icon/icon.component';\n\n/**\n * @description A component for displaying a list item with various customization options.\n * @summary The ListItemComponent is an Angular component that extends NgxBaseComponentDirective. It provides a flexible and customizable list item interface with support for icons, buttons, and various text elements. The component also handles actions and navigation based on user interactions.\n *\n * @class\n * @extends NgxBaseComponentDirective\n *\n * @param {string} [lines='none'] - Determines the line style of the item. Can be 'inset', 'inseet', or 'none'.\n * @param {Record<string, any>} item - The data item to be displayed in the list item.\n * @param {string} icon - The name of the icon to be displayed.\n * @param {'start' | 'end'} [iconSlot='start'] - The position of the icon within the item.\n * @param {StringOrBoolean} [button=true] - Determines if the item should behave as a button.\n * @param {string} [title] - The main title of the list item.\n * @param {string} [description] - A description for the list item.\n * @param {string} [info] - Additional information for the list item.\n * @param {string} [subinfo] - Sub-information for the list item.\n *\n * @example\n * <ngx-decaf-list-item\n *   [item]=\"dataItem\"\n *   icon=\"star\"\n *   title=\"Item Title\"\n *   description=\"Item Description\"\n *   (clickEvent)=\"handleItemClick($event)\">\n * </ngx-decaf-list-item>\n *\n * @mermaid\n * sequenceDiagram\n *   participant C as Component\n *   participant V as View\n *   participant U as User\n *   C->>V: Initialize component\n *   V->>U: Display list item\n *   U->>V: Click on item or action\n *   V->>C: Trigger handleAction()\n *   C->>C: Process action\n *   C->>V: Update view or navigate\n */\n@Dynamic()\n@Component({\n  selector: 'ngx-decaf-list-item',\n  templateUrl: './list-item.component.html',\n  styleUrls: ['./list-item.component.scss'],\n  standalone: true,\n  imports: [\n    TranslatePipe,\n    IonList,\n    IonListHeader,\n    IonItem,\n    IonItemSliding,\n    IonItemOptions,\n    IonItemOption,\n    IonIcon,\n    IonLabel,\n    IonButton,\n    IonContent,\n    IconComponent,\n    IonPopover,\n  ],\n  host: { '[attr.id]': 'uid' },\n})\nexport class ListItemComponent extends NgxComponentDirective implements OnInit, AfterViewInit {\n  @ViewChild('component', { read: ElementRef, static: false })\n  override component!: ElementRef;\n\n  /**\n   * @description Reference to the action menu popover component.\n   * @summary ViewChild reference that provides access to the HTMLIonPopoverElement\n   * used for displaying action menus. This reference is used to programmatically\n   * control the popover, such as dismissing it when necessary.\n   *\n   * @type {HTMLIonPopoverElement}\n   * @memberOf ListItemComponent\n   */\n  @ViewChild('actionMenuComponent')\n  actionMenuComponent!: HTMLIonPopoverElement;\n\n  @Input()\n  actionsType: 'popover' | 'inline' = 'inline';\n\n  /**\n   * @description Controls the display of lines around the list item.\n   * @summary Determines how lines are displayed around the list item borders.\n   * 'inset' shows lines with padding, 'full' shows full-width lines, and 'none'\n   * removes all lines. This affects the visual separation between list items.\n   *\n   * @type {'inset' | 'full' | 'none'}\n   * @default 'inset'\n   * @memberOf ListItemComponent\n   */\n  @Input()\n  lines: 'inset' | 'full' | 'none' = 'full';\n\n  /**\n   * @description The data object associated with this list item.\n   * @summary Contains the raw data that this list item represents. This object\n   * is used to extract display information and for passing to event handlers\n   * when the item is interacted with. It overrides the base item property.\n   *\n   * @type {Record<string, unknown>}\n   * @memberOf ListItemComponent\n   */\n  @Input()\n  override item!: Record<string, unknown>;\n\n  /**\n   * @description The name of the icon to display in the list item.\n   * @summary Specifies which icon to display using Ionic's icon system.\n   * The icon name should correspond to an available Ionic icon or a custom\n   * icon that has been registered with the icon registry.\n   *\n   * @type {string}\n   * @memberOf ListItemComponent\n   */\n  @Input()\n  icon!: string;\n\n  /**\n   * @description Position of the icon within the list item.\n   * @summary Determines whether the icon appears at the start (left in LTR languages)\n   * or end (right in LTR languages) of the list item. This affects the overall\n   * layout and visual hierarchy of the item content.\n   *\n   * @type {'start' | 'end'}\n   * @default 'start'\n   * @memberOf ListItemComponent\n   */\n  @Input()\n  iconSlot: 'start' | 'end' = 'start';\n\n  /**\n   * @description Controls whether the list item behaves as a clickable button.\n   * @summary When set to true, the list item will have button-like behavior including\n   * hover effects, click handling, and appropriate accessibility attributes.\n   * When false, the item is displayed as static content without interactive behavior.\n   *\n   * @type {StringOrBoolean}\n   * @default true\n   * @memberOf ListItemComponent\n   */\n  @Input()\n  button: StringOrBoolean = true;\n\n  /**\n   * @description The main title text displayed in the list item.\n   * @summary Sets the primary text content that appears prominently in the list item.\n   * This is typically the most important information about the item and is displayed\n   * with emphasis in the component's visual hierarchy.\n   *\n   * @type {string}\n   * @memberOf ListItemComponent\n   */\n  @Input()\n  title?: string;\n\n  /**\n   * @description Secondary descriptive text for the list item.\n   * @summary Provides additional context or details about the item. This text\n   * is typically displayed below the title with less visual emphasis.\n   * Useful for providing context without cluttering the main title.\n   *\n   * @type {string}\n   * @memberOf ListItemComponent\n   */\n  @Input()\n  description?: string;\n\n  /**\n   * @description Additional information text for the list item.\n   * @summary Displays supplementary information that provides extra context\n   * about the item. This could include metadata, status information, or\n   * other relevant details that don't fit in the title or description.\n   *\n   * @type {string}\n   * @memberOf ListItemComponent\n   */\n  @Input()\n  info?: string;\n\n  /**\n   * @description Sub-information text displayed in the list item.\n   * @summary Provides tertiary level information that complements the info field.\n   * This is typically used for additional metadata or contextual details\n   * that are useful but not critical for understanding the item.\n   *\n   * @type {string}\n   * @memberOf ListItemComponent\n   */\n  @Input()\n  subinfo?: string;\n\n  /**\n   * @description Event emitter for list item click interactions.\n   * @summary Emits custom events when the list item is clicked or when actions\n   * are performed on it. The emitted event contains information about the action,\n   * the item data, and other relevant context for parent components to handle.\n   *\n   * @type {EventEmitter<IListItemCustomEvent>}\n   * @memberOf ListItemComponent\n   */\n  @Output()\n  clickEvent: EventEmitter<IListItemCustomEvent> = new EventEmitter<IListItemCustomEvent>();\n\n  /**\n   * @description Flag indicating whether slide items are currently enabled.\n   * @summary Controls the visibility of slide actions based on screen size and\n   * available operations. When true, users can swipe on the item to reveal\n   * action buttons for operations like edit and delete.\n   *\n   * @type {boolean}\n   * @default false\n   * @memberOf ListItemComponent\n   */\n  showSlideItems: boolean = false;\n\n  /**\n   * @description Current window width in pixels.\n   * @summary Stores the current browser window width which is used to determine\n   * responsive behavior, such as when to show or hide slide items based on\n   * screen size. Updated automatically on window resize events.\n   *\n   * @type {number}\n   * @memberOf ListItemComponent\n   */\n  windowWidth!: number;\n\n  /**\n   * @description Flag indicating whether the action menu popover is currently open.\n   * @summary Tracks the state of the action menu to prevent multiple instances\n   * from being opened simultaneously and to ensure proper cleanup when actions\n   * are performed. Used for managing the popover lifecycle.\n   *\n   * @type {boolean}\n   * @default false\n   * @memberOf ListItemComponent\n   */\n  actionMenuOpen: boolean = false;\n\n  /**\n   * @description Flag controlling whether the component should emit click events.\n   * @summary When true, interaction handlers emit payloads via `clickEvent` instead of relying\n   * solely on navigation. Useful for parent components that listen for custom events to drive\n   * their own logic.\n   *\n   * @type {boolean}\n   * @default false\n   * @memberOf ListItemComponent\n   */\n  @Input()\n  emitEvent: boolean = false;\n\n  /**\n   * @description Creates an instance of ListItemComponent.\n   * @summary Initializes a new ListItemComponent by calling the parent class constructor\n   * with the component name for logging and identification purposes. Also registers\n   * all available Ionic icons to ensure they can be displayed in the component.\n   *\n   * @memberOf ListItemComponent\n   */\n  constructor() {\n    super('ListItemComponent');\n    addIcons(AllIcons);\n    this.enableDarkMode = true;\n  }\n\n  /**\n   * @description Initializes the component after Angular first displays the data-bound properties.\n   * @summary Sets up the component by determining slide item visibility, processing boolean inputs,\n   * building CSS class names based on properties, and capturing the current window width.\n   * This method prepares the component for user interaction by ensuring all properties are\n   * properly initialized and responsive behavior is configured.\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant A as Angular Lifecycle\n   *   participant L as ListItemComponent\n   *   participant W as Window\n   *\n   *   A->>L: ngOnInit()\n   *   L->>L: enableSlideItems()\n   *   L->>L: Process button boolean\n   *   L->>L: Build className with flex classes\n   *   alt operations exist\n   *     L->>L: Add 'action' class\n   *   end\n   *   L->>W: getWindowWidth()\n   *   W-->>L: Return current width\n   *   L->>L: Store windowWidth\n   *\n   * @return {Promise<void>}\n   * @memberOf ListItemComponent\n   */\n  async ngOnInit(): Promise<void> {\n    const item = this.item as KeyValue;\n    if (typeof item === 'object' && 'mapper' in item) {\n      await this.parseItem(item, item['mapper']);\n    } else {\n      await this.parseItem(item);\n    }\n\n    this.showSlideItems = this.enableSlideItems();\n    this.button = stringToBoolean(this.button);\n    this.className = `${this.className}  dcf-flex dcf-flex-middle grid-item`;\n    if (this.operations?.length) this.className += ` action`;\n    this.windowWidth = getWindowWidth() as number;\n  }\n\n  async ngAfterViewInit(): Promise<void> {\n    this.checkDarkMode();\n  }\n\n  async parseItem(\n    item: Pick<ListItemComponent, 'title' | 'description' | 'info' | 'subinfo'>,\n    mapper?: KeyValue\n  ): Promise<void> {\n    const model = this.model as Model;\n    function getPropValue(prop: string): string | undefined {\n      if (prop in model) {\n        const value = model[prop as keyof Model];\n        return value === undefined ? '' : `${value}`?.length ? String(value) : undefined;\n      }\n      return prop?.length ? (prop !== 'undefined' ? prop : undefined) : undefined;\n    }\n    if (mapper) {\n      Object.entries(mapper).forEach(([key, value]) => {\n        if (value) {\n          (this as KeyValue)[key] = getPropValue(value);\n          this.changeDetectorRef.detectChanges();\n        }\n      });\n    } else {\n      if (typeof model === 'object') {\n        if (!this.title) {\n          this.title = getPropValue(`${item.title}`);\n        }\n        if (!this.description) {\n          this.description = getPropValue(`${item.description}`);\n        }\n        if (!this.info) {\n          this.info = getPropValue(`${item.info}`);\n        }\n        if (!this.subinfo) {\n          this.subinfo = getPropValue(`${item.subinfo}`);\n        }\n      }\n    }\n\n    this.changeDetectorRef.markForCheck();\n  }\n\n  /**\n   * @description Handles user interactions and actions performed on the list item.\n   * @summary This method is the central action handler for list item interactions. It manages\n   * event propagation, dismisses open action menus, removes focus traps, and either emits\n   * events for parent components to handle or performs navigation based on the component's\n   * route configuration. This method supports both event-driven and navigation-driven architectures.\n   *\n   * @param {CrudOperations} action - The type of CRUD operation being performed\n   * @param {Event} event - The browser event that triggered the action\n   * @param {HTMLElement} [target] - Optional target element for the event\n   * @return {Promise<boolean|void>} A promise that resolves to navigation success or void for events\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant U as User\n   *   participant L as ListItemComponent\n   *   participant P as Parent Component\n   *   participant N as Router\n   *   participant E as Event System\n   *\n   *   U->>L: Perform action (click/swipe)\n   *   L->>L: stopImmediatePropagation()\n   *   alt actionMenuOpen\n   *     L->>L: Dismiss action menu\n   *   end\n   *   L->>L: removeFocusTrap()\n   *   alt No route configured\n   *     L->>E: windowEventEmitter()\n   *     L->>P: clickEvent.emit()\n   *   else Route configured\n   *     L->>N: redirect(action, uid)\n   *     N-->>L: Return navigation result\n   *   end\n   *\n   * @memberOf ListItemComponent\n   */\n  async handleAction(event: Event, action: CrudOperations, target?: HTMLElement): Promise<void> {\n    event.stopImmediatePropagation();\n    if (this.actionMenuOpen) {\n      await this.actionMenuComponent.dismiss();\n    }\n    const uid = this.model ? (this.model as KeyValue)[this.pk] : this.uid;\n    // forcing trap focus\n    removeFocusTrap();\n    if (!this.route || this.emitEvent) {\n      const event = {\n        target: target,\n        action,\n        pk: this.pk,\n        data: uid,\n        name: ComponentEventNames.Click,\n        component: this.componentName,\n      } as IListItemCustomEvent;\n      windowEventEmitter(`ListItem${ComponentEventNames.Click}`, event);\n      return this.clickEvent.emit(event);\n    }\n\n    await this.redirect(action, `${this.uid}`);\n  }\n\n  /**\n   * @description Responsive handler that enables or disables slide items based on screen size and operations.\n   * @summary This method is automatically called when the window is resized and also during component\n   * initialization. It determines whether slide actions should be available based on the current\n   * window width and the presence of UPDATE or DELETE operations. Slide items are typically hidden\n   * on larger screens where there's space for dedicated action buttons.\n   *\n   * @return {boolean} True if slide items should be shown, false otherwise\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant W as Window\n   *   participant L as ListItemComponent\n   *   participant U as UI\n   *\n   *   W->>L: resize event\n   *   L->>W: getWindowWidth()\n   *   W-->>L: Return current width\n   *   L->>L: Store windowWidth\n   *   alt No operations OR width > 639px\n   *     L->>U: showSlideItems = false\n   *   else Operations include UPDATE/DELETE\n   *     L->>U: showSlideItems = true\n   *   end\n   *   L-->>U: Return showSlideItems value\n   *\n   * @memberOf ListItemComponent\n   */\n  @HostListener('window:resize')\n  enableSlideItems(): boolean {\n    this.windowWidth = getWindowWidth() as number;\n    if (!this.operations?.length || this.windowWidth > 639) return (this.showSlideItems = false);\n    this.showSlideItems =\n      this.operations.includes(OperationKeys.UPDATE) || this.operations.includes(OperationKeys.DELETE);\n    return this.showSlideItems;\n  }\n\n  /**\n   * @description Animates and removes an element from the DOM.\n   * @summary This method applies CSS animation classes to create a smooth fade-out effect\n   * before removing the element from the DOM. The animation enhances user experience by\n   * providing visual feedback when items are deleted or removed from lists. The timing\n   * is coordinated with the CSS animation duration to ensure the element is removed\n   * after the animation completes.\n   *\n   * @param {HTMLElement} element - The DOM element to animate and remove\n   * @return {void}\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant L as ListItemComponent\n   *   participant E as HTMLElement\n   *   participant D as DOM\n   *\n   *   L->>E: Add animation classes\n   *   Note over E: uk-animation-fade, uk-animation-medium, uk-animation-reverse\n   *   E->>E: Start fade animation\n   *   L->>L: setTimeout(600ms)\n   *   Note over L: Wait for animation to complete\n   *   L->>D: element.remove()\n   *   D->>D: Remove element from DOM\n   *\n   * @memberOf ListItemComponent\n   */\n  removeElement(element: HTMLElement): void {\n    element.classList.add('uk-animation-fade', 'uk-animation-medium', 'uk-animation-reverse');\n    setTimeout(() => {\n      element.remove();\n    }, 600);\n  }\n\n  /**\n   * @description Navigates to a new route based on the specified action and item ID.\n   * @summary This method constructs a navigation URL using the component's route configuration,\n   * the specified action, and an item identifier. It uses Ionic's Router to perform\n   * forward navigation with appropriate animations. This method is typically used for\n   * CRUD operations where each action (create, read, update, delete) has its own route.\n   *\n   * @param {string} action - The action to be performed (e.g., 'edit', 'view', 'delete')\n   * @param {string} [id] - The unique identifier of the item to be acted upon\n   * @return {Promise<boolean>} A promise that resolves to true if navigation was successful\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant L as ListItemComponent\n   *   participant N as Router\n   *   participant R as Router\n   *\n   *   L->>L: redirect(action, id)\n   *   L->>L: Construct URL: /{route}/{action}/{id}\n   *   L->>N: navigateForward(url)\n   *   N->>R: Navigate to constructed URL\n   *   R-->>N: Return navigation result\n   *   N-->>L: Return boolean success\n   *\n   * @memberOf ListItemComponent\n   */\n  async redirect(action: string, id?: string): Promise<boolean> {\n    return await this.router.navigateByUrl(`/${this.route}/${action}/${id || this.uid}`);\n  }\n\n  /**\n   * @description Presents the actions menu popover for the list item.\n   * @summary This method handles the display of a contextual action menu when triggered by user\n   * interaction (typically a long press or right-click). It stops event propagation to prevent\n   * unwanted side effects, removes any existing focus traps for accessibility, configures the\n   * popover with the triggering event, and opens the action menu. The menu typically contains\n   * available CRUD operations for the item.\n   *\n   * @param {Event} event - The event that triggered the action menu request\n   * @return {void}\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant U as User\n   *   participant L as ListItemComponent\n   *   participant P as Popover\n   *   participant A as Accessibility\n   *\n   *   U->>L: Trigger action menu (long press/right-click)\n   *   L->>L: stopImmediatePropagation()\n   *   L->>A: removeFocusTrap()\n   *   L->>P: Set event reference\n   *   L->>L: actionMenuOpen = true\n   *   L->>P: Display popover with actions\n   *\n   * @memberOf ListItemComponent\n   */\n  presentActionsMenu(event: Event): void {\n    event.stopImmediatePropagation();\n    // forcing trap focus\n    removeFocusTrap();\n    this.actionMenuComponent.event = event;\n    this.actionMenuOpen = true;\n  }\n}\n","@if (title || description) {\n  <ion-item-sliding>\n    <ion-item\n      [id]=\"uid\"\n      [lines]=\"lines\"\n      [button]=\"!operations?.length ? false : button\"\n      [class]=\"className\"\n      (click)=\"\n        operations?.includes(OperationKeys.READ)\n          ? handleAction($event, OperationKeys.READ, component)\n          : ''\n      \"\n      [class.dcf-modal-child]=\"isModalChild\"\n      #component\n    >\n      @if (icon && lines !== 'inset') {\n        <div\n          class=\"dcf-icon-container dcf-width-auto\"\n          [slot]=\"iconSlot\"\n        >\n          <ngx-decaf-icon\n            slot=\"icon-only\"\n            [name]=\"icon\"\n          />\n        </div>\n      }\n      <div class=\"dcf-width-expand\">\n        <div\n          class=\"dcf-flex dcf-flex-middle dcf-grid-collapse\"\n          dcf-grid\n        >\n          @if (icon && lines === 'inset') {\n            <div\n              class=\"dcf-icon\"\n              [slot]=\"iconSlot\"\n            >\n              <ion-avatar>\n                <ion-icon\n                  aria-hidden=\"true\"\n                  name=\"reader-outline\"\n                  size=\"default\"\n                />\n              </ion-avatar>\n            </div>\n          }\n          <div class=\"dcf-width-expand@s dcf-width-1-1 dcf-label\">\n            @if (title) {\n              <ion-label class=\"dcf-item-title\">\n                <ion-text\n                  [innerHTML]=\"translatable ? (title | translate) : title\"\n                ></ion-text>\n              </ion-label>\n            }\n            @if (description) {\n              <div\n                class=\"dcf-description\"\n                [innerHTML]=\"description\"\n              ></div>\n            }\n          </div>\n          @if (info?.length || subinfo?.length) {\n            <div\n              class=\"dcf-width-auto@s dcf-width-expand dcf-info dcf-flex dcf-flex-right@s\"\n            >\n              <div>\n                @if (info) {\n                  <span [innerHTML]=\"info\"></span>\n                }\n                @if (subinfo) {\n                  <div\n                    class=\"dcf-subinfo dcf-text-truncate\"\n                    [innerHTML]=\"subinfo\"\n                  ></div>\n                }\n              </div>\n            </div>\n          }\n\n          <div class=\"dcf-width-auto dcf-flex dcf-flex-middle dcf-flex-right\">\n            @if (\n              (operations?.includes(OperationKeys.DELETE) ||\n                operations?.includes(OperationKeys.UPDATE)) &&\n              uid\n            ) {\n              <div\n                class=\"dcf-visible@s\"\n                id=\"dcf-actions\"\n              >\n                @if (actionsType === 'popover') {\n                  <ion-button\n                    shape=\"round\"\n                    fill=\"clear\"\n                    color=\"primary\"\n                    (click)=\"presentActionsMenu($event)\"\n                    [attr.aria-label]=\"locale + '.actions' | translate\"\n                  >\n                    <ion-icon\n                      slot=\"icon-only\"\n                      aria-hidden=\"true\"\n                      name=\"ellipsis-vertical-outline\"\n                    />\n                  </ion-button>\n                  <ion-popover\n                    #actionMenuComponent\n                    side=\"bottom\"\n                    alignment=\"left\"\n                    [isOpen]=\"actionMenuOpen\"\n                    (didDismiss)=\"actionMenuOpen = false\"\n                  >\n                    <ng-template>\n                      <ion-content class=\"ion-padding\">\n                        <ion-list lines=\"none\">\n                          <ion-list-header>\n                            <h4\n                              class=\"dcf-text-capitalize\"\n                              [innerHTML]=\"'actions' | translate\"\n                            ></h4>\n                          </ion-list-header>\n                          @for (\n                            operation of [\n                              OperationKeys.UPDATE,\n                              OperationKeys.DELETE,\n                            ];\n                            track operation\n                          ) {\n                            @if (operations?.includes(operation)) {\n                              <ion-item\n                                [button]=\"true\"\n                                (click)=\"\n                                  handleAction($event, operation, component)\n                                \"\n                              >\n                                <div slot=\"start\">\n                                  @if (operation === OperationKeys.UPDATE) {\n                                    <ngx-decaf-icon\n                                      [button]=\"true\"\n                                      slot=\"icon-only\"\n                                      name=\"ti-edit\"\n                                    />\n                                  } @else {\n                                    <ngx-decaf-icon\n                                      [button]=\"true\"\n                                      slot=\"icon-only\"\n                                      color=\"danger\"\n                                      name=\"ti-trash\"\n                                    />\n                                  }\n                                </div>\n                                <ion-label class=\"dcf-text-capitalize\">\n                                  {{ operation | translate }}\n                                </ion-label>\n                              </ion-item>\n                            }\n                          }\n                        </ion-list>\n                      </ion-content>\n                    </ng-template>\n                  </ion-popover>\n                } @else {\n                  <div\n                    class=\"dcf-grid-actions dcf-grid dcf-grid-small dcf-flex\"\n                  >\n                    @for (\n                      operation of [OperationKeys.UPDATE, OperationKeys.DELETE];\n                      track operation\n                    ) {\n                      <div>\n                        @if (operations?.includes(operation)) {\n                          <ngx-decaf-icon\n                            (click)=\"handleAction($event, operation, component)\"\n                            fill=\"clear\"\n                            shape=\"round\"\n                            [attr.aria-label]=\"\n                              locale + '.operations.' + operation | translate\n                            \"\n                            [button]=\"true\"\n                            slot=\"icon-only\"\n                            [color]=\"\n                              operation === OperationKeys.UPDATE\n                                ? 'dark'\n                                : 'danger'\n                            \"\n                            [name]=\"\n                              operation === OperationKeys.UPDATE\n                                ? 'ti-edit'\n                                : 'ti-trash'\n                            \"\n                          />\n                        }\n                      </div>\n                    }\n                  </div>\n                }\n              </div>\n            }\n            @if (windowWidth > 639) {\n              <div id=\"end\">\n                <ng-content select=\"[slot='end']\"></ng-content>\n              </div>\n            }\n          </div>\n        </div>\n      </div>\n    </ion-item>\n    @if (showSlideItems && uid) {\n      <ion-item-options\n        side=\"end\"\n        (ionSwipe)=\"\n          operations.length === 1\n            ? handleAction($event, operations[0], component)\n            : ''\n        \"\n      >\n        @if (operations?.includes(OperationKeys.UPDATE)) {\n          <ion-item-option\n            class=\"dcf-update\"\n            (click)=\"handleAction($event, OperationKeys.UPDATE, component)\"\n            [expandable]=\"operations.length === 1\"\n          >\n            <ion-icon\n              aria-hidden=\"true\"\n              slot=\"icon-only\"\n              name=\"create-outline\"\n            />\n          </ion-item-option>\n        }\n        @if (operations?.includes(OperationKeys.DELETE)) {\n          <ion-item-option\n            class=\"dcf-delete\"\n            (click)=\"handleAction($event, OperationKeys.DELETE, component)\"\n            [expandable]=\"operations.length === 1\"\n          >\n            <ion-icon\n              aria-hidden=\"true\"\n              slot=\"icon-only\"\n              name=\"trash\"\n            />\n          </ion-item-option>\n        }\n      </ion-item-options>\n    }\n  </ion-item-sliding>\n}\n","/**\n * @module module:lib/components/pagination/pagination.component\n * @description Pagination component module.\n * @summary Provides `PaginationComponent` for displaying page navigation controls\n * and emitting pagination events. Use this component to navigate paginated data\n * in lists and other collections.\n *\n * @link {@link PaginationComponent}\n */\n\nimport { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core';\nimport { ComponentEventNames } from '@decaf-ts/ui-decorators';\nimport { IonIcon } from '@ionic/angular/standalone';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { addIcons } from 'ionicons';\nimport { chevronBackOutline, chevronForwardOutline } from 'ionicons/icons';\nimport { IPaginationCustomEvent } from '../../engine/interfaces';\nimport { NgxComponentDirective } from '../../engine/NgxComponentDirective';\nimport { KeyValue } from '../../engine/types';\n\n/**\n * @description A pagination component for navigating through multiple pages of content.\n * @summary This component provides a user interface for paginated content navigation,\n * displaying page numbers and navigation controls. It supports customizable page counts,\n * current page tracking, and emits events when users navigate between pages.\n *\n * The component intelligently handles large numbers of pages by showing a subset of page\n * numbers with ellipses to indicate skipped pages, ensuring the UI remains clean and usable\n * even with many pages.\n *\n * @mermaid\n * sequenceDiagram\n *   participant U as User\n *   participant P as PaginationComponent\n *   participant E as External Component\n *\n *   U->>P: Click page number\n *   P->>P: navigate(page)\n *   P->>P: handleClick(direction, page)\n *   P->>E: Emit clickEvent with IPaginationCustomEvent\n *\n *   U->>P: Click next button\n *   P->>P: next()\n *   P->>P: handleClick('next')\n *   P->>E: Emit clickEvent with IPaginationCustomEvent\n *\n *   U->>P: Click previous button\n *   P->>P: previous()\n *   P->>P: handleClick('previous')\n *   P->>E: Emit clickEvent with IPaginationCustomEvent\n *\n * @example\n * <ngx-decaf-pagination\n *   [pages]=\"10\"\n *   [current]=\"3\"\n *   (clickEvent)=\"handlePageChange($event)\">\n * </ngx-decaf-pagination>\n *\n * @extends {NgxBaseComponentDirective}\n * @implements {OnInit}\n */\n@Component({\n  selector: 'ngx-decaf-pagination',\n  templateUrl: './pagination.component.html',\n  styleUrls: ['./pagination.component.scss'],\n  imports: [TranslatePipe, IonIcon],\n  standalone: true,\n  host: { '[attr.id]': 'uid' },\n})\nexport class PaginationComponent extends NgxComponentDirective implements OnInit {\n  @Input()\n  table!: ElementRef<HTMLElement>;\n\n  /**\n   * @description The total number of pages to display in the pagination component.\n   * @summary Specifies the total number of pages available for navigation. This is a required\n   * input that determines how many page numbers will be generated and displayed.\n   *\n   * @type {number}\n   * @required\n   * @memberOf PaginationComponent\n   */\n  @Input({ required: true })\n  totalPages!: number;\n\n  /**\n   * @description The currently active page number.\n   * @summary Specifies which page is currently active or selected. This value is used\n   * to highlight the current page in the UI and as a reference point for navigation.\n   *\n   * @type {number}\n   * @default 1\n   * @memberOf PaginationComponent\n   */\n  @Input()\n  current: number = 1;\n\n  /**\n   * @description Array of page objects for rendering in the template.\n   * @summary Contains the processed page data used for rendering the pagination UI.\n   * Each object includes an index (page number) and text representation.\n   *\n   * @type {KeyValue[]}\n   * @memberOf PaginationComponent\n   */\n  pages!: KeyValue[];\n\n  /**\n   * @description The last page number in the pagination.\n   * @summary Stores the number of the last page for boundary checking during navigation.\n   *\n   * @type {number}\n   * @memberOf PaginationComponent\n   */\n  last!: number;\n\n  /**\n   * @description Determines whether to truncate the displayed pages in the pagination.\n   * @summary If true, the pagination component will display a subset of pages with ellipses to indicate skipped pages. If false, all pages will be displayed.\n   *\n   * @type {boolean}\n   * @default true\n   * @memberOf PaginationComponent\n   */\n  @Input()\n  truncatePages: boolean = true;\n\n  /**\n   * @description Controls whether all pages are disabled.\n   * @summary When set to true, disables the display and functionality of all pages, effectively hiding pagination\n   * and preventing navigation between pages.\n   *\n   * @type {boolean}\n   * @default false\n   * @memberOf ListComponent\n   */\n  @Input()\n  disablePages: boolean = false;\n  /**\n   * @description Event emitter for pagination navigation events.\n   * @summary Emits a custom event when users navigate between pages, either by clicking\n   * on page numbers or using the next/previous buttons. The event contains information\n   * about the navigation direction and the target page number.\n   *\n   * @type {EventEmitter<IPaginationCustomEvent>}\n   * @memberOf PaginationComponent\n   */\n  @Output()\n  clickEvent: EventEmitter<IPaginationCustomEvent> = new EventEmitter<IPaginationCustomEvent>();\n\n  @Input()\n  bookMarkPagination: boolean = false;\n\n  @Input()\n  nextBookmark: string = '';\n\n  /**\n   * @constructor\n   * @description Initializes a new instance of the PaginationComponent.\n   * Calls the parent constructor with the component name for generate base locale string.\n   */\n  constructor() {\n    super('PaginationComponent');\n    addIcons({ chevronBackOutline, chevronForwardOutline });\n  }\n\n  /**\n   * @description Initializes the component after Angular sets the input properties.\n   * @summary Sets up the component by initializing the locale settings based on the\n   * translatable property, generating the page numbers based on the total pages and\n   * current page, and storing the last page number for boundary checking.\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant A as Angular Lifecycle\n   *   participant P as PaginationComponent\n   *\n   *   A->>P: ngOnInit()\n   *   P->>P: getLocale(translatable)\n   *   P->>P: Set locale\n   *   P->>P: getPages(data, current)\n   *   P->>P: Set pages array\n   *   P->>P: Set last page number\n   *\n   * @returns {void}\n   * @memberOf PaginationComponent\n   */\n  ngOnInit(): void {\n    if (this.disablePages) {\n      this.truncatePages = false;\n    }\n    // this.locale = this.getLocale(this.translatable);\n    this.pages = this.getPages(this.totalPages, this.current) as KeyValue[];\n    this.last = this.totalPages;\n    if (this.bookMarkPagination) {\n      this.disablePages = true;\n    }\n  }\n\n  /**\n   * @description Handles click events on pagination controls.\n   * @summary Processes user interactions with the pagination component, updating the\n   * current page if specified and emitting an event with navigation details. This method\n   * is called when users click on page numbers or navigation buttons.\n   *\n   * @param {('next' | 'previous')} direction - The direction of navigation\n   * @param {number} [page] - Optional page number to navigate to directly\n   * @returns {void}\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant U as User\n   *   participant P as PaginationComponent\n   *   participant E as External Component\n   *\n   *   U->>P: Click pagination control\n   *   P->>P: handleClick(direction, page?)\n   *   alt page is provided\n   *     P->>P: Update current page\n   *   end\n   *   P->>E: Emit clickEvent with direction and page\n   *\n   * @memberOf PaginationComponent\n   */\n  handleClick(direction: 'next' | 'previous', page?: number): void {\n    if (page) this.current = page;\n    this.clickEvent.emit({\n      name: ComponentEventNames.Click,\n      data: {\n        direction,\n        page: this.current,\n      },\n      component: this.componentName,\n    } as IPaginationCustomEvent);\n    if (this.table && this.table?.nativeElement) {\n      this.table.nativeElement.focus();\n    }\n  }\n\n  /**\n   * @description Generates the array of page objects for display.\n   * @summary Creates an array of page objects based on the total number of pages and\n   * the current page. For small page counts (≤5), all pages are shown. For larger page\n   * counts, a subset is shown with ellipses to indicate skipped pages. This ensures\n   * the pagination UI remains clean and usable even with many pages.\n   *\n   * @param {number} total - The total number of pages\n   * @param {number} [current] - The current active page (defaults to this.current)\n   * @returns {KeyValue[]} Array of page objects with index and text properties\n   *\n   * @mermaid\n   * flowchart TD\n   *   A[Start] --> B{total <= 5?}\n   *   B -->|Yes| C[Show all pages]\n   *   B -->|No| D[Show first page]\n   *   D --> E[Show last pages]\n   *   E --> F[Add ellipses for skipped pages]\n   *   C --> G[Return pages array]\n   *   F --> G\n   *\n   * @memberOf PaginationComponent\n   */\n  getPages(total: number, current?: number): KeyValue[] {\n    if (!current) current = this.current;\n\n    const pages: KeyValue[] = [];\n\n    function getPage(index: number | null, text = '', clazz = 'button'): void {\n      if (pages.some((item) => item['index'] === index)) return;\n      pages.push({\n        index,\n        text: index != null ? index.toString().padStart(2, '0') : text,\n        class: clazz,\n      });\n    }\n\n    if (!this.truncatePages) {\n      for (let i = 1; i <= total; i++) getPage(i);\n    } else {\n      if (total <= 5) {\n        for (let i = 1; i <= total; i++) getPage(i);\n      } else {\n        // Adiciona os dois primeiros\n        getPage(1);\n        getPage(2);\n\n        // Adiciona \"...\" entre os blocos\n        if (current && current > 3) getPage(null, '...');\n\n        // Adiciona a página atual (se estiver no meio)\n        if (current && current > 2 && current < total - 1) getPage(current);\n\n        // Adiciona \"...\" entre os blocos\n        if (current && current < total - 2) getPage(null, '...', 'separator');\n\n        // Adiciona os dois últimos\n        getPage(total - 1);\n        getPage(total);\n      }\n    }\n\n    return pages;\n  }\n\n  /**\n   * @description Gets the current active page number.\n   * @summary Returns the current page number that is active in the pagination component.\n   * This method provides a way to access the current page state from outside the component.\n   *\n   * @returns {number} The current page number\n   * @memberOf PaginationComponent\n   */\n  getCurrent(): number {\n    return this.current;\n  }\n\n  /**\n   * @description Navigates to the next page.\n   * @summary Increments the current page number if not at the last page and triggers\n   * the click event handler with 'next' direction. This method is typically called\n   * when the user clicks on the \"next\" button in the pagination UI.\n   *\n   * @returns {void}\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant U as User\n   *   participant P as PaginationComponent\n   *\n   *   U->>P: Click next button\n   *   P->>P: next()\n   *   alt page <= max pages\n   *     P->>P: Increment current page\n   *     P->>P: handleClick('next')\n   *   end\n   *\n   * @memberOf PaginationComponent\n   */\n  next(): void {\n    if (!this.bookMarkPagination) {\n      const page = this.current + 1;\n      if (page <= Object.keys(this.pages)?.length || 0) {\n        this.current = page;\n        this.handleClick('next');\n      }\n    } else {\n      if (this.nextBookmark) {\n        if (this.nextBookmark) {\n          const page = this.current + 1;\n          this.current = page;\n          this.handleClick('next');\n        }\n      }\n    }\n  }\n\n  /**\n   * @description Navigates to the previous page.\n   * @summary Decrements the current page number if not at the first page and triggers\n   * the click event handler with 'previous' direction. This method is typically called\n   * when the user clicks on the \"previous\" button in the pagination UI.\n   *\n   * @returns {void}\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant U as User\n   *   participant P as PaginationComponent\n   *\n   *   U->>P: Click previous button\n   *   P->>P: previous()\n   *   alt page > 0\n   *     P->>P: Decrement current page\n   *     P->>P: handleClick('previous')\n   *   end\n   *\n   * @memberOf PaginationComponent\n   */\n  previous(): void {\n    const page = this.current - 1;\n    if (page > 0) {\n      this.current = page;\n      this.handleClick('previous');\n    }\n  }\n\n  /**\n   * @description Navigates to a specific page number.\n   * @summary Updates the current page to the specified page number and triggers\n   * the click event handler with the appropriate direction. This method is typically\n   * called when the user clicks directly on a page number in the pagination UI.\n   *\n   * @param {number | null} page - The page number to navigate to\n   * @returns {void}\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant U as User\n   *   participant P as PaginationComponent\n   *\n   *   U->>P: Click page number\n   *   P->>P: navigate(page)\n   *   alt page is not null and different from current\n   *     P->>P: Determine direction (next/previous)\n   *     P->>P: handleClick(direction, page)\n   *   end\n   *\n   * @memberOf PaginationComponent\n   */\n  navigate(page: number | null): void {\n    if (page !== null && this.current !== (page as number))\n      this.handleClick(page > this.current ? 'next' : 'previous', page);\n  }\n}\n","<div\n  [id]=\"uid\"\n  class=\"dcf-paginator-container dcf-flex dcf-flex-center\"\n  #component\n>\n  @if (pages?.length > 1 || bookMarkPagination) {\n    <div class=\"dcf-width-1-1\">\n      @if (!bookMarkPagination) {\n        <div\n          class=\"dcf-pagination-resume\"\n          [innerHTML]=\"\n            locale + '.resume' | translate: { '0': current, '1': last }\n          \"\n        ></div>\n      }\n\n      <div\n        #paginationComponent\n        class=\"dcf-pagination dcf-flex-center\"\n        [class.dcf-bookmark-pagination]=\"bookMarkPagination\"\n      >\n        <div\n          aria-label=\"previous\"\n          tabindex=\"0\"\n          [class]=\"disablePages ? 'dcf-nav dcf-nav-prev' : ''\"\n          (click)=\"previous()\"\n          (keydown.enter)=\"previous()\"\n          [class.dcf-disabled]=\"current === 1\"\n          [class.dcf-hidden]=\"bookMarkPagination && nextBookmark === 'nil'\"\n        >\n          <ion-icon\n            name=\"chevron-back-outline\"\n            aria-hidden=\"true\"\n          ></ion-icon>\n\n          @if (disablePages) {\n            {{ locale + '.previous' | translate }}\n          }\n        </div>\n\n        @if (!disablePages) {\n          @for (page of pages; track page) {\n            <div\n              tabindex=\"0\"\n              [class]=\"page['class']\"\n              (click)=\"navigate(page['index'])\"\n              (keydown.enter)=\"navigate(page['index'])\"\n              [class.dcf-active]=\"current === page['index']\"\n            >\n              <span class=\"page-item\">{{ page['text'] }}</span>\n            </div>\n          }\n        }\n        @if (\n          pages?.length > 1 || (bookMarkPagination && nextBookmark !== 'nil')\n        ) {\n          <div\n            tabindex=\"0\"\n            [class]=\"disablePages ? 'dcf-nav dcf-nav-next' : ''\"\n            (click)=\"next()\"\n            (keydown.enter)=\"next()\"\n            [class.dcf-disabled]=\"\n              current === last || (bookMarkPagination && !nextBookmark?.length)\n            \"\n          >\n            @if (disablePages) {\n              {{ locale + '.next' | translate }}\n            }\n            <ion-icon\n              name=\"chevron-forward-outline\"\n              aria-hidden=\"true\"\n            ></ion-icon>\n          </div>\n        }\n      </div>\n    </div>\n  }\n</div>\n","/**\n * @module module:lib/components/list/list.component\n * @description List component module.\n * @summary Provides the `ListComponent` which renders collections of data with\n * support for infinite scroll, pagination, searching, filtering, custom item\n * rendering and refresh events. Use this module's `ListComponent` to display\n * lists sourced from models, functions or direct data arrays.\n *\n * @link {@link ListComponent}\n */\n\nimport { Component, EventEmitter, HostListener, Input, OnDestroy, OnInit, Output } from '@angular/core';\nimport { Condition, Observer, Paginator } from '@decaf-ts/core';\nimport { OperationKeys } from '@decaf-ts/db-decorators';\nimport { Constructor, Metadata } from '@decaf-ts/decoration';\nimport { Model, Primitives } from '@decaf-ts/decorator-validation';\nimport { ComponentEventNames, UIFunctionLike } from '@decaf-ts/ui-decorators';\nimport { InfiniteScrollCustomEvent, RefresherCustomEvent, SpinnerTypes } from '@ionic/angular';\nimport {\n  IonButton,\n  IonInfiniteScroll,\n  IonInfiniteScrollContent,\n  IonItem,\n  IonLabel,\n  IonList,\n  IonRefresher,\n  IonRefresherContent,\n  IonSkeletonText,\n  IonText,\n  IonThumbnail,\n} from '@ionic/angular/standalone';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { debounceTime, shareReplay, Subject, takeUntil } from 'rxjs';\nimport { NgxComponentDirective } from '../../engine/NgxComponentDirective';\nimport { ComponentsTagNames, DefaultListEmptyOptions, ListComponentsTypes } from '../../engine/constants';\nimport { Dynamic } from '../../engine/decorators';\nimport {\n  IBaseCustomEvent,\n  IFilterQuery,\n  IFilterQueryItem,\n  IListEmptyOptions,\n  IListItemCustomEvent,\n  IPaginationCustomEvent,\n} from '../../engine/interfaces';\nimport { DecafRepository, FunctionLike, KeyValue } from '../../engine/types';\nimport { dateFromString, formatDate, isValidDate, stringToBoolean } from '../../utils/helpers';\nimport { ComponentRendererComponent } from '../component-renderer/component-renderer.component';\nimport { EmptyStateComponent } from '../empty-state/empty-state.component';\nimport { FilterComponent } from '../filter/filter.component';\nimport { PaginationComponent } from '../pagination/pagination.component';\nimport { SearchbarComponent } from '../searchbar/searchbar.component';\n\n/**\n * @description A versatile list component that supports various data display modes.\n * @summary This component provides a flexible way to display lists of data with support\n * for infinite scrolling, pagination, searching, and custom item rendering. It can fetch\n * data from various sources including models, functions, or direct data input.\n *\n * The component supports two main display types:\n * 1. Infinite scrolling - Loads more data as the user scrolls\n * 2. Pagination - Displays data in pages with navigation controls\n *\n * Additional features include:\n * - Pull-to-refresh functionality\n * - Search filtering\n * - Empty state customization\n * - Custom item rendering\n * - Event emission for interactions\n *\n * @mermaid\n * sequenceDiagram\n *   participant U as User\n *   participant L as ListComponent\n *   participant D as Data Source\n *   participant E as External Components\n *\n *   U->>L: Initialize component\n *   L->>L: ngOnInit()\n *   L->>D: Request initial data\n *   D-->>L: Return data\n *   L->>L: Process and display data\n *\n *   alt User scrolls (Infinite mode)\n *     U->>L: Scroll to bottom\n *     L->>D: Request more data\n *     D-->>L: Return additional data\n *     L->>L: Append to existing data\n *   else User changes page (Paginated mode)\n *     U->>L: Click page number\n *     L->>L: handlePaginate()\n *     L->>D: Request data for page\n *     D-->>L: Return page data\n *     L->>L: Replace displayed data\n *   end\n *\n *   alt User searches\n *     U->>L: Enter search term\n *     L->>L: handleSearch()\n *     L->>D: Filter data by search term\n *     D-->>L: Return filtered data\n *     L->>L: Update displayed data\n *   end\n *\n *   alt User clicks item\n *     U->>L: Click list item\n *     L->>L: handleClick()\n *     L->>E: Emit clickEvent\n *   end\n *\n * @example\n * <ngx-decaf-list\n *   [source]=\"dataSource\"\n *   [limit]=\"10\"\n *   [type]=\"'infinite'\"\n *   [showSearchbar]=\"true\"\n *   (clickEvent)=\"handleItemClick($event)\"\n *   (refreshEvent)=\"handleRefresh($event)\">\n * </ngx-decaf-list>\n *\n * @extends {NgxBaseComponentDirective}\n * @implements {OnInit}\n */\n@Dynamic()\n@Component({\n  selector: 'ngx-decaf-list',\n  templateUrl: './list.component.html',\n  styleUrls: ['./list.component.scss'],\n  standalone: true,\n  imports: [\n    TranslatePipe,\n    IonRefresher,\n    IonButton,\n    PaginationComponent,\n    IonList,\n    IonItem,\n    IonThumbnail,\n    IonSkeletonText,\n    IonLabel,\n    IonText,\n    IonRefresherContent,\n    IonInfiniteScroll,\n    IonInfiniteScrollContent,\n    IonThumbnail,\n    IonSkeletonText,\n    SearchbarComponent,\n    EmptyStateComponent,\n    FilterComponent,\n    ComponentRendererComponent,\n  ],\n  host: { '[attr.id]': 'uid' },\n})\nexport class ListComponent extends NgxComponentDirective implements OnInit, OnDestroy {\n  /**\n   * @description The display mode for the list component.\n   * @summary Determines how the list data is loaded and displayed. Options include:\n   * - INFINITE: Loads more data as the user scrolls (infinite scrolling)\n   * - PAGINATED: Displays data in pages with navigation controls\n   *\n   * @type {ListComponentsTypes}\n   * @default ListComponentsTypes.INFINITE\n   * @memberOf ListComponent\n   */\n  @Input()\n  type: ListComponentsTypes = ListComponentsTypes.PAGINATED;\n\n  /**\n   * @description Controls the visibility of the search bar.\n   * @summary When set to true, displays a search bar at the top of the list that allows\n   * users to filter the list items. The search functionality works by filtering the\n   * existing data or by triggering a new data fetch with search parameters.\n   *\n   * @type {boolean}\n   * @default true\n   * @memberOf ListComponent\n   */\n  @Input()\n  showSearchbar: boolean = true;\n\n  /**\n   * @description Controls the visibility of the search bar.\n   * @summary When set to true, displays a search bar at the top of the list that allows\n   * users to filter the list items. The search functionality works by filtering the\n   * existing data or by triggering a new data fetch with search parameters.\n   *\n   * @type {boolean}\n   * @default true\n   * @memberOf ListComponent\n   */\n  @Input()\n  searchbarPlaceholder!: string;\n\n  /**\n   * @description Direct data input for the list component.\n   * @summary Provides a way to directly pass data to the list component instead of\n   * fetching it from a source. When both data and source are provided, the component\n   * will use the source to fetch data only if the data array is empty.\n   *\n   * @type {KeyValue[] | undefined}\n   * @default undefined\n   * @memberOf ListComponent\n   */\n  @Input()\n  data?: KeyValue[] | undefined = undefined;\n\n  /**\n   * @description The data source for the list component.\n   * @summary Specifies where the list should fetch its data from. This can be either:\n   * - A string URL or endpoint identifier\n   * - A function that returns data when called\n   * The component will call this source when it needs to load or refresh data.\n   *\n   * @type {string | FunctionLike}\n   * @required\n   * @memberOf ListComponent\n   */\n  @Input()\n  source!: string | FunctionLike;\n\n  /**\n   * @description Controls whether more data can be loaded.\n   * @summary When set to true, the component will allow loading additional data\n   * through infinite scrolling or pagination. When false, the component will not\n   * attempt to load more data beyond what is initially displayed.\n   *\n   * @type {boolean}\n   * @default true\n   * @memberOf ListComponent\n   */\n  @Input()\n  loadMoreData: boolean = true;\n\n  /**\n   * @description The style of dividing lines between list items.\n   * @summary Determines how dividing lines appear between list items. Options include:\n   * - \"inset\": Lines are inset from the edges\n   * - \"full\": Lines extend the full width\n   * - \"none\": No dividing lines\n   *\n   * @type {\"inset\" | \"full\" | \"none\"}\n   * @default \"full\"\n   * @memberOf ListComponent\n   */\n  @Input()\n  lines: 'inset' | 'full' | 'none' = 'full';\n\n  /**\n   * @description Controls whether the list has inset styling.\n   * @summary When set to true, the list will have inset styling with rounded corners\n   * and margin around the edges. This creates a card-like appearance for the list.\n   *\n   * @type {boolean}\n   * @default false\n   * @memberOf ListComponent\n   */\n  @Input()\n  inset: boolean = false;\n\n  /**\n   * @description The threshold for triggering infinite scroll loading.\n   * @summary Specifies how close to the bottom of the list the user must scroll\n   * before the component triggers loading of additional data. This is expressed\n   * as a percentage of the list height.\n   *\n   * @type {string}\n   * @default \"15%\"\n   * @memberOf ListComponent\n   */\n  @Input()\n  scrollThreshold: string = '15%';\n\n  /**\n   * @description The position where new items are added during infinite scrolling.\n   * @summary Determines whether new items are added to the top or bottom of the list\n   * when loading more data through infinite scrolling.\n   *\n   * @type {\"bottom\" | \"top\"}\n   * @default \"bottom\"\n   * @memberOf ListComponent\n   */\n  @Input()\n  scrollPosition: 'bottom' | 'top' = 'bottom';\n\n  /**\n   * @description Custom text to display during loading operations.\n   * @summary Specifies the text shown in the loading indicator when the component\n   * is fetching data. If not provided, a default loading message will be used.\n   *\n   * @type {string | undefined}\n   * @memberOf ListComponent\n   */\n  @Input()\n  loadingText?: string;\n\n  /**\n   * @description Controls the visibility of the pull-to-refresh feature.\n   * @summary When set to true, enables the pull-to-refresh functionality that allows\n   * users to refresh the list data by pulling down from the top of the list.\n   *\n   * @type {boolean}\n   * @default true\n   * @memberOf ListComponent\n   */\n  @Input()\n  showRefresher: boolean = true;\n\n  /**\n   * @description Controls the visibility of the create button.\n   * @summary When set to true, displays a button to create new items in the list.\n   *\n   * @type {boolean}\n   * @default false\n   * @memberOf ListComponent\n   */\n  @Input()\n  createButton: boolean = false;\n\n  /**\n   * @description The type of spinner to display during loading operations.\n   * @summary Specifies the visual style of the loading spinner shown during data\n   * fetching operations. Uses Ionic's predefined spinner types.\n   *\n   * @type {SpinnerTypes}\n   * @default \"circular\"\n   * @memberOf ListComponent\n   */\n  @Input()\n  loadingSpinner: SpinnerTypes = 'circular';\n\n  // /**\n  //  * @description Query parameters for data fetching.\n  //  * @summary Specifies additional query parameters to use when fetching data from\n  //  * the source. This can be provided as a string (JSON) or a direct object.\n  //  *\n  //  * @type {string | KeyValue | undefined}\n  //  * @memberOf ListComponent\n  //  */\n  // @Input()\n  // query?: string | KeyValue;\n\n  /**\n   * @description Controls whether the filtering functionality is enabled.\n   * @summary When set to true, enables the filter component that allows users to create\n   * complex search criteria with multiple field filters, conditions, and values.\n   * When false, disables the filter interface entirely.\n   *\n   * @type {boolean}\n   * @default true\n   * @memberOf ListComponent\n   */\n  @Input()\n  enableFilter: boolean = true;\n\n  /**\n   * @description Controls whether multiple filter groups can be applied simultaneously.\n   * @summary When true, the filter component allows users to build compound queries with\n   * several filter rows. When false, only a single filter row is available.\n   *\n   * @type {boolean}\n   * @default true\n   * @memberOf ListComponent\n   */\n  @Input()\n  multipleFilter: boolean = true;\n\n  /**\n   * @description Controls whether sorting functionality is disabled.\n   * @summary When set to true, disables the sort controls and prevents users from\n   * changing the sort order or field. The list will maintain its default or\n   * programmatically set sort configuration without user interaction.\n   *\n   * @type {boolean}\n   * @default false\n   * @memberOf ListComponent\n   */\n  @Input()\n  disableSort: boolean = false;\n\n  /**\n   * @description Controls whether pagination pages are disabled.\n   * @summary When set to true, disables the pagination controls, preventing users from navigating between pages.\n   * This is useful for scenarios where pagination is not required or should be hidden.\n   *\n   * @type {boolean}\n   * @default false\n   * @memberOf ListComponent\n   */\n  @Input()\n  disablePaginationPages: boolean = false;\n\n  /**\n   * @description Controls whether pagination pages are truncated.\n   * @summary When set to true, truncates the pagination controls to show fewer pages, improving the user interface\n   * for lists with a large number of pages.\n   *\n   * @type {boolean}\n   * @default true\n   * @memberOf ListComponent\n   */\n  @Input()\n  truncatePaginationPages: boolean = true;\n\n  /**\n   * @description Configuration for the empty state display.\n   * @summary Customizes how the empty state is displayed when no data is available.\n   * This includes the title, subtitle, button text, icon, and navigation link.\n   *\n   * @type {Partial<IListEmptyOptions>}\n   * @default {\n   *   title: 'empty.title',\n   *   subtitle: 'empty.subtitle',\n   *   showButton: false,\n   *   icon: 'alert-circle-outline',\n   *   buttonText: 'locale.empty.button',\n   *   link: ''\n   * }\n   * @memberOf ListComponent\n   */\n  @Input()\n  empty: Partial<IListEmptyOptions> = {};\n\n  /**\n   * @description The current page number in paginated mode.\n   * @summary Tracks which page is currently being displayed when the component\n   * is in paginated mode. This is used for pagination controls and data fetching.\n   *\n   * @type {number}\n   * @default 1\n   * @memberOf ListComponent\n   */\n  page: number = 1;\n\n  /**\n   * @description The total number of pages available.\n   * @summary Stores the calculated total number of pages based on the data size\n   * and limit. This is used for pagination controls and boundary checking.\n   *\n   * @type {number}\n   * @memberOf ListComponent\n   */\n  pages!: number;\n\n  /**\n   * @description Array used for rendering skeleton loading placeholders.\n   * @summary Contains placeholder items that are displayed during data loading.\n   * The length of this array determines how many skeleton items are shown.\n   *\n   * @type {string[]}\n   * @default new Array(2)\n   * @memberOf ListComponent\n   */\n  skeletonData: string[] = new Array(2);\n\n  /**\n   * @description The processed list items ready for display.\n   * @summary Stores the current set of items being displayed in the list after\n   * processing from the raw data source. This may be a subset of the full data\n   * when using pagination or infinite scrolling.\n   *\n   * @type {KeyValue[]}\n   * @memberOf ListComponent\n   */\n  items!: KeyValue[];\n\n  searching: boolean = false;\n\n  /**\n   * @description A paginator object for handling pagination operations.\n   * @summary Provides a paginator object that can be used to retrieve and navigate\n   * through data in chunks, reducing memory usage and improving performance.\n   *\n   * The paginator object is initialized in the `ngOnInit` lifecycle hook and is\n   * used to fetch and display data in the pagination component. It is an instance\n   * of the `Paginator` class from the `@decaf-ts/core` package, which provides\n   * methods for querying and manipulating paginated data.\n   *\n   * @type {Paginator<Model>}\n   * @memberOf PaginationComponent\n   */\n  paginator!: Paginator<Model> | undefined;\n\n  /**\n   * @description The last page number that was displayed.\n   * @summary Keeps track of the previously displayed page number, which is useful\n   * for handling navigation and search operations in paginated mode.\n   *\n   * @type {number}\n   * @default 1\n   * @memberOf ListComponent\n   */\n  lastPage: number = 1;\n\n  bookMarkPagination: boolean = false;\n\n  /**\n   * @description Event emitter for item click interactions.\n   * @summary Emits an event when a list item is clicked. The event includes the data\n   * of the clicked item, allowing parent components to respond to the interaction.\n   *\n   * @type {EventEmitter<KeyValue>}\n   * @memberOf ListComponent\n   */\n  @Output()\n  clickEvent: EventEmitter<IListItemCustomEvent | IBaseCustomEvent> = new EventEmitter<\n    IListItemCustomEvent | IBaseCustomEvent\n  >();\n\n  /**\n   * @description Subject for debouncing click events.\n   * @summary Uses RxJS Subject to collect click events and emit them after a debounce\n   * period. This prevents multiple rapid clicks from triggering multiple events.\n   *\n   * @private\n   * @type {Subject<CustomEvent | IListItemCustomEvent | IBaseCustomEvent>}\n   * @memberOf ListComponent\n   */\n  private clickItemSubject: Subject<CustomEvent | IListItemCustomEvent | IBaseCustomEvent> = new Subject<\n    CustomEvent | IListItemCustomEvent | IBaseCustomEvent\n  >();\n\n  /**\n   * @description Initializes a new instance of the ListComponent.\n   * @summary Creates a new ListComponent and sets up the base component with the appropriate\n   * component name. This constructor is called when Angular instantiates the component and\n   * before any input properties are set. It passes the component name to the parent class\n   * constructor to enable proper localization and component identification.\n   *\n   * The constructor is intentionally minimal, with most initialization logic deferred to\n   * the ngOnInit lifecycle hook. This follows Angular best practices by keeping the constructor\n   * focused on dependency injection and basic setup, while complex initialization that depends\n   * on input properties is handled in ngOnInit.\n   *\n   * @memberOf ListComponent\n   */\n  constructor() {\n    super('ListComponent');\n  }\n\n  /**\n   * @description Initializes the component after Angular sets the input properties.\n   * @summary Sets up the component by initializing event subscriptions, processing boolean\n   * inputs, and loading the initial data. This method prepares the component for user\n   * interaction by ensuring all properties are properly initialized and data is loaded.\n   *\n   * @returns {Promise<void>}\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant A as Angular Lifecycle\n   *   participant L as ListComponent\n   *   participant D as Data Source\n   *\n   *   A->>L: ngOnInit()\n   *   L->>L: Set up click event debouncing\n   *   L->>L: Process boolean inputs\n   *   L->>L: Configure component based on inputs\n   *   L->>L: refresh()\n   *   L->>D: Request initial data\n   *   D-->>L: Return data\n   *   L->>L: Process and display data\n   *   L->>L: Configure empty state if needed\n   *   L->>L: initialize()\n   *\n   * @memberOf ListComponent\n   */\n  async ngOnInit(): Promise<void> {\n    // this.initialized = false;\n    // this.router.events.subscribe(async event => {\n    //   if (event instanceof NavigationStart)\n    //     await super.ngOnDestroy();\n    // });\n\n    if (!this.searchbarPlaceholder) this.searchbarPlaceholder = `${this.locale}.search.placeholder`;\n\n    this.clickItemSubject\n      .pipe(debounceTime(100), shareReplay({ bufferSize: 1, refCount: true }), takeUntil(this.destroySubscriptions$))\n      .subscribe((event) => this.clickEventEmit(event as IListItemCustomEvent | IBaseCustomEvent));\n\n    this.limit = Number(this.limit);\n    this.start = Number(this.start);\n\n    this.enableFilter = stringToBoolean(this.enableFilter);\n    this.inset = stringToBoolean(this.inset);\n    this.showRefresher = stringToBoolean(this.showRefresher);\n    this.loadMoreData = stringToBoolean(this.loadMoreData);\n    this.showSearchbar = stringToBoolean(this.showSearchbar);\n    this.disableSort = stringToBoolean(this.disableSort);\n\n    if (!this.operations || !this.operations.includes(OperationKeys.CREATE)) this.createButton = false;\n    if (typeof this.item?.['tag'] === 'boolean' && this.item?.['tag'] === true)\n      this.item['tag'] = ComponentsTagNames.LIST_ITEM as string;\n    if (!this.initialized) this.parseProps(this);\n    this.empty = Object.assign({}, DefaultListEmptyOptions, this.empty);\n    // await this.initialize();\n    await this.initialize();\n    await this.refresh();\n  }\n\n  /**\n   * @description Cleans up resources when the component is destroyed.\n   * @summary Performs cleanup operations when the component is being removed from the DOM.\n   * This includes clearing references to models and data to prevent memory leaks.\n   *\n   * @returns {Promise<void>}\n   * @memberOf ListComponent\n   */\n  override async ngOnDestroy(): Promise<void> {\n    await this.destroy();\n  }\n\n  /**\n   * @description Releases component resources and unregisters repository observers.\n   * @summary Invoked by Angular teardown logic to ensure the base directive and any\n   * attached repositories stop emitting events, preventing memory leaks when the\n   * list component leaves the DOM.\n   *\n   * The method performs the following actions:\n   * - Delegates to the parent directive's `ngOnDestroy` for shared cleanup\n   * - Detaches the repository observer when one is registered\n   * - Catches and logs repository errors to avoid bubbling failures\n   * - Clears internal references to large objects so they can be garbage collected\n   *\n   * @returns {Promise<void>} Resolves when every teardown step completes.\n   */\n  async destroy(): Promise<void> {\n    await super.ngOnDestroy();\n    if (this._repository && this.repositoryObserver) {\n      const repo = this._repository as DecafRepository<Model>;\n      //TODO: fix check observerHandler\n      if (repo) {\n        const observeHandler = repo['observerHandler'] as { observers: Observer[] } | undefined;\n        if (observeHandler && observeHandler?.observers?.length) {\n          try {\n            repo.unObserve(this.repositoryObserver);\n            this.log.info(`Repository observer detached successfully for repository ${repo.class.name}`);\n          } catch (error: unknown) {\n            this.log.info((error as Error)?.message);\n          }\n        }\n      }\n    }\n    this.data = this.model = this._repository = this.paginator = undefined;\n  }\n\n  /**\n   * @description Produces the sanitized mapper configuration.\n   * @summary Merges the component mapper with the primary key metadata and filters\n   * non-string entries so downstream rendering logic only receives valid bindings.\n   *\n   * @protected\n   * @returns {KeyValue} A mapper object that contains string values mapped to the\n   * component's public keys.\n   */\n  protected async getMapper(): Promise<KeyValue> {\n    this.mapper = { ...this.mapper, ...{ uid: this.pk } };\n    const mapper = {} as KeyValue;\n    for (const [key, value] of Object.entries(this.mapper as Record<string, unknown>)) {\n      if (typeof value === Primitives.STRING) {\n        mapper[key] = value;\n        continue;\n      }\n      const mapperFn = (value as KeyValue)?.['valueParserFn'] || undefined;\n      if (typeof mapperFn === 'function') {\n        const value = await mapperFn(this, key);\n        if (typeof value === Primitives.STRING) {\n          mapper[value] = key;\n        }\n      }\n    }\n    return mapper;\n  }\n\n  /**\n   * @description Refreshes the list data from the configured source.\n   * @summary This method handles both initial data loading and subsequent refresh operations,\n   * including pull-to-refresh and infinite scrolling. It manages the data fetching process,\n   * updates the component's state, and handles pagination or infinite scrolling logic based\n   * on the component's configuration.\n   *\n   * The method performs the following steps:\n   * 1. Sets the refreshing flag to indicate a data fetch is in progress\n   * 2. Calculates the appropriate start and limit values based on pagination settings\n   * 3. Fetches data from the appropriate source (model or request)\n   * 4. Updates the component's data and emits a refresh event\n   * 5. Handles pagination or infinite scrolling state updates\n   * 6. Completes any provided event (like InfiniteScrollCustomEvent)\n   *\n   * @param {InfiniteScrollCustomEvent | RefresherCustomEvent | boolean} event - The event that triggered the refresh,\n   * or a boolean flag indicating if this is a forced refresh\n   * @returns {Promise<void>} A promise that resolves when the refresh operation is complete\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant L as ListComponent\n   *   participant D as Data Source\n   *   participant E as Event System\n   *\n   *   L->>L: refresh(event)\n   *   L->>L: Set refreshing flag\n   *   L->>L: Calculate start and limit\n   *   alt Using model\n   *     L->>D: getFromModel(force, start, limit)\n   *     D-->>L: Return data\n   *   else Using request\n   *     L->>D: getFromRequest(force, start, limit)\n   *     D-->>L: Return data\n   *   end\n   *   L->>E: refreshEventEmit()\n   *   alt Infinite scrolling mode\n   *     L->>L: Check if reached last page\n   *     alt Last page reached\n   *       L->>L: Complete scroll event\n   *       L->>L: Disable loadMoreData\n   *     else More pages available\n   *       L->>L: Increment page number\n   *       L->>L: Complete scroll event after delay\n   *     end\n   *   else Paginated mode\n   *     L->>L: Clear refreshing flag after delay\n   *   end\n   *\n   * @memberOf ListComponent\n   */\n  override async refresh(event: InfiniteScrollCustomEvent | RefresherCustomEvent | boolean = false): Promise<void> {\n    await super.refresh();\n    //  if (typeof force !== 'boolean' && force.type === ComponentEventNames.BackButtonClickEvent) {\n    //    const {refresh} = (force as CustomEvent).detail;\n    //    if (!refresh)\n    //      return false;\n    //  }\n    this.refreshing = true;\n    const start: number = this.page > 1 ? (this.page - 1) * this.limit : this.start;\n    const limit: number = this.page * (this.limit > 12 ? 12 : this.limit);\n\n    this.data = !this.model\n      ? await this.getFromRequest(!!event, start, limit)\n      : ((await this.getFromModel(!!event)) as KeyValue[]);\n    if (this.isModalChild) {\n      this.changeDetectorRef.detectChanges();\n    }\n    this.refreshEventEmit(this.data);\n    if (this.type === ListComponentsTypes.INFINITE) {\n      if (this.page === this.pages) {\n        if ((event as InfiniteScrollCustomEvent)?.target) (event as InfiniteScrollCustomEvent).target.complete();\n        this.loadMoreData = false;\n      } else {\n        this.page += 1;\n        this.refreshing = false;\n        setTimeout(() => {\n          if (\n            (event as InfiniteScrollCustomEvent)?.target &&\n            (event as CustomEvent)?.type !== ComponentEventNames.BackButtonClickEvent\n          )\n            (event as InfiniteScrollCustomEvent).target.complete();\n        }, 200);\n      }\n    } else {\n      setTimeout(() => {\n        this.refreshing = false;\n      }, 200);\n    }\n    this.changeDetectorRef.markForCheck();\n  }\n\n  /**\n   * @description Handles specific repository events and updates the list accordingly.\n   * @summary Processes repository change events (CREATE, UPDATE, DELETE) and performs\n   * the appropriate list operations. This includes adding new items, updating existing\n   * ones, or removing deleted items from the list display.\n   *\n   * @param {UIFunctionLike} clazz - The model instance that changed\n   * @param {OperationKeys} event - The type of operation (CREATE, UPDATE, DELETE)\n   * @param {string | number} uid - The unique identifier of the affected item\n   * @returns {Promise<void>}\n   * @memberOf ListComponent\n   */\n  override async handleObserveEvent<M extends Model>(\n    data: M,\n    constructor: UIFunctionLike,\n    event: OperationKeys,\n    uid: string | number\n  ): Promise<void> {\n    if (event === OperationKeys.CREATE) {\n      if (uid) {\n        await this.handleCreate(data, uid);\n      } else {\n        await this.refresh(true);\n      }\n    } else {\n      if (event === OperationKeys.UPDATE) {\n        await this.handleUpdate(data, uid);\n      }\n      if (event === OperationKeys.DELETE) this.handleDelete(uid);\n      this.refreshEventEmit();\n    }\n  }\n\n  /**\n   * @description Function for tracking items in the list.\n   * @summary Provides a tracking function for the `*ngFor` directive in the component template.\n   * This function is used to identify and control the rendering of items in the list,\n   * preventing duplicate or unnecessary rendering.\n   *\n   * The `trackItemFn` function takes two parameters: `index` (the index of the item in the list)\n   * and `item` (the actual item from the list). It returns the tracking key, which in this case\n   * is the union of the `uid` of the item with the model name.\n   *\n   * @param {number} index - The index of the item in the list.\n\n   * @param {KeyValue | string | number} item - The actual item from the list.\n   * @returns {string | number} The tracking key for the item.\n   * @memberOf ListComponent\n   */\n  override trackItemFn(index: number, item: KeyValue | string | number): string | number {\n    return `${(item as KeyValue)?.['uid'] || (item as KeyValue)?.[this.pk]}-${index}`;\n  }\n\n  /**\n   * Handles the create event from the repository.\n   *\n   * @param {string | number} uid - The ID of the item to create.\n   * @returns {Promise<void>} A promise that resolves when the item is created and added to the list.\n   */\n  async handleCreate(model: Model, uid: string | number): Promise<void> {\n    if (!model || !Object.keys(model).length) {\n      model = (await this._repository?.read(uid)) as Model;\n    }\n    const item = (await this.mapResults([model]))[0];\n    this.items = this.data = [item, ...(this.items || [])];\n  }\n\n  /**\n   * @description Handles the update event from the repository.\n   * @summary Updates the list item with the specified ID based on the new data.\n   *\n   * @param {string | number} uid - The ID of the item to update\n   * @returns {Promise<void>}\n   * @private\n   * @memberOf ListComponent\n   */\n  async handleUpdate(model: Model, uid: string | number): Promise<void> {\n    if (!model || !Object.keys(model).length) {\n      model = (await this._repository?.read(uid)) as Model;\n    }\n\n    // const item: KeyValue = this.itemMapper((await this._repository?.read(uid)) || {}, this.mapper);\n    this.data = [];\n    this.changeDetectorRef.detectChanges();\n    for (const key in this.items as KeyValue[]) {\n      const child = this.items[key] as KeyValue;\n      if (`${child['uid']}`.trim() === `${uid}`.trim()) {\n        this.items[key] = Object.assign({}, child, this.itemMapper(model || {}, this.mapper), {\n          model: model || {},\n        });\n        break;\n      }\n    }\n    this.data = [...this.items];\n    this.changeDetectorRef.detectChanges();\n  }\n\n  /**\n   * @description Removes an item from the list by ID.\n   * @summary Filters out an item with the specified ID from the data array and\n   * refreshes the list display. This is typically used after a delete operation.\n   *\n   * @param {string} modelId - The ID of the item to delete\n   * @param {string} pk - The primary key field name\n   * @returns {Promise<void>}\n   *\n   * @memberOf ListComponent\n   */\n  handleDelete(modelId: string | number, pk?: string): void {\n    if (!pk) {\n      pk = this.pk;\n    }\n    this.items = [\n      ...(this.data?.filter(({ uid }: KeyValue) => {\n        if (typeof uid === Primitives.STRING) {\n          return uid !== modelId;\n        } else {\n          const { value } = uid;\n          return value !== modelId;\n        }\n      }) || []),\n    ];\n    this.data = [...this.items];\n    if (!this.data.length) {\n      this.searchValue = undefined;\n      this.page = 1;\n      this.searching = false;\n    }\n    this.changeDetectorRef.detectChanges();\n  }\n\n  /**\n   * @description Handles click events from list items.\n   * @summary Listens for global ListItemClickEvent events and passes them to the\n   * debounced click subject. This allows the component to respond to clicks on\n   * list items regardless of where they originate from.\n   *\n   * @param {IListItemCustomEvent | IBaseCustomEvent} event - The click event\n   * @returns {Promise<void>}\n   *\n   * @memberOf ListComponent\n   */\n  @HostListener('window:ListItemClickEvent', ['$event'])\n  async handleClick(event: IListItemCustomEvent | IBaseCustomEvent): Promise<void> {\n    this.clickItemSubject.next(event);\n  }\n\n  /**\n   * @description Handles search events from the search bar.\n   * @summary Processes search queries from the search bar component, updating the\n   * displayed data based on the search term. The behavior differs between infinite\n   * and paginated modes to provide the best user experience for each mode.\n   *\n   * @param {string | undefined} value - The search term or undefined to clear search\n   * @returns {Promise<void>}\n   *\n   * @mermaid\n   * flowchart TD\n   *   A[Search Event] --> B{Type is Infinite?}\n   *   B -->|Yes| C[Disable loadMoreData]\n   *   B -->|No| D[Enable loadMoreData]\n   *   C --> E{Search value undefined?}\n   *   E -->|Yes| F[Enable loadMoreData]\n   *   E -->|No| G[Store search value]\n   *   D --> G\n   *   F --> H[Reset page to 1]\n   *   G --> I[Refresh data]\n   *   H --> I\n   *\n   * @memberOf ListComponent\n   */\n  @HostListener('window:searchbarEvent', ['$event'])\n  async handleSearch(value: string | IFilterQuery | undefined): Promise<void> {\n    this.searching = value !== undefined;\n\n    if (this.type === ListComponentsTypes.INFINITE) {\n      this.loadMoreData = false;\n      if (value === undefined) {\n        this.loadMoreData = true;\n        this.page = 1;\n        this.items = this.data = [];\n        this.changeDetectorRef.detectChanges();\n      }\n\n      this.searchValue = value;\n      if (this.isModalChild) {\n        this.changeDetectorRef.detectChanges();\n      }\n\n      await this.refresh(true);\n    } else {\n      this.loadMoreData = true;\n      this.searchValue = value;\n      if (value === undefined) this.page = this.lastPage;\n      await this.refresh(true);\n    }\n  }\n\n  /**\n   * @description Handles filter events from the filter component.\n   * @summary Processes filter queries from the filter component and applies them\n   * to the list data. This method acts as a bridge between the filter component\n   * and the search functionality, converting filter queries into search operations.\n   *\n   * @param {IFilterQuery | undefined} value - The filter query object or undefined to clear filters\n   * @returns {Promise<void>}\n   * @memberOf ListComponent\n   */\n  async handleFilter(value: IFilterQuery | undefined): Promise<void> {\n    await this.handleSearch(value);\n  }\n\n  /**\n   * @description Clears the current search and resets the list.\n   * @summary Convenience method that clears the search by calling handleSearch\n   * with undefined. This resets the list to show all data without filtering.\n   *\n   * @returns {Promise<void>}\n   * @memberOf ListComponent\n   */\n  async clearSearch(): Promise<void> {\n    await this.handleSearch(undefined);\n    if (this.isModalChild) this.changeDetectorRef.detectChanges();\n  }\n\n  /**\n   * @description Emits a refresh event with the current data.\n   * @summary Creates and emits a refresh event containing the current list data.\n   * This notifies parent components that the list data has been refreshed.\n   *\n   * @param {KeyValue[]} [data] - Optional data to include in the event\n   * @returns {void}\n   *\n   * @memberOf ListComponent\n   */\n  refreshEventEmit(data?: KeyValue[]): void {\n    if (!data) data = this.items;\n    this.skeletonData = new Array(1);\n    // Avoid emitting refresh events when the component is a child of a modal to prevent\n    if (!this.isModalChild) {\n      this.refreshEvent.emit({\n        name: ComponentEventNames.Refresh,\n        data: data || [],\n        component: this.componentName,\n      });\n    }\n  }\n\n  /**\n   * @description Emits a click event for a list item.\n   * @summary Processes and emits a click event when a list item is clicked.\n   * This extracts the relevant data from the event and passes it to parent components.\n   *\n   * @private\n   * @param {IListItemCustomEvent | IBaseCustomEvent} event - The click event\n   * @returns {void}\n   *\n   * @memberOf ListComponent\n   */\n  private clickEventEmit(event: IListItemCustomEvent | IBaseCustomEvent): void {\n    this.clickEvent.emit(event);\n  }\n\n  /**\n   * @description Handles pagination events from the pagination component.\n   * @summary Processes pagination events by updating the current page number and\n   * refreshing the list data to display the selected page. This method is called\n   * when a user interacts with the pagination controls to navigate between pages.\n   *\n   * @param {IPaginationCustomEvent} event - The pagination event containing page information\n   * @returns {Promise<void>}\n   *\n   * @memberOf ListComponent\n   */\n  async handlePaginate(event: IPaginationCustomEvent | number): Promise<void> {\n    this.page = typeof event === 'number' ? event : event.data?.page;\n    await this.refresh(true);\n  }\n\n  /**\n   * @description Handles pull-to-refresh events from the refresher component.\n   * @summary Processes refresh events triggered by the user pulling down on the list\n   * or by programmatic refresh requests. This method refreshes the list data and\n   * completes the refresher animation when the data is loaded.\n   *\n   * @param {InfiniteScrollCustomEvent | CustomEvent} [event] - The refresh event\n   * @returns {Promise<void>} A promise that resolves when the refresh operation is complete\n   *\n   * @memberOf ListComponent\n   */\n  async handleRefresh(event?: InfiniteScrollCustomEvent | CustomEvent): Promise<void> {\n    await this.refresh((event as InfiniteScrollCustomEvent) || true);\n    if (event instanceof CustomEvent)\n      setTimeout(() => {\n        // Any calls to load data go here\n        (event.target as HTMLIonRefresherElement).complete();\n      }, 400);\n  }\n\n  /**\n   * @description Filters data based on a search string.\n   * @summary Processes the current data array to find items that match the provided\n   * search string. This uses the arrayQueryByString utility to perform the filtering\n   * across all properties of the items.\n   *\n   * @param {KeyValue[]} results - The array of items to search through\n   * @param {string} search - The search string to filter by\n   * @returns {KeyValue[]} A promise that resolves to the filtered array of items\n   *\n   * @memberOf ListComponent\n   */\n  parseSearchResults(results: KeyValue[], search: string): KeyValue[] {\n    const filtered = results.filter((item: KeyValue) =>\n      Object.values(item).some((v) => {\n        if (`${v}`.toLowerCase().includes((search as string)?.toLowerCase())) return v;\n      })\n    );\n    return filtered;\n  }\n\n  /**\n   * @description Fetches data from a request source.\n   * @summary Retrieves data from the configured source function or URL, processes it,\n   * and updates the component's data state. This method handles both initial data loading\n   * and subsequent refresh operations when using an external data source rather than a model.\n   *\n   * @param {boolean} force - Whether to force a refresh even if data already exists\n   * @param {number} start - The starting index for pagination\n   * @param {number} limit - The maximum number of items to retrieve\n   * @returns {Promise<KeyValue[]>} A promise that resolves to the fetched data\n   *\n   * @memberOf ListComponent\n   */\n  async getFromRequest(force: boolean = false, start: number, limit: number): Promise<KeyValue[]> {\n    let data: KeyValue[] = [...(this.data || [])];\n\n    if (!this.data?.length || force || (this.searchValue as string)?.length || !!(this.searchValue as IFilterQuery)) {\n      // (self.data as ListItem[]) = [];\n      if (!(this.searchValue as string)?.length && !(this.searchValue as IFilterQuery)) {\n        if (!this.source && !this.data?.length) {\n          this.log.info('No data and source passed to infinite list');\n          return [];\n        }\n        if (this.source instanceof Function) {\n          data = (await this.source()) as KeyValue[];\n          if (!Array.isArray(data)) data = data?.['response']?.['data'] || data?.['results'] || [];\n        }\n\n        if (!data?.length && this.data?.length) data = this.data as KeyValue[];\n        data = [...(await this.parseResult(data))];\n        if (this.data?.length)\n          data =\n            this.type === ListComponentsTypes.INFINITE\n              ? [...(this.items || []).concat([...data.slice(start, limit)])]\n              : [...(data.slice(start, limit) as KeyValue[])];\n      } else {\n        data = await this.parseResult(this.parseSearchResults(this.data as [], this.searchValue as string));\n      }\n      this.items = [...data];\n      if (this.isModalChild) this.changeDetectorRef.detectChanges();\n    } else {\n      const data = [...(await this.parseResult(this.data as []))];\n      this.items =\n        this.type === ListComponentsTypes.INFINITE ? [...(this.items || []), ...(data || [])] : [...(data || [])];\n      if (this.isModalChild) this.changeDetectorRef.detectChanges();\n    }\n\n    if (this.loadMoreData && this.type === ListComponentsTypes.PAGINATED) this.getMoreData(this.data?.length || 0);\n    return this.data || ([] as KeyValue[]);\n  }\n\n  /**\n   * @description Fetches data from a model source.\n   * @summary Retrieves data from the configured model using its pagination or find methods,\n   * processes it, and updates the component's data state. This method handles both initial\n   * data loading and subsequent refresh operations when using a model as the data source.\n   *\n   * @param {boolean} force - Whether to force a refresh even if data already exists\n   * @param {number} start - The starting index for pagination\n   * @param {number} limit - The maximum number of items to retrieve\n   * @returns {Promise<KeyValue[]>} A promise that resolves to the fetched data\n   *\n   * @memberOf ListComponent\n   */\n  async getFromModel(force: boolean = false): Promise<KeyValue[]> {\n    let data = [...(this.data || [])];\n    let request: KeyValue[] = [];\n\n    if (!this._repository) {\n      this._repository = this.repository;\n    }\n    const repo = this._repository as DecafRepository<Model>;\n    if (!this.indexes) {\n      this.indexes = Object.keys(Model.indexes(this.model as Model) || {});\n    }\n    if (!this.data?.length || force || (this.searchValue as string)?.length || !!(this.searchValue as IFilterQuery)) {\n      try {\n        if (!(this.searchValue as string)?.length && !(this.searchValue as IFilterQuery)) {\n          if (this.type !== ListComponentsTypes.INFINITE) {\n            (this.data as KeyValue[]) = [];\n          }\n\n          // const rawQuery = this.parseQuery(self.model as Repository<Model>, start, limit);\n          // request = this.parseResult(await (this.model as any)?.paginate(start, limit));\n          if (!this.paginator) {\n            this.paginator = await this.paginate();\n          }\n          request = await this.parseResult(this.paginator as Paginator<Model>);\n        } else {\n          if (this.type === ListComponentsTypes.INFINITE) {\n            this.items = this.data = [];\n            this.changeDetectorRef.detectChanges();\n          }\n          const condition = this.parseConditions(this.searchValue as IFilterQuery);\n          const result =\n            typeof this.searchValue === Primitives.STRING\n              ? await repo.find(String(this.searchValue), this.sortDirection)\n              : await repo\n                  .select()\n                  .where(condition)\n                  .orderBy((this.sortBy || this.pk) as keyof Model, this.sortDirection)\n                  .execute();\n          request = typeof result === Primitives.STRING ? [] : await this.parseResult(result);\n          data = [];\n          this.changeDetectorRef.detectChanges();\n        }\n        if (!request?.length) {\n          this.refreshing = false;\n          this.items = this.data = [];\n          this.changeDetectorRef.detectChanges();\n        } else {\n          data = this.type === ListComponentsTypes.INFINITE ? [...data.concat(request)] : [...request];\n        }\n      } catch (error: unknown) {\n        this.log.error(\n          (error as Error)?.message || `Unable to find ${this.model} on registry. Return empty array from component`\n        );\n      }\n    }\n\n    if (data?.length) {\n      if (this.searchValue) {\n        this.items = [...data];\n        if (this.items?.length <= this.limit) {\n          this.loadMoreData = false;\n        }\n      } else {\n        this.items = [...data];\n      }\n    }\n    if (this.type === ListComponentsTypes.PAGINATED && this.paginator && !this.pages) {\n      this.getMoreData(this.paginator.total);\n    }\n    return data || ([] as KeyValue[]);\n  }\n\n  /**\n   * @description Converts search values or filter queries into database conditions.\n   * @summary Transforms search input or complex filter queries into Condition objects\n   * that can be used for database querying. Handles both simple string/number searches\n   * across indexed fields and complex filter queries with multiple criteria.\n   *\n   * For simple searches (string/number):\n   * - Creates conditions that search across all indexed fields\n   * - Uses equality for numeric values and regex for string values\n   * - Combines conditions with OR logic to search multiple fields\n   *\n   * For complex filter queries:\n   * - Processes each filter item with its specific condition type\n   * - Supports Equal, Not Equal, Contains, Not Contains, Greater Than, Less Than\n   * - Updates sort configuration based on the filter query\n   * - Combines multiple filter conditions with OR logic\n   *\n   * @param {string | number | IFilterQuery} value - The search value or filter query object\n   * @returns {Condition<Model>} A Condition object for database querying\n   * @memberOf ListComponent\n   */\n  parseConditions(value: string | number | IFilterQuery): Condition<Model> {\n    let _condition: Condition<Model>;\n    const constructor = this.repository.class as Constructor<Model>;\n    if (typeof value === Primitives.STRING) {\n      _condition = Condition.attribute<Model>(this.pk as keyof Model).eq(\n        this.pkType.toLocaleLowerCase() === Primitives.STRING ? value : Number(value)\n      );\n      for (const index of this.indexes as (keyof Model)[]) {\n        if (index !== this.pk) {\n          const type = Metadata.type(constructor, index).name;\n          let orCondition;\n          if ([Primitives.NUMBER, Primitives.BIGINT].includes(type.toLocaleLowerCase() as Primitives)) {\n            orCondition = Condition.attribute<Model>(index).eq(Number(value));\n          } else {\n            orCondition =\n              type === Date\n                ? Condition.attribute<Model>(index).eq(new Date(value as string))\n                : Condition.attribute<Model>(index).regexp(value as string);\n          }\n          _condition = _condition.or(orCondition);\n        }\n      }\n    } else {\n      const { query, sort } = value as IFilterQuery;\n      const pk = this.pk as keyof Model;\n      _condition = Condition.attribute<Model>(pk).dif('null');\n\n      if (query?.length) {\n        _condition = undefined as unknown as Condition<Model>;\n      }\n      (query || []).forEach((item: IFilterQueryItem) => {\n        const { value, condition, index } = item;\n        const idx = index as keyof Model;\n        const type = Metadata.type(constructor, idx).name;\n\n        let val = value as string | number | Date;\n        if ([Primitives.NUMBER, Primitives.BIGINT].includes(type.toLocaleLowerCase() as Primitives)) {\n          val = Number(val);\n        }\n        if (type === Date.name) {\n          val = new Date(val as string);\n        }\n        let orCondition;\n        switch (condition) {\n          case 'Equal':\n            orCondition = Condition.attribute<Model>(idx).eq(val);\n            break;\n          case 'Not Equal':\n            orCondition = Condition.attribute<Model>(idx).dif(val);\n            break;\n          case 'Not Contains':\n            orCondition = !Condition.attribute<Model>(idx).regexp(new RegExp(`^(?!.*${val}).*$`));\n            break;\n          case 'Contains':\n            orCondition = Condition.attribute<Model>(idx).regexp(val as string);\n            break;\n          case 'Greater Than':\n            orCondition = Condition.attribute<Model>(idx).gte(val);\n            break;\n          case 'Less Than':\n            orCondition = Condition.attribute<Model>(idx).lte(val);\n            break;\n        }\n        _condition = (\n          !_condition ? orCondition : _condition.and(orCondition as unknown as Condition<Model>)\n        ) as Condition<Model>;\n      });\n\n      this.sortBy = (sort?.value as keyof Model) || this.pk;\n      this.sortDirection = sort?.direction || this.sortDirection;\n    }\n    return _condition as Condition<Model>;\n  }\n\n  /**\n   * @description Processes query results into a standardized format.\n   * @summary Handles different result formats from various data sources, extracting\n   * pagination information when available and applying any configured data mapping.\n   * This ensures consistent data structure regardless of the source.\n   *\n   * @protected\n   * @param {KeyValue[] | Paginator} result - The raw query result\n   * @returns {KeyValue[]} The processed array of items\n   *\n   * @memberOf ListComponent\n   */\n  async parseResult(result: KeyValue[] | Paginator<Model>): Promise<KeyValue[]> {\n    if (!result || result === undefined) {\n      return [];\n    }\n    if (!Array.isArray(result) && 'page' in result && 'total' in result) {\n      const paginator = result as Paginator<Model>;\n      try {\n        result = await paginator.page(this.page);\n        this.getMoreData(paginator.total || this.pages);\n      } catch (error: unknown) {\n        this.log.info(\n          (error as Error)?.message || 'Unable to get page from paginator. Return empty array from component'\n        );\n        result = [];\n      }\n    } else {\n      this.getMoreData((result as KeyValue[])?.length || 0);\n    }\n    return Object.keys(this.mapper || {}).length || typeof this.mapper === 'function'\n      ? await this.mapResults(result)\n      : result;\n  }\n\n  /**\n   * @description Updates pagination state based on data length.\n   * @summary Calculates whether more data is available and how many pages exist\n   * based on the total number of items and the configured limit per page.\n   * This information is used to control pagination UI and infinite scrolling behavior.\n   *\n   * @param {number} length - The total number of items available\n   * @returns {void}\n   *\n   * @memberOf ListComponent\n   */\n  getMoreData(length: number): void {\n    if (this.type === ListComponentsTypes.INFINITE) {\n      if (length === undefined) {\n        this.loadMoreData = `${this.paginator?.['_bookmark']}`?.length ? true : false;\n      } else {\n        if (this.paginator) {\n          length = this.paginator['_recordCount'] || length * this.limit;\n        }\n        if (length >= this.limit) {\n          this.loadMoreData = false;\n        } else {\n          this.pages = Math.floor(length / this.limit);\n          if (this.pages * this.limit < length) this.pages += 1;\n          if (this.pages === 1) this.loadMoreData = false;\n        }\n      }\n    } else {\n      if (!this.paginator) {\n        this.pages = length * this.limit;\n        if (this.pages === 1) {\n          this.loadMoreData = false;\n        }\n      } else {\n        this.pages = this.paginator?.total || this.paginator['_totalPages'];\n        if (this.pages === undefined) {\n          this.bookMarkPagination = this.paginator?.['_bookmark'] !== undefined ? true : false;\n        } else {\n          if (this.pages === 1) {\n            this.loadMoreData = false;\n          }\n        }\n      }\n    }\n  }\n\n  /**\n   * @description Maps a single item using the configured mapper.\n   * @summary Transforms a data item according to the mapping configuration,\n   * extracting nested properties and formatting values as needed. This allows\n   * the component to display data in a format different from how it's stored.\n   *\n   * @protected\n   * @param {KeyValue} item - The item to map\n   * @param {KeyValue} mapper - The mapping configuration\n   * @param {KeyValue} [props] - Additional properties to include\n   * @returns {KeyValue} The mapped item\n   *\n   * @memberOf ListComponent\n   */\n  protected itemMapper(item: KeyValue, mapper: KeyValue, props?: KeyValue): KeyValue {\n    return Object.entries(mapper).reduce((accum: KeyValue, [key, value]) => {\n      const arrayValue = value.split('.');\n      if (!value) {\n        accum[key] = value;\n      } else {\n        if (arrayValue.length === 1) {\n          value = item?.[value] ? item[value] : '';\n          // value = item?.[value] ? item[value] : value !== key ? value : \"\";\n          if (isValidDate(value)) {\n            value = `${formatDate(dateFromString(value))}`;\n          }\n          accum[key] = value;\n        } else {\n          let val;\n\n          for (const _value of arrayValue)\n            val = !val ? item[_value] : (typeof val === Primitives.STRING ? JSON.parse(val) : val)[_value];\n\n          if (isValidDate(new Date(val))) val = `${formatDate(dateFromString(val))}`;\n\n          accum[key] = val === null || val === undefined ? value : val;\n        }\n      }\n      return Object.assign({}, props || {}, accum);\n    }, {});\n  }\n\n  /**\n   * @description Maps all result items using the configured mapper.\n   * @summary Applies the itemMapper to each item in the result set, adding\n   * common properties like operations and route information. This transforms\n   * the raw data into the format expected by the list item components.\n   *\n   * @param {KeyValue[]} data - The array of items to map\n   * @returns {KeyValue[]} The array of mapped items\n   *\n   * @memberOf ListComponent\n   */\n  async mapResults(data: KeyValue[]): Promise<KeyValue[]> {\n    if (!data || !data.length) return [];\n\n    const props = Object.assign({\n      operations: this.operations,\n      route: this.route,\n      ...Object.keys(this.item).reduce((acc: KeyValue, key: string) => {\n        acc[key] = this.item[key];\n        return acc;\n      }, {}),\n    });\n    if (typeof this.mapper !== 'function') {\n      this.mapper = await this.getMapper();\n      return data.reduce((accum: KeyValue[], curr) => {\n        accum.push({\n          ...this.itemMapper(curr, this.mapper as KeyValue, props),\n          ...{\n            pk: this.pk,\n            model: curr,\n            isModalChild: this.isModalChild,\n            emitEvent: props.emitEvent,\n          },\n        });\n        return accum;\n      }, []);\n    } else {\n      return await Promise.all(\n        data.map(async (item) => {\n          const mapped = await (this.mapper as UIFunctionLike)(item);\n          return {\n            item: mapped as KeyValue,\n            model: item,\n            pk: this.pk,\n            isModalChild: this.isModalChild,\n            emitEvent: props.emitEvent,\n          };\n        })\n      );\n    }\n  }\n\n  parseSearchValue() {\n    if (typeof this.searchValue === Primitives.STRING) return this.searchValue || '';\n    const searchValue = this.searchValue as IFilterQuery;\n    if (searchValue?.query === undefined) return (this.searchValue = '');\n    return (searchValue?.query as IFilterQueryItem[])\n      .map((item) => `${item.index} ${item.condition} ${item.value}`)\n      .join(', ');\n  }\n}\n","@if (showRefresher) {\n  <ion-refresher\n    slot=\"fixed\"\n    [pullFactor]=\"1\"\n    [pullMin]=\"100\"\n    [pullMax]=\"200\"\n    (ionRefresh)=\"handleRefresh($event)\"\n  >\n    <ion-refresher-content />\n  </ion-refresher>\n}\n\n@if (showSearchbar) {\n  <div [hidden]=\"!data?.length && !searching\">\n    <div\n      [class]=\"\n        'dcf-grid dcf-grid-actions ' + enableFilter\n          ? 'dcf-grid-small'\n          : 'dcf-grid-collapse'\n      \"\n    >\n      <div class=\"dcf-width-expand@m dcf-width-1-1\">\n        @if (model && enableFilter) {\n          @if (data?.length || searching) {\n            <ngx-decaf-filter\n              [model]=\"model\"\n              [modelName]=\"modelName\"\n              [multiple]=\"multipleFilter\"\n              [indexes]=\"indexes ?? []\"\n              [locale]=\"locale ?? undefined\"\n              [isModalChild]=\"isModalChild\"\n              [sortDirection]=\"sortDirection\"\n              [disableSort]=\"disableSort\"\n              (filterEvent)=\"handleFilter($event)\"\n              (searchEvent)=\"handleSearch($event)\"\n            />\n          }\n        } @else {\n          <ngx-decaf-searchbar\n            [emitEventToWindow]=\"false\"\n            [debounce]=\"isModalChild ? 800 : 500\"\n            [model]=\"model\"\n            [modelName]=\"modelName\"\n            [locale]=\"locale ?? undefined\"\n            [isModalChild]=\"isModalChild\"\n            (searchEvent)=\"handleSearch($event)\"\n          />\n        }\n      </div>\n      @if (createButton) {\n        <div\n          class=\"dcf-width-auto@m dcf-button-container dcf-width-1-1 dcf-flex-middle dcf-flex dcf-flex-center dcf-flex-right@m\"\n        >\n          <div>\n            <ion-button\n              expand=\"block\"\n              (click)=\"changeOperation(OperationKeys.CREATE)\"\n            >\n              Create\n            </ion-button>\n          </div>\n        </div>\n      }\n    </div>\n  </div>\n}\n\n@if (initialized && data?.length) {\n  <div\n    class=\"dcf-list-component\"\n    #component\n  >\n    <ion-list\n      [id]=\"uid\"\n      [inset]=\"inset\"\n      [lines]=\"lines\"\n    >\n      @if (item?.tag) {\n        @for (child of items; track trackItemFn($index, child)) {\n          <ngx-decaf-component-renderer\n            [tag]=\"item.tag\"\n            (listenEvent)=\"handleEvent($event)\"\n            [globals]=\"{\n              item: child,\n              mapper: mapper,\n              route: isModalChild ? route : undefined,\n              model: child,\n              isModalChild: child.isModalChild,\n              emitEvent: child.emitEvent,\n            }\"\n          ></ngx-decaf-component-renderer>\n        }\n      } @else {\n        <ng-content></ng-content>\n      }\n    </ion-list>\n  </div>\n  @if (loadMoreData) {\n    @if (\n      (pages > 0 || bookMarkPagination) &&\n      type === 'paginated' &&\n      !searchValue?.length\n    ) {\n      <ngx-decaf-pagination\n        [disablePages]=\"disablePaginationPages\"\n        [truncatePages]=\"truncatePaginationPages\"\n        [totalPages]=\"pages\"\n        [bookMarkPagination]=\"bookMarkPagination\"\n        [nextBookmark]=\"paginator?.['_bookmark']\"\n        [table]=\"component\"\n        [current]=\"page\"\n        (clickEvent)=\"handlePaginate($event)\"\n      />\n    } @else {\n      <ion-infinite-scroll\n        [class]=\"searchValue?.length ? 'dcf-hidden' : ''\"\n        [position]=\"scrollPosition\"\n        [threshold]=\"scrollThreshold\"\n        (ionInfinite)=\"handleRefresh($event)\"\n      >\n        <ion-infinite-scroll-content\n          [loadingSpinner]=\"loadingSpinner\"\n          [loadingText]=\"loadingText\"\n        />\n      </ion-infinite-scroll>\n    }\n  }\n} @else {\n  @if (refreshing) {\n    @for (skl of skeletonData; track $index) {\n      <ion-item>\n        <ion-thumbnail slot=\"start\">\n          <ion-skeleton-text [animated]=\"true\"></ion-skeleton-text>\n        </ion-thumbnail>\n        <ion-label>\n          <ion-skeleton-text [animated]=\"true\"></ion-skeleton-text>\n          <ion-text\n            class=\"date\"\n            style=\"width: 20%\"\n          >\n            <ion-skeleton-text [animated]=\"true\"></ion-skeleton-text>\n          </ion-text>\n        </ion-label>\n      </ion-item>\n    }\n  } @else {\n    @if (!searching) {\n      <ngx-decaf-empty-state\n        [model]=\"empty?.showButton ? model : undefined\"\n        [route]=\"route\"\n        [modelId]=\"modelId\"\n        [buttonLink]=\"empty?.link ?? undefined\"\n        [borders]=\"borders\"\n        [refreshing]=\"refreshing\"\n        [icon]=\"(item?.icon ?? 'folder-open-outline') || empty.icon\"\n        className=\"dcf-empty-data\"\n        [title]=\"empty.title ? (locale + '.' + empty.title | translate) : ''\"\n        [subtitle]=\"\n          empty.subtitle ? (locale + '.' + empty.subtitle | translate) : ''\n        \"\n      />\n    } @else {\n      <ngx-decaf-empty-state\n        icon=\"search-outline\"\n        [model]=\"empty?.showButton ? model : undefined\"\n        [route]=\"route\"\n        [modelId]=\"modelId\"\n        [borders]=\"borders\"\n        [operations]=\"operations\"\n        [refreshing]=\"refreshing\"\n        [body]=\"'small'\"\n        [translatable]=\"true\"\n        [title]=\"'component.list.search.title' | translate\"\n        [subtitle]=\"\n          'component.list.search.subtitle'\n            | translate: { '0': parseSearchValue() }\n        \"\n        [searchValue]=\"searchValue\"\n      />\n    }\n  }\n}\n","/**\n * @module module:lib/components/stepped-form/stepped-form.component\n * @description Stepped form component module.\n * @summary Provides `SteppedFormComponent` which implements a multi-page form\n * UI with navigation, validation and submission support. Useful for forms that\n * need to be split into logical steps/pages.\n *\n * @link {@link SteppedFormComponent}\n */\n\nimport { Component, Input, OnInit, OnDestroy } from '@angular/core';\nimport { FormGroup, ReactiveFormsModule } from '@angular/forms';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { IonButton, IonSkeletonText, IonText } from '@ionic/angular/standalone';\nimport { arrowForwardOutline, arrowBackOutline } from 'ionicons/icons';\nimport { addIcons } from 'ionicons';\nimport { UIElementMetadata, ComponentEventNames, UIModelMetadata } from '@decaf-ts/ui-decorators';\nimport { CrudOperations, OperationKeys } from '@decaf-ts/db-decorators';\nimport { Dynamic } from '../../engine/decorators';\nimport { NgxFormService } from '../../services/NgxFormService';\nimport { getLocaleContext } from '../../i18n/Loader';\nimport { LayoutComponent } from '../layout/layout.component';\nimport { NgxFormDirective } from '../../engine/NgxFormDirective';\nimport { FormParent } from '../../engine/types';\n\n@Dynamic()\n@Component({\n  selector: 'ngx-decaf-stepped-form',\n  templateUrl: './stepped-form.component.html',\n  styleUrls: ['./stepped-form.component.scss'],\n  imports: [\n    TranslatePipe,\n    ReactiveFormsModule,\n    IonSkeletonText,\n    IonText,\n    IonButton,\n    LayoutComponent,\n  ],\n  standalone: true,\n  host: { '[attr.id]': 'uid' },\n})\nexport class SteppedFormComponent extends NgxFormDirective implements OnInit, OnDestroy {\n  /**\n   * @description Array of UI model metadata for all form fields.\n   * @summary Contains the complete collection of UI model metadata that defines\n   * the structure, validation, and presentation of form fields across all pages.\n   * Each metadata object contains information about field type, validation rules,\n   * page assignment, and display properties.\n   *\n   * @type {UIModelMetadata[]}\n   * @memberOf SteppedFormComponent\n   */\n  @Input()\n  override children!:\n    | UIModelMetadata[]\n    | { title: string; description: string; items?: UIModelMetadata[] }[];\n\n  /**\n   * @description The locale to be used for translations.\n   * @summary Specifies the locale identifier to use when translating component text.\n   * This can be set explicitly via input property to override the automatically derived\n   * locale from the component name. The locale is typically a language code (e.g., 'en', 'fr')\n   * or a language-region code (e.g., 'en-US', 'fr-CA') that determines which translation\n   * set to use for the component's text content.\n   *\n   * @type {string}\n   * @memberOf SteppedFormComponent\n   */\n  @Input()\n  paginated: boolean = true;\n\n  // /**\n  //  * @description Optional action identifier for form submission context.\n  //  * @summary Specifies a custom action name that will be included in the submit event.\n  //  * If not provided, defaults to the standard submit event constant. Used to\n  //  * distinguish between different types of form submissions within the same component.\n  //  *\n  //  * @type {string | undefined}\n  //  */\n  // @Input()\n  // action?: string;\n\n  /**\n   * @description Number of pages in the stepped form.\n   * @summary Represents the total number of steps/pages in the multi-step form.\n   * This value is automatically calculated based on the page properties of the children\n   * or can be explicitly set. Each page represents a logical group of form fields.\n   *\n   * @type {number}\n   * @default 1\n   * @memberOf SteppedFormComponent\n   */\n  @Input()\n  override pages: number | { title: string; description: string }[] = 1;\n\n  /**\n   * List of titles and descriptions for each page of the stepped form.\n   * Each object in the array represents a page, containing a title and a description.\n   *\n   * @example\n   * pageTitles = [\n   *   { title: 'Personal Information', description: 'Fill in your personal details.' },\n   *   { title: 'Address', description: 'Provide your residential address.' }\n   * ];\n   */\n  @Input()\n  pageTitles: { title: string; description: string }[] = [];\n\n  /**\n   * @description The CRUD operation type for this form.\n   * @summary Defines the type of operation being performed (CREATE, READ, UPDATE, DELETE).\n   * This affects form behavior, validation rules, and field accessibility. For example,\n   * READ operations might disable form fields, while CREATE operations enable all fields.\n   *\n   * @type {CrudOperations}\n   * @default OperationKeys.CREATE\n   * @memberOf SteppedFormComponent\n   */\n  @Input()\n  override operation: CrudOperations = OperationKeys.CREATE;\n\n  /**\n   * @description The initial page to display when the form loads.\n   * @summary Specifies which page of the multi-step form should be shown first.\n   * This allows starting the form at any step, useful for scenarios like editing\n   * existing data where you might want to jump to a specific section.\n   *\n   * @type {number}\n   * @default 1\n   * @memberOf SteppedFormComponent\n   */\n  @Input()\n  startPage: number = 1;\n\n  // /**\n  //  * @description Angular reactive FormGroup or FormArray for form state management.\n  //  * @summary The form instance that manages all form controls, validation, and form state.\n  //  * When using FormArray, each array element represents a page's FormGroup. When using\n  //  * FormGroup, it contains all form controls for the entire stepped form.\n  //  *\n  //  * @type {FormGroup | FormArray | undefined}\n  //  * @memberOf SteppedFormComponent\n  //  */\n  // @Input()\n  // formGroup!: FormGroup | FormArray | undefined;\n\n  /**\n   * @description Array representing the structure of pages.\n   * @summary Contains metadata about each page, including page numbers and indices.\n   * This array is built during initialization to organize the form fields into\n   * logical pages and provide navigation structure.\n   *\n   * @type {UIModelMetadata[]}\n   * @memberOf SteppedFormComponent\n   */\n  pagesArray: UIModelMetadata[] = [];\n\n  // /**\n  //  * @description Custom event handlers for form actions.\n  //  * @summary A record of event handler functions keyed by event names that can be\n  //  * triggered during form operations. These handlers provide extensibility for\n  //  * custom business logic and can be invoked for various form events and actions.\n  //  *\n  //  * @type {HandlerLike}\n  //  */\n  // @Input()\n  // handlers!: HandlerLike;\n\n  /**\n   * @description Event emitter for form submission.\n   * @summary Emits events when the form is submitted, typically on the last page\n   * when all validation passes. The emitted event contains the form data and\n   * event type information for parent components to handle.\n   *\n   * @type {EventEmitter<IBaseCustomEvent>}\n   * @memberOf SteppedFormComponent\n   */\n  // @Output()\n  // submitEvent: EventEmitter<ICrudFormEvent> = new EventEmitter<ICrudFormEvent>();\n\n  /**\n   * @description Creates an instance of SteppedFormComponent.\n   * @summary Initializes a new SteppedFormComponent instance and registers the required\n   * Ionic icons for navigation buttons (forward and back arrows).\n   *\n   * @memberOf SteppedFormComponent\n   */\n  constructor() {\n    super('SteppedFormComponent');\n    addIcons({ arrowForwardOutline, arrowBackOutline });\n    this.enableDarkMode = true;\n  }\n\n  /**\n   * @description Initializes the component after Angular first displays the data-bound properties.\n   * @summary Sets up the stepped form by organizing children into pages, calculating the total\n   * number of pages, and initializing the active page. This method processes the UI model metadata\n   * to create a logical page structure and ensures proper page assignments for all form fields.\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant A as Angular Lifecycle\n   *   participant S as SteppedFormComponent\n   *   participant F as Form Service\n   *\n   *   A->>S: ngOnInit()\n   *   S->>S: Set activeIndex = startPage\n   *   S->>S: Calculate total pages\n   *   S->>S: Assign page props to children\n   *   S->>S: getCurrentFormGroup(activeIndex)\n   *   S->>F: Extract FormGroup for active page\n   *   F-->>S: Return activeFormGroup\n   *\n   * @memberOf SteppedFormComponent\n   */\n  async ngOnInit(): Promise<void> {\n    if (!this.locale) this.locale = getLocaleContext('SteppedFormComponent');\n    this.activeIndex = this.startPage;\n    if (typeof this.pages === 'object') {\n      this.pageTitles = this.pages;\n    } else {\n      if (!this.pageTitles.length)\n        this.pageTitles = Array.from({ length: this.pages }, () => ({\n          title: '',\n          description: '',\n        }));\n    }\n\n    this.pages = this.pageTitles.length;\n\n    if (this.paginated) {\n      if (!this.parentForm)\n        this.parentForm = (this.formGroup?.root || this.formGroup) as FormParent;\n      this.children = [\n        ...(this.children as UIModelMetadata[]).map((c) => {\n          if (!c.props) c.props = {};\n          const page = c.props['page'] || 1;\n          // prevent page overflow\n          c.props['page'] = page > this.pages ? this.pages : page;\n          return c;\n        }),\n      ];\n      this.getActivePage(this.activeIndex);\n    } else {\n      this.children = this.pageTitles.map((page, index) => {\n        const pageNumber = index + 1;\n        const items = (this.children as UIModelMetadata[]).filter(\n          ({ props }: UIElementMetadata) => props?.['page'] === pageNumber,\n        );\n        return {\n          page: pageNumber,\n          title: page.title,\n          description: page.description,\n          items,\n        };\n      });\n      // this.formGroup =  new FormGroup(\n      //   (this.formGroup as FormArray).controls.reduce((acc, control, index) => {\n      //     acc[index] = control as FormGroup;\n      //     return acc;\n      //   }, {} as Record<string, FormGroup>)\n      // );\n    }\n    await super.initialize();\n  }\n\n  /**\n   * @description Cleanup method called when the component is destroyed.\n   * @summary Unsubscribes from any active timer subscriptions to prevent memory leaks.\n   * This is part of Angular's component lifecycle and ensures proper resource cleanup.\n   *\n   * @memberOf SteppedFormComponent\n   */\n  override async ngOnDestroy(): Promise<void> {\n    await super.ngOnDestroy();\n    if (this.timerSubscription) this.timerSubscription.unsubscribe();\n  }\n\n  /**\n   * @description Handles navigation to the next page or form submission.\n   * @summary Validates the current page's form fields and either navigates to the next page\n   * or submits the entire form if on the last page. Form validation must pass before\n   * proceeding. On successful submission, emits a submit event with form data.\n   *\n   * @param {boolean} lastPage - Whether this is the last page of the form\n   * @return {void}\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant U as User\n   *   participant S as SteppedFormComponent\n   *   participant F as Form Service\n   *   participant P as Parent Component\n   *\n   *   U->>S: Click Next/Submit\n   *   S->>F: validateFields(activeFormGroup)\n   *   F-->>S: Return validation result\n   *   alt Not last page and valid\n   *     S->>S: activeIndex++\n   *     S->>S: getCurrentFormGroup(activeIndex)\n   *   else Last page and valid\n   *     S->>F: getFormData(formGroup)\n   *     F-->>S: Return form data\n   *     S->>P: submitEvent.emit({data, name: SUBMIT})\n   *   end\n   *\n   * @memberOf SteppedFormComponent\n   */\n  handleNext(lastPage: boolean = false): void {\n    const isValid = NgxFormService.validateFields(this.formGroup as FormGroup);\n    // const isValid = this.paginated ?\n    //   NgxFormService.validateFields(this.formGroup as FormGroup) :\n    //   (this.formGroup as FormArray)?.controls.every(control => NgxFormService.validateFields(control as FormGroup));\n    if (!lastPage) {\n      if (isValid) {\n        this.activeIndex = this.activeIndex + 1;\n        this.getActivePage(this.activeIndex);\n      }\n    } else {\n      if (isValid) {\n        const rootForm = this.formGroup?.root || this.formGroup;\n        const data = Object.assign(\n          {},\n          ...Object.values(NgxFormService.getFormData(rootForm as FormGroup)),\n        );\n        super.submitEventEmit(\n          data,\n          'SteppedFormComponent',\n          this.action || ComponentEventNames.Submit,\n          this.handlers,\n        );\n      }\n    }\n  }\n\n  /**\n   * @description Handles navigation to the previous page.\n   * @summary Moves the user back to the previous page in the stepped form.\n   * This method decrements the active page number and updates the form\n   * group and children to display the previous page's content.\n   *\n   * @return {void}\n   *\n   * @mermaid\n   * sequenceDiagram\n   *   participant U as User\n   *   participant S as SteppedFormComponent\n   *\n   *   U->>S: Click Back\n   *   S->>S: activeIndex--\n   *   S->>S: getCurrentFormGroup(activeIndex)\n   *   Note over S: Update active form and children\n   *\n   * @memberOf SteppedFormComponent\n   */\n  handleBack(): void {\n    if (!this.paginated) return this.location.back();\n    this.activeIndex = this.activeIndex - 1;\n    this.getActivePage(this.activeIndex);\n  }\n\n  // async submit(event?: SubmitEvent, eventName?: string, componentName?: string): Promise<boolean | void> {\n  //   if (event) {\n  //     event.preventDefault();\n  //     event.stopImmediatePropagation();\n  //   }\n\n  //   if (!NgxFormService.validateFields(this.formGroup as FormGroup))\n  //     return false;\n  //   const data = NgxFormService.getFormData(this.formGroup as FormGroup);\n  //   this.submitEvent.emit({\n  //     data,\n  //     component: componentName || this.componentName,\n  //     name: eventName || this.action || ComponentEventNames.Submit,\n  //     handlers: this.handlers,\n  //   });\n  // }\n}\n","<form\n  class=\"dcf-steped-form\"\n  [class.paginated]=\"paginated\"\n  novalidate\n  #component\n>\n  @if (paginated) {\n    <div class=\"dcf-page-steps\">\n      <div class=\"dcf-grid dcf-grid-collapse skip\">\n        @for (page of pageTitles; track $index) {\n          <div class=\"dcf-flex dcf-flex-middle\">\n            <div\n              class=\"dcf-step\"\n              [class.dcf-active]=\"activeIndex === $index + 1\"\n              [class.dcf-passed]=\"$index + 1 < activeIndex\"\n            >\n              {{ $index + 1 }}\n            </div>\n            @if (page?.title || page?.description) {\n              <div class=\"dcf-information dcf-visible@s\">\n                @if (page?.title) {\n                  <div class=\"dcf-title\">{{ page?.title | translate }}</div>\n                }\n                @if (page?.description) {\n                  <div class=\"dcf-description\">\n                    {{ page?.description | translate }}\n                  </div>\n                }\n                <div class=\"dcf-separator\"></div>\n              </div>\n            }\n            @if ($index < pageTitles.length - 1) {\n              <div class=\"dcf-arrow-container\">\n                <svg\n                  width=\"8\"\n                  height=\"12\"\n                  viewBox=\"0 0 8 12\"\n                  fill=\"none\"\n                  xmlns=\"http://www.w3.org/2000/svg\"\n                >\n                  <path d=\"M1.5 1L6.5 6L1.5 11\" />\n                </svg>\n              </div>\n            }\n          </div>\n        }\n      </div>\n    </div>\n\n    @if (\n      pageTitles[activeIndex - 1]?.title ||\n      pageTitles[activeIndex - 1]?.description\n    ) {\n      <div class=\"dcf-current-step\">\n        <div>\n          @if (pageTitles[activeIndex - 1]?.title) {\n            <div class=\"dcf-title\">\n              {{ pageTitles[activeIndex - 1]?.title | translate }}\n            </div>\n          }\n          @if (pageTitles[activeIndex - 1]?.description) {\n            <div class=\"dcf-description\">\n              {{ pageTitles[activeIndex - 1]?.description | translate }}\n            </div>\n          }\n        </div>\n      </div>\n    }\n\n    @if (initialized && activePage?.length) {\n      <ngx-decaf-layout\n        [isModalChild]=\"isModalChild\"\n        [className]=\"'dcf-stepped-form-grid paginated dcf-grid-nested'\"\n        [children]=\"activePage || []\"\n        [parentForm]=\"formGroup || parentForm\"\n        [gap]=\"'small'\"\n        [flexMode]=\"props.flexMode || false\"\n        [match]=\"false\"\n        [cardBody]=\"cardBody\"\n        [operation]=\"operation\"\n        [cardType]=\"cardType\"\n        [rows]=\"rows\"\n        [cols]=\"cols\"\n        [match]=\"false\"\n      />\n    } @else {\n      <ion-skeleton-text [animated]=\"true\"></ion-skeleton-text>\n      <ion-text\n        class=\"date\"\n        style=\"width: 20%\"\n      >\n        <ion-skeleton-text [animated]=\"true\"></ion-skeleton-text>\n      </ion-text>\n      <br />\n      <ion-skeleton-text [animated]=\"true\"></ion-skeleton-text>\n      <ion-text\n        class=\"date\"\n        style=\"width: 20%\"\n      >\n        <ion-skeleton-text [animated]=\"true\"></ion-skeleton-text>\n      </ion-text>\n    }\n    <div\n      class=\"dcf-buttons-container dcf-grid dcf-grid-collapse dcf-flex dcf-flex-left\"\n    >\n      <div class=\"dcf-width-1-2@s\">\n        <ion-button\n          color=\"light\"\n          (click)=\"handleBack()\"\n          [disabled]=\"activeIndex <= 1\"\n        >\n          {{ locale + '.previous' | translate }}\n        </ion-button>\n      </div>\n\n      <div class=\"dcf-width-1-2@s\">\n        <ion-button\n          fill=\"solid\"\n          (click)=\"handleNext(activeIndex === pages ? true : false)\"\n        >\n          @if (activeIndex === pages) {\n            {{ locale + '.submit' | translate }}\n          } @else {\n            {{ locale + '.next' | translate }}\n          }\n        </ion-button>\n      </div>\n    </div>\n  } @else {\n    <div class=\"dcf-single-step\">\n      @for (item of children; track $index) {\n        <ngx-decaf-card\n          [className]=\"className\"\n          [body]=\"cardBody\"\n          [type]=\"cardType\"\n        >\n          <div>\n            @if (item.title || item.description) {\n              <div class=\"dcf-information\">\n                <div>\n                  @if (item.title) {\n                    <div class=\"dcf-title\">{{ item.title | translate }}</div>\n                  }\n                  @if (item.description) {\n                    <div class=\"dcf-description\">\n                      {{ item.description | translate }}\n                    </div>\n                  }\n                </div>\n              </div>\n            }\n            <div [class.dcf-margin-bottom]=\"cardType === 'blank'\">\n              @if (initialized && item.items?.length) {\n                <ngx-decaf-layout\n                  [isModalChild]=\"isModalChild\"\n                  [className]=\"'dcf-stepped-form-grid dcf-grid-nested'\"\n                  [children]=\"item.items || []\"\n                  [parentForm]=\"formGroup || parentForm\"\n                  [flexMode]=\"props.flexMode || false\"\n                  [gap]=\"'small'\"\n                  [cardBody]=\"cardBody\"\n                  [cardType]=\"cardType\"\n                  [rows]=\"rows\"\n                  [cols]=\"cols\"\n                  [match]=\"false\"\n                />\n              }\n            </div>\n          </div>\n        </ngx-decaf-card>\n      }\n      <div\n        class=\"dcf-buttons-container dcf-grid dcf-grid-small dcf-flex dcf-flex-right\"\n      >\n        <div class=\"dcf-width-auto@s dcf-width-1-1\">\n          <ion-button\n            color=\"light\"\n            (click)=\"handleBack()\"\n          >\n            {{ locale + '.cancel' | translate }}\n          </ion-button>\n        </div>\n\n        <div class=\"dcf-width-auto@s dcf-width-1-1\">\n          <ion-button\n            fill=\"solid\"\n            (click)=\"handleNext(true)\"\n          >\n            {{ locale + '.submit' | translate }}\n          </ion-button>\n        </div>\n      </div>\n    </div>\n  }\n</form>\n","/**\n * @module TableComponent\n * @description Provides a feature-rich, paginated data table component for Angular applications.\n * @summary The `TableComponent` extends the {@link ListComponent} and serves as a dynamic, configurable table\n * component. It supports server-side filtering, dynamic column resolution, row-level CRUD actions, and cell\n * truncation with tooltips via {@link DecafTooltipDirective}. The component integrates seamlessly with the\n * Decaf rendering engine and provides advanced customization options for filtering, sorting, and data mapping.\n * @class TableComponent\n * @extends {ListComponent}\n * @implements {OnInit}\n */\nimport { CommonModule } from '@angular/common';\nimport { Component, Input, OnInit } from '@angular/core';\nimport { OrderDirection } from '@decaf-ts/core';\nimport { CrudOperations, OperationKeys } from '@decaf-ts/db-decorators';\nimport { Model, Primitives } from '@decaf-ts/decorator-validation';\nimport { ComponentEventNames, UIFunctionLike, UIKeys } from '@decaf-ts/ui-decorators';\nimport { IonSelect, IonSelectOption, SelectCustomEvent } from '@ionic/angular/standalone';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { debounceTime, shareReplay, takeUntil } from 'rxjs';\nimport { DecafTooltipDirective } from '../../directives';\nimport { Dynamic } from '../../engine';\nimport {\n  ActionRoles,\n  DefaultListEmptyOptions,\n  ListComponentsTypes,\n  SelectFieldInterfaces,\n} from '../../engine/constants';\nimport { getModelAndRepository } from '../../engine/helpers';\nimport { IBaseCustomEvent, IFilterQuery } from '../../engine/interfaces';\nimport { FunctionLike, KeyValue, SelectOption } from '../../engine/types';\nimport { getWindow } from '../../utils/helpers';\nimport { EmptyStateComponent } from '../empty-state/empty-state.component';\nimport { IconComponent } from '../icon/icon.component';\nimport { ListComponent } from '../list/list.component';\nimport { getNgxSelectOptionsModal } from '../modal/modal.component';\nimport { PaginationComponent } from '../pagination/pagination.component';\nimport { SearchbarComponent } from '../searchbar/searchbar.component';\n\n@Dynamic()\n@Component({\n  selector: 'ngx-decaf-table',\n  templateUrl: './table.component.html',\n  styleUrls: ['./table.component.scss'],\n  standalone: true,\n  imports: [\n    CommonModule,\n    TranslatePipe,\n    IonSelect,\n    IonSelectOption,\n    SearchbarComponent,\n    EmptyStateComponent,\n    IconComponent,\n    PaginationComponent,\n    DecafTooltipDirective,\n  ],\n})\nexport class TableComponent extends ListComponent implements OnInit {\n  /**\n   * @description Maximum character count before cell content is truncated. `-1` disables truncation.\n   * @type {number}\n   * @default -1\n   */\n  @Input()\n  maxContentLength: number = -1;\n\n  /**\n   * @description Column keys whose values are never truncated regardless of `maxContentLength`.\n   * @type {string[]}\n   * @default ['userId']\n   */\n  @Input()\n  preserve: string[] = ['userId'];\n\n  /**\n   * @description Source used to populate filter select options: a model class, async function, or string key.\n   * @type {Model | FunctionLike | string}\n   */\n  @Input()\n  filterModel!: Model | FunctionLike | string;\n\n  /**\n   * @description Array of {@link SelectOption} objects displayed in the filter select control.\n   * @type {SelectOption[]}\n   */\n  @Input()\n  filterOptions!: SelectOption[];\n\n  /**\n   * @description Translatable label rendered on the filter select input.\n   * @type {string}\n   */\n  @Input()\n  filterLabel!: string;\n\n  /**\n   * @description Custom function that maps a repository item to a {@link SelectOption} shape.\n   * @type {FunctionLike}\n   */\n  @Input()\n  filterOptionsMapper!: FunctionLike;\n\n  /**\n   * @description Currently selected filter value; `undefined` when no filter is active.\n   * @type {string | undefined}\n   */\n  filterValue: string | undefined = undefined;\n\n  /**\n   * @description Ordered array of column keys rendered as table columns. Includes `'actions'` when operations are permitted.\n   * @type {string[]}\n   */\n  cols!: string[];\n\n  /**\n   * @description Column header label array, mirrors `cols` after `getOperations()` resolves.\n   * @type {string[]}\n   */\n  headers: string[] = [];\n\n  /**\n   * @description When `true`, row-level action buttons are rendered if the user has the required permissions.\n   * @type {boolean}\n   * @default true\n   */\n  @Input()\n  allowOperations: boolean = true;\n\n  /**\n   * @description Resolves and sorts the visible column keys from the current mapper metadata.\n   * @summary Reads `this._mapper` to obtain all columns that carry a `sequence` property,\n   * then sorts them so that columns anchored to `UIKeys.FIRST` appear first, numerically\n   * sequenced columns are ordered by their value, and `UIKeys.LAST` anchored columns appear\n   * last. Returns the final sorted array of column key strings.\n   * @return {string[]} Sorted array of column keys derived from the mapper.\n   * @mermaid\n   * sequenceDiagram\n   *   participant TC as TableComponent\n   *   participant M as _mapper\n   *   TC->>M: Object.entries(_mapper)\n   *   M-->>TC: [key, value][] entries\n   *   TC->>TC: sort by sequence weight (FIRST=0, number=1, LAST=100)\n   *   TC-->>TC: return sorted keys[]\n   */\n  private get _cols(): string[] {\n    this.mapper = this._mapper;\n    return Object.entries(this.mapper)\n      .sort(([, a], [, b]) => {\n        const aSequence = a?.sequence ?? 0;\n        const bSequence = b?.sequence ?? 0;\n        const weight = (v: string | number) =>\n          v === UIKeys.FIRST ? 0 : typeof v === Primitives.NUMBER ? 1 : v === UIKeys.LAST ? 100 : 1;\n        const aWeight = weight(aSequence);\n        const bWeight = weight(bSequence);\n        if (aWeight !== bWeight) {\n          return aWeight - bWeight;\n        }\n        if (aWeight === 1 && typeof aSequence === Primitives.NUMBER && typeof bSequence === Primitives.NUMBER) {\n          return aSequence - bSequence;\n        }\n        return 0;\n      })\n      .map(([key]) => key);\n  }\n\n  /**\n   * @description Returns the column header labels derived directly from the resolved `cols` array.\n   * @return {string[]} Shallow copy of `cols` used as table header labels.\n   */\n  private get _headers(): string[] {\n    return this.cols.map((col) => col);\n  }\n\n  /**\n   * @description Filters the raw mapper to only the entries that declare a `sequence` property.\n   * @summary Iterates over `this.mapper`, retains only keys whose value is a plain object\n   * containing a `sequence` field, and returns the resulting subset as a {@link KeyValue} map\n   * used by `_cols` for ordered column resolution.\n   * @return {KeyValue} Filtered mapper containing only sequenced column definitions.\n   */\n  get _mapper(): KeyValue {\n    return Object.keys(this.mapper).reduce((accum: KeyValue, curr: string) => {\n      const mapper = (this.mapper as KeyValue)[curr];\n      if (typeof mapper === 'object' && 'sequence' in mapper) accum[curr] = mapper;\n      return accum;\n    }, {} as KeyValue);\n  }\n\n  /**\n   * @description Angular lifecycle hook that initializes the table and loads its first page of data.\n   * @summary Sets up the table by resolving columns, headers, and filter options. It also reads URL query parameters\n   * to pre-populate the search state and triggers the initial data refresh.\n   * @return {Promise<void>}\n   */\n  override async ngOnInit(): Promise<void> {\n    await super.initialize();\n    this.type = ListComponentsTypes.PAGINATED;\n    this.empty = Object.assign({}, DefaultListEmptyOptions, this.empty);\n    this.repositoryObserverSubject\n      .pipe(debounceTime(100), shareReplay({ bufferSize: 1, refCount: true }), takeUntil(this.destroySubscriptions$))\n      .subscribe(([model, action, uid, data]) => this.handleObserveEvent(model, action, uid, data));\n    this.cols = this._cols as string[];\n    this.getOperations();\n    const filter = this.routerService.getQueryParamValue('filter') as string;\n    if (filter) {\n      const value = this.routerService.getQueryParamValue('value') as string;\n      this.searchValue = {\n        query: [\n          {\n            index: filter,\n            condition: 'Contains',\n            value,\n          },\n        ],\n        sort: {\n          value: filter,\n          direction: OrderDirection.ASC,\n        },\n      };\n    }\n    if (this.filterModel) {\n      await this.getFilterOptions();\n    }\n    await this.refresh();\n  }\n\n  /**\n   * @description Determines which row-level CRUD operations are permitted and finalizes the column list.\n   * @summary Checks user permissions for `UPDATE` and `DELETE` operations. Updates the `cols` and `headers` arrays accordingly.\n   * @return {void}\n   */\n  getOperations(): void {\n    if (this.allowOperations) {\n      this.allowOperations =\n        this.isAllowed(OperationKeys.READ) ||\n        this.isAllowed(OperationKeys.UPDATE) ||\n        this.isAllowed(OperationKeys.DELETE);\n    } else {\n      this.operations = [];\n    }\n    if (this.operations?.length) {\n      this.cols.push('actions');\n    }\n    this.headers = this._headers;\n  }\n\n  /**\n   * @description Populates `filterOptions` from a function call or a decorator-bound repository.\n   * @summary Resolves filter options dynamically based on the provided `filterModel`. Supports both\n   * async functions and repository-based data sources.\n   * @return {Promise<void>}\n   */\n  protected async getFilterOptions(): Promise<void> {\n    const getFilterOptionsMapper = (pk: string) => {\n      if (!this.filterBy) {\n        this.filterBy = pk as keyof Model;\n      }\n      if (!this.filterOptionsMapper) {\n        this.filterOptionsMapper = (item) => ({\n          title: `${item[pk]}`,\n          description: `${item[pk]}`,\n          uid: `${item[this.filterBy]}`,\n        });\n      }\n    };\n    if (typeof this.filterModel === 'function') {\n      this.filterOptions = await this.filterModel();\n    } else {\n      const repo = getModelAndRepository(this.filterModel);\n      if (repo) {\n        const { pk } = repo;\n        getFilterOptionsMapper(pk);\n        // const query = await repository.select().execute();\n        // this.filterOptions = query.map((item) => this.filterOptionsMapper(item));\n      }\n    }\n  }\n\n  /**\n   * @description Maps a single raw data row to the cell-structured format expected by the table template.\n   * @summary Applies transformations and event bindings to each row of data, preparing it for rendering.\n   * @param {KeyValue} item - Raw data object representing a single table row.\n   * @param {KeyValue} mapper - Column mapper definitions.\n   * @param {KeyValue} [props={}] - Additional rendering props.\n   * @return {Promise<KeyValue>} Mapped row object.\n   */\n  protected override async itemMapper(item: KeyValue, mapper: KeyValue, props: KeyValue = {}): Promise<KeyValue> {\n    this.model = item as Model;\n    const mapped = super.itemMapper(\n      item,\n      this.cols.filter((c) => c !== 'actions'),\n      props\n    );\n    const { children } = (this.props as KeyValue) || [];\n    const entries = Object.entries(mapped);\n    for (const [curr, value] of entries) {\n      const getEvents = async (index: number, name: string) => {\n        try {\n          const child = children.find((c: KeyValue) => c?.['props']?.name === name);\n          if (child) {\n            const { events, name } = child?.['props'] || {};\n            if (events) {\n              const sequence = String(index);\n              const evts = this.parseEvents(events, this);\n              for (const [key, evt] of Object.entries(evts)) {\n                const handler = evt;\n                if (key === ComponentEventNames.Render) {\n                  if (handler?.name === ComponentEventNames.Render) {\n                    mapped[sequence] = {\n                      ...mapped[sequence],\n                      value: await handler.bind(this)(this, name, value, key, item),\n                    };\n                  } else {\n                    const handlerFn = await handler(this, name, value, key, item);\n                    mapped[sequence] = {\n                      ...mapped[sequence],\n                      value:\n                        name + ' ' + typeof handlerFn === 'function' || handlerFn instanceof Promise\n                          ? await handlerFn.bind(this)(this, name, value, key, item)\n                          : handlerFn,\n                    };\n                  }\n                }\n                if (key === 'handleClick' || key === 'handleAction') {\n                  mapped[sequence] = {\n                    ...mapped[sequence],\n                    handler: {\n                      index: Number(sequence),\n                      handle: handler.bind(this),\n                    },\n                  };\n                }\n              }\n            }\n          }\n          return value;\n        } catch (error) {\n          this.log.for(this.itemMapper).error(`Error mapping child events. ${(error as Error)?.message || error}`);\n        }\n      };\n      const name = this.cols[Number(curr)];\n      const index = Number(curr);\n      const parserFn = mapper[name]?.valueParserFn || undefined;\n      const resolvedValue = parserFn ? await parserFn(this, name, value, item) : value;\n      mapped[curr] = {\n        prop: name ?? this.pk,\n        value: resolvedValue,\n        index: index || 0,\n      };\n      await getEvents(index, name);\n    }\n    return mapped;\n  }\n\n  /**\n   * @description Maps an array of raw data objects to the cell-structured rows used by the template.\n   * @summary Resolves all rows concurrently via `Promise.all`, delegating each item to `itemMapper`.\n   * @param {KeyValue[]} data - Raw row objects returned by the data source.\n   * @return {Promise<KeyValue[]>} Array of structured row objects.\n   */\n  override async mapResults(data: KeyValue[]): Promise<KeyValue[]> {\n    // if ((this._data as [])?.length && data?.length === (this._data as [])?.length) {\n    //   return this._data as KeyValue[];\n    // }\n    this._data = [...data];\n    if (!data || !data.length) return [];\n    return await Promise.all(\n      data.map(async (curr) => await this.itemMapper(curr, this.mapper, { uid: curr[this.pk] }))\n    );\n  }\n\n  /**\n   * @description Handles a CRUD action triggered by a row action button.\n   * @summary Invokes a custom handler or navigates to the appropriate route for the given action.\n   * @param {IBaseCustomEvent} event - The originating event.\n   * @param {UIFunctionLike | undefined} handler - Optional custom handler.\n   * @param {string} uid - Primary key value of the target row.\n   * @param {CrudOperations} action - The CRUD operation type.\n   * @return {Promise<void>}\n   */\n  async handleAction(\n    event: IBaseCustomEvent,\n    handler: UIFunctionLike | undefined,\n    uid: string,\n    action: CrudOperations,\n    colName?: string\n  ): Promise<void> {\n    if (handler) {\n      const model = (this._data as [])?.find((item) => item[this.pk] === uid) || this.model;\n      const handlerFn = await handler(this, event, colName, uid, model);\n      return typeof handlerFn === 'function' ? handlerFn() : handlerFn;\n    }\n    const win = getWindow() as Window;\n    const selection = (win as unknown as Window).getSelection();\n    if (!selection || selection.toString().length === 0) {\n      return await this.handleRedirect(event, uid, action);\n    }\n  }\n\n  /**\n   * @description Navigates to the CRUD action route for the specified row.\n   * @summary Verifies the requested `action` and navigates to the appropriate route.\n   * @param {Event | IBaseCustomEvent} event - The originating event.\n   * @param {string} uid - Primary key value of the target row.\n   * @param {CrudOperations} action - The CRUD operation to navigate to.\n   * @return {Promise<void>}\n   */\n  async handleRedirect(event: Event | IBaseCustomEvent, uid: string, action: CrudOperations): Promise<void> {\n    if (event instanceof Event) {\n      event.preventDefault();\n      event.stopImmediatePropagation();\n    }\n    if (this.operations.includes(action)) {\n      await this.router.navigate([`/${this.route}/${action}/${uid}`]);\n    }\n  }\n\n  async handleFilterSelection(event: SelectCustomEvent, search: boolean = true): Promise<void> {\n    const { detail } = event;\n    if (detail) {\n      this.filterValue = detail?.value;\n      if (search) {\n        await this.handleSearch({\n          query: [\n            {\n              index: this.filterBy,\n              value: this.filterValue,\n              condition: 'Contains',\n            },\n          ],\n        } as IFilterQuery);\n      }\n    }\n  }\n\n  /**\n   * @description Opens the filter select UI, allowing the user to narrow table results by a field value.\n   * @summary Determines the presentation mode and handles user selection.\n   * @param {Event} event - The click event that triggered the filter open action.\n   * @return {Promise<void>}\n   */\n  async openFilterSelectOptions(event: Event): Promise<void> {\n    const type = SelectFieldInterfaces.MODAL;\n\n    event.preventDefault();\n    event.stopImmediatePropagation();\n    const title = (await this.translate(`${this.locale}.filter_by`)) as string;\n    const modal = await getNgxSelectOptionsModal(\n      title,\n      this.filterModel as string | Model,\n      { mapper: this.filterOptionsMapper, pk: this.filterBy, locale: this.locale ?? undefined },\n      this.filterBy || 'tableComponentFilter',\n      this.injector\n    );\n    this.changeDetectorRef.detectChanges();\n    const { data, role } = await modal.onWillDismiss();\n    if (role === ActionRoles.confirm && data !== this.filterValue) {\n      this.filterValue = data;\n      this.handleFilterSelection({ detail: { value: data } } as SelectCustomEvent, false);\n      await this.handleSearch({\n        query: [\n          {\n            index: this.filterBy,\n            value: this.filterValue,\n            condition: 'Contains',\n          },\n        ],\n      } as IFilterQuery);\n    }\n  }\n\n  /**\n   * @description Clears the active filter selection and resets the table to an unfiltered state.\n   * @summary Resets `filterValue` and reloads the full data set.\n   * @param {CustomEvent} event - The clear event emitted by the filter select control.\n   * @return {Promise<void>}\n   */\n  async handleFilterSelectClear(event: CustomEvent): Promise<void> {\n    event.preventDefault();\n    event.stopImmediatePropagation();\n    if (this.filterValue !== undefined) {\n      this.filterValue = undefined;\n      await this.clearSearch();\n    }\n  }\n\n  /**\n   * @description Updates the matching rendered table row after an edit operation.\n   * @summary Executes the default update flow inherited from `ListComponent` and then\n   * finds the already-mapped row in `this.items` by `uid`. When found, it synchronizes\n   * each displayed cell value (except the `uid` field) with the latest values from\n   * `model`, preserving the mapped row structure used by the table.\n   * @param {Model} model - Model instance containing updated values.\n   * @param {string | number} uid - Unique identifier of the row to update.\n   * @return {Promise<void>}\n   */\n  override async handleUpdate(model: Model, uid: string | number): Promise<void> {\n    await super.refresh();\n    // await super.handleUpdate(model, uid);\n    // const item = this.items.find((item) => `${item['uid']?.value}`.trim() === `${uid}`.trim());\n    // const mapper: KeyValue = this.mapper || {};\n    // if (item) {\n    //   for (const [key, entry] of Object.entries(item)) {\n    //     const { prop } = entry;\n    //     if (key !== 'uid' && prop in model) {\n    //       const value = model[prop as keyof Model];\n    //       if (value !== undefined) {\n    //         const valueFn = mapper?.[prop]?.valueParserFn || value;\n    //         if (typeof valueFn === 'function') {\n    //           entry.value = await valueFn(this, prop, value);\n    //         } else {\n    //           if (isValidDate(value)) {\n    //             entry.value = `${formatDate(dateFromString(value as unknown as string))}`;\n    //           } else {\n    //             entry.value = value;\n    //           }\n    //         }\n    //       }\n    //     }\n    //   }\n    // }\n  }\n\n  // /**\n  //  * Handles the create event from the repository.\n  //  *\n  //  * @param {string | number} uid - The ID of the item to create.\n  //  * @returns {Promise<void>} A promise that resolves when the item is created and added to the list.\n  //  */\n  // override async handleCreate(model: Model, uid: string | number): Promise<void> {\n  //   if (!model || !Object.keys(model).length) {\n  //     model = (await this._repository?.read(uid)) as Model;\n  //   }\n  //   const item = await this.itemMapper(model, this.mapper, { uid: model[this.pk as keyof Model] });\n  //   this.items = this.data = [item, ...(this.items || [])];\n  // }\n}\n","@if (showSearchbar) {\n  <div class=\"dcf-grid-actions\">\n    <div class=\"dcf-grid dcf-grid-small\">\n      <div class=\"dcf-width-expand@s\">\n        <ngx-decaf-searchbar\n          [emitEventToWindow]=\"false\"\n          [debounce]=\"isModalChild ? 800 : 500\"\n          [isModalChild]=\"isModalChild\"\n          [model]=\"model\"\n          [modelName]=\"modelName\"\n          [locale]=\"locale ?? undefined\"\n          (searchEvent)=\"handleSearch($event)\"\n        />\n      </div>\n      @if (filterModel) {\n        <div\n          class=\"dcf-width-1-3@s dcf-width-1-4@m dcf-select-filter-container dcf-flex dcf-flex-middle\"\n        >\n          <ion-select\n            [id]=\"name\"\n            [class]=\"\n              filterOptions?.length > 10 || !filterOptions?.length\n                ? ' dcf-modal-interface'\n                : ' dcf-popover-interface'\n            \"\n            toggleIcon=\"chevron-down-outline\"\n            expandedIcon=\"chevron-up-outline\"\n            [mode]=\"'md'\"\n            fill=\"outline\"\n            [value]=\"filterValue ?? ''\"\n            [labelPlacement]=\"'floating'\"\n            [label]=\"locale + '.filter.label' | translate\"\n            (click)=\"openFilterSelectOptions($event)\"\n            [placeholder]=\"locale + '.filter.label' | translate\"\n            (ionChange)=\"handleFilterSelection($event)\"\n            interface=\"modal\"\n          >\n            <ion-select-option [value]=\"filterValue ?? ''\">\n              {{ filterValue ?? locale + '.filter.all' | translate }}\n            </ion-select-option>\n\n            <ion-button\n              fill=\"clear\"\n              (click)=\"handleFilterSelectClear($event)\"\n              slot=\"end\"\n              size=\"small\"\n              [disabled]=\"!filterValue\"\n            >\n              <ngx-decaf-icon\n                fill=\"clear\"\n                slot=\"icon-only\"\n                [name]=\"'ti-input-x'\"\n              />\n            </ion-button>\n          </ion-select>\n        </div>\n      }\n    </div>\n  </div>\n}\n<div\n  class=\"dcf-table-container\"\n  [class.dcf-empty]=\"!data?.length\"\n  #component\n>\n  @if (initialized && data?.length) {\n    <table class=\"dcf-table\">\n      <thead>\n        <tr>\n          @for (header of headers; track $index) {\n            <th class=\"dcf-th-{{ header }}\">\n              {{ locale + '.' + header + '.label' | translate }}\n            </th>\n          }\n        </tr>\n      </thead>\n      <tbody>\n        @for (item of items; track trackItemFn($index, item)) {\n          <tr>\n            @for (col of item | keyvalue; track $index) {\n              @if (!['handler', 'actions', 'uid'].includes(col.key)) {\n                <td\n                  (click)=\"\n                    handleAction(\n                      $event,\n                      col?.value.handler ? col.value.handler.handle : undefined,\n                      item.uid.value,\n                      OperationKeys.READ,\n                      col?.value?.prop\n                    )\n                  \"\n                  [innerHTML]=\"col.value.value\"\n                  [ngx-decaf-tooltip]=\"\n                    maxContentLength > 0 && !preserve.includes(col.value.prop)\n                      ? {\n                          text: col.value.value,\n                          truncate: true,\n                          limit: maxContentLength,\n                        }\n                      : {}\n                  \"\n                ></td>\n              } @else {\n                @if (allowOperations && col.key !== 'handler') {\n                  <td class=\"dcf-col-actions\">\n                    <div class=\"\">\n                      @if (operations?.includes(OperationKeys.UPDATE)) {\n                        <ngx-decaf-icon\n                          [button]=\"true\"\n                          (click)=\"\n                            handleRedirect(\n                              $event,\n                              item.uid.value,\n                              OperationKeys.UPDATE,\n                              true\n                            )\n                          \"\n                          fill=\"clear\"\n                          slot=\"icon-only\"\n                          color=\"primary\"\n                          name=\"ti-edit\"\n                        />\n                      } @else {\n                        @if (\n                          operations?.includes(OperationKeys.READ) &&\n                          !operations?.includes(OperationKeys.DELETE)\n                        ) {\n                          <ngx-decaf-icon\n                            [button]=\"true\"\n                            (click)=\"\n                              handleRedirect(\n                                $event,\n                                item.uid.value,\n                                OperationKeys.READ,\n                                true\n                              )\n                            \"\n                            fill=\"clear\"\n                            slot=\"icon-only\"\n                            color=\"primary\"\n                            name=\"ti-eye\"\n                          />\n                        }\n                      }\n                      @if (operations?.includes(OperationKeys.DELETE)) {\n                        <ngx-decaf-icon\n                          [button]=\"true\"\n                          (click)=\"\n                            handleRedirect(\n                              $event,\n                              item.uid.value,\n                              OperationKeys.DELETE,\n                              true\n                            )\n                          \"\n                          fill=\"clear\"\n                          slot=\"icon-only\"\n                          color=\"danger\"\n                          name=\"ti-trash\"\n                        />\n                      }\n                    </div>\n                  </td>\n                }\n              }\n            }\n          </tr>\n        }\n      </tbody>\n    </table>\n  } @else {\n    @if (!searching) {\n      <ngx-decaf-empty-state\n        [title]=\"'component.list.empty.title' | translate\"\n        [subtitle]=\"'component.list.empty.subtitle' | translate\"\n        [model]=\"empty?.showButton ? model : undefined\"\n        [route]=\"route\"\n        [refreshing]=\"refreshing\"\n        [modelId]=\"modelId\"\n        [buttonLink]=\"empty?.link ?? undefined\"\n        [borders]=\"borders\"\n        [icon]=\"(item?.icon ?? 'folder-open-outline') || empty.icon\"\n        className=\"dcf-empty-data\"\n      />\n    } @else {\n      <ngx-decaf-empty-state\n        icon=\"search-outline\"\n        [model]=\"empty?.showButton ? model : undefined\"\n        [route]=\"route\"\n        [modelId]=\"modelId\"\n        [borders]=\"borders\"\n        [operations]=\"operations\"\n        [body]=\"'small'\"\n        [refreshing]=\"refreshing\"\n        [translatable]=\"true\"\n        [title]=\"'component.list.search.title' | translate\"\n        [subtitle]=\"\n          'component.list.search.subtitle'\n            | translate: { '0': parseSearchValue() }\n        \"\n        [searchValue]=\"searchValue\"\n      />\n    }\n  }\n</div>\n\n<div class=\"dcf-table-pagination\">\n  @if (\n    (pages > 0 || bookMarkPagination) && (data?.length >= limit || page > 1)\n  ) {\n    <ngx-decaf-pagination\n      [table]=\"component\"\n      [bookMarkPagination]=\"bookMarkPagination\"\n      [nextBookmark]=\"paginator?.['_bookmark']\"\n      [totalPages]=\"pages\"\n      [disablePages]=\"disablePaginationPages\"\n      [truncatePages]=\"truncatePaginationPages\"\n      [current]=\"page\"\n      (clickEvent)=\"handlePaginate($event)\"\n    />\n  }\n</div>\n","/**\n * @module module:lib/components/for-angular-components.module\n * @description Aggregate module for library components.\n * @summary Bundles and exports all UI components from `src/lib/components` as an\n * Angular `NgModule`. This module re-exports components like `ListComponent`,\n * `PaginationComponent`, `SearchbarComponent`, and others so they can be imported\n * together in consumer applications.\n *\n * @link {@link ForAngularComponentsModule}\n */\n\nimport { NgModule } from '@angular/core';\nimport { CrudFieldComponent } from './crud-field/crud-field.component';\nimport { CrudFormComponent } from './crud-form/crud-form.component';\nimport { ModelRendererComponent } from './model-renderer/model-renderer.component';\nimport { SearchbarComponent } from './searchbar/searchbar.component';\nimport { EmptyStateComponent } from './empty-state/empty-state.component';\nimport { ListItemComponent } from './list-item/list-item.component';\nimport { ComponentRendererComponent } from './component-renderer/component-renderer.component';\nimport { PaginationComponent } from './pagination/pagination.component';\nimport { ListComponent } from './list/list.component';\nimport { FieldsetComponent } from './fieldset/fieldset.component';\nimport { LayoutComponent } from './layout/layout.component';\nimport { FilterComponent } from './filter/filter.component';\nimport { SteppedFormComponent } from './stepped-form/stepped-form.component';\nimport { IconComponent } from './icon/icon.component';\nimport { CardComponent } from './card/card.component';\nimport { FileUploadComponent } from './file-upload/file-upload.component';\nimport { TableComponent } from './table/table.component';\n\nconst Components = [\n  ModelRendererComponent,\n  ComponentRendererComponent,\n  CrudFieldComponent,\n  CrudFormComponent,\n  EmptyStateComponent,\n  ListComponent,\n  ListItemComponent,\n  SearchbarComponent,\n  PaginationComponent,\n  CrudFormComponent,\n  FieldsetComponent,\n  LayoutComponent,\n  FilterComponent,\n  SteppedFormComponent,\n  IconComponent,\n  CardComponent,\n  FileUploadComponent,\n  TableComponent\n];\n\n@NgModule({\n  imports: [...Components],\n  declarations: [],\n  schemas: [],\n  exports: [...Components],\n})\nexport class ForAngularComponentsModule {}\n","/**\n * @module module:lib/components/index\n * @description Barrel exports for components.\n * @summary Re-exports the component modules and individual components from\n * `src/lib/components` so consumers can import them from a single entrypoint.\n * This file exposes components such as `ListComponent`, `PaginationComponent`,\n * `SearchbarComponent`, and the `ForAngularComponentsModule`.\n *\n * @link {@link ForAngularComponentsModule}\n */\n\n// Component exports\nexport * from './card/card.component';\nexport * from './component-renderer/component-renderer.component';\nexport * from './crud-field/crud-field.component';\nexport * from './crud-form/crud-form.component';\nexport * from './empty-state/empty-state.component';\nexport * from './fieldset/fieldset.component';\nexport * from './file-upload/file-upload.component';\nexport * from './filter/filter.component';\nexport * from './icon/icon.component';\nexport * from './layout/layout.component';\nexport * from './list-item/list-item.component';\nexport * from './list/list.component';\nexport * from './modal';\nexport * from './model-renderer/model-renderer.component';\nexport * from './pagination/pagination.component';\nexport * from './searchbar/searchbar.component';\nexport * from './stepped-form/stepped-form.component';\nexport * from './table/table.component';\n// Module export\nexport * from './for-angular-components.module';\n","// alias to path on ui-decorators overrides to ensure correct resolution in Angular projects\nimport '@decaf-ts/overrides/ui-decorators';\n\n/**\n * @module lib/for-angular-common.module\n * @description Core Angular module and providers for Decaf's for-angular package.\n * @summary Provides the shared Angular module, injection tokens and helper functions used\n * by the for-angular integration. This module wires up common imports (forms, translation)\n * and exposes helper providers such as DB adapter registration and logger utilities.\n * @link {@link ForAngularCommonModule}\n */\nimport { CommonModule } from '@angular/common';\nimport { ModuleWithProviders, NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { TranslateModule, TranslatePipe } from '@ngx-translate/core';\nimport { AngularEngineKeys } from './engine/constants';\nimport { NgxRenderingEngine } from './engine/NgxRenderingEngine';\nimport { getWindow, setOnWindow } from './utils/helpers';\n\nconst CommonModules = [CommonModule, FormsModule, ReactiveFormsModule, TranslateModule, TranslatePipe];\n\ntry {\n  const win = getWindow();\n  if (!win?.[AngularEngineKeys.LOADED]) new NgxRenderingEngine();\n  setOnWindow(AngularEngineKeys.LOADED, true);\n} catch (e: unknown) {\n  throw new Error(`Failed to load rendering engine: ${e}`);\n}\n\n/**\n * @description Main Angular module for the Decaf framework.\n * @summary The ForAngularCommonModule provides the core functionality for integrating Decaf with Angular applications.\n * It imports and exports common Angular and Ionic components and modules needed for Decaf applications,\n * including form handling, translation support, and Ionic UI components. This module can be imported\n * directly or via the forRoot() method for proper initialization in the application's root module.\n * @class ForAngularCommonModule\n * @memberOf module:lib/for-angular-common.module\n * @example\n * // In your app module:\n * @NgModule({\n *   imports: [\n *     ForAngularCommonModule.forRoot(),\n *     // other imports\n *   ],\n *   // ...\n * })\n * export class AppModule {}\n */\n@NgModule({\n  imports: CommonModules,\n  declarations: [],\n  exports: CommonModules,\n  schemas: [],\n  providers: [],\n})\nexport class ForAngularCommonModule {\n  /**\n   * @description Creates a module with providers for root module import.\n   * @summary This static method provides the proper way to import the ForAngularCommonModule in the application's\n   * root module. It returns a ModuleWithProviders object that includes the ForAngularCommonModule itself.\n   * Using forRoot() ensures that the module and its providers are properly initialized and only\n   * instantiated once in the application.\n   * @return {ModuleWithProviders<ForAngularCommonModule>} The module with its providers\n   * @memberOf ForAngularCommonModule\n   * @static\n   * @example\n   * // Import in root module\n   * @NgModule({\n   *   imports: [ForAngularCommonModule.forRoot()],\n   *   // ...\n   * })\n   * export class AppModule {}\n   */\n  static forRoot(): ModuleWithProviders<ForAngularCommonModule> {\n    return {\n      ngModule: ForAngularCommonModule,\n    };\n  }\n}\n","import { Pipe, PipeTransform, inject } from '@angular/core';\nimport { sf } from '@decaf-ts/logging';\nimport { TranslateService } from '@ngx-translate/core';\nimport { I18nLoader } from '../i18n/Loader';\n/**\n * @module DecafTranslatePipe\n * @description Angular pipe for translating text using the `@ngx-translate/core` library.\n * @summary The `DecafTranslatePipe` provides a mechanism to translate text keys into localized\n * strings based on the current language settings. It integrates with the `TranslateService`\n * to fetch translations dynamically and supports fallback rendering for untranslated keys.\n * @class DecafTranslatePipe\n * @implements {PipeTransform}\n */\n@Pipe({\n  name: 'translate',\n  // pure: false,\n  standalone: true,\n})\nexport class DecafTranslatePipe implements PipeTransform {\n  /**\n   * @description Injected instance of the `TranslateService` for handling translations.\n   * @type {TranslateService}\n   */\n  translate: TranslateService = inject(TranslateService);\n\n  /**\n   * @description Transforms a text key into its localized string representation.\n   * @summary Uses the `TranslateService` to fetch the translated string for the provided key.\n   * If translations are disabled or the key is not found, it returns a fallback HTML-wrapped key.\n   * @param {string} value - The translation key to be transformed.\n   * @param {...any[]} args - Optional arguments to interpolate within the translation string.\n   * @return {string} The translated string or a fallback HTML-wrapped key.\n   * @example\n   * ```html\n   * {{ 'HELLO_WORLD' | translate }}\n   * ```\n   */\n  transform(value: string, ...args: []): string {\n    if (I18nLoader.enabled && value) {\n      return this.translate.instant(value, ...args);\n    }\n    return `<div class=\"dcf-translation-key\">${sf(value, args)}</div>`;\n  }\n}\n","/**\n * @module module:lib/public-apis\n * @description Public exports for the for-angular package.\n * @summary Re-exports the public API surface for the Decaf for-Angular integration. Consumers\n * should import from this barrel to access components, engine utilities, directives, helpers,\n * and i18n loaders provided by the library.\n *\n * @link {@link ForAngularCommonModule}\n */\n\n// import '@decaf-ts/overrides/ui-decorators';\n\nexport * from './components';\nexport * from './directives';\nexport * from './engine';\nexport * from './for-angular-common.module';\nexport * from './i18n/Loader';\nexport * from './pipes';\nexport * from './services';\nexport * from './utils';\n/**\n * @description Angular integration for the Decaf framework\n * @summary This module provides Angular components and services for integrating with the Decaf framework.\n * It includes components for rendering models, CRUD operations, and form handling, as well as\n * rendering engines and utility functions to facilitate Angular application development with Decaf.\n * @module for-angular\n */\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-apis';\n"],"names":["isValidDate","instance","component","CoreService","CoreRepository","shareReplay","takeUntil","sf","i1","AllIcons"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOO,MAAM,wBAAwB,GAAG;AAExC;;;AAGG;AACH;;;AAGG;AACI,MAAM,iBAAiB,GAA2B;IACvD,CAAC,cAAc,CAAC,QAAQ,GAAG,gBAAgB,CAAC,QAAQ,CAAC,iBAAiB;AACtE,IAAA,CAAC,cAAc,CAAC,KAAK,GAAG,gBAAgB,CAAC,KAAK;AAC9C,IAAA,CAAC,cAAc,CAAC,GAAG,GAAG,gBAAgB,CAAC,GAAG;;AAG5C;;;;;;AAMG;MACU,yBAAyB,GAAG,IAAI,cAAc,CAAyB,2BAA2B;AAC/G;;;;;;;;;AASG;MACU,iBAAiB,GAAG,IAAI,cAAc,CAAS,mBAAmB;AAE/E;AACA;;;;;;;;;;;;;;;;;AAiBG;MACU,KAAK,GAAG,IAAI,cAAc,CAAU,OAAO,EAAE;AACxD,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,EAAE;AAClB,CAAA;AAED;;;;;;;AAOG;MACU,iBAAiB,GAAG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